Palm bitmap

From Just Solve the File Format Problem
(Difference between revisions)
Jump to: navigation, search
(Format details)
(Format details)
Line 10: Line 10:
 
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 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 format. This table 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.
+
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.
  
Multi-byte numeric fields are big-endian. There is possibly also a little-endian variant of BitmapTypeV3 (version=0x83?), which is not covered here.
+
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.
 +
 
 +
Some bitmaps begin with an extra 16-byte header, whose would-be ''pixelSize'' field is set to 0xff. We couldn't find any clear documentation of this phenomenon (we assume it's a backward-compatibility hack), but be aware that such headers exist, and must be skipped over.
  
 
=== Header ===
 
=== Header ===
Line 29: Line 31:
 
| flags: compressed [unset=uncompressed, set=use compressionType field], hasColorTable, hasTransparency, directColor, noDither
 
| flags: compressed [unset=uncompressed, set=use compressionType field], hasColorTable, hasTransparency, directColor, noDither
 
|-
 
|-
|8 || reserved || pixelSize<br>=1,2,4 || pixelSize<br>=1,2,4,8,16 || pixelSize<br>=1,2,4,8
+
|8 || reserved || pixelSize<br>valid values: 1, 2, 4, 8(?)<br>(The documentation doesn't list 8, but such images exist.) || pixelSize<br>valid values: 1, 2, 4, 8, 16 || pixelSize<br>valid values: 1, 2, 4, 8, 16<br>(The documentation doesn't list 16, but this looks like a clerical error.)
 
|-
 
|-
 
|9 || reserved<br>=0 || version<br>=1 || version<br>=2 || version<br>=3
 
|9 || reserved<br>=0 || version<br>=1 || version<br>=2 || version<br>=3
 
|-
 
|-
|10 ||rowspan="2"| reserved ||rowspan="2"| nextDepthOffset&lt;UInt16><br>in 4-byte units ||rowspan="2"| same || size (header size)
+
|10 ||rowspan="2"| reserved ||rowspan="2"| nextDepthOffset&lt;UInt16><br>(in 4-byte units) ||rowspan="2"| same || size (header size)
 
|-
 
|-
 
|11 || pixelFormat&lt;PixelFormatType><br>0=Indexed, 1=565, 2=565LE, 3=IndexedLE
 
|11 || pixelFormat&lt;PixelFormatType><br>0=Indexed, 1=565, 2=565LE, 3=IndexedLE
Line 45: Line 47:
 
|16 || (end of header) || (end of header) || (end of header) || transparentValue&lt;UInt32>
 
|16 || (end of header) || (end of header) || (end of header) || transparentValue&lt;UInt32>
 
|-
 
|-
|20 ||rowspan="2"| ||rowspan="2"| ||rowspan="2"| || nextBitmapOffset&lt;UInt32><br>in bytes
+
|20 ||rowspan="2"| ||rowspan="2"| ||rowspan="2"| || nextBitmapOffset&lt;UInt32><br>(in bytes)
 
|-
 
|-
 
|24 || (additional fields could exist here)
 
|24 || (additional fields could exist here)

Revision as of 15:23, 16 October 2017

File Format
Name Palm bitmap
Ontology

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.

Contents

Format details

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.

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.

Some bitmaps begin with an extra 16-byte header, whose would-be pixelSize field is set to 0xff. We couldn't find any clear documentation of this phenomenon (we assume it's a backward-compatibility hack), but be aware that such headers exist, and must be skipped over.

Header

Offs. BitmapTypeV0 BitmapTypeV1 BitmapTypeV2 BitmapTypeV3
0 width<Int16> same same same
2 height<Int16> same same same
4 rowBytes<UInt16> same same same
6 flags<BitmapFlagsType>: compressed [unset=uncompressed, set=ScanLine] flags: compressed [unset=uncompressed, set=ScanLine], hasColorTable flags: compressed [unset=uncompressed, set=use compressionType field], hasColorTable, hasTransparency, directColor flags: compressed [unset=uncompressed, set=use compressionType field], hasColorTable, hasTransparency, directColor, noDither
8 reserved pixelSize
valid values: 1, 2, 4, 8(?)
(The documentation doesn't list 8, but such images exist.)
pixelSize
valid values: 1, 2, 4, 8, 16
pixelSize
valid values: 1, 2, 4, 8, 16
(The documentation doesn't list 16, but this looks like a clerical error.)
9 reserved
=0
version
=1
version
=2
version
=3
10 reserved nextDepthOffset<UInt16>
(in 4-byte units)
same size (header size)
11 pixelFormat<PixelFormatType>
0=Indexed, 1=565, 2=565LE, 3=IndexedLE
12 reserved reserved transparentIndex unused
13 compressionType<BitmapCompressionType>
0=ScanLine, 1=RLE, 2=PackBits, 255=None
same
14 reserved reserved reserved density<DensityType>
72=kDensityLow, 108=kDensityOneAndAHalf, ...
16 (end of header) (end of header) (end of header) transparentValue<UInt32>
20 nextBitmapOffset<UInt32>
(in bytes)
24 (additional fields could exist here)

Specifications

Software

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox