Palm Database ImageViewer

From Just Solve the File Format Problem
Revision as of 19:08, 1 August 2020 by Sembiance (Talk | contribs)

Jump to: navigation, search
File Format
Name Palm Database ImageViewer
Ontology
Extension(s) .pdb

Palm Database ImageViewer format is a type of Palm OS Database file. It contains a bitmap image, and is associated with the Image Viewer III application.

It is also known as FireViewer format, and maybe also TinyViewer format.

It supports at least grayscale images with 2, 4, or 16 gray shades. Images may be uncompressed, or use RLE compression.

Contents

Discussion

The ImageViewer format has been decoded fairly completely, but as far as we can tell, no one has ever bothered to write any documentation about it – only source code. Note that it is not a wrapper for Palm bitmap format.

The imgvtopnm software (also called imgvtopgm, apparently) by Eric Howe, released around 1997, is significant. See the README file in that software for information about its origins.

Netpbm's code was derived from Howe's software. ImageMagick also has source code for reading and writing this format.

Format details

This section is based on guesswork, and source code whose correctness is unverified. It is incomplete, and may be incorrect. It does not necessarily apply if the "version_etc" field is greater than 1. There is evidence that other versions exist that are quite different.

The file is a PDB file with certain characteristics. In the Palm database header, the type code is "vIMG", and the creator code is "View". There are 1 or 2 records: an "image" record, optionally followed by a "comment" record. The image record has its uniqueID field in the record list set to 0x6f8000. The comment record has uniqueID 0x6f8001.

Image record data segment

The image record's data segment consists of a 58-byte header, followed by the pixel data.

The starting offset N is the 32-bit integer usually found at file offset 78. N is usually 86 or 94.

Offset Type Field Observed values Remarks
N+0 char[32] name A name for the image. Same format as the main "database name" field at the beginning of the file, and usually a copy of that field.
N+32 byte version_etc cmpr_meth := (version_etc & 0x07)
cmpr_meth: 0=Uncompressed, 1=RLE
N+33 byte type 0 = 2 bits/pixel grayscale
2 = 4 bits/pixel grayscale
other (typically 0xff) = 1 bit/pixel grayscale
N+34 byte[4] reserved 0
N+38 byte[4] note 0
N+42 uint16 last_x 0
N+44 uint16 last_y 0
N+46 byte[4] reserved 0
N+50 uint16 anchor_x 0xffff
N+52 uint16 anchor_y 0xffff
N+54 uint16 width The pixel dimensions of the image.
N+56 uint16 height
N+58 bytes pixel data After decompression if necessary (see below), pixels are left-to-right, top-to-bottom. Rows are padded to the next byte boundary. A pixel value of 0 is white.

RLE compression

The compressed data consists of a code byte, followed by one or more data bytes, followed by another code byte, and so on. To decompress:

Code byte (N) Instructions
N ≤ 128 Emit the next N+1 bytes literally.
N ≥ 129 Emit the next byte N−127 times.

Comment record data segment

The comment data apparently consists entirely of the comment text, presumably using the Palm OS character set.

Identification

ASCII characters vIMGView appear at file offset 60.

Software

Sample files

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox