1
.TH JPEGTOPNM 1 "19 March 2000"
3
jpegtopnm \- convert JPEG/JFIF file to portable pixmap or graymap
7
.RB { int | fast | float "}]"
11
.RB [{ -adobe | -notadobe }]
14
.RB [ -exif=\fIfilespec ]
22
All options may be abbreviated to their shortest unique prefix.
27
converts the named JFIF file, or the standard input if no file is
28
named to a PPM or PGM image file on the standard output. If the JFIF
29
file is of the grayscale variety,
31
generates a PGM (Portable Graymap) file. Otherwise, it generates a
32
PPM (Portable Pixmap) file.
35
uses the Independent JPEG Group's JPEG library to interpret the input file.
38
for information on the library.
40
"JFIF" is the correct name for the image format commonly known as "JPEG."
41
Strictly speaking, JPEG is a method of compression. The image format
42
using JPEG compression that is by far the most common is JFIF. There is
43
also a subformat of TIFF that uses JPEG compression.
45
EXIF is an image format that is a subformat of JFIF (to wit, a JFIF
46
file that contains an EXIF header as an APP1 marker).
50
JFIF files can have either 8 bits per sample or 12 bits per sample.
51
The 8 bit variety is by far the most common. There are two versions
52
of the IJG JPEG library. One reads only 8 bit files and the other
53
reads only 12 bit files. You must link the appropriate one of these
56
Ordinarily, this means the library is in your shared library search
61
generates output with either one byte or two bytes per sample depending on
62
whether the JFIF input has either 8 bits or 12 bits per sample. You can
65
to reduce a two-byte-per-sample file to a one-byte-per-sample file if
68
If the JFIF file uses the CMYK or YCCK color space, the input does not
69
actually contain enough information to know what color each pixel is.
70
To know what color a pixel is, one would have to know the properties of
71
the inks to which the color space refers.
73
interprets the colors using the common transformation which assumes
74
all the inks are simply subtractive and linear.
78
The options are only for advanced users:
81
Use integer DCT method (default).
84
Use fast integer DCT (less accurate).
87
Use floating-point DCT method.
88
The float method is very slightly more accurate than the int method, but is
89
much slower unless your machine has very fast floating-point hardware. Also
90
note that results of the floating-point method may vary slightly across
91
machines, while the integer methods should give the same results everywhere.
92
The fast integer method is much less accurate than the other two.
95
Use a faster, lower-quality upsampling routine.
98
Set limit on the amount of memory
100
uses in processing large images. Value is in thousands of bytes, or
101
millions of bytes if "M" is suffixed to the number. For example,
103
selects 4000000 bytes. If
105
needs more space, it uses temporary files.
110
There are two variations on the CMYK (and likewise YCCK) color space that
111
may be used in the JFIF input. In the normal one, a zero value for a color
112
components indicates absence of ink. In the other, a zero value means the
113
maximum ink coverage. The latter is used by Adobe Photoshop when it creates
114
a bare JFIF output file (but not when it creates JFIF output as part of
115
Encapsulated Postscript output).
119
which version of the CMYK or YCCK color space the image uses. If you
122
tries to figure it out on its own. In the present version, it doesn't
123
try very hard at all: It just assumes the Photoshop version, since
124
Photoshop and its emulators seem to be the main source of CMYK and
125
YCCK images. But with experience of use, future versions might be
128
If the JFIF image does not indicate that it is CMYK or YCCK, these
129
options have no effect.
131
If you don't use the right one of these options, the symptom is output
132
that looks like a negative.
136
Print the interpreted contents of any Exif header in the input file to the
137
Standard Error file. Similar to the program
139
(not part of the Netpbm package).
141
.B \-exif=\fIfilespec
142
Extract the contents of the EXIF header from the input image and write it
148
means write it to Standard Output. In this case,
150
does not output the converted image at all.
153
writes the contents of the EXIF header byte-for-byte, starting with the
154
two byte length field (which length includes those two bytes).
156
You can use this file as input to
158
to insert an identical EXIF header into a new JFIF image.
160
If there is no EXIF header,
162
writes two bytes of binary zero and nothing else.
164
An EXIF header takes the form of a JFIF APP1 marker. Only the first
165
such marker within the JFIF header counts.
169
Print any comments in the input file to the Standard Error file.
172
Print details about the conversion to the Standard Error file.
174
.BI \-tracelevel " n"
175
Turn on the JPEG library's trace messages to the Standard Error file.
178
gets more trace information.
180
implies a trace level of at least 1.
184
This example converts the color JFIF file foo.jpg to a PPM file
187
.B jpegtopnm foo.jpg >foo.ppm
192
to color quantize the result, i.e. to reduce the number of distinct colors
193
in the image. In fact, you may have to if you want to convert the PPM
194
file to certain other formats.
196
Does a more sophisticated quantization.
200
to change the dimensions of the resulting image.
204
to convert a color JFIF file to a grayscale PGM file.
206
You can easily use these converters together. E.g.:
208
.B jpegtopnm foo.jpg | ppmtopgm | pnmscale .25
215
gain speed at a small sacrifice in quality.
217
If you are fortunate enough to have very fast floating point hardware,
218
\fB\-dct float\fR may be even faster than \fB\-dct fast\fR. But
219
on most machines \fB\-dct float\fR is slower than \fB\-dct int\fR;
220
in this case it is not worth using, because its theoretical accuracy
221
advantage is too small to be significant in practice.
227
is maintained by the Independent JPEG Group and packaged with the
230
uses for all its JPEG work. Because of that, you may expect it to exploit
231
more current JPEG features. Also, since you have to have the library to
236
may be more commonly available.
240
does not use the NetPBM libraries to generate its output, as all the NetPBM
243
do. This means it is less likely to be consistent with all the other programs
244
that deal with the NetPBM formats. Also, the command syntax of
246
is consistent with that of the other Netpbm tools, unlike
252
If this environment variable is set, its value is the default memory limit.
253
The value is specified as described for the
276
Wallace, Gregory K. "The JPEG Still Picture Compression Standard",
277
Communications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44.
280
Arithmetic coding is not supported for legal reasons.
282
The program could be much faster.
286
and this man page were derived in large part from
288
by the Independent JPEG Group.
289
The program is otherwise by Bryan Henderson on March 19, 2000.