version 1, including all changes.
.
| Rev |
Author |
# |
Line |
| 1 |
perry |
1 |
DJPEG |
| |
|
2 |
!!!DJPEG |
| |
|
3 |
NAME |
| |
|
4 |
SYNOPSIS |
| |
|
5 |
DESCRIPTION |
| |
|
6 |
OPTIONS |
| |
|
7 |
EXAMPLES |
| |
|
8 |
HINTS |
| |
|
9 |
ENVIRONMENT |
| |
|
10 |
SEE ALSO |
| |
|
11 |
AUTHOR |
| |
|
12 |
BUGS |
| |
|
13 |
---- |
| |
|
14 |
!!NAME |
| |
|
15 |
|
| |
|
16 |
|
| |
|
17 |
djpeg - decompress a JPEG file to an image file |
| |
|
18 |
!!SYNOPSIS |
| |
|
19 |
|
| |
|
20 |
|
| |
|
21 |
__djpeg__ [[ ''options'' ] [[ ''filename'' |
| |
|
22 |
] |
| |
|
23 |
!!DESCRIPTION |
| |
|
24 |
|
| |
|
25 |
|
| |
|
26 |
__djpeg__ decompresses the named JPEG file, or the |
| |
|
27 |
standard input if no file is named, and produces an image |
| |
|
28 |
file on the standard output. PBMPLUS (PPM/PGM), BMP, GIF, |
| |
|
29 |
Targa, or RLE (Utah Raster Toolkit) output format can be |
| |
|
30 |
selected. (RLE is supported only if the URT library is |
| |
|
31 |
available.) |
| |
|
32 |
!!OPTIONS |
| |
|
33 |
|
| |
|
34 |
|
| |
|
35 |
All switch names may be abbreviated; for example, |
| |
|
36 |
__-grayscale__ may be written __-gray__ or __-gr__. |
| |
|
37 |
Most of the |
| |
|
38 |
__-BMP__ is the same as __-bmp__). British |
| |
|
39 |
spellings are also accepted (e.g., __-greyscale__), |
| |
|
40 |
though for brevity these are not mentioned |
| |
|
41 |
below. |
| |
|
42 |
|
| |
|
43 |
|
| |
|
44 |
The basic switches are: |
| |
|
45 |
|
| |
|
46 |
|
| |
|
47 |
__-colors__ ''N'' |
| |
|
48 |
|
| |
|
49 |
|
| |
|
50 |
Reduce image to at most N colors. This reduces the number of |
| |
|
51 |
colors used in the output image, so that it can be displayed |
| |
|
52 |
on a colormapped display or stored in a colormapped file |
| |
|
53 |
format. For example, if you have an 8-bit display, you'd |
| |
|
54 |
need to reduce to 256 or fewer colors. |
| |
|
55 |
|
| |
|
56 |
|
| |
|
57 |
__-quantize__ ''N'' |
| |
|
58 |
|
| |
|
59 |
|
| |
|
60 |
Same as __-colors__. __-colors__ is the recommended |
| |
|
61 |
name, __-quantize__ is provided only for backwards |
| |
|
62 |
compatibility. |
| |
|
63 |
|
| |
|
64 |
|
| |
|
65 |
__-fast__ |
| |
|
66 |
|
| |
|
67 |
|
| |
|
68 |
Select recommended processing options for fast, low quality |
| |
|
69 |
output. (The default options are chosen for highest quality |
| |
|
70 |
output.) Currently, this is equivalent to __-dct fast |
| |
|
71 |
-nosmooth -onepass -dither ordered__. |
| |
|
72 |
|
| |
|
73 |
|
| |
|
74 |
__-grayscale__ |
| |
|
75 |
|
| |
|
76 |
|
| |
|
77 |
Force gray-scale output even if JPEG file is color. Useful |
| |
|
78 |
for viewing on monochrome displays; also, __djpeg__ runs |
| |
|
79 |
noticeably faster in this mode. |
| |
|
80 |
|
| |
|
81 |
|
| |
|
82 |
__-scale__ ''M/N'' |
| |
|
83 |
|
| |
|
84 |
|
| |
|
85 |
Scale the output image by a factor M/N. Currently the scale |
| |
|
86 |
factor must be 1/1, 1/2, 1/4, or 1/8. Scaling is handy if |
| |
|
87 |
the image is larger than your screen; also, __djpeg__ |
| |
|
88 |
runs much faster when scaling down the output. |
| |
|
89 |
|
| |
|
90 |
|
| |
|
91 |
__-bmp__ |
| |
|
92 |
|
| |
|
93 |
|
| |
|
94 |
Select BMP output format (Windows flavor). 8-bit colormapped |
| |
|
95 |
format is emitted if __-colors__ or __-grayscale__ is |
| |
|
96 |
specified, or if the JPEG file is gray-scale; otherwise, |
| |
|
97 |
24-bit full-color format is emitted. |
| |
|
98 |
|
| |
|
99 |
|
| |
|
100 |
__-gif__ |
| |
|
101 |
|
| |
|
102 |
|
| |
|
103 |
Select GIF output format. Since GIF does not support more |
| |
|
104 |
than 256 colors, __-colors 256__ is assumed (unless you |
| |
|
105 |
specify a smaller number of colors). |
| |
|
106 |
|
| |
|
107 |
|
| |
|
108 |
__-os2__ |
| |
|
109 |
|
| |
|
110 |
|
| |
|
111 |
Select BMP output format (OS/2 1.x flavor). 8-bit |
| |
|
112 |
colormapped format is emitted if __-colors__ or |
| |
|
113 |
__-grayscale__ is specified, or if the JPEG file is |
| |
|
114 |
gray-scale; otherwise, 24-bit full-color format is |
| |
|
115 |
emitted. |
| |
|
116 |
|
| |
|
117 |
|
| |
|
118 |
__-pnm__ |
| |
|
119 |
|
| |
|
120 |
|
| |
|
121 |
Select PBMPLUS (PPM/PGM) output format (this is the default |
| |
|
122 |
format). PGM is emitted if the JPEG file is gray-scale or if |
| |
|
123 |
__-grayscale__ is specified; otherwise PPM is |
| |
|
124 |
emitted. |
| |
|
125 |
|
| |
|
126 |
|
| |
|
127 |
__-rle__ |
| |
|
128 |
|
| |
|
129 |
|
| |
|
130 |
Select RLE output format. (Requires URT |
| |
|
131 |
library.) |
| |
|
132 |
|
| |
|
133 |
|
| |
|
134 |
__-targa__ |
| |
|
135 |
|
| |
|
136 |
|
| |
|
137 |
Select Targa output format. Gray-scale format is emitted if |
| |
|
138 |
the JPEG file is gray-scale or if __-grayscale__ is |
| |
|
139 |
specified; otherwise, colormapped format is emitted if |
| |
|
140 |
__-colors__ is specified; otherwise, 24-bit full-color |
| |
|
141 |
format is emitted. |
| |
|
142 |
|
| |
|
143 |
|
| |
|
144 |
Switches for advanced users: |
| |
|
145 |
|
| |
|
146 |
|
| |
|
147 |
__-dct int__ |
| |
|
148 |
|
| |
|
149 |
|
| |
|
150 |
Use integer DCT method (default). |
| |
|
151 |
|
| |
|
152 |
|
| |
|
153 |
__-dct fast__ |
| |
|
154 |
|
| |
|
155 |
|
| |
|
156 |
Use fast integer DCT (less accurate). |
| |
|
157 |
|
| |
|
158 |
|
| |
|
159 |
__-dct float__ |
| |
|
160 |
|
| |
|
161 |
|
| |
|
162 |
Use floating-point DCT method. The float method is very |
| |
|
163 |
slightly more accurate than the int method, but is much |
| |
|
164 |
slower unless your machine has very fast floating-point |
| |
|
165 |
hardware. Also note that results of the floating-point |
| |
|
166 |
method may vary slightly across machines, while the integer |
| |
|
167 |
methods should give the same results everywhere. The fast |
| |
|
168 |
integer method is much less accurate than the other |
| |
|
169 |
two. |
| |
|
170 |
|
| |
|
171 |
|
| |
|
172 |
__-dither fs__ |
| |
|
173 |
|
| |
|
174 |
|
| |
|
175 |
Use Floyd-Steinberg dithering in color |
| |
|
176 |
quantization. |
| |
|
177 |
|
| |
|
178 |
|
| |
|
179 |
__-dither ordered__ |
| |
|
180 |
|
| |
|
181 |
|
| |
|
182 |
Use ordered dithering in color quantization. |
| |
|
183 |
|
| |
|
184 |
|
| |
|
185 |
__-dither none__ |
| |
|
186 |
|
| |
|
187 |
|
| |
|
188 |
Do not use dithering in color quantization. By default, |
| |
|
189 |
Floyd-Steinberg dithering is applied when quantizing colors; |
| |
|
190 |
this is slow but usually produces the best results. Ordered |
| |
|
191 |
dither is a compromise between speed and quality; no |
| |
|
192 |
dithering is fast but usually looks awful. Note that these |
| |
|
193 |
switches have no effect unless color quantization is being |
| |
|
194 |
done. Ordered dither is only available in __-onepass__ |
| |
|
195 |
mode. |
| |
|
196 |
|
| |
|
197 |
|
| |
|
198 |
__-map__ ''file'' |
| |
|
199 |
|
| |
|
200 |
|
| |
|
201 |
Quantize to the colors used in the specified image file. |
| |
|
202 |
This is useful for producing multiple files with identical |
| |
|
203 |
color maps, or for forcing a predefined set of colors to be |
| |
|
204 |
used. The ''file'' must be a GIF or PPM file. This option |
| |
|
205 |
overrides __-colors__ and __-onepass__. |
| |
|
206 |
|
| |
|
207 |
|
| |
|
208 |
__-nosmooth__ |
| |
|
209 |
|
| |
|
210 |
|
| |
|
211 |
Use a faster, lower-quality upsampling routine. |
| |
|
212 |
|
| |
|
213 |
|
| |
|
214 |
__-onepass__ |
| |
|
215 |
|
| |
|
216 |
|
| |
|
217 |
Use one-pass instead of two-pass color quantization. The |
| |
|
218 |
one-pass method is faster and needs less memory, but it |
| |
|
219 |
produces a lower-quality image. __-onepass__ is ignored |
| |
|
220 |
unless you also say __-colors__ ''N''. Also, the |
| |
|
221 |
one-pass method is always used for gray-scale output (the |
| |
|
222 |
two-pass method is no improvement then). |
| |
|
223 |
|
| |
|
224 |
|
| |
|
225 |
__-maxmemory__ ''N'' |
| |
|
226 |
|
| |
|
227 |
|
| |
|
228 |
Set limit for amount of memory to use in processing large |
| |
|
229 |
images. Value is in thousands of bytes, or millions of bytes |
| |
|
230 |
if |
| |
|
231 |
-max 4m__ selects 4000000 bytes. If more space is |
| |
|
232 |
needed, temporary files will be used. |
| |
|
233 |
|
| |
|
234 |
|
| |
|
235 |
__-outfile__ ''name'' |
| |
|
236 |
|
| |
|
237 |
|
| |
|
238 |
Send output image to the named file, not to standard |
| |
|
239 |
output. |
| |
|
240 |
|
| |
|
241 |
|
| |
|
242 |
__-verbose__ |
| |
|
243 |
|
| |
|
244 |
|
| |
|
245 |
Enable debug printout. More __-v__'s give more output. |
| |
|
246 |
Also, version information is printed at |
| |
|
247 |
startup. |
| |
|
248 |
|
| |
|
249 |
|
| |
|
250 |
__-debug__ |
| |
|
251 |
|
| |
|
252 |
|
| |
|
253 |
Same as __-verbose__. |
| |
|
254 |
!!EXAMPLES |
| |
|
255 |
|
| |
|
256 |
|
| |
|
257 |
This example decompresses the JPEG file foo.jpg, quantizes |
| |
|
258 |
it to 256 colors, and saves the output in 8-bit BMP format |
| |
|
259 |
in foo.bmp: |
| |
|
260 |
|
| |
|
261 |
|
| |
|
262 |
__djpeg -colors 256 -bmp__ ''foo.jpg'' ____ |
| |
|
263 |
''foo.bmp'' |
| |
|
264 |
!!HINTS |
| |
|
265 |
|
| |
|
266 |
|
| |
|
267 |
To get a quick preview of an image, use the |
| |
|
268 |
__-grayscale__ and/or __-scale__ switches. |
| |
|
269 |
__-grayscale -scale 1/8__ is the fastest |
| |
|
270 |
case. |
| |
|
271 |
|
| |
|
272 |
|
| |
|
273 |
Several options are available that trade off image quality |
| |
|
274 |
to gain speed. __-fast__ turns on the recommended |
| |
|
275 |
settings. |
| |
|
276 |
|
| |
|
277 |
|
| |
|
278 |
__-dct fast__ and/or __-nosmooth__ gain speed at a |
| |
|
279 |
small sacrifice in quality. When producing a color-quantized |
| |
|
280 |
image, __-onepass -dither ordered__ is fast but much |
| |
|
281 |
lower quality than the default behavior. __-dither none__ |
| |
|
282 |
may give acceptable results in two-pass mode, but is seldom |
| |
|
283 |
tolerable in one-pass mode. |
| |
|
284 |
|
| |
|
285 |
|
| |
|
286 |
If you are fortunate enough to have very fast floating point |
| |
|
287 |
hardware, __-dct float__ may be even faster than __-dct |
| |
|
288 |
fast__. But on most machines __-dct float__ is slower |
| |
|
289 |
than __-dct int__; in this case it is not worth using, |
| |
|
290 |
because its theoretical accuracy advantage is too small to |
| |
|
291 |
be significant in practice. |
| |
|
292 |
!!ENVIRONMENT |
| |
|
293 |
|
| |
|
294 |
|
| |
|
295 |
__JPEGMEM__ |
| |
|
296 |
|
| |
|
297 |
|
| |
|
298 |
If this environment variable is set, its value is the |
| |
|
299 |
default memory limit. The value is specified as described |
| |
|
300 |
for the __-maxmemory__ switch. __JPEGMEM__ overrides |
| |
|
301 |
the default value specified when the program was compiled, |
| |
|
302 |
and itself is overridden by an explicit |
| |
|
303 |
__-maxmemory__. |
| |
|
304 |
!!SEE ALSO |
| |
|
305 |
|
| |
|
306 |
|
| |
|
307 |
cjpeg(1), jpegtran(1), rdjpgcom(1), |
| |
|
308 |
wrjpgcom(1)__ |
| |
|
309 |
ppm__(5), pgm(5) |
| |
|
310 |
Wallace, Gregory K. |
| |
|
311 |
!!AUTHOR |
| |
|
312 |
|
| |
|
313 |
|
| |
|
314 |
Independent JPEG Group |
| |
|
315 |
!!BUGS |
| |
|
316 |
|
| |
|
317 |
|
| |
|
318 |
Arithmetic coding is not supported for legal |
| |
|
319 |
reasons. |
| |
|
320 |
|
| |
|
321 |
|
| |
|
322 |
To avoid the Unisys LZW patent, __djpeg__ produces |
| |
|
323 |
uncompressed GIF files. These are larger than they should |
| |
|
324 |
be, but are readable by standard GIF decoders. |
| |
|
325 |
|
| |
|
326 |
|
| |
|
327 |
Still not as fast as we'd like. |
| |
|
328 |
---- |