1 .TH DJPEG 1 "21 November 2014"
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 integer DCT method (default).
120 Use fast integer DCT (less accurate).
121 In libjpeg-turbo, the fast method is generally about 5-15% faster than the int
122 method when using the x86/x86-64 SIMD extensions (results may vary with other
123 SIMD implementations, or when using libjpeg-turbo without SIMD extensions.) If
124 the JPEG image was compressed using a quality level of 85 or below, then there
125 should be little or no perceptible difference between the two algorithms. When
126 decompressing images that were compressed using quality levels above 85,
127 however, the difference between the fast and int methods becomes more
128 pronounced. With images compressed using quality=97, for instance, the fast
129 method incurs generally about a 4-6 dB loss (in PSNR) relative to the int
130 method, but this can be larger for some images. If you can avoid it, do not
131 use the fast method when decompressing images that were compressed using
132 quality levels above 97. The algorithm often degenerates for such images and
133 can actually produce a more lossy output image than if the JPEG image had been
134 compressed using lower quality levels.
137 Use floating-point DCT method.
138 The float method is mainly a legacy feature. It does not produce significantly
139 more accurate results than the int method, and it is much slower. The float
140 method may also give different results on different machines due to varying
141 roundoff behavior, whereas the integer methods should give the same results on
145 Use Floyd-Steinberg dithering in color quantization.
148 Use ordered dithering in color quantization.
151 Do not use dithering in color quantization.
152 By default, Floyd-Steinberg dithering is applied when quantizing colors; this
153 is slow but usually produces the best results. Ordered dither is a compromise
154 between speed and quality; no dithering is fast but usually looks awful. Note
155 that these switches have no effect unless color quantization is being done.
156 Ordered dither is only available in
161 Quantize to the colors used in the specified image file. This is useful for
162 producing multiple files with identical color maps, or for forcing a
163 predefined set of colors to be used. The
165 must be a GIF or PPM file. This option overrides
171 Use a faster, lower-quality upsampling routine.
174 Use one-pass instead of two-pass color quantization. The one-pass method is
175 faster and needs less memory, but it produces a lower-quality image.
177 is ignored unless you also say
180 Also, the one-pass method is always used for grayscale output (the two-pass
181 method is no improvement then).
184 Set limit for amount of memory to use in processing large images. Value is
185 in thousands of bytes, or millions of bytes if "M" is attached to the
188 selects 4000000 bytes. If more space is needed, temporary files will be used.
190 .BI \-outfile " name"
191 Send output image to the named file, not to standard output.
194 Load input file into memory before decompressing. This feature was implemented
195 mainly as a way of testing the in-memory source manager (jpeg_mem_src().)
198 Enable debug printout. More
200 give more output. Also, version information is printed at startup.
207 Print version information and exit.
210 This example decompresses the JPEG file foo.jpg, quantizes it to
211 256 colors, and saves the output in 8-bit BMP format in foo.bmp:
213 .B djpeg \-colors 256 \-bmp
218 To get a quick preview of an image, use the
223 .B \-grayscale \-scale 1/8
226 Several options are available that trade off image quality to gain speed.
228 turns on the recommended settings.
233 gain speed at a small sacrifice in quality.
234 When producing a color-quantized image,
235 .B \-onepass \-dither ordered
236 is fast but much lower quality than the default behavior.
238 may give acceptable results in two-pass mode, but is seldom tolerable in
241 If you are fortunate enough to have very fast floating point hardware,
242 \fB\-dct float\fR may be even faster than \fB\-dct fast\fR. But on most
243 machines \fB\-dct float\fR is slower than \fB\-dct int\fR; in this case it is
244 not worth using, because its theoretical accuracy advantage is too small to be
245 significant in practice.
249 If this environment variable is set, its value is the default memory limit.
250 The value is specified as described for the
254 overrides the default value specified when the program was compiled, and
255 itself is overridden by an explicit
266 Wallace, Gregory K. "The JPEG Still Picture Compression Standard",
267 Communications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44.
269 Independent JPEG Group
271 This file was modified by The libjpeg-turbo Project to include only information
272 relevant to libjpeg-turbo, to wordsmith certain sections, and to describe
273 features not present in libjpeg.
275 To avoid the Unisys LZW patent,
277 produces uncompressed GIF files. These are larger than they should be, but
278 are readable by standard GIF decoders.