Convert modern image formats (JPEG, PNG) to the classic Amiga IFF ILBM format. This tool provides a simple way to create IFF images compatible with Amiga computers and emulators.
Why not? This tool lets you create images for a legendary computer system, the Commodore Amiga. While plenty of tools can view IFF/ILBM files, very few actually let you create them.
Also, I was curious to see if it's even possible to write such a tool in PHP. This project is a way to test those limits, relive some nostalgia, and celebrate the creative quirks of the Amiga graphics legacy.
# Basic conversion with default settings
php iff_convertor.php --input=input.jpg --output=output.iff
# Standard image (320x200, 16 colors, no dither)
php iff_convertor.php --input=input.jpg --output=output.iff --width=320 --height=200 --colors=16 --dither=false --compress=true
# HAM6 image (320x256)
php iff_convertor.php --input=input.jpg --output=output_ham6.iff --width=320 --height=256 --ham=true --compress=true
# ECS-compatible image (320x256, 32 colors, 12-bit RGB)
php iff_convertor.php --input=input.jpg --output=output_ecs.iff --width=320 --height=256 --colors=32 --chipset=ECS --dither=true --compress=true
- Convert JPEG/PNG to IFF ILBM
- Optional image resizing
- Configurable color palettes (2–256 colors)
- Hold-And-Modify (HAM6) support
- ECS chipset compatibility mode
- ByteRun1 compression support
- PAL and NTSC resolution support
The IFF ILBM format is flexible and will accept colors from the full 24-bit RGB space (16.7 million colors). You can create technically valid IFF files that:
- Use up to 256 colors selected from 24-bit palette
- Use all 256 levels (0-255) for each RGB channel
- Are valid IFF ILBM files that modern software can read
- May not display correctly on actual Amiga hardware
When using --chipset=ECS
, the converter enforces actual Amiga Enhanced Chip Set (ECS) hardware limitations:
- Colors are clamped to 12-bit RGB space (4096 colors total)
- Each color channel limited to 4-bit depth (16 levels, 0-15)
- Maximum 32 simultaneous colors in standard modes
- Guaranteed compatibility with Amiga ECS hardware and accurate emulators
# Example ECS-compatible image
php iff_convertor.php --input=input.jpg --output=output_ecs.iff --width=320 --height=256 --colors=32 --chipset=ECS --dither=true --compress=true
The Hold-And-Modify (HAM) mode is iconic to the Amiga:
- Uses 16 base colors
- Modifies previous pixel's color for high-color effects
- Can show characteristic color fringing artifacts
- Especially visible in areas with sharp color transitions
We converted a JPEG image to HAM6 using this tool and opened it in Deluxe Paint IV to validate compatibility.
This demonstrates authentic HAM6 output, complete with classic color fringing effects. These artifacts are particularly noticeable in areas with sharp color transitions - a characteristic quirk of the HAM6 mode that retro enthusiasts often appreciate!
The converter generates standard IFF ILBM files containing:
- FORM container
- BMHD (Bitmap Header) chunk
- CMAP (Color Map) chunk
- BODY (Bitmap Data) chunk
- PAL: 320×256
- NTSC: 320×200
- Generated images are tested on FS-UAE and WinUAE emulators
- ECS mode files should display correctly on original hardware
- Use standard Amiga resolutions for best results
- Add AGA chipset support (24-bit RGB color space)
- Implement HAM8 mode for AGA chipsets
- Add support for halfbrite mode