1DJPEG(1) General Commands Manual DJPEG(1)
2
3
4
6 djpeg - decompress a JPEG file to an image file
7
9 djpeg [ options ] [ filename ]
10
12 djpeg decompresses the named JPEG file, or the standard input if no
13 file is named, and produces an image file on the standard output. PBM‐
14 PLUS (PPM/PGM), BMP, GIF, Targa, or RLE (Utah Raster Toolkit) output
15 format can be selected. (RLE is supported only if the URT library is
16 available.)
17
19 All switch names may be abbreviated; for example, -grayscale may be
20 written -gray or -gr. Most of the "basic" switches can be abbreviated
21 to as little as one letter. Upper and lower case are equivalent (thus
22 -BMP is the same as -bmp). British spellings are also accepted (e.g.,
23 -greyscale), though for brevity these are not mentioned below.
24
25 The basic switches are:
26
27 -colors N
28 Reduce image to at most N colors. This reduces the number of
29 colors used in the output image, so that it can be displayed on
30 a colormapped display or stored in a colormapped file format.
31 For example, if you have an 8-bit display, you'd need to reduce
32 to 256 or fewer colors.
33
34 -quantize N
35 Same as -colors. -colors is the recommended name, -quantize is
36 provided only for backwards compatibility.
37
38 -fast Select recommended processing options for fast, low quality out‐
39 put. (The default options are chosen for highest quality out‐
40 put.) Currently, this is equivalent to -dct fast -nosmooth
41 -onepass -dither ordered.
42
43 -grayscale
44 Force gray-scale output even if JPEG file is color. Useful for
45 viewing on monochrome displays; also, djpeg runs noticeably
46 faster in this mode.
47
48 -scale M/N
49 Scale the output image by a factor M/N. Currently the scale
50 factor must be M/8, where M is an integer between 1 and 16
51 inclusive, or any reduced fraction thereof (such as 1/2, 3/4,
52 etc.) Scaling is handy if the image is larger than your screen;
53 also, djpeg runs much faster when scaling down the output.
54
55 -bmp Select BMP output format (Windows flavor). 8-bit colormapped
56 format is emitted if -colors or -grayscale is specified, or if
57 the JPEG file is gray-scale; otherwise, 24-bit full-color format
58 is emitted.
59
60 -gif Select GIF output format. Since GIF does not support more than
61 256 colors, -colors 256 is assumed (unless you specify a smaller
62 number of colors).
63
64 -os2 Select BMP output format (OS/2 1.x flavor). 8-bit colormapped
65 format is emitted if -colors or -grayscale is specified, or if
66 the JPEG file is gray-scale; otherwise, 24-bit full-color format
67 is emitted.
68
69 -pnm Select PBMPLUS (PPM/PGM) output format (this is the default for‐
70 mat). PGM is emitted if the JPEG file is gray-scale or if
71 -grayscale is specified; otherwise PPM is emitted.
72
73 -rle Select RLE output format. (Requires URT library.)
74
75 -targa Select Targa output format. Gray-scale format is emitted if the
76 JPEG file is gray-scale or if -grayscale is specified; other‐
77 wise, colormapped format is emitted if -colors is specified;
78 otherwise, 24-bit full-color format is emitted.
79
80 Switches for advanced users:
81
82 -dct int
83 Use integer DCT method (default).
84
85 -dct fast
86 Use fast integer DCT (less accurate).
87
88 -dct float
89 Use floating-point DCT method. The float method is very
90 slightly more accurate than the int method, but is much slower
91 unless your machine has very fast floating-point hardware. Also
92 note that results of the floating-point method may vary slightly
93 across machines, while the integer methods should give the same
94 results everywhere. The fast integer method is much less accu‐
95 rate than the other two.
96
97 -dither fs
98 Use Floyd-Steinberg dithering in color quantization.
99
100 -dither ordered
101 Use ordered dithering in color quantization.
102
103 -dither none
104 Do not use dithering in color quantization. By default, Floyd-
105 Steinberg dithering is applied when quantizing colors; this is
106 slow but usually produces the best results. Ordered dither is a
107 compromise between speed and quality; no dithering is fast but
108 usually looks awful. Note that these switches have no effect
109 unless color quantization is being done. Ordered dither is only
110 available in -onepass mode.
111
112 -map file
113 Quantize to the colors used in the specified image file. This
114 is useful for producing multiple files with identical color
115 maps, or for forcing a predefined set of colors to be used. The
116 file must be a GIF or PPM file. This option overrides -colors
117 and -onepass.
118
119 -nosmooth
120 Use a faster, lower-quality upsampling routine.
121
122 -onepass
123 Use one-pass instead of two-pass color quantization. The one-
124 pass method is faster and needs less memory, but it produces a
125 lower-quality image. -onepass is ignored unless you also say
126 -colors N. Also, the one-pass method is always used for gray-
127 scale output (the two-pass method is no improvement then).
128
129 -maxmemory N
130 Set limit for amount of memory to use in processing large
131 images. Value is in thousands of bytes, or millions of bytes if
132 "M" is attached to the number. For example, -max 4m selects
133 4000000 bytes. If more space is needed, temporary files will be
134 used.
135
136 -outfile name
137 Send output image to the named file, not to standard output.
138
139 -memsrc
140 Load input file into memory before decompressing. This feature
141 was implemented mainly as a way of testing the in-memory source
142 manager (jpeg_mem_src().)
143
144 -verbose
145 Enable debug printout. More -v's give more output. Also, ver‐
146 sion information is printed at startup.
147
148 -debug Same as -verbose.
149
151 This example decompresses the JPEG file foo.jpg, quantizes it to 256
152 colors, and saves the output in 8-bit BMP format in foo.bmp:
153
154 djpeg -colors 256 -bmp foo.jpg > foo.bmp
155
157 To get a quick preview of an image, use the -grayscale and/or -scale
158 switches. -grayscale -scale 1/8 is the fastest case.
159
160 Several options are available that trade off image quality to gain
161 speed. -fast turns on the recommended settings.
162
163 -dct fast and/or -nosmooth gain speed at a small sacrifice in quality.
164 When producing a color-quantized image, -onepass -dither ordered is
165 fast but much lower quality than the default behavior. -dither none
166 may give acceptable results in two-pass mode, but is seldom tolerable
167 in one-pass mode.
168
169 If you are fortunate enough to have very fast floating point hardware,
170 -dct float may be even faster than -dct fast. But on most machines
171 -dct float is slower than -dct int; in this case it is not worth using,
172 because its theoretical accuracy advantage is too small to be signifi‐
173 cant in practice.
174
176 JPEGMEM
177 If this environment variable is set, its value is the default
178 memory limit. The value is specified as described for the
179 -maxmemory switch. JPEGMEM overrides the default value speci‐
180 fied when the program was compiled, and itself is overridden by
181 an explicit -maxmemory.
182
184 cjpeg(1), jpegtran(1), rdjpgcom(1), wrjpgcom(1)
185 ppm(5), pgm(5)
186 Wallace, Gregory K. "The JPEG Still Picture Compression Standard",
187 Communications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44.
188
190 Independent JPEG Group
191
192 This file was modified by The libjpeg-turbo Project to include only
193 information relevant to libjpeg-turbo, to wordsmith certain sections,
194 and to describe features not present in libjpeg.
195
197 To avoid the Unisys LZW patent, djpeg produces uncompressed GIF files.
198 These are larger than they should be, but are readable by standard GIF
199 decoders.
200
201
202
203 18 January 2013 DJPEG(1)