Debian Codegraph @

texk/xdvipsk/thirdparty/libjpeg/libjpeg-src/djpeg.1

raw
1 .TH DJPEG 1 "26 July 2015"
2 .SH NAME
3 djpeg \- decompress a JPEG file to an image file
4 .SH SYNOPSIS
5 .B djpeg
6 [
7 .I options
8 ]
9 [
10 .I filename
11 ]
12 .LP
13 .SH DESCRIPTION
14 .LP
15 .B djpeg
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.)
20 .SH OPTIONS
21 All switch names may be abbreviated; for example,
22 .B \-grayscale
23 may be written
24 .B \-gray
25 or
26 .BR \-gr .
27 Most of the "basic" switches can be abbreviated to as little as one letter.
28 Upper and lower case are equivalent (thus
29 .B \-BMP
30 is the same as
31 .BR \-bmp ).
32 British spellings are also accepted (e.g.,
33 .BR \-greyscale ),
34 though for brevity these are not mentioned below.
35 .PP
36 The basic switches are:
37 .TP
38 .BI \-colors " N"
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.
43 .TP
44 .BI \-quantize " N"
45 Same as
46 .BR \-colors .
47 .B \-colors
48 is the recommended name,
49 .B \-quantize
50 is provided only for backwards compatibility.
51 .TP
52 .B \-fast
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.
56 .TP
57 .B \-grayscale
58 Force grayscale output even if JPEG file is color.
59 Useful for viewing on monochrome displays; also,
60 .B djpeg
61 runs noticeably faster in this mode.
62 .TP
63 .B \-rgb
64 Force RGB output even if JPEG file is grayscale.
65 This is provided to support applications that don't
66 want to cope with grayscale as a separate case.
67 .TP
68 .BI \-scale " M/N"
69 Scale the output image by a factor M/N. Currently supported scale factors are
70 M/N with all M from 1 to 16, where N is the source DCT size, which is 8 for
71 baseline JPEG. If the /N part is omitted, then M specifies the DCT scaled
72 size to be applied on the given input. For baseline JPEG this is equivalent
73 to M/8 scaling, since the source DCT size for baseline JPEG is 8.
74 Scaling is handy if the image is larger than your screen; also,
75 .B djpeg
76 runs much faster when scaling down the output.
77 .TP
78 .B \-bmp
79 Select BMP output format (Windows flavor). 8-bit colormapped format is
80 emitted if
81 .B \-colors
82 or
83 .B \-grayscale
84 is specified, or if the JPEG file is grayscale; otherwise, 24-bit full-color
85 format is emitted.
86 .TP
87 .B \-gif
88 Select GIF output format. Since GIF does not support more than 256 colors,
89 .B \-colors 256
90 is assumed (unless you specify a smaller number of colors).
91 .TP
92 .B \-os2
93 Select BMP output format (OS/2 1.x flavor). 8-bit colormapped format is
94 emitted if
95 .B \-colors
96 or
97 .B \-grayscale
98 is specified, or if the JPEG file is grayscale; otherwise, 24-bit full-color
99 format is emitted.
100 .TP
101 .B \-pnm
102 Select PBMPLUS (PPM/PGM) output format (this is the default format).
103 PGM is emitted if the JPEG file is grayscale or if
104 .B \-grayscale
105 is specified; otherwise PPM is emitted.
106 .TP
107 .B \-rle
108 Select RLE output format. (Requires URT library.)
109 .TP
110 .B \-targa
111 Select Targa output format. Grayscale format is emitted if the JPEG file is
112 grayscale or if
113 .B \-grayscale
114 is specified; otherwise, colormapped format is emitted if
115 .B \-colors
116 is specified; otherwise, 24-bit full-color format is emitted.
117 .PP
118 Switches for advanced users:
119 .TP
120 .B \-dct int
121 Use integer DCT method (default).
122 .TP
123 .B \-dct fast
124 Use fast integer DCT (less accurate).
125 .TP
126 .B \-dct float
127 Use floating-point DCT method.
128 The float method is very slightly more accurate than the int method, but is
129 much slower unless your machine has very fast floating-point hardware. Also
130 note that results of the floating-point method may vary slightly across
131 machines, while the integer methods should give the same results everywhere.
132 The fast integer method is much less accurate than the other two.
133 .TP
134 .B \-dither fs
135 Use Floyd-Steinberg dithering in color quantization.
136 .TP
137 .B \-dither ordered
138 Use ordered dithering in color quantization.
139 .TP
140 .B \-dither none
141 Do not use dithering in color quantization.
142 By default, Floyd-Steinberg dithering is applied when quantizing colors; this
143 is slow but usually produces the best results. Ordered dither is a compromise
144 between speed and quality; no dithering is fast but usually looks awful. Note
145 that these switches have no effect unless color quantization is being done.
146 Ordered dither is only available in
147 .B \-onepass
148 mode.
149 .TP
150 .BI \-map " file"
151 Quantize to the colors used in the specified image file. This is useful for
152 producing multiple files with identical color maps, or for forcing a
153 predefined set of colors to be used. The
154 .I file
155 must be a GIF or PPM file. This option overrides
156 .B \-colors
157 and
158 .BR \-onepass .
159 .TP
160 .B \-nosmooth
161 Don't use high-quality upsampling.
162 .TP
163 .B \-onepass
164 Use one-pass instead of two-pass color quantization. The one-pass method is
165 faster and needs less memory, but it produces a lower-quality image.
166 .B \-onepass
167 is ignored unless you also say
168 .B \-colors
169 .IR N .
170 Also, the one-pass method is always used for grayscale output (the two-pass
171 method is no improvement then).
172 .TP
173 .BI \-maxmemory " N"
174 Set limit for amount of memory to use in processing large images. Value is
175 in thousands of bytes, or millions of bytes if "M" is attached to the
176 number. For example,
177 .B \-max 4m
178 selects 4000000 bytes. If more space is needed, temporary files will be used.
179 .TP
180 .BI \-outfile " name"
181 Send output image to the named file, not to standard output.
182 .TP
183 .B \-verbose
184 Enable debug printout. More
185 .BR \-v 's
186 give more output. Also, version information is printed at startup.
187 .TP
188 .B \-debug
189 Same as
190 .BR \-verbose .
191 .SH EXAMPLES
192 .LP
193 This example decompresses the JPEG file foo.jpg, quantizes it to
194 256 colors, and saves the output in 8-bit BMP format in foo.bmp:
195 .IP
196 .B djpeg \-colors 256 \-bmp
197 .I foo.jpg
198 .B >
199 .I foo.bmp
200 .SH HINTS
201 To get a quick preview of an image, use the
202 .B \-grayscale
203 and/or
204 .B \-scale
205 switches.
206 .B \-grayscale \-scale 1/8
207 is the fastest case.
208 .PP
209 Several options are available that trade off image quality to gain speed.
210 .B \-fast
211 turns on the recommended settings.
212 .PP
213 .B \-dct fast
214 and/or
215 .B \-nosmooth
216 gain speed at a small sacrifice in quality.
217 When producing a color-quantized image,
218 .B \-onepass \-dither ordered
219 is fast but much lower quality than the default behavior.
220 .B \-dither none
221 may give acceptable results in two-pass mode, but is seldom tolerable in
222 one-pass mode.
223 .PP
224 If you are fortunate enough to have very fast floating point hardware,
225 \fB\-dct float\fR may be even faster than \fB\-dct fast\fR. But on most
226 machines \fB\-dct float\fR is slower than \fB\-dct int\fR; in this case it is
227 not worth using, because its theoretical accuracy advantage is too small to be
228 significant in practice.
229 .SH ENVIRONMENT
230 .TP
231 .B JPEGMEM
232 If this environment variable is set, its value is the default memory limit.
233 The value is specified as described for the
234 .B \-maxmemory
235 switch.
236 .B JPEGMEM
237 overrides the default value specified when the program was compiled, and
238 itself is overridden by an explicit
239 .BR \-maxmemory .
240 .SH SEE ALSO
241 .BR cjpeg (1),
242 .BR jpegtran (1),
243 .BR rdjpgcom (1),
244 .BR wrjpgcom (1)
245 .br
246 .BR ppm (5),
247 .BR pgm (5)
248 .br
249 Wallace, Gregory K. "The JPEG Still Picture Compression Standard",
250 Communications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44.
251 .SH AUTHOR
252 Independent JPEG Group
253 .SH BUGS
254 To avoid the Unisys LZW patent (now expired),
255 .B djpeg
256 produces uncompressed GIF files. These are larger than they should be, but
257 are readable by standard GIF decoders.