blob: be5a815aa49a63860ca83518840f0d8901587bf5 [file] [log] [blame]
Thomas G. Lane88aeed41992-12-10 00:00:00 +00001.TH DJPEG 1 "2 August 1992"
Thomas G. Lanebd543f01991-12-13 00:00:00 +00002.SH NAME
3djpeg \- decompress a JPEG file to an image file
4.SH SYNOPSIS
5.B djpeg
6[
Thomas G. Lane88aeed41992-12-10 00:00:00 +00007.BI \-colors " N"
Thomas G. Lanebd543f01991-12-13 00:00:00 +00008]
9[
Thomas G. Lane88aeed41992-12-10 00:00:00 +000010.B \-gif
Thomas G. Lane4a6b7301992-03-17 00:00:00 +000011]
12[
Thomas G. Lane88aeed41992-12-10 00:00:00 +000013.B \-pnm
14]
15[
16.B \-rle
17]
18[
19.B \-targa
20]
21[
22.B \-blocksmooth
23]
24[
25.B \-grayscale
26]
27[
28.BI \-maxmemory " N"
29]
30[
31.B \-nodither
32]
33[
34.B \-onepass
35]
36[
37.B \-verbose
38]
39[
40.B \-debug
Thomas G. Lanebd543f01991-12-13 00:00:00 +000041]
42[
43.I filename
44]
45.LP
46.SH DESCRIPTION
47.LP
48.B djpeg
49decompresses the named JPEG file, or the standard input if no file is named,
Thomas G. Lane88aeed41992-12-10 00:00:00 +000050and produces an image file on the standard output. PBMPLUS (PPM/PGM), GIF,
51Targa, or RLE (Utah Raster Toolkit) output format can be selected. (RLE is
52supported only if the URT library is available.)
Thomas G. Lanebd543f01991-12-13 00:00:00 +000053.SH OPTIONS
Thomas G. Lane88aeed41992-12-10 00:00:00 +000054All switch names may be abbreviated; for example,
55.B \-grayscale
56may be written
57.B \-gray
58or
59.BR \-gr .
60Most of the "basic" switches can be abbreviated to as little as one letter.
61Upper and lower case are equivalent (thus
62.B \-GIF
63is the same as
64.BR \-gif ).
65British spellings are also accepted (e.g.,
66.BR \-greyscale ),
67though for brevity these are not mentioned below.
68.PP
69The basic switches are:
Thomas G. Lanebd543f01991-12-13 00:00:00 +000070.TP
Thomas G. Lane88aeed41992-12-10 00:00:00 +000071.BI \-colors " N"
72Reduce image to at most N colors. This reduces the number of colors used in
73the output image, so that it can be displayed on a colormapped display or
74stored in a colormapped file format. For example, if you have an 8-bit
75display, you'd need to reduce to 256 or fewer colors.
Thomas G. Lanebd543f01991-12-13 00:00:00 +000076.TP
Thomas G. Lane88aeed41992-12-10 00:00:00 +000077.BI \-quantize " N"
78Same as
79.BR \-colors .
80.B \-colors
81is the recommended name,
82.B \-quantize
83is provided only for backwards compatibility.
Thomas G. Lanebd543f01991-12-13 00:00:00 +000084.TP
Thomas G. Lane88aeed41992-12-10 00:00:00 +000085.B \-gif
86Select GIF output format. Since GIF does not support more than 256 colors,
87.B \-colors 256
88is assumed (unless you specify a smaller number of colors).
Thomas G. Lanebd543f01991-12-13 00:00:00 +000089.TP
Thomas G. Lane88aeed41992-12-10 00:00:00 +000090.B \-pnm
91Select PBMPLUS (PPM/PGM) output format (this is the default format).
92PGM is emitted if the JPEG file is gray-scale or if
93.B \-grayscale
94is specified; otherwise PPM is emitted.
95.TP
96.B \-rle
97Select RLE output format. (Requires URT library.)
98.TP
99.B \-targa
Thomas G. Lanebd543f01991-12-13 00:00:00 +0000100Select Targa output format. Gray-scale format is emitted if the JPEG file is
101gray-scale or if
Thomas G. Lane88aeed41992-12-10 00:00:00 +0000102.B \-grayscale
Thomas G. Lanebd543f01991-12-13 00:00:00 +0000103is specified; otherwise, colormapped format is emitted if
Thomas G. Lane88aeed41992-12-10 00:00:00 +0000104.B \-colors
Thomas G. Lanebd543f01991-12-13 00:00:00 +0000105is specified; otherwise, 24-bit full-color format is emitted.
Thomas G. Lane88aeed41992-12-10 00:00:00 +0000106.PP
107Switches for advanced users:
Thomas G. Lanebd543f01991-12-13 00:00:00 +0000108.TP
Thomas G. Lane88aeed41992-12-10 00:00:00 +0000109.B \-blocksmooth
110Perform cross-block smoothing. This is quite memory-intensive and only seems
111to improve the image at very low quality settings (\fB\-quality\fR 10 to 20 or
112so). At normal quality settings it may make the image worse.
Thomas G. Lanebd543f01991-12-13 00:00:00 +0000113.TP
Thomas G. Lane88aeed41992-12-10 00:00:00 +0000114.B \-grayscale
115Force gray-scale output even if JPEG file is color.
116Useful for viewing on monochrome displays.
Thomas G. Lanebd543f01991-12-13 00:00:00 +0000117.TP
Thomas G. Lane88aeed41992-12-10 00:00:00 +0000118.BI \-maxmemory " N"
119Set limit for amount of memory to use in processing large images. Value is
120in thousands of bytes, or millions of bytes if "M" is attached to the
121number. For example,
122.B \-max 4m
123selects 4000000 bytes. If more space is needed, temporary files will be used.
124.TP
125.B \-nodither
Thomas G. Lanebd543f01991-12-13 00:00:00 +0000126Do not use dithering in color quantization. By default, Floyd-Steinberg
127dithering is applied when quantizing colors, but on some images dithering may
128result in objectionable "graininess". If that happens, you can turn off
129dithering with
Thomas G. Lane88aeed41992-12-10 00:00:00 +0000130.BR \-nodither .
131.B \-nodither
Thomas G. Lane4a6b7301992-03-17 00:00:00 +0000132is ignored unless you also say
Thomas G. Lane88aeed41992-12-10 00:00:00 +0000133.B \-colors
134.IR N .
Thomas G. Lanebd543f01991-12-13 00:00:00 +0000135.TP
Thomas G. Lane88aeed41992-12-10 00:00:00 +0000136.B \-onepass
Thomas G. Lane4a6b7301992-03-17 00:00:00 +0000137Use one-pass instead of two-pass color quantization. The one-pass method is
138faster and needs less memory, but it produces a lower-quality image.
Thomas G. Lane88aeed41992-12-10 00:00:00 +0000139.B \-onepass
Thomas G. Lane4a6b7301992-03-17 00:00:00 +0000140is ignored unless you also say
Thomas G. Lane88aeed41992-12-10 00:00:00 +0000141.B \-colors
142.IR N .
Thomas G. Lane4a6b7301992-03-17 00:00:00 +0000143Also, the one-pass method is always used for gray-scale output (the two-pass
144method is no improvement then).
145.TP
Thomas G. Lane88aeed41992-12-10 00:00:00 +0000146.B \-verbose
Thomas G. Lanebd543f01991-12-13 00:00:00 +0000147Enable debug printout. More
Thomas G. Lane88aeed41992-12-10 00:00:00 +0000148.BR \-v 's
Thomas G. Lanebd543f01991-12-13 00:00:00 +0000149give more output. Also, version information is printed at startup.
Thomas G. Lane4a6b7301992-03-17 00:00:00 +0000150.TP
Thomas G. Lane88aeed41992-12-10 00:00:00 +0000151.B \-debug
152Same as
153.BR \-verbose .
Thomas G. Lanebd543f01991-12-13 00:00:00 +0000154.SH EXAMPLES
155.LP
Thomas G. Lane88aeed41992-12-10 00:00:00 +0000156This example decompresses the JPEG file foo.jpg, automatically quantizes to
157256 colors, and saves the output in GIF format in foo.gif:
Thomas G. Lanebd543f01991-12-13 00:00:00 +0000158.IP
Thomas G. Lane88aeed41992-12-10 00:00:00 +0000159.B djpeg \-gif
Thomas G. Lanebd543f01991-12-13 00:00:00 +0000160.I foo.jpg
161.B >
Thomas G. Lane4a6b7301992-03-17 00:00:00 +0000162.I foo.gif
Thomas G. Lane88aeed41992-12-10 00:00:00 +0000163.SH ENVIRONMENT
164.TP
165.B JPEGMEM
166If this environment variable is set, its value is the default memory limit.
167The value is specified as described for the
168.B \-maxmemory
169switch.
170.B JPEGMEM
171overrides the default value specified when the program was compiled, and
172itself is overridden by an explicit
173.BR \-maxmemory .
Thomas G. Lanebd543f01991-12-13 00:00:00 +0000174.SH SEE ALSO
175.BR cjpeg (1)
176.br
Thomas G. Lane4a6b7301992-03-17 00:00:00 +0000177.BR ppm (5),
178.BR pgm (5)
Thomas G. Lanebd543f01991-12-13 00:00:00 +0000179.br
180Wallace, Gregory K. "The JPEG Still Picture Compression Standard",
181Communications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44.
182.SH AUTHOR
183Independent JPEG Group
184.SH BUGS
Thomas G. Lanebd543f01991-12-13 00:00:00 +0000185Arithmetic coding is not supported for legal reasons.
186.PP
Thomas G. Lane88aeed41992-12-10 00:00:00 +0000187Still not as fast as we'd like.