summary refs log tree commit diff
path: root/hpcdtoppm.html
blob: f28d55561743346ae8d66c04e9000dfee6b45640 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML><HEAD><TITLE>Hpcdtoppm User Manual</TITLE></HEAD>
<BODY>
<H1>hpcdtoppm</H1>
Updated: 7 August 2003
<BR>

<A HREF="#index">Table Of Contents</A>

<H2>NAME</H2>
hpcdtoppm - convert a Photo-CD image into a PBM image

<H2 id="synopsis">SYNOPSIS</H2>

<B>hpcdtoppm</B>
<I>infile</I>
[<B>-a</B>]
[{<B>-C</B>|<B>-0</B>|<B>-Overview</B>|<B>-O</B>} <I>file opt</I>]
[<B>-c0</B>]
[<B>-c-</B>]
[<B>-c+</B>]
[<B>-crop</B>]
[<B>-d</B>]
[<B>-dpi</B> <I>f</I>]
[<B>-eps</B>]
[<B>-epsd</B>]
[<B>-epsg</B>]
[<B>-fak</B> <I>scale</I>]
[<B>-hori</B>]
[<B>-i</B>]
[<B>-l</B>]
[<B>-m</B>]
[<B>-n</B>]
[<B>-pb</B> <I>pos</I>]
[<B>-pgm</B>]
[<B>-ph</B> <I>height</I>]
[<B>-pl</B> <I>pos</I>]
[<B>-pos</B>]
[<B>-ppm</B>]
[<B>-ps</B>]
[<B>-psd</B>]
[<B>-psg</B>]
[<B>-pw</B> <I>width</I>]
[<B>-r</B>]
[<B>-rep</B>]
[<B>-S</B> <I>long short</I>]
[<B>-s</B>]
[<B>-vert</B>]
[<B>-x</B>]
[<B>-ycc</B>]
[<B>-1</B>|<B>-Base/16</B>|<B>-128x192</B>]
[<B>-2</B>|<B>-Base/4</B>|<B>-256x384</B>]
[<B>-3</B>|<B>-Base</B>|<B>-512x768</B>]
[<B>-4</B>|<B>-4Base</B>|<B>-1024x1536</B>]
[<B>-5</B>|<B>-16Base</B>|<B>-2048x3072</B>]
[<B>-6</B>|<B>-64Base</B>|<B>-4096x6144</B>]
[<I>outfile</I>]

<H2 id="description">DESCRIPTION</H2>

<p>This program is part of <a href="index.html">Netpbm</a>.

<p>This program accepts Photo-CD image or overview file data from the
specified input file, <I>infile</I> (or, if the resolution is lower
than 64Base and the file argument is specified as <B>-</B>, from
standard input), and writes either PBM Format or PostScript to the
specified output file (or to standard output if no file is specified).

<P>On a standard Photo-CD, image files appear in the directory
<b>photo_cd/images</b>, in files with names of the form
img<I>nnnn</i>.pcd, where <I>nnnn</I> is a 4-digit-number.  The
overview file appears in <B>photo_cd/overview.pcd</B>.

<P>Photo-CD images are stored using as many as 6 different resolutions:


<PRE>
          Format              Resolution
          ------              ----------
          64Base              4096x6144 (ProPhotoCD only)
          16Base              2048x3072
          4Base               1024x1536
          Base                512x768
          Base/4              256x384
          Base/16             128x192
</PRE>

<P>The overview file employs Base/16 format.


<H2 id="options">OPTIONS</H2>

Invoking <b>hpcdtoppm</b> without arguments produces a list of default
values.  Note that you can supply only one size option.

<DL COMPACT>
<DT><B>-a</B>

<DD>Automatically determine image orientation (this option is
experimental, and does not work for overview files).

<DT>{<B>-C</B> | <B>-0</B> | <B>-Overview</B> | <B>-O</B> } <I>file opt</I>

<DD>Extract all images from an overview file.  The mandatory
<I>file</I> argument is the name of a PPM file; output files are named
<i>filennnn</I>, where <I>nnnn</I> is a 4-digit number.  Overview
images are extracted in their original Base/16 format.  The value of
<I>opt</I> determines the orientation of the contact sheet image;
recognized values are:

<DL COMPACT>
<DT><B>n</B>

<DD>Do not rotate the image.

<DT><B>l</B>

<DD>Rotate the picture counter-clockwise (portrait mode).

<DT><B>r</B>

<DD>Rotate the picture clockwise (portrait mode).

</DL>

<DT><B>-c0</B>

<DD>Do not correct (brighten or darken) the image.

<DT><B>-c-</B>

<DD>Darken the image.

<DT><B>-c+</B>

<DD>Brighten the image.

<DT><B>-crop</B>

<DD>Cut off the black frame which sometimes appears at the image
borders.

<DT><B>-d</B>

<DD>Show only the decompressed difference rather than the complete image
(applicable only to 4Base and 16Base images).

<DT><B>-dpi</b> <i>res</i>

<DD>Set the printer resolution to <I>res</I> for dithered Postscript
images.

<DT><B>-eps</B>

<DD>Write a RGB Encapsulated Postscript color image.

<DT><B>-epsd</B>

<DD>Write a Floyd-Steinberg dithered image in Encapsulated Postscript.

<DT><B>-epsg</B>

<DD>Write a grayscale image in Encapsulated Postscript.

<DT><B>-fak</b> <i>scale</i>

<DD>Set the scaling factor for dithered PostScript images to
<I>scale</I>.

<DT><B>-hori</B>

<DD>Flip the image horizontally.

<DT><B>-i</B>

<DD>Send information from an image file header to Standard Error.

<DT><B>-l</B>

<DD>Rotate the picture counter-clockwise (portrait mode).

<DT><B>-m</B>

<DD>Write messages about the phases of decoding to standard error.

<DT><B>-n</B>

<DD>Do not rotate the image.

<DT><B>-pb</b> <i>pos</i>

<DD>Set the bottom position of the Postscript image to <I>pos</I>.

<DT><B>-pgm</B>

<DD>Write a <I>pgm</I> (grayscale) image.

<DT><B>-ph height</B>

<DD>Set the height of the Postscript image to <I>height</I>.

<DT><B>-pl</b> <i>pos</i>

<DD>Set the leftmost position of the Postscript image to <I>pos</I>.

<DT><B>-pos</B>

<DD>Print the relative starting position of the data for the current
resolution.  

<DT><B>-ppm</B>

<DD>Write a <I>ppm</I> RGB (color) image.

<DT><B>-ps</B>

<DD>Write a RGB Postscript color image.

<DT><B>-psd</B>

<DD>Write a Floyd-Steinberg dithered image in Postscript.

<DT><B>-psg</B>

<DD>Write a Postscript grayscale image.

<DT><B>-pw width</B>

<DD>Set the width of the Postscript image to <I>width</I>.

<DT><B>-r</B>

<DD>Rotate the picture clockwise (portrait mode).

<DT><B>-rep</B>

<DD>Try to jump over reading errors in the Huffman code. 

<DT><B>-S</b> <i>long</i> <i>short</i>

<DD>Cut out a subrectangle with boundaries defined by the values:

<DL COMPACT>
<DT><I>long</I>

<DD>For the longer side of the image.

<DT><I>short</I>

<DD>For the shorter side of the image.

</DL>

where <I>long</I> and <I>short</I> take one of two forms:

<DL COMPACT>
<DT><B>a-b</B>

<DD>Cut from position <I>a</I> to position <I>b</I>.

<DT><B>a+b</B>

<DD>Starting at offset <I>a</I>, cut a length of <I>b</I>.

</DL>

and where <I>a</I> and <I>b</I> are either integers representing pixel
locations, or floating point values over the range [0.0 ... 1.0],
representing the fraction of the length of a side.

<DT><B>-s</B>

<DD>Apply a simple sharpness operator to the luminosity channel.

<DT><B>-vert</B>

<DD>Flip the image vertically.

<DT><B>-x</B>

<DD> Overskip Mode (applicable to Base/16, Base/4, Base and 4Base).
In Photo-CD images the luminosity channel is stored in full
resolution, the two chromaticity channels are stored in half
resolution only and have to be interpolated.  In Overskip Mode, the
chromaticity channels of the next higher resolution are taken instead
of interpolating.  To see the difference, generate one PPM with and
one PPM without this option.  Use <B><A
HREF="pamarith.html">pamarith</A></B> to generate the difference image
of these two images.  Call <B><A HREF="ppmhist.html">ppmhist</A></B>
for this difference or show it with <b>xv</b> (push the <B>HistEq</B> button
in the color editor).

<DT><B>-ycc</B>

<DD>Write the image in a variation on PPM format in which the samples
are YCC instead of RGB.

<DT><B>-1</B>|<B>-Base/16</B>|<B>-128x192</B>

<DD>Extract the Base/16 image.

<DT><B>-2</b>|<b>-Base/4</b>|<b>-256x384</B>

<DD>Extract the Base/4 image.

<DT><B>-3</b>|<b>-Base</b>|<b>-512x768</B>

<DD>Extract the Base image.

<DT><B>-4</b>|<b>-4Base</b>|<b>-1024x1536</B>

<DD>Extract the 4Base image.

<DT><B>-5</b>|<b>-16Base</b>|<b>-2048x3072</B>

<DD>Extract the 16Base image.

<DT><B>-6</b>|<b>-64Base</b>|<b>-4096x6144</B>

<DD>Extract the 64Base image.  This resolution can be extracted from
ProPhotoCD images only.  The path of the 64Base extension files is
derived from the path to the image file. This means that it doesn't
work on stdin an the directory structure must be the very same as on
the ProPhotoCD.

</DL>

<H2 id="postscriptoutput">Postcript Output</H2>

<p>For Postscript output (options <B>-ps</B>, <B>-eps</B>,
<B>-psg</B>, <B>-epsg</B>, <B>-psd</B>, <B>-epsg</B>) you can define
both the resolution and placement of the image.  Both size and
position are specified in points (1/72 inch).

<P>The position of the image (where the origin is assumed to be at the
lower left corner of the page) is controlled by the <B>-pl</B> and
<B>-pb</B> options (applicable at all resolutions).  

<P>The size of color and grayscale images is changed with the
<B>-pw</B> and <B>-ph</B> options.  Every image pixel is mapped onto
one Postscript pixel.

<P>There are three modes of control for dithered Postscript: 

<DL COMPACT>
<DT>Image size

<DD> (<B>-pw</B> and <B>-ph</B>)

<DT>Printer resolution

<DD>(<B>-dpi</B>)

<DT>Scaling factor

<DD>(<B>-fak</B>)

</DL>

<P>These three factors are interdependent, hence no more then two can
be specified simultaneously.  Using <B>-dpi</B> and the
<B>-pw</B>/<B>-ph</B> options together often yields pleasing results.
Even using the default values for these options will produce results
differing from those obtained without use of the options.

<H2 id="limitations">Limitations</H2>
<p>The program ignores read protection.

<P>The <B>-i</B> option is not working correctly.

<P>Available information obout the Photo-CD format is vague; this
program was developed by trial-and-error after staring at hex-dumps.
Please send bugs reports and patches to the author.


<H2 id="seealso">SEE ALSO</H2>

<A HREF="pcdovtoppm.html">pcdovtoppm</A>,
<A HREF="pamarith.html">pamarith</A>,
<A HREF="ppm.html">ppm</A>,
<A HREF="ppmhist.html">ppmhist</A>,
<A HREF="pnmquant.html">pnmquant</A>,
<A HREF="ppmtopgm.html">ppmtopgm</A>,
<A HREF="ppmtorgb3.html">ppmtorgb3</A>,
<b>xv</b>


<H2 id="version">VERSION</H2>

<p>The name <b>hpcdtoppm</b> stands for "Hadmut's pcdtoppm," to
make it distinguishable in the event that someone else is building a
similar application and naming it <b>pcdtoppm</b>.

<p>This is version 0.6.


<H2 id="author">AUTHOR</H2>

Copyright (c) 1992, 1993, 1994 by Hadmut Danisch (<A
HREF="mailto:danisch@ira.uka.de">danisch@ira.uka.de</A>).

<p>Hadmut Danish has given permission to Bryan Henderson (August 2003)
to distribute this documentation as part of Netpbm on Sourceforge and
therefore to license this copy of this documentation to the public
with the following Sourceforge-compatible license.  Note that this
license does not contain a restriction on one's right to sell the
material, as does the <b>hpcdtoppm</b> program itself and other copies
of this documentation.

<p>This software is not public domain.  Permission to use and
distribute this software and its documentation for noncommercial use
and without fee is hereby granted, provided that the above copyright
notice appear in all copies and that both that copyright notice and
this permission notice appear in supporting documentation.

<P>The <b>hpcdtoppm</b> software itself (as opposed to this supporting
documentation) is licensed by Danisch under a similar license, but
with an additional restriction that a recipient may not sell the
software or use it in profit-making activity.  See the source code of
the program for details on its license.

<P> Manual page extensively modified by R. P. C. Rodgers (<A
HREF="mailto:rodgers@nlm.nih.gov">rodgers@nlm.nih.gov</A>).

<HR>
<H2>Table Of Contents</H2>
<UL>
<LI><A HREF="#synopsis">SYNOPSIS</A>
<LI><A HREF="#description">DESCRIPTION</A>
<LI><A HREF="#options">OPTIONS</A>
<LI><A HREF="#postscriptoutput">POSTSCRIPT OUTPUT</A>
<LI><A HREF="#limitations">LIMITATIONS</A>
<LI><A HREF="#seealso">SEE ALSO</A>
<LI><A HREF="#version">VERSION</A>
<LI><A HREF="#author">AUTHOR</A>
</UL>
</BODY>
</HTML>