ppmtoilbm
Convert PPM images to ILBM (IFF LBM) format
TLDR
Convert a PPM image to an ILBM file
Write a maximum of n planes to the ILBM file and produce a HAM/24bit/direct color file if this number is exceeded
Produce a ILBM file with exactly n planes
Select the compression method to be used
SYNOPSIS
ppmtoilbm [-24] [-maxcolors N] [-map N] [-ham] [-ehb] [-halfbrite] [-packed] [-s-superhires] [-l-interlaced] [-pal palette_file] [ppmfile]
PARAMETERS
-24
Forces 24-bit output. This is typically used for HAM8 images where each pixel effectively encodes a 24-bit color, though limited by HAM constraints.
-maxcolors N
Specifies the maximum number of colors to include in the output colormap for paletted modes. The tool will quantize the image to this number of colors if needed.
-map N
Specifies the exact number of bits per pixel (N) for a colormapped image. For example, -map 4 for 16 colors (AGA) or -map 5 for EHB/HAM6. Useful for precise control over color depth.
-ham
Produces an Amiga Hold-And-Modify (HAM) image. HAM modes allow more colors than the palette size by modifying previous pixel colors. Typically used for HAM6 or HAM8.
-ehb
Produces an Amiga Extra HalfBrite (EHB) image. In EHB mode, the first 32 colors of the palette have a 'half-bright' version automatically available, effectively providing 64 colors from a 32-entry palette.
-halfbrite
Alias for -ehb. Produces an Amiga Extra HalfBrite (EHB) image.
-packed
Outputs packed bitmap data instead of standard interleaved planar data. This can sometimes result in smaller files or be required by specific Amiga software.
-s-superhires
Sets the Amiga SuperHiRes display mode (768x240 or 768x480 interlaced). Modifies the display parameters in the ILBM header.
-l-interlaced
Sets the Amiga interlaced display mode, effectively doubling the vertical resolution (e.g., 320x400 instead of 320x200). Modifies the ILBM header.
-pal palette_file
Uses the specified palette from 'palette_file' instead of generating one. The palette file should be in a Netpbm format (e.g., PPM or PGM header followed by colors).
ppmfile
The input Portable PixMap (PPM) image file. If not specified, ppmtoilbm reads from standard input.
DESCRIPTION
The ppmtoilbm command converts a Portable PixMap (PPM) image, a standard Netpbm format, into an Amiga InterLeaved BitMap (ILBM) image. ILBM is a chunk-based file format, commonly used on Amiga computers for storing graphic data, including static images and animations (ANIM).
This utility is crucial for adapting modern or general-purpose images for use on Amiga systems, which have specific display hardware characteristics. ppmtoilbm handles various Amiga display modes, including standard paletted modes (1-8 bits per pixel), Extra HalfBrite (EHB), and Hold-And-Modify (HAM) modes. It intelligently reduces the color depth or applies HAM/EHB algorithms if the input PPM image has more colors than the target Amiga mode supports.
It can automatically generate a suitable palette or accept a pre-defined palette. The output is typically a static ILBM image. Its primary use case is for retrocomputing, game development for Amiga, or archival purposes where images need to be in a native Amiga format.
CAVEATS
ppmtoilbm is designed for Amiga-specific image formats, which have inherent limitations compared to modern true-color images. Color reduction and mode selection (like HAM or EHB) can lead to color banding or dithered output, especially when converting images with a wide color gamut. The command does not handle alpha channels; if the input PPM is derived from a PAM file with transparency, the alpha information will be lost. Output dimensions are determined by the input PPM unless explicitly overridden by other Netpbm tools like pamscale before piping to ppmtoilbm.
AMIGA DISPLAY MODES
The Amiga platform supports various display modes with different resolutions and color depths. ppmtoilbm generates ILBM files compatible with these modes, which typically include OCS/ECS (Original Chip Set/Enhanced Chip Set) modes like LoRes (320x200/256) and HiRes (640x200/256), often with up to 32 or 64 colors (with EHB). AGA (Advanced Graphics Architecture) Amigas support higher resolutions and more colors (up to 256 paletted, or HAM8 for 262,144 colors).
PALETTE HANDLING
When converting an image to a paletted Amiga mode, ppmtoilbm attempts to find the best possible palette. If the input image has more colors than the target mode's palette size, it quantizes the colors. Users can provide a specific palette file using the -pal option, which is useful for ensuring color consistency across multiple images or adhering to specific game/application palette requirements.
HISTORY
The ppmtoilbm command is a component of the comprehensive Netpbm image manipulation toolkit. Netpbm's origins trace back to the early 1990s, evolving from Jef Poskanzer's Pbmplus utilities. The suite was developed to provide a standardized set of tools for converting and manipulating various bitmap image formats across different Unix-like systems. Given the Amiga's prominence in graphics and multimedia during that era, incorporating support for its native ILBM format was a logical and necessary addition to ensure interoperability and ease of image transfer between PCs/Unix workstations and Amiga systems. Its development reflects the need for cross-platform graphics conversion in the pre-web era.