Palm bitmap, or Palm BitmapType (also called Palm Pilot Tbmp, Palm Pilot Bitmap, Palm pixmap, etc.), is a native bitmap format of Palm OS. It supports a variety of image types and compression schemes.
It can be found embedded in some Palm file formats, and apparently has also been used by itself as a file format. In a PRC file, resources named "Tbmp", "tAIB", and probably others, use this format.
There can be multiple images in a file. Each image begins with a header. In some cases the header is followed by a color table, or a "DirectInfoType" structure. The pixel data follows.
There are about four different versions of the bitmap format. This section summarizes the information in the Palm OS Reference (see the Links section below), and uses some terms defined there. It does not include every detail. "Same" means the field is the same as in the previous version. Different bitmap versions often appear in the same file.
Some newer-format bitmaps begin with an extra 16-byte "dummy" header, whose would-be pixelSize field is set to 0xff. This header must be skipped over to get to the real header.
Multi-byte numeric fields are normally big-endian. Little-endian variants of the format evidently exist, but are not covered here. For one thing, the documentation implies there is a V3 variant with version=0x83.
valid flags: compressed [unset=uncompressed, set=ScanLine]
valid flags: compressed [unset=uncompressed, set=ScanLine], hasColorTable
valid flags: compressed [unset=uncompressed, set=use compressionType field], hasColorTable, hasTransparency, directColor
valid flags: compressed [unset=uncompressed, set=use compressionType field], hasColorTable, hasTransparency, directColor, noDither
valid values: 1, 2, 4, 8(?)
(The documentation doesn't list 8, but such images exist.)
valid values: 1, 2, 4, 8, 16
valid values: 1, 2, 4, 8, 16
(The documentation doesn't list 16, but that looks like a clerical error.)
(in 4-byte units)
|same||size (header size)|
0=Indexed, 1=565, 2=565LE, 3=IndexedLE
0=ScanLine, 1=RLE, 2=PackBits, 255=None
72=kDensityLow, 108=kDensityOneAndAHalf, ...
|16||(end of header)||(end of header)||(end of header)||transparentValue<UInt32>|
|24||(additional fields could exist here)|
Images with ≤ 8 bits/pixel may, or may not, use a custom color table (palette) contained in the file.
Some educated guesses about color tables: If there is no custom color table (i.e. if the hasColorTable flag is not set, or the number of colors in the color table is 0), then images with ≤ 4 bits/pixel are grayscale, and 8-bit images use a standard color table. The standard color table may be found in the source code of programs that support this format.
- Palm OS Reference - See "BitmapType" and "BitmapTypeV..." sections starting on p. 518
- Palm Native Image Format
Many PRC files contain embedded Palm bitmaps.