pnmtopalm
Convert PNM image to a Palm Pilot image
TLDR
Convert a PNM image to a Palm bitmap
Specify the color depth of the resulting bitmap
Choose a compression method for the resulting bitmap
Build a custom colormap and include it in the resulting bitmap
Specify the bitmap's density
SYNOPSIS
pnmtopalm [options] [pnmfile]
PARAMETERS
-compress
Enables Palm's RLE compression for the output image. This is the default behavior.
-nocompress
Disables Palm's RLE compression, potentially resulting in larger file sizes but faster decompression on the device.
-dither
Enables dithering when converting to lower bit depths (e.g., from 24-bit color to 8-bit color or grayscale). This is the default.
-nodither
Disables dithering. This can lead to banding or loss of detail in gradients when reducing color depth.
-color
Forces the output to be an 8-bit color image. This is the default if the input PNM is color.
-nocolor
Forces the output to be a grayscale image, even if the input PNM is color. This is the default if the input PNM is grayscale or monochrome.
-2gray
Forces the output to be a 2-bit (4-level) grayscale image.
-4gray
Forces the output to be a 4-bit (16-level) grayscale image.
-8gray
Forces the output to be an 8-bit (256-level) grayscale image.
-idb
Outputs an iDB format image, which is a specific structure used by Palm's Image library.
-name <db_name>
Sets the database name for the output .pdb file. Default is 'Netpbm Image'.
-creator <creator_id>
Sets the 4-character creator ID for the database. Default is 'PbIm'.
-type <type_id>
Sets the 4-character type ID for the database. Default is 'IMAG'.
-comments <comment_string>
Adds a comment string to the image record within the database.
DESCRIPTION
pnmtopalm is a Netpbm utility that converts a Portable Anymap (PNM) image into a PalmPilot image database (.pdb) file. It supports various Palm image formats, including 1-bit monochrome, 2-bit grayscale, 4-bit grayscale, 8-bit grayscale, and 8-bit color. The command can optionally apply Palm's RLE compression to reduce file size and performs dithering for conversions to lower bit depths to maintain visual quality. The generated .pdb file is structured to be directly installable and viewable on PalmPilot devices, making it a crucial tool for preparing images for these handheld organizers.
CAVEATS
Given the widespread obsolescence of PalmPilot devices, pnmtopalm is primarily a historical tool or useful for enthusiasts and emulation purposes. The .pdb format created is specific to these older platforms and not generally compatible with modern image viewers or mobile devices.
The quality of conversion, especially for color images, is limited by the capabilities of the original Palm devices, which often had restricted color palettes.
INPUT AND OUTPUT
By default, pnmtopalm reads the PNM image data from standard input (stdin) and writes the resulting PalmPilot .pdb file to standard output (stdout).
Alternatively, an input file path (pnmfile) can be specified as the last argument, in which case the command reads from that file instead of stdin.
SUPPORTED PALM IMAGE FORMATS
pnmtopalm can generate images in several Palm-compatible formats:
1-bit monochrome (black and white)
2-bit grayscale (4 levels)
4-bit grayscale (16 levels)
8-bit grayscale (256 levels)
8-bit color (256 colors, typically from a fixed palette)
The command attempts to select the best format based on the input PNM and specified options, or can be forced to a specific grayscale depth.
HISTORY
pnmtopalm is an integral part of the Netpbm graphics toolkit, a venerable suite of image processing utilities that has been in continuous development since the early days of Unix. Its inclusion highlights Netpbm's commitment to supporting a wide array of image formats and devices, even niche or historical ones like the PalmPilot. The command was developed to bridge the gap between standard image formats (PNM) and the proprietary image formats required by Palm OS devices, allowing users to transfer and view their images on early handheld organizers.