|
darco |
56a656 |
.TH DJPEG 1 "22 August 1997"
|
|
darco |
56a656 |
.SH NAME
|
|
darco |
56a656 |
djpeg \- decompress a JPEG file to an image file
|
|
darco |
56a656 |
.SH SYNOPSIS
|
|
darco |
56a656 |
.B djpeg
|
|
darco |
56a656 |
[
|
|
darco |
56a656 |
.I options
|
|
darco |
56a656 |
]
|
|
darco |
56a656 |
[
|
|
darco |
56a656 |
.I filename
|
|
darco |
56a656 |
]
|
|
darco |
56a656 |
.LP
|
|
darco |
56a656 |
.SH DESCRIPTION
|
|
darco |
56a656 |
.LP
|
|
darco |
56a656 |
.B djpeg
|
|
darco |
56a656 |
decompresses the named JPEG file, or the standard input if no file is named,
|
|
darco |
56a656 |
and produces an image file on the standard output. PBMPLUS (PPM/PGM), BMP,
|
|
darco |
56a656 |
GIF, Targa, or RLE (Utah Raster Toolkit) output format can be selected.
|
|
darco |
56a656 |
(RLE is supported only if the URT library is available.)
|
|
darco |
56a656 |
.SH OPTIONS
|
|
darco |
56a656 |
All switch names may be abbreviated; for example,
|
|
darco |
56a656 |
.B \-grayscale
|
|
darco |
56a656 |
may be written
|
|
darco |
56a656 |
.B \-gray
|
|
darco |
56a656 |
or
|
|
darco |
56a656 |
.BR \-gr .
|
|
darco |
56a656 |
Most of the "basic" switches can be abbreviated to as little as one letter.
|
|
darco |
56a656 |
Upper and lower case are equivalent (thus
|
|
darco |
56a656 |
.B \-BMP
|
|
darco |
56a656 |
is the same as
|
|
darco |
56a656 |
.BR \-bmp ).
|
|
darco |
56a656 |
British spellings are also accepted (e.g.,
|
|
darco |
56a656 |
.BR \-greyscale ),
|
|
darco |
56a656 |
though for brevity these are not mentioned below.
|
|
darco |
56a656 |
.PP
|
|
darco |
56a656 |
The basic switches are:
|
|
darco |
56a656 |
.TP
|
|
darco |
56a656 |
.BI \-colors " N"
|
|
darco |
56a656 |
Reduce image to at most N colors. This reduces the number of colors used in
|
|
darco |
56a656 |
the output image, so that it can be displayed on a colormapped display or
|
|
darco |
56a656 |
stored in a colormapped file format. For example, if you have an 8-bit
|
|
darco |
56a656 |
display, you'd need to reduce to 256 or fewer colors.
|
|
darco |
56a656 |
.TP
|
|
darco |
56a656 |
.BI \-quantize " N"
|
|
darco |
56a656 |
Same as
|
|
darco |
56a656 |
.BR \-colors .
|
|
darco |
56a656 |
.B \-colors
|
|
darco |
56a656 |
is the recommended name,
|
|
darco |
56a656 |
.B \-quantize
|
|
darco |
56a656 |
is provided only for backwards compatibility.
|
|
darco |
56a656 |
.TP
|
|
darco |
56a656 |
.B \-fast
|
|
darco |
56a656 |
Select recommended processing options for fast, low quality output. (The
|
|
darco |
56a656 |
default options are chosen for highest quality output.) Currently, this is
|
|
darco |
56a656 |
equivalent to \fB\-dct fast \-nosmooth \-onepass \-dither ordered\fR.
|
|
darco |
56a656 |
.TP
|
|
darco |
56a656 |
.B \-grayscale
|
|
darco |
56a656 |
Force gray-scale output even if JPEG file is color. Useful for viewing on
|
|
darco |
56a656 |
monochrome displays; also,
|
|
darco |
56a656 |
.B djpeg
|
|
darco |
56a656 |
runs noticeably faster in this mode.
|
|
darco |
56a656 |
.TP
|
|
darco |
56a656 |
.BI \-scale " M/N"
|
|
darco |
56a656 |
Scale the output image by a factor M/N. Currently the scale factor must be
|
|
darco |
56a656 |
1/1, 1/2, 1/4, or 1/8. Scaling is handy if the image is larger than your
|
|
darco |
56a656 |
screen; also,
|
|
darco |
56a656 |
.B djpeg
|
|
darco |
56a656 |
runs much faster when scaling down the output.
|
|
darco |
56a656 |
.TP
|
|
darco |
56a656 |
.B \-bmp
|
|
darco |
56a656 |
Select BMP output format (Windows flavor). 8-bit colormapped format is
|
|
darco |
56a656 |
emitted if
|
|
darco |
56a656 |
.B \-colors
|
|
darco |
56a656 |
or
|
|
darco |
56a656 |
.B \-grayscale
|
|
darco |
56a656 |
is specified, or if the JPEG file is gray-scale; otherwise, 24-bit full-color
|
|
darco |
56a656 |
format is emitted.
|
|
darco |
56a656 |
.TP
|
|
darco |
56a656 |
.B \-gif
|
|
darco |
56a656 |
Select GIF output format. Since GIF does not support more than 256 colors,
|
|
darco |
56a656 |
.B \-colors 256
|
|
darco |
56a656 |
is assumed (unless you specify a smaller number of colors).
|
|
darco |
56a656 |
.TP
|
|
darco |
56a656 |
.B \-os2
|
|
darco |
56a656 |
Select BMP output format (OS/2 1.x flavor). 8-bit colormapped format is
|
|
darco |
56a656 |
emitted if
|
|
darco |
56a656 |
.B \-colors
|
|
darco |
56a656 |
or
|
|
darco |
56a656 |
.B \-grayscale
|
|
darco |
56a656 |
is specified, or if the JPEG file is gray-scale; otherwise, 24-bit full-color
|
|
darco |
56a656 |
format is emitted.
|
|
darco |
56a656 |
.TP
|
|
darco |
56a656 |
.B \-pnm
|
|
darco |
56a656 |
Select PBMPLUS (PPM/PGM) output format (this is the default format).
|
|
darco |
56a656 |
PGM is emitted if the JPEG file is gray-scale or if
|
|
darco |
56a656 |
.B \-grayscale
|
|
darco |
56a656 |
is specified; otherwise PPM is emitted.
|
|
darco |
56a656 |
.TP
|
|
darco |
56a656 |
.B \-rle
|
|
darco |
56a656 |
Select RLE output format. (Requires URT library.)
|
|
darco |
56a656 |
.TP
|
|
darco |
56a656 |
.B \-targa
|
|
darco |
56a656 |
Select Targa output format. Gray-scale format is emitted if the JPEG file is
|
|
darco |
56a656 |
gray-scale or if
|
|
darco |
56a656 |
.B \-grayscale
|
|
darco |
56a656 |
is specified; otherwise, colormapped format is emitted if
|
|
darco |
56a656 |
.B \-colors
|
|
darco |
56a656 |
is specified; otherwise, 24-bit full-color format is emitted.
|
|
darco |
56a656 |
.PP
|
|
darco |
56a656 |
Switches for advanced users:
|
|
darco |
56a656 |
.TP
|
|
darco |
56a656 |
.B \-dct int
|
|
darco |
56a656 |
Use integer DCT method (default).
|
|
darco |
56a656 |
.TP
|
|
darco |
56a656 |
.B \-dct fast
|
|
darco |
56a656 |
Use fast integer DCT (less accurate).
|
|
darco |
56a656 |
.TP
|
|
darco |
56a656 |
.B \-dct float
|
|
darco |
56a656 |
Use floating-point DCT method.
|
|
darco |
56a656 |
The float method is very slightly more accurate than the int method, but is
|
|
darco |
56a656 |
much slower unless your machine has very fast floating-point hardware. Also
|
|
darco |
56a656 |
note that results of the floating-point method may vary slightly across
|
|
darco |
56a656 |
machines, while the integer methods should give the same results everywhere.
|
|
darco |
56a656 |
The fast integer method is much less accurate than the other two.
|
|
darco |
56a656 |
.TP
|
|
darco |
56a656 |
.B \-dither fs
|
|
darco |
56a656 |
Use Floyd-Steinberg dithering in color quantization.
|
|
darco |
56a656 |
.TP
|
|
darco |
56a656 |
.B \-dither ordered
|
|
darco |
56a656 |
Use ordered dithering in color quantization.
|
|
darco |
56a656 |
.TP
|
|
darco |
56a656 |
.B \-dither none
|
|
darco |
56a656 |
Do not use dithering in color quantization.
|
|
darco |
56a656 |
By default, Floyd-Steinberg dithering is applied when quantizing colors; this
|
|
darco |
56a656 |
is slow but usually produces the best results. Ordered dither is a compromise
|
|
darco |
56a656 |
between speed and quality; no dithering is fast but usually looks awful. Note
|
|
darco |
56a656 |
that these switches have no effect unless color quantization is being done.
|
|
darco |
56a656 |
Ordered dither is only available in
|
|
darco |
56a656 |
.B \-onepass
|
|
darco |
56a656 |
mode.
|
|
darco |
56a656 |
.TP
|
|
darco |
56a656 |
.BI \-map " file"
|
|
darco |
56a656 |
Quantize to the colors used in the specified image file. This is useful for
|
|
darco |
56a656 |
producing multiple files with identical color maps, or for forcing a
|
|
darco |
56a656 |
predefined set of colors to be used. The
|
|
darco |
56a656 |
.I file
|
|
darco |
56a656 |
must be a GIF or PPM file. This option overrides
|
|
darco |
56a656 |
.B \-colors
|
|
darco |
56a656 |
and
|
|
darco |
56a656 |
.BR \-onepass .
|
|
darco |
56a656 |
.TP
|
|
darco |
56a656 |
.B \-nosmooth
|
|
darco |
56a656 |
Use a faster, lower-quality upsampling routine.
|
|
darco |
56a656 |
.TP
|
|
darco |
56a656 |
.B \-onepass
|
|
darco |
56a656 |
Use one-pass instead of two-pass color quantization. The one-pass method is
|
|
darco |
56a656 |
faster and needs less memory, but it produces a lower-quality image.
|
|
darco |
56a656 |
.B \-onepass
|
|
darco |
56a656 |
is ignored unless you also say
|
|
darco |
56a656 |
.B \-colors
|
|
darco |
56a656 |
.IR N .
|
|
darco |
56a656 |
Also, the one-pass method is always used for gray-scale output (the two-pass
|
|
darco |
56a656 |
method is no improvement then).
|
|
darco |
56a656 |
.TP
|
|
darco |
56a656 |
.BI \-maxmemory " N"
|
|
darco |
56a656 |
Set limit for amount of memory to use in processing large images. Value is
|
|
darco |
56a656 |
in thousands of bytes, or millions of bytes if "M" is attached to the
|
|
darco |
56a656 |
number. For example,
|
|
darco |
56a656 |
.B \-max 4m
|
|
darco |
56a656 |
selects 4000000 bytes. If more space is needed, temporary files will be used.
|
|
darco |
56a656 |
.TP
|
|
darco |
56a656 |
.BI \-outfile " name"
|
|
darco |
56a656 |
Send output image to the named file, not to standard output.
|
|
darco |
56a656 |
.TP
|
|
darco |
56a656 |
.B \-verbose
|
|
darco |
56a656 |
Enable debug printout. More
|
|
darco |
56a656 |
.BR \-v 's
|
|
darco |
56a656 |
give more output. Also, version information is printed at startup.
|
|
darco |
56a656 |
.TP
|
|
darco |
56a656 |
.B \-debug
|
|
darco |
56a656 |
Same as
|
|
darco |
56a656 |
.BR \-verbose .
|
|
darco |
56a656 |
.SH EXAMPLES
|
|
darco |
56a656 |
.LP
|
|
darco |
56a656 |
This example decompresses the JPEG file foo.jpg, quantizes it to
|
|
darco |
56a656 |
256 colors, and saves the output in 8-bit BMP format in foo.bmp:
|
|
darco |
56a656 |
.IP
|
|
darco |
56a656 |
.B djpeg \-colors 256 \-bmp
|
|
darco |
56a656 |
.I foo.jpg
|
|
darco |
56a656 |
.B >
|
|
darco |
56a656 |
.I foo.bmp
|
|
darco |
56a656 |
.SH HINTS
|
|
darco |
56a656 |
To get a quick preview of an image, use the
|
|
darco |
56a656 |
.B \-grayscale
|
|
darco |
56a656 |
and/or
|
|
darco |
56a656 |
.B \-scale
|
|
darco |
56a656 |
switches.
|
|
darco |
56a656 |
.B \-grayscale \-scale 1/8
|
|
darco |
56a656 |
is the fastest case.
|
|
darco |
56a656 |
.PP
|
|
darco |
56a656 |
Several options are available that trade off image quality to gain speed.
|
|
darco |
56a656 |
.B \-fast
|
|
darco |
56a656 |
turns on the recommended settings.
|
|
darco |
56a656 |
.PP
|
|
darco |
56a656 |
.B \-dct fast
|
|
darco |
56a656 |
and/or
|
|
darco |
56a656 |
.B \-nosmooth
|
|
darco |
56a656 |
gain speed at a small sacrifice in quality.
|
|
darco |
56a656 |
When producing a color-quantized image,
|
|
darco |
56a656 |
.B \-onepass \-dither ordered
|
|
darco |
56a656 |
is fast but much lower quality than the default behavior.
|
|
darco |
56a656 |
.B \-dither none
|
|
darco |
56a656 |
may give acceptable results in two-pass mode, but is seldom tolerable in
|
|
darco |
56a656 |
one-pass mode.
|
|
darco |
56a656 |
.PP
|
|
darco |
56a656 |
If you are fortunate enough to have very fast floating point hardware,
|
|
darco |
56a656 |
\fB\-dct float\fR may be even faster than \fB\-dct fast\fR. But on most
|
|
darco |
56a656 |
machines \fB\-dct float\fR is slower than \fB\-dct int\fR; in this case it is
|
|
darco |
56a656 |
not worth using, because its theoretical accuracy advantage is too small to be
|
|
darco |
56a656 |
significant in practice.
|
|
darco |
56a656 |
.SH ENVIRONMENT
|
|
darco |
56a656 |
.TP
|
|
darco |
56a656 |
.B JPEGMEM
|
|
darco |
56a656 |
If this environment variable is set, its value is the default memory limit.
|
|
darco |
56a656 |
The value is specified as described for the
|
|
darco |
56a656 |
.B \-maxmemory
|
|
darco |
56a656 |
switch.
|
|
darco |
56a656 |
.B JPEGMEM
|
|
darco |
56a656 |
overrides the default value specified when the program was compiled, and
|
|
darco |
56a656 |
itself is overridden by an explicit
|
|
darco |
56a656 |
.BR \-maxmemory .
|
|
darco |
56a656 |
.SH SEE ALSO
|
|
darco |
56a656 |
.BR cjpeg (1),
|
|
darco |
56a656 |
.BR jpegtran (1),
|
|
darco |
56a656 |
.BR rdjpgcom (1),
|
|
darco |
56a656 |
.BR wrjpgcom (1)
|
|
darco |
56a656 |
.br
|
|
darco |
56a656 |
.BR ppm (5),
|
|
darco |
56a656 |
.BR pgm (5)
|
|
darco |
56a656 |
.br
|
|
darco |
56a656 |
Wallace, Gregory K. "The JPEG Still Picture Compression Standard",
|
|
darco |
56a656 |
Communications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44.
|
|
darco |
56a656 |
.SH AUTHOR
|
|
darco |
56a656 |
Independent JPEG Group
|
|
darco |
56a656 |
.SH BUGS
|
|
darco |
56a656 |
Arithmetic coding is not supported for legal reasons.
|
|
darco |
56a656 |
.PP
|
|
darco |
56a656 |
To avoid the Unisys LZW patent,
|
|
darco |
56a656 |
.B djpeg
|
|
darco |
56a656 |
produces uncompressed GIF files. These are larger than they should be, but
|
|
darco |
56a656 |
are readable by standard GIF decoders.
|
|
darco |
56a656 |
.PP
|
|
darco |
56a656 |
Still not as fast as we'd like.
|