This project consists of 2 command line utilities:
- iff2bpl Converts ILBM (Interleaved Bitmap) IFF files to Amiga bitplane format and 8-bit chunky format.
- bpl2iff Converts Amiga raw bitplane format to ILBM (Interleaved Bitmap) IFF files (note: currently palette has all colours other than 0 fixed to $FFF)
This tool converts IFF image files into formats suitable for Amiga applications:
- Raw bitplane data (.bpl) - Interleaved format for Amiga hardware (default)
- Palette data (.pal) - 16-bit words in Amiga colour register format
- Chunky pixel data (.chk) - 8-bit per pixel chunky format (optional)
- Non-interleaved planar data (.bpf) - All rows of plane 0, then plane 1, etc. (optional)
- Converts ILBM (IFF) files to Amiga-compatible formats
- Supports both compressed (RLE/PackBits) and uncompressed IFF files
- Generates Amiga hardware-ready bitplane data
- Converts 8-bit RGB palette to 4-bit Amiga colour format
- Optional chunky format output for software-based pixel manipulation
- Optional non-interleaved planar format for specific development needs
- Custom output filename support
- Minimal dependencies - compiles with standard C libraries
iff2bpl [-o output_name] [-c] [-cd] [-ni] <input.iff>-o output_name- Specify custom base name for output files-c- Also create chunky format output (.chk file)-cd- Also create chunky format with bit doubling (.chk file)-ni- Also create non-interleaved planar format (.bpf file)<input.iff>- Input IFF/ILBM file to convert
# Basic conversion - creates image.bpl and image.pal
iff2bpl image.iff
# Custom output name - creates sprite.bpl and sprite.pal
iff2bpl -o sprite image.iff
# Include chunky format - creates image.bpl, image.pal and image.chk
iff2bpl -c image.iff
# Include non-interleaved format - creates image.bpl, image.pal and image.bpf
iff2bpl -ni image.iff
# Combined options - creates sprite.bpl, sprite.pal, sprite.chk and sprite.bpf
iff2bpl -c -ni -o sprite image.iff
# Include chunky format with bit doubling - creates image.bpl, image.pal and image.chk
iff2bpl -cd image.iffRaw bitplane data in interleaved format ready for Amiga hardware. Each bitplane contains one bit per pixel, organized in the format expected by Amiga's custom chips.
Palette entries converted from 8-bit RGB to 4-bit Amiga format, stored as 16-bit words compatible with Amiga colour registers.
Optional 8-bit per pixel format where each byte represents a complete pixel value (palette index). Useful for software-based pixel manipulation or conversion to other formats.
Optional planar format where all rows of each bitplane are grouped together (plane 0 data, then plane 1 data, etc.) rather than interleaved by scanline. Useful for certain development workflows or tools that expect this data organization.
The -cd option creates chunky data where each bit of the 4 least significant bits is expanded to 2 bits by replication. This effectively converts 4-bit color values to 8-bit values. This is useful with a particular class of C2P routines (up to 16 colours) which require such input.
Examples:
00000001becomes0000001100000010becomes0000110000001101becomes11110011
gcc iff2bpl.c -o iff2bpl.exeUse the included VS Code configuration files for building and debugging.
- Standard C compiler (GCC, Clang, MSVC)
- Standard C libraries (stdio, stdlib, stdint, string)
bpl2iff converts raw Amiga planar bitplane data into an ILBM IFF file (FORM/ILBM) containing the BMHD, CMAP and BODY chunks. It supports interleaved and non-interleaved input, an optional byte-column transpose mode (-t) and optional PackBits (RLE) compression of the BODY chunk (-r).
The CMAP chunk created by bpl2iff contains 2^n entries where n is the number of bitplanes.
- If a palette of the matching number of colours is found at the end of the file (2^n * 2 bytes) then it is converted to the CMAP.
- Otherwise the first palette entry is set to black (
00,00,00) and all other entries are set to white (FF,FF,FF).
bpl2iff -x <xsize> -y <ysize> -n <bplnum> [-i] [-t <colwidth>] [-r] -o <output_name> <input_file>
Parameters:
-x <xsize>: horizontal size in pixels (required)-y <ysize>: vertical size in pixels (required)-n <bplnum>: number of bitplanes (required)-i: input is interleaved rows per plane (optional)-t <colwidth>: input is stored in byte columns of specified width and must be transposed first (optional)-r: compress BODY with PackBits (RLE) (optional)-o <output_name>: base name for output file (will have.iffappended if missing) (required)<input_file>: path to raw input file (required)
gcc bpl2iff.c -o bpl2iff.exeThere are small test inputs and helpers in the tests/ folder. See tests/README.md for details.
Conversion of 8x8 1-bitplane fonts:
./bpl2iff.exe -x 768 -y 8 -n 1 -t 1 -r -o ./tests/fonts8.iff ./tests/fonts8.fntThis will create fonts8.iff which should be a 1-bitplane, RLE compressed font file.
Conversion of 16x16 1-bitplane fonts:
./bpl2iff.exe -x 1536 -y 16 -n 1 -t 2 -r -o ./tests/fonts16.iff ./tests/fonts16.fntConversion of a 320x200 5-bitplane (interleaved) raw picture with a palette attached at the end:
./bpl2iff.exe -x 320 -y 200 -n 5 -r -i -o ./tests/dead.iff ./tests/dead.rawbCopyright (c) 2025 Kane/Suspect
Licensed under the GNU GPLv3 License.