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