1 .TH DJPEG 1 "4 November 2020"
3 djpeg \- decompress a JPEG file to an image file
16 decompresses the named JPEG file, or the standard input if no file is named,
17 and produces an image file on the standard output. PBMPLUS (PPM/PGM), BMP,
18 GIF, Targa, or RLE (Utah Raster Toolkit) output format can be selected.
19 (RLE is supported only if the URT library is available.)
21 All switch names may be abbreviated; for example,
27 Most of the "basic" switches can be abbreviated to as little as one letter.
28 Upper and lower case are equivalent (thus
32 British spellings are also accepted (e.g.,
34 though for brevity these are not mentioned below.
36 The basic switches are:
39 Reduce image to at most N colors. This reduces the number of colors used in
40 the output image, so that it can be displayed on a colormapped display or
41 stored in a colormapped file format. For example, if you have an 8-bit
42 display, you'd need to reduce to 256 or fewer colors.
48 is the recommended name,
50 is provided only for backwards compatibility.
53 Select recommended processing options for fast, low quality output. (The
54 default options are chosen for highest quality output.) Currently, this is
55 equivalent to \fB\-dct fast \-nosmooth \-onepass \-dither ordered\fR.
58 Force grayscale output even if JPEG file is color. Useful for viewing on
59 monochrome displays; also,
61 runs noticeably faster in this mode.
64 Force RGB output even if JPEG file is grayscale.
67 Scale the output image by a factor M/N. Currently the scale factor must be
68 M/8, where M is an integer between 1 and 16 inclusive, or any reduced fraction
69 thereof (such as 1/2, 3/4, etc.) Scaling is handy if the image is larger than
72 runs much faster when scaling down the output.
75 Select BMP output format (Windows flavor). 8-bit colormapped format is
80 is specified, or if the JPEG file is grayscale; otherwise, 24-bit full-color
84 Select GIF output format. Since GIF does not support more than 256 colors,
86 is assumed (unless you specify a smaller number of colors).
89 Select BMP output format (OS/2 1.x flavor). 8-bit colormapped format is
94 is specified, or if the JPEG file is grayscale; otherwise, 24-bit full-color
98 Select PBMPLUS (PPM/PGM) output format (this is the default format).
99 PGM is emitted if the JPEG file is grayscale or if
101 is specified; otherwise PPM is emitted.
104 Select RLE output format. (Requires URT library.)
107 Select Targa output format. Grayscale format is emitted if the JPEG file is
110 is specified; otherwise, colormapped format is emitted if
112 is specified; otherwise, 24-bit full-color format is emitted.
114 Switches for advanced users:
117 Use accurate integer DCT method (default).
120 Use less accurate integer DCT method [legacy feature].
121 When the Independent JPEG Group's software was first released in 1991, the
122 decompression time for a 1-megapixel JPEG image on a mainstream PC was measured
123 in minutes. Thus, the \fBfast\fR integer DCT algorithm provided noticeable
124 performance benefits. On modern CPUs running libjpeg-turbo, however, the
125 decompression time for a 1-megapixel JPEG image is measured in milliseconds,
126 and thus the performance benefits of the \fBfast\fR algorithm are much less
127 noticeable. On modern x86/x86-64 CPUs that support AVX2 instructions, the
128 \fBfast\fR and \fBint\fR methods have similar performance. On other types of
129 CPUs, the \fBfast\fR method is generally about 5-15% faster than the \fBint\fR
132 If the JPEG image was compressed using a quality level of 85 or below, then
133 there should be little or no perceptible quality difference between the two
134 algorithms. When decompressing images that were compressed using quality
135 levels above 85, however, the difference between the \fBfast\fR and \fBint\fR
136 methods becomes more pronounced. With images compressed using quality=97, for
137 instance, the \fBfast\fR method incurs generally about a 4-6 dB loss in PSNR
138 relative to the \fBint\fR method, but this can be larger for some images. If
139 you can avoid it, do not use the \fBfast\fR method when decompressing images
140 that were compressed using quality levels above 97. The algorithm often
141 degenerates for such images and can actually produce a more lossy output image
142 than if the JPEG image had been compressed using lower quality levels.
145 Use floating-point DCT method [legacy feature].
146 The \fBfloat\fR method does not produce significantly more accurate results
147 than the \fBint\fR method, and it is much slower. The \fBfloat\fR method may
148 also give different results on different machines due to varying roundoff
149 behavior, whereas the integer methods should give the same results on all
153 Use Floyd-Steinberg dithering in color quantization.
156 Use ordered dithering in color quantization.
159 Do not use dithering in color quantization.
160 By default, Floyd-Steinberg dithering is applied when quantizing colors; this
161 is slow but usually produces the best results. Ordered dither is a compromise
162 between speed and quality; no dithering is fast but usually looks awful. Note
163 that these switches have no effect unless color quantization is being done.
164 Ordered dither is only available in
169 Extract ICC color management profile to the specified file.
172 Quantize to the colors used in the specified image file. This is useful for
173 producing multiple files with identical color maps, or for forcing a
174 predefined set of colors to be used. The
176 must be a GIF or PPM file. This option overrides
182 Use a faster, lower-quality upsampling routine.
185 Use one-pass instead of two-pass color quantization. The one-pass method is
186 faster and needs less memory, but it produces a lower-quality image.
188 is ignored unless you also say
191 Also, the one-pass method is always used for grayscale output (the two-pass
192 method is no improvement then).
195 Set limit for amount of memory to use in processing large images. Value is
196 in thousands of bytes, or millions of bytes if "M" is attached to the
199 selects 4000000 bytes. If more space is needed, an error will occur.
201 .BI \-outfile " name"
202 Send output image to the named file, not to standard output.
205 Load input file into memory before decompressing. This feature was implemented
206 mainly as a way of testing the in-memory source manager (jpeg_mem_src().)
209 Decompress all rows of the JPEG image except those between Y0 and Y1
210 (inclusive.) Note that if decompression scaling is being used, then Y0 and Y1
211 are relative to the scaled image dimensions.
213 .BI \-crop " WxH+X+Y"
214 Decompress only a rectangular subregion of the image, starting at point X,Y
215 with width W and height H. If necessary, X will be shifted left to the nearest
216 iMCU boundary, and the width will be increased accordingly. Note that if
217 decompression scaling is being used, then X, Y, W, and H are relative to the
218 scaled image dimensions. Currently this option only works with the
219 PBMPLUS (PPM/PGM), GIF, and Targa output formats.
222 Enable debug printout. More
224 give more output. Also, version information is printed at startup.
231 Print version information and exit.
234 This example decompresses the JPEG file foo.jpg, quantizes it to
235 256 colors, and saves the output in 8-bit BMP format in foo.bmp:
237 .B djpeg \-colors 256 \-bmp
242 To get a quick preview of an image, use the
247 .B \-grayscale \-scale 1/8
250 Several options are available that trade off image quality to gain speed.
252 turns on the recommended settings.
257 gain speed at a small sacrifice in quality.
258 When producing a color-quantized image,
259 .B \-onepass \-dither ordered
260 is fast but much lower quality than the default behavior.
262 may give acceptable results in two-pass mode, but is seldom tolerable in
267 If this environment variable is set, its value is the default memory limit.
268 The value is specified as described for the
272 overrides the default value specified when the program was compiled, and
273 itself is overridden by an explicit
284 Wallace, Gregory K. "The JPEG Still Picture Compression Standard",
285 Communications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44.
287 Independent JPEG Group
289 This file was modified by The libjpeg-turbo Project to include only information
290 relevant to libjpeg-turbo, to wordsmith certain sections, and to describe
291 features not present in libjpeg.
293 Support for compressed GIF output files was removed in djpeg v6b due to
294 concerns over the Unisys LZW patent. Although this patent expired in 2006,
295 djpeg still lacks compressed GIF support, for these historical reasons.
296 (Conversion of JPEG files to GIF is usually a bad idea anyway, since GIF is a
297 256-color format.) The uncompressed GIF files that djpeg generates are larger
298 than they should be, but they are readable by standard GIF decoders.