.TH DJPEG 1 "17 February 1993" .SH NAME djpeg \- decompress a JPEG file to an image file .SH SYNOPSIS .B djpeg [ .BI \-colors " N" ] [ .B \-gif ] [ .B \-pnm ] [ .B \-rle ] [ .B \-targa ] [ .B \-blocksmooth ] [ .B \-grayscale ] [ .BI \-maxmemory " N" ] [ .B \-nodither ] [ .B \-onepass ] [ .B \-verbose ] [ .B \-debug ] [ .I filename ] .LP .SH DESCRIPTION .LP .B djpeg decompresses the named JPEG file, or the standard input if no file is named, and produces an image file on the standard output. PBMPLUS (PPM/PGM), GIF, Targa, or RLE (Utah Raster Toolkit) output format can be selected. (RLE is supported only if the URT library is available.) .SH OPTIONS All switch names may be abbreviated; for example, .B \-grayscale may be written .B \-gray or .BR \-gr . Most of the "basic" switches can be abbreviated to as little as one letter. Upper and lower case are equivalent (thus .B \-GIF is the same as .BR \-gif ). British spellings are also accepted (e.g., .BR \-greyscale ), though for brevity these are not mentioned below. .PP The basic switches are: .TP .BI \-colors " N" Reduce image to at most N colors. This reduces the number of colors used in the output image, so that it can be displayed on a colormapped display or stored in a colormapped file format. For example, if you have an 8-bit display, you'd need to reduce to 256 or fewer colors. .TP .BI \-quantize " N" Same as .BR \-colors . .B \-colors is the recommended name, .B \-quantize is provided only for backwards compatibility. .TP .B \-gif Select GIF output format. Since GIF does not support more than 256 colors, .B \-colors 256 is assumed (unless you specify a smaller number of colors). .TP .B \-pnm Select PBMPLUS (PPM/PGM) output format (this is the default format). PGM is emitted if the JPEG file is gray-scale or if .B \-grayscale is specified; otherwise PPM is emitted. .TP .B \-rle Select RLE output format. (Requires URT library.) .TP .B \-targa Select Targa output format. Gray-scale format is emitted if the JPEG file is gray-scale or if .B \-grayscale is specified; otherwise, colormapped format is emitted if .B \-colors is specified; otherwise, 24-bit full-color format is emitted. .PP Switches for advanced users: .TP .B \-blocksmooth Perform cross-block smoothing. This is slow, quite memory-intensive, and only seems to improve the image at very low quality settings (\fB\-quality\fR 10 to 20 or so). At normal quality settings it may make the image worse. .TP .B \-grayscale Force gray-scale output even if JPEG file is color. Useful for viewing on monochrome displays. .TP .BI \-maxmemory " N" Set limit for amount of memory to use in processing large images. Value is in thousands of bytes, or millions of bytes if "M" is attached to the number. For example, .B \-max 4m selects 4000000 bytes. If more space is needed, temporary files will be used. .TP .B \-nodither Do not use dithering in color quantization. By default, Floyd-Steinberg dithering is applied when quantizing colors, but on some images dithering may result in objectionable "graininess". If that happens, you can turn off dithering with .BR \-nodither . .B \-nodither is ignored unless you also say .B \-colors .IR N . .TP .B \-onepass Use one-pass instead of two-pass color quantization. The one-pass method is faster and needs less memory, but it produces a lower-quality image. .B \-onepass is ignored unless you also say .B \-colors .IR N . Also, the one-pass method is always used for gray-scale output (the two-pass method is no improvement then). .TP .B \-verbose Enable debug printout. More .BR \-v 's give more output. Also, version information is printed at startup. .TP .B \-debug Same as .BR \-verbose . .SH EXAMPLES .LP This example decompresses the JPEG file foo.jpg, automatically quantizes to 256 colors, and saves the output in GIF format in foo.gif: .IP .B djpeg \-gif .I foo.jpg .B > .I foo.gif .SH ENVIRONMENT .TP .B JPEGMEM If this environment variable is set, its value is the default memory limit. The value is specified as described for the .B \-maxmemory switch. .B JPEGMEM overrides the default value specified when the program was compiled, and itself is overridden by an explicit .BR \-maxmemory . .SH SEE ALSO .BR cjpeg (1) .br .BR ppm (5), .BR pgm (5) .br Wallace, Gregory K. "The JPEG Still Picture Compression Standard", Communications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44. .SH AUTHOR Independent JPEG Group .SH BUGS Arithmetic coding is not supported for legal reasons. .PP Still not as fast as we'd like.