LinuxCommandLibrary

ppmtopi1

Convert PPM image to Picture It format

TLDR

Convert a PPM image into an Atari Degas PI1 image

$ ppmtopi1 [path/to/image.ppm] > [path/to/output_image.pi1]
copy

SYNOPSIS

ppmtopi1 [-gamma val] [ppmfile]

PARAMETERS

-gamma val
    Applies a gamma correction to the image. val is a floating-point number representing the gamma value. This can be crucial for ensuring colors appear correctly on Amiga displays, which often have different gamma characteristics than modern displays.

ppmfile
    The path to the input Portable Pixmap (PPM) file. If ppmfile is omitted, ppmtopi1 reads the PPM data from standard input (stdin).

DESCRIPTION

ppmtopi1 is a command-line utility from the Netpbm suite that converts an image in the Portable Pixmap (PPM) format into an Amiga Deluxe Paint PI1 format file.

The PI1 format is a specific Amiga graphics file type, typically used by early Amiga software, most notably Deluxe Paint. This tool is useful for preparing images for use on classic Amiga systems or emulators. It handles color quantization by attempting to match the input image's colors to the Amiga's 4096-color palette, selecting the best 32 colors, and then applying Floyd-Steinberg dithering to approximate colors not in the chosen palette. The output PI1 file is fixed at a resolution of 320x200 pixels and uses 32 colors. If the input PPM image is not 320x200, it will be scaled to fit.

CAVEATS

The output PI1 file is always 320x200 pixels and uses a 32-color palette. Input images of different resolutions will be scaled to fit. The command performs color quantization and dithering to fit the Amiga's limited palette, which may result in some loss of color fidelity for images with a very wide color range.
It does not support the Amiga's hi-res (640x200) modes or extended color modes like EHB/HAM, only the standard 32-color lo-res (320x200) mode.

COLOR QUANTIZATION AND DITHERING

ppmtopi1 employs an algorithm to select the best 32 colors from the input PPM's palette to match the Amiga's 4096-color RGB space. It then uses Floyd-Steinberg dithering to approximate colors not in the chosen palette, minimizing visual artifacts caused by color reduction.

STANDARD OUTPUT

By default, the converted PI1 image is written to standard output. Users typically redirect this output to a file using the '>' operator, e.g.,
ppmtopi1 input.ppm > output.pi1

HISTORY

ppmtopi1 is part of the extensive Netpbm project, a toolkit for converting and manipulating various graphics formats. The Netpbm project has a long history, evolving from the original Pbmplus tools created by Jef Poskanzer in the late 1980s. The inclusion of tools like ppmtopi1 reflects the historical need to bridge various digital graphic formats, including those specific to platforms like the Amiga, for cross-platform compatibility and archiving purposes.

SEE ALSO

pi1toppm(1), ppm(5), pnmgamma(1), netpbm(1)

Copied to clipboard