Introduction
PBM is the picture format of Deluxe Paint for MS-DOS. Deluxe Paint II Enhanced,
Electronic Arts’ paint program for VGA, saved its
256-colour pictures and brushes in it; whether the first release, in 1989, already
did is not confirmed. The files usually have the extension
.lbm, and brushes sometimes as .bbm. Many MS-DOS games kept
their artwork in these files.
A PBM file is an IFF file, built from the same chunks as the Amiga’s ILBM: a bitmap
header, a colour map, Deluxe Paint’s colour ranges. The pixels are stored differently:
one byte a pixel, the colour number, instead of bitplanes. The form type is the three
letters PBM and a space. Later write-ups expand PBM as “Planar Bitmap”,
although the pixels are not planar; what Electronic Arts meant by it is not
recorded.
Electronic Arts never published a description of PBM. The author of libilbm, one of
the libraries that read it, wrote that he “couldn’t find any specification”. What is
known comes from files and from the programs that read them: FFmpeg, Netpbm and
libilbm. The parts it shares with ILBM are documented in Electronic Arts’ IFF and ILBM
documents; the PBM BODY, the TINY thumbnail and the
DPPS chunk are not.
A file dropped on any page of this site opens in the explorer, which shows every chunk and every row, with the picture, its palette, its colour ranges and its thumbnail.
Structure
A PBM file is one IFF FORM chunk with the form type
PBM . Every chunk inside it is a four-letter ID, a 4-byte big-endian
length and the data, padded to an even length. In the files Deluxe Paint writes the
chunks come in this order:
0FORM chunk ID, size and the form typePBM12 bytes12BMHD the bitmap header: size, 8 planes, masking and compression28 bytes40CMAP the colour map, 256 colours of 3 bytes776 bytes816DPPS Deluxe Paint’s settings, undocumented118 bytes934CRNG × 16, the colour ranges256 bytes1190TINY a thumbnail a quarter of the sizevaries…BODY rows of one byte a pixel, usually packed with ByteRun1varies
A reader should not depend on that order: as in any IFF file, the bitmap header comes first and the pixel data last, and the chunks in between can come in any order or be left out.
The start of a file
The first 48 bytes of a 320 × 55 picture. The FORM header is marked,
then comes the BMHD chunk, then the start of the CMAP,
marked. The form’s size, 00 00 0F 2C, is 3,884; with the 8-byte header
that gives the file’s 3,892 bytes.
00000000 46 4F 52 4D 00 00 0F 2C 50 42 4D 20 42 4D 48 44
00000010 00 00 00 14 01 40 00 37 00 00 00 00 08 00 01 00
00000020 00 00 05 06 01 40 00 C8 43 4D 41 50 00 00 03 00
FORM, PBM ; a 20-byte BMHD: 320 × 55, 8 planes, ByteRun1, aspect 5:6, page 320 × 200; a 768-byte CMAPIn this file a DPPS chunk follows at offset 0x330, sixteen
CRNG chunks from 0x3A6, a TINY of 80 × 13 at 0x4A6, and the
BODY at 0x5BA, whose 2,417 bytes are followed by a pad byte.
Telling it apart
The explorer’s parser for this format checks that the file starts with
FORM and that the form type, the four bytes at offset 8, is
PBM (50 42 4D 20), with the space. It turns the file down
if there is no BMHD chunk, if the BMHD is shorter than 20
bytes, or if the BODY comes before the BMHD, and the
explorer then tries the parsers for the other formats of the family.
Deluxe Paint for the PC also wrote ILBM files,
with the same extension and nearly the same chunks; only the form type tells them
apart. Netpbm’s .pbm, the
portable bitmap, is a different format with nothing
in common but the letters.
Variants
- Interleaved bitmap (IFF ILBM) – the Amiga’s format: interleaved bitplanes, with HAM, EHB and 24-bit pictures
- Deluxe Paint PC bitmap (IFF PBM) – Deluxe Paint for MS-DOS: one byte a pixel
- Amiga contiguous bitmap (IFF ACBM) – AmigaBASIC’s form: each bitplane stored whole
Links
Software
- GrafX2 – free pixel-art paint program in the style of Deluxe Paint, which opens and saves PBM (Windows, macOS, Linux)
- Netpbm – command-line image tools;
ilbmtoppmreads PBM forms as well as ILBM (Windows, macOS, Linux) - FFmpeg – command-line converter whose IFF decoder reads PBM (Windows, macOS, Linux)
Developers
- libilbm – library that reads and writes ILBM and PBM, by Sander van der Burg (C)
- FFmpeg’s IFF decoder – libavcodec’s reader, with the PBM row padding (C)
Reference
- LBM Format – ModdingWiki’s notes on Deluxe Paint PC files, with PBM, TINY and the games that use them
- IFF PBM datatype – the readme of an AmigaOS datatype for PBM, “used by the DOS version of Deluxe Paint”
- ILBM IFF Interleaved Bitmap – the ILBM document, which defines the chunks PBM shares with ILBM