.TL
Pnmtopalm User Manual
.SH 1
pnmtopalm
.LP
Updated: 05 October 2003
.br
Table Of Contents
.SH 2
NAME
.LP
pnmtopalm - convert a PNM image to a Palm Bitmap
.SH 2
SYNOPSIS
.LP
\fBpnmtopalm\fR
[\fB-verbose\fR]
[\fB-depth=\fR\fIN\fR]
[\fB-maxdepth=\fR\fIN\fR]
[\fB-colormap\fR]
[\fB-transparent=\fR\fIcolor\fR]
[\fB-density=\fR\fIN\fR]
[\fB-offset\fR]
[\fB-withdummy\fR]
.br
[\fB-scanline-compression\fR | \fB-rle-compression\fR |
\fB-packbits-compression\fR]
[\fIpnmfile\fR]
.LP
Minimum unique abbreviation of option is acceptable. You may use
double hyphens instead of single hyphen to denote options. You may use
white space in place of the equals sign to separate an option name
from its value.
.SH 2
DESCRIPTION
.LP
.LP
This program is part of Netpbm.
.LP
\fBpnmtopalm\fR reads a PNM image as input, from Standard Input or
\fIpnmfile\fR and produces a Palm Bitmap as output.
.LP
Palm Bitmap files are either grayscale files 1, 2, or 4 bits wide,
or color files 8 bits wide, so \fBpnmtopalm\fR automatically scales
colors to have an appropriate maxval, unless you specify a depth or
max depth. Input files must have an appropriate number and set of
colors for the selected output constraints.
.LP
This often means that you should run the PNM image through
\fBpnmquant\fR or \fBpnmremap\fR before you pass it to
\fBpnmtopalm\fR. Netpbm comes with several colormap files you can
use with \fBpnmremap\fR for this purpose. They are
\fIpalmgray2.map\fR (4 shades of gray for a depth of 2),
\fIpalmgray4.map\fR (16 shades of gray for a depth of 4), and
\fIpalmcolor8.map\fR (232 colors in default Palm colormap). In a
standard Netpbm installation, these are in the Netpbm data directory,
and you can find the Netpbm data directory with a \fBnetpbm-config
--datadir\fR shell command.
.LP
Example:
.DS L
pnmremap myimage.ppm \
-mapfile=$(netpbm-config --datadir)/palmgray2.map \
| pnmtopalm -depth=2 >myimage.palm
.DE
.SH 3
Palm Bitmap Version
.LP
.LP
\fBpnmtopalm\fR generates a Version 0, 1, 2, or 3 Palm Bitmap.
It generates the oldest (lowest) version it can for the given image and
the options you specify.
.IP \(bu
If you specify a density (\fB-density\fR option) higher than
"low," the version is at least 3.
.IP \(bu
If you specify transparency (\fB-transparent\fR option) or
any compression, the version is at least 2.
.IP \(bu
If you specify a custom colormap (\fB-colormap\fR option), the
verison is at least 1.
.IP \(bu
If the image has more than one bit per pixel, the version is at least
1. The image has more than one bit per pixel if you specify it with
\fB-depth\fR or if you let it default and the image has more than
two colors (or shades of gray).
.LP
.LP
All releases of Palm OS can read a Version 0 bitmap. Palm OS 3.0 and
later can read a Version 1 bitmap. Palm OS 3.5 and later can read a
Version 2 bitmap. To read a Version 3 bitmap, you need Palm OS Garnet
or a handheld running the High Density Display Feature Set.
.SH 2
OPTIONS
.LP
.RS
.IP "\fB-verbose\fR"
Display the format of the output file.
.IP "\fB-depth=\fR\fIN\fR"
Produce a file of depth \fIN\fR, where \fIN\fR must be either 1, 2,
4, 8, or 16. Because the default Palm 8-bit colormap is not
grayscale, if the input is a grayscale or monochrome image, the
output will never be more than 4 bits deep, regardless of the
specified depth. Note that 8-bit color works only in PalmOS 3.5 (and
higher), and 16-bit direct color works only in PalmOS 4.0 (and
higher). However, the 16-bit direct color format is also compatible
with the various PalmOS 3.x versions used in the Handspring Visor, so
these images may also work in that device.
.IP "\fB-maxdepth=\fR\fIN\fR"
Produce a file of minimal depth, but in any case less than \fIN\fR
bits wide. If you specify 16-bit, the output will always be 16-bit
direct color.
.IP "\fB-offset\fR"
Set the \fBnextDepthOffset\fR field in the palm file header to indicate
the end of the file (and pad the end of the file to 4 bytes, since
\fBnextDepthOffset\fR can point only to 4 byte boundaries).
.LP
A palm image file can contain multiple renditions of the same image,
with different color depths, so a viewer can choose one appropriate for
the display. The \fBnextDepthOffset\fR field tells where in the stream
the next rendition begins.
.LP
\fBpnmtopalm\fR creates a file that contains only one image, but
you can separately concatenate multiple one-image files to create a
multi-image file. If you do that, you'll need to use \fB-offset\fR
so that the resulting concatenation is a correct stream.
.LP
By default (if you don't specify \fB-offset\fR), \fBpnmtopalm\fR
generates a \fBnextDepthOffset\fR field that says there is no following
image (and does not add any padding after the image).
.LP
Version 3 Palm Bitmaps actually have a \fBnextBitmapOffset\fR
field instead of the \fBnextDepthOffset\fR. The foregoing applies to
whichever is relevant.
.LP
The \fB-offset\fR option was new in Netpbm 10.26 (January 2005).
Before that, \fBpnmtopalm\fR always set the \fBnextDepthOffset\fR
field to "none."
.LP
Before Netpbm 10.27 (March 2005), you cannot use \fB-offset\fR if
you create a compressed raster (because \fBpnmtopalm\fR isn't smart
enough to be able to know the size of the image at the time it writes
the header). You also cannot use it with 16 bit color depth or with
the \fB-colormap\fR option, for much the same reason.
.IP "\fB-withdummy\fR"
This option tells \fBpnmtopalm\fR to put in the stream, after after
the image, a dummy image header to introduce subsequent high density
images.
.LP
This dummy image header is a special sequence specified in Palm Bitmap
specifications. It looks to an older Palm Bitmap interpreter like an invalid
image header, so such an intepreter will stop reading the stream
there. But a new Palm Bitmap interpreter recognizes it for what it is (just
something to choke an old interpreter) and skips over it. Presumably,
you will add to the stream after this high density images which would
confuse an older interpreter.
.LP
If you specify \fB-withdummy\fR, you must also specify \fB-offset\fR,
since it doesn't make any sense otherwise.
.LP
\fB-withdummy\fR was new in Netpbm 10.27 (March 2005).
.IP "\fB-colormap\fR"
Build a custom colormap and include it in the output file. This is
not recommended by Palm, for efficiency reasons. Otherwise, \fBpnmtopalm\fR
uses the default Palm colormap for color output.
.IP "\fB-transparent=\fR\fIcolor\fR"
Marks one particular color as fully transparent. The format
to specify the color is either (when for example orange)
"1.0,0.5,0.0", where the values are floats between zero and
one, or with the syntax "#RGB", "#RRGGBB" or
"#RRRRGGGGBBBB" where R, G and B are hexadecimal numbers.
Transparency works only on Palm OS 3.5 and higher.
.IP "\fB-scanline-compression\fR"
Specifies that the output Palm bitmap will use the Palm scanline
compression scheme. Scanline compression works only in Palm OS 2.0
and higher.
.IP "\fB-rle-compression\fR"
Specifies that the output Palm bitmap will use the Palm RLE
compression scheme. RLE compression works only with Palm OS 3.5 and
higher.
.IP "\fB-packbits-compression\fR"
Specifies that the output Palm bitmap will use the Palm packbits
compression scheme. Packbits compression works only with Palm OS 4.0 and
higher.
.LP
This option was new in Netpbm 10.27 (March 2005).
.IP "\fB-density\fR=\fIN\fR"
This specifies the Palm Bitmap density. The density is a number that
is proportional to the resolution the image should have when displayed.
The proportionality factor is up to whatever is doing the displaying,
but it's helpful to think of these numbers as being pixels per inch.
The allowable values are:
.IP \(bu
72
.IP \(bu
108
.IP \(bu
144
.IP \(bu
216
.IP \(bu
288
.LP
.LP
This option was new in Netpbm 10.27 (March 2005). Earlier Netpbm
could not generate Version 3 Palm Bitmaps, so there was no such thing
as density.
.RE
.SH 2
SEE ALSO
.LP
\fBpalmtopnm\fR,
\fBpnmquant\fR,
\fBpnmremap\fR,
pnm,
PalmOS
Reference,
PalmOS
Companion.
.SH 2
NOTES
.LP
.LP
Palm Bitmaps may contains multiple renditions of the same bitmap,
in different depths. To construct an N-multiple-rendition Palm Bitmap
with \fBpnmtopalm\fR, first construct renditions 1 through N-1 using
the \fB-offset\fR option, then construct the Nth image without the
\fB-offset\fR option. Then concatenate the individual renditions
together in a single file using \fBcat\fR.
.LP
If you will include both high density and low density renditions,
put the high density images last and when you create the last of the
low density images, use the \fB-withdummy\fR option.
.SH 2
LIMITATIONS
.LP
.LP
You cannot generate an alpha mask if the Palm pixmap has a
transparent color. However, you can still do this with
\fBppmcolormask\fR with a Netpbm pipe similar to:
.LP
\fBpalmtopnm pixmap.palm | ppmcolormask `palmtopnm -transparent pixmap.palm`\fR
.SH 2
AUTHORS
.LP
This program was originally written as ppmtoTbmp.c, by Ian Goldberg
and George Caswell. It was completely re-written by Bill Janssen to
add color, compression, and transparency function.
.br
Copyright 1995-2001 by Ian Goldberg, George Caswell, and Bill Janssen.
.br
\l'5i'
.SH 2
Table Of Contents
.LP
.IP \(bu
NAME
.IP \(bu
SYNOPSIS
.IP \(bu
DESCRIPTION
.IP \(bu
PALM BITMAP VERSION
.IP \(bu
OPTIONS
.IP \(bu
SEE ALSO
.IP \(bu
NOTES
.IP \(bu
NOTES
.IP \(bu
AUTHORS
.LP
|