1Pnmtopalm User Manual(0) Pnmtopalm User Manual(0)
2
3
4
6 pnmtopalm - convert a PNM image to a Palm Bitmap
7
8
10 pnmtopalm
11
12 [-verbose]
13
14 [-depth=N]
15
16 [-maxdepth=N]
17
18 [-colormap]
19
20 [-transparent=color]
21
22 [-density=N]
23
24 [-offset]
25
26 [-withdummy] [-scanline-compression | -rle-compression | -packbits-com‐
27 pression]
28
29 [pnmfile]
30
31
33 This program is part of Netpbm(1).
34
35 pnmtopalm reads a PNM image as input, from Standard Input or pnmfile
36 and produces a Palm Bitmap as output.
37
38 Palm Bitmap files are either grayscale files 1, 2, or 4 bits wide, or
39 color files 8 bits wide, so pnmtopalm automatically scales colors to
40 have an appropriate maxval, unless you specify a depth or max depth.
41 Input files must have an appropriate number and set of colors for the
42 selected output constraints.
43
44 This often means that you should run the PNM image through pnmquant or
45 pnmremap before you pass it to pnmtopalm. Netpbm comes with several
46 colormap files you can use with pnmremap for this purpose. They are
47 palmgray2.map (4 shades of gray for a depth of 2), palmgray4.map (16
48 shades of gray for a depth of 4), and palmcolor8.map (232 colors in
49 default Palm colormap). In a standard Netpbm installation, these are
50 in the Netpbm data directory, and you can find the Netpbm data direc‐
51 tory with a netpbm-config --datadir shell command.
52
53 Example:
54
55 pnmremap myimage.ppm -mapfile=$(netpbm-config --datadir)/palmgray2.map | pnmtopalm -depth=2 >myimage.palm
56
57
58
59
60 Palm Bitmap Version
61 pnmtopalm generates a Version 0, 1, 2, or 3 Palm Bitmap. It generates
62 the oldest (lowest) version it can for the given image and the options
63 you specify.
64
65
66
67 · If you specify a density (-density option) higher than 'low,'
68 the version is at least 3.
69
70
71 · If you specify transparency (-transparent option) or any com‐
72 pression, the version is at least 2.
73
74
75 · If you specify a custom colormap (-colormap option), the verison
76 is at least 1.
77
78
79 · If the image has more than one bit per pixel, the version is at
80 least 1. The image has more than one bit per pixel if you spec‐
81 ify it with -depth or if you let it default and the image has
82 more than two colors (or shades of gray).
83
84
85
86 All releases of Palm OS can read a Version 0 bitmap. Palm OS 3.0 and
87 later can read a Version 1 bitmap. Palm OS 3.5 and later can read a
88 Version 2 bitmap. To read a Version 3 bitmap, you need Palm OS Garnet
89 or a handheld running the High Density Display Feature Set.
90
91
93 Minimum unique abbreviation of option is acceptable. You may use dou‐
94 ble hyphens instead of single hyphen to denote options. You may use
95 white space in place of the equals sign to separate an option name from
96 its value.
97
98
99
100 -verbose
101 Display the format of the output file.
102
103
104 -depth=N
105 Produce a file of depth N, where N must be either 1, 2, 4, 8, or
106 16. Because the default Palm 8-bit colormap is not grayscale,
107 if the input is a grayscale or monochrome image, the output will
108 never be more than 4 bits deep, regardless of the specified
109 depth. Note that 8-bit color works only in PalmOS 3.5 (and
110 higher), and 16-bit direct color works only in PalmOS 4.0 (and
111 higher). However, the 16-bit direct color format is also com‐
112 patible with the various PalmOS 3.x versions used in the Hand‐
113 spring Visor, so these images may also work in that device.
114
115
116 -maxdepth=N
117 Produce a file of minimal depth, but in any case less than N
118 bits wide. If you specify 16-bit, the output will always be
119 16-bit direct color.
120
121
122 -offset
123 Set the nextDepthOffset field in the palm file header to indi‐
124 cate the end of the file (and pad the end of the file to 4
125 bytes, since nextDepthOffset can point only to 4 byte bound‐
126 aries).
127
128 A palm image file can contain multiple renditions of the same
129 image, with different color depths, so a viewer can choose one
130 appropriate for the display. The nextDepthOffset field tells
131 where in the stream the next rendition begins.
132
133 pnmtopalm creates a file that contains only one image, but you
134 can separately concatenate multiple one-image files to create a
135 multi-image file. If you do that, you'll need to use -offset so
136 that the resulting concatenation is a correct stream.
137
138 By default (if you don't specify -offset), pnmtopalm generates a
139 nextDepthOffset field that says there is no following image (and
140 does not add any padding after the image).
141
142 Version 3 Palm Bitmaps actually have a nextBitmapOffset field
143 instead of the nextDepthOffset. The foregoing applies to which‐
144 ever is relevant.
145
146 The -offset option was new in Netpbm 10.26 (January 2005).
147 Before that, pnmtopalm always set the nextDepthOffset field to
148 'none.'
149
150 Before Netpbm 10.27 (March 2005), you cannot use -offset if you
151 create a compressed raster (because pnmtopalm isn't smart enough
152 to be able to know the size of the image at the time it writes
153 the header). You also cannot use it with 16 bit color depth or
154 with the -colormap option, for much the same reason.
155
156
157 -withdummy
158 This option tells pnmtopalm to put in the stream, after after
159 the image, a dummy image header to introduce subsequent high
160 density images.
161
162 This dummy image header is a special sequence specified in Palm
163 Bitmap specifications. It looks to an older Palm Bitmap inter‐
164 preter like an invalid image header, so such an intepreter will
165 stop reading the stream there. But a new Palm Bitmap inter‐
166 preter recognizes it for what it is (just something to choke an
167 old interpreter) and skips over it. Presumably, you will add to
168 the stream after this high density images which would confuse an
169 older interpreter.
170
171 If you specify -withdummy, you must also specify -offset, since
172 it doesn't make any sense otherwise.
173
174 -withdummy was new in Netpbm 10.27 (March 2005).
175
176
177 -colormap
178 Build a custom colormap and include it in the output file. This
179 is not recommended by Palm, for efficiency reasons. Otherwise,
180 pnmtopalm uses the default Palm colormap for color output.
181
182
183 -transparent=color
184 Marks one particular color as fully transparent. The format to
185 specify the color is either (when for example orange)
186 '1.0,0.5,0.0', where the values are floats between zero and one,
187 or with the syntax '#RGB', '#RRGGBB' or '#RRRRGGGGBBBB' where R,
188 G and B are hexadecimal numbers. Transparency works only on
189 Palm OS 3.5 and higher.
190
191
192 -scanline-compression
193 Specifies that the output Palm bitmap will use the Palm scanline
194 compression scheme. Scanline compression works only in Palm OS
195 2.0 and higher.
196
197
198 -rle-compression
199 Specifies that the output Palm bitmap will use the Palm RLE com‐
200 pression scheme. RLE compression works only with Palm OS 3.5
201 and higher.
202
203
204 -packbits-compression
205 Specifies that the output Palm bitmap will use the Palm packbits
206 compression scheme. Packbits compression works only with Palm
207 OS 4.0 and higher.
208
209 This option was new in Netpbm 10.27 (March 2005).
210
211
212 -density=N
213 This specifies the Palm Bitmap density. The density is a number
214 that is proportional to the resolution the image should have
215 when displayed. The proportionality factor is up to whatever is
216 doing the displaying, but it's helpful to think of these numbers
217 as being pixels per inch. The allowable values are:
218
219
220
221 · 72
222
223 · 108
224
225 · 144
226
227 · 216
228
229 · 288
230
231
232 This option was new in Netpbm 10.27 (March 2005). Earlier
233 Netpbm could not generate Version 3 Palm Bitmaps, so there was
234 no such thing as density.
235
236
237
238
239
241 palmtopnm(1), pnmquant(1), pnmremap(1), pnm(1), PalmOS Reference (1),
242 PalmOS Companion ⟨http://www.access-
243 company.com/developers/documents/docs/palmos/PalmOSCompanion/UserInterface.html#1010236⟩
244 .
245
246
247
249 Palm Bitmaps may contains multiple renditions of the same bitmap, in
250 different depths. To construct an N-multiple-rendition Palm Bitmap
251 with pnmtopalm, first construct renditions 1 through N-1 using the
252 -offset option, then construct the Nth image without the -offset
253 option. Then concatenate the individual renditions together in a sin‐
254 gle file using cat.
255
256 If you will include both high density and low density renditions, put
257 the high density images last and when you create the last of the low
258 density images, use the -withdummy option.
259
260
262 This program was originally written as ppmtoTbmp.c, by Ian Goldberg and
263 George Caswell. It was completely re-written by Bill Janssen to add
264 color, compression, and transparency function. Copyright 1995-2001 by
265 Ian Goldberg, George Caswell, and Bill Janssen.
266
267
268
269netpbm documentation 05 October 2003 Pnmtopalm User Manual(0)