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 de‐
57 fault Palm colormap). In a standard Netpbm installation, these are in
58 the Netpbm data directory, and you can find the Netpbm data directory
59 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
69 Compressed Palm Bitmap files, at least the ones pnmtopalm knows how to
70 create, cannot have more than 8 bits per pixel. pnmtopalm defaults to
71 8 bits per pixel if you specify a compressed output. You can specify
72 the number of bits per pixel explicitly with -depth. -maxdepth has the
73 same effect as -depth. If you specify more than 8 bits per pixel with
74 either of these, pnmtopalm fails.
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 In addition to the options common to all programs based on libnetpbm
111 (most notably -quiet, see
112 Common Options ⟨index.html#commonoptions⟩ ), pnmtopalm recognizes the
113 following command line options:
114
115
116
117 -verbose
118 Display the format of the output file.
119
120
121 -depth=N
122 Produce a file of depth N, where N must be either 1, 2, 4, 8, or
123 16. Because the default Palm 8-bit colormap is not grayscale,
124 if the input is a grayscale or monochrome image, the output will
125 never be more than 4 bits deep, regardless of the specified
126 depth. Note that 8-bit color works only in PalmOS 3.5 (and
127 higher), and 16-bit direct color works only in PalmOS 4.0 (and
128 higher). However, the 16-bit direct color format is also com‐
129 patible with the various PalmOS 3.x versions used in the Hand‐
130 spring Visor, so these images may also work in that device.
131
132
133 -maxdepth=N
134 Produce a file of minimal depth, but in any case less than N
135 bits wide. If you specify 16-bit, the output will always be
136 16-bit direct color.
137
138
139 -offset
140 Set the nextDepthOffset field in the palm file header to indi‐
141 cate the end of the file (and pad the end of the file to 4
142 bytes, since nextDepthOffset can point only to 4 byte bound‐
143 aries).
144
145 A palm image file can contain multiple renditions of the same
146 image, with different color depths, so a viewer can choose one
147 appropriate for the display. The nextDepthOffset field tells
148 where in the stream the next rendition begins.
149
150 pnmtopalm creates a file that contains only one image, but you
151 can separately concatenate multiple one-image files to create a
152 multi-image file. If you do that, you'll need to use -offset so
153 that the resulting concatenation is a correct stream.
154
155 By default (if you don't specify -offset), pnmtopalm generates a
156 nextDepthOffset field that says there is no following image (and
157 does not add any padding after the image).
158
159 Version 3 Palm Bitmaps actually have a nextBitmapOffset field
160 instead of the nextDepthOffset. The foregoing applies to which‐
161 ever is relevant.
162
163 The -offset option was new in Netpbm 10.26 (January 2005). Be‐
164 fore that, pnmtopalm always set the nextDepthOffset field to
165 "none."
166
167 Before Netpbm 10.27 (March 2005), you cannot use -offset if you
168 create a compressed raster (because pnmtopalm isn't smart enough
169 to be able to know the size of the image at the time it writes
170 the header). You also cannot use it with 16 bit color depth or
171 with the -colormap option, for much the same reason.
172
173
174 -withdummy
175 This option tells pnmtopalm to put in the stream, after the im‐
176 age, a dummy image header to introduce subsequent high density
177 images.
178
179 This dummy image header is a special sequence specified in Palm
180 Bitmap specifications. It looks to an older Palm Bitmap inter‐
181 preter like an invalid image header, so such an interpreter will
182 stop reading the stream there. But a new Palm Bitmap inter‐
183 preter recognizes it for what it is (just something to choke an
184 old interpreter) and skips over it. Presumably, you will add to
185 the stream after this high density images which would confuse an
186 older interpreter.
187
188 If you specify -withdummy, you must also specify -offset, since
189 it doesn't make any sense otherwise.
190
191 -withdummy was new in Netpbm 10.27 (March 2005).
192
193
194 -colormap
195 Build a custom colormap and include it in the output file. This
196 is not recommended by Palm, for efficiency reasons. Otherwise,
197 pnmtopalm uses the default Palm colormap for color output.
198
199
200 -transparent=colorspec
201 Marks one particular color as fully transparent.
202
203 colorspec is as described for the argument of the
204 pnm_parsecolor() library routine
205 ⟨libnetpbm_image.html#colorname⟩ .
206
207 Transparency works only on Palm OS 3.5 and higher.
208
209
210 -scanline_compression
211 Specifies that the output Palm bitmap will use the Palm scanline
212 compression scheme. Scanline compression works only in Palm OS
213 2.0 and higher.
214
215
216 -rle_compression
217 Specifies that the output Palm bitmap will use the Palm RLE com‐
218 pression scheme. RLE compression works only with Palm OS 3.5
219 and higher.
220
221
222 -packbits_compression
223 Specifies that the output Palm bitmap will use the Palm packbits
224 compression scheme. Packbits compression works only with Palm
225 OS 4.0 and higher.
226
227 This option was new in Netpbm 10.27 (March 2005).
228
229
230 -density=N
231 This specifies the Palm Bitmap density. The density is a number
232 that is proportional to the resolution the image should have
233 when displayed. The proportionality factor is up to whatever is
234 doing the displaying, but it's helpful to think of these numbers
235 as being pixels per inch. The allowable values are:
236
237
238
239 • 72
240
241 • 108
242
243 • 144
244
245 • 216
246
247 • 288
248
249
250 This option was new in Netpbm 10.27 (March 2005). Earlier
251 Netpbm could not generate Version 3 Palm Bitmaps, so there was
252 no such thing as density.
253
254
255
256
258 palmtopnm(1), pdbimgtopam(1), pnmquant(1), pnmremap(1), pnm(1)
259
260
262 Palm Bitmaps may contains multiple renditions of the same bitmap, in
263 different depths. To construct an N-multiple-rendition Palm Bitmap
264 with pnmtopalm, first construct renditions 1 through N-1 using the
265 -offset option, then construct the Nth image without the -offset op‐
266 tion. Then concatenate the individual renditions together in a single
267 file using cat.
268
269 If you will include both high density and low density renditions, put
270 the high density images last and when you create the last of the low
271 density images, use the -withdummy option.
272
273 If you specify the Palm packbits compression scheme for a 16-bit direct
274 color bitmap, this program generates an invalid bitmap.
275
276
277
279 This program was originally written as ppmtoTbmp.c, by Ian Goldberg and
280 George Caswell. It was completely re-written by Bill Janssen to add
281 color, compression, and transparency function. Copyright 1995-2001 by
282 Ian Goldberg, George Caswell, and Bill Janssen.
283
285 This manual page was generated by the Netpbm tool 'makeman' from HTML
286 source. The master documentation is at
287
288 http://netpbm.sourceforge.net/doc/pnmtopalm.html
289
290netpbm documentation 25 August 2017 Pnmtopalm User Manual(0)