Blame | Last modification | View Log | RSS feed
.TH DJPEG 1 "22 August 1997".SH NAMEdjpeg \- decompress a JPEG file to an image file.SH SYNOPSIS.B djpeg[.I options][.I filename].LP.SH DESCRIPTION.LP.B djpegdecompresses 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), BMP,GIF, Targa, or RLE (Utah Raster Toolkit) output format can be selected.(RLE is supported only if the URT library is available.).SH OPTIONSAll switch names may be abbreviated; for example,.B \-grayscalemay be written.B \-grayor.BR \-gr .Most of the "basic" switches can be abbreviated to as little as one letter.Upper and lower case are equivalent (thus.B \-BMPis the same as.BR \-bmp ).British spellings are also accepted (e.g.,.BR \-greyscale ),though for brevity these are not mentioned below..PPThe basic switches are:.TP.BI \-colors " N"Reduce image to at most N colors. This reduces the number of colors used inthe output image, so that it can be displayed on a colormapped display orstored in a colormapped file format. For example, if you have an 8-bitdisplay, you'd need to reduce to 256 or fewer colors..TP.BI \-quantize " N"Same as.BR \-colors ..B \-colorsis the recommended name,.B \-quantizeis provided only for backwards compatibility..TP.B \-fastSelect recommended processing options for fast, low quality output. (Thedefault options are chosen for highest quality output.) Currently, this isequivalent to \fB\-dct fast \-nosmooth \-onepass \-dither ordered\fR..TP.B \-grayscaleForce gray-scale output even if JPEG file is color. Useful for viewing onmonochrome displays; also,.B djpegruns noticeably faster in this mode..TP.BI \-scale " M/N"Scale the output image by a factor M/N. Currently the scale factor must be1/1, 1/2, 1/4, or 1/8. Scaling is handy if the image is larger than yourscreen; also,.B djpegruns much faster when scaling down the output..TP.B \-bmpSelect BMP output format (Windows flavor). 8-bit colormapped format isemitted if.B \-colorsor.B \-grayscaleis specified, or if the JPEG file is gray-scale; otherwise, 24-bit full-colorformat is emitted..TP.B \-gifSelect GIF output format. Since GIF does not support more than 256 colors,.B \-colors 256is assumed (unless you specify a smaller number of colors)..TP.B \-os2Select BMP output format (OS/2 1.x flavor). 8-bit colormapped format isemitted if.B \-colorsor.B \-grayscaleis specified, or if the JPEG file is gray-scale; otherwise, 24-bit full-colorformat is emitted..TP.B \-pnmSelect PBMPLUS (PPM/PGM) output format (this is the default format).PGM is emitted if the JPEG file is gray-scale or if.B \-grayscaleis specified; otherwise PPM is emitted..TP.B \-rleSelect RLE output format. (Requires URT library.).TP.B \-targaSelect Targa output format. Gray-scale format is emitted if the JPEG file isgray-scale or if.B \-grayscaleis specified; otherwise, colormapped format is emitted if.B \-colorsis specified; otherwise, 24-bit full-color format is emitted..PPSwitches for advanced users:.TP.B \-dct intUse integer DCT method (default)..TP.B \-dct fastUse fast integer DCT (less accurate)..TP.B \-dct floatUse floating-point DCT method.The float method is very slightly more accurate than the int method, but ismuch slower unless your machine has very fast floating-point hardware. Alsonote that results of the floating-point method may vary slightly acrossmachines, while the integer methods should give the same results everywhere.The fast integer method is much less accurate than the other two..TP.B \-dither fsUse Floyd-Steinberg dithering in color quantization..TP.B \-dither orderedUse ordered dithering in color quantization..TP.B \-dither noneDo not use dithering in color quantization.By default, Floyd-Steinberg dithering is applied when quantizing colors; thisis slow but usually produces the best results. Ordered dither is a compromisebetween speed and quality; no dithering is fast but usually looks awful. Notethat these switches have no effect unless color quantization is being done.Ordered dither is only available in.B \-onepassmode..TP.BI \-map " file"Quantize to the colors used in the specified image file. This is useful forproducing multiple files with identical color maps, or for forcing apredefined set of colors to be used. The.I filemust be a GIF or PPM file. This option overrides.B \-colorsand.BR \-onepass ..TP.B \-nosmoothUse a faster, lower-quality upsampling routine..TP.B \-onepassUse one-pass instead of two-pass color quantization. The one-pass method isfaster and needs less memory, but it produces a lower-quality image..B \-onepassis ignored unless you also say.B \-colors.IR N .Also, the one-pass method is always used for gray-scale output (the two-passmethod is no improvement then)..TP.BI \-maxmemory " N"Set limit for amount of memory to use in processing large images. Value isin thousands of bytes, or millions of bytes if "M" is attached to thenumber. For example,.B \-max 4mselects 4000000 bytes. If more space is needed, temporary files will be used..TP.BI \-outfile " name"Send output image to the named file, not to standard output..TP.B \-verboseEnable debug printout. More.BR \-v 'sgive more output. Also, version information is printed at startup..TP.B \-debugSame as.BR \-verbose ..SH EXAMPLES.LPThis example decompresses the JPEG file foo.jpg, quantizes it to256 colors, and saves the output in 8-bit BMP format in foo.bmp:.IP.B djpeg \-colors 256 \-bmp.I foo.jpg.B >.I foo.bmp.SH HINTSTo get a quick preview of an image, use the.B \-grayscaleand/or.B \-scaleswitches..B \-grayscale \-scale 1/8is the fastest case..PPSeveral options are available that trade off image quality to gain speed..B \-fastturns on the recommended settings..PP.B \-dct fastand/or.B \-nosmoothgain speed at a small sacrifice in quality.When producing a color-quantized image,.B \-onepass \-dither orderedis fast but much lower quality than the default behavior..B \-dither nonemay give acceptable results in two-pass mode, but is seldom tolerable inone-pass mode..PPIf you are fortunate enough to have very fast floating point hardware,\fB\-dct float\fR may be even faster than \fB\-dct fast\fR. But on mostmachines \fB\-dct float\fR is slower than \fB\-dct int\fR; in this case it isnot worth using, because its theoretical accuracy advantage is too small to besignificant in practice..SH ENVIRONMENT.TP.B JPEGMEMIf this environment variable is set, its value is the default memory limit.The value is specified as described for the.B \-maxmemoryswitch..B JPEGMEMoverrides the default value specified when the program was compiled, anditself is overridden by an explicit.BR \-maxmemory ..SH SEE ALSO.BR cjpeg (1),.BR jpegtran (1),.BR rdjpgcom (1),.BR wrjpgcom (1).br.BR ppm (5),.BR pgm (5).brWallace, Gregory K. "The JPEG Still Picture Compression Standard",Communications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44..SH AUTHORIndependent JPEG Group.SH BUGSArithmetic coding is not supported for legal reasons..PPTo avoid the Unisys LZW patent,.B djpegproduces uncompressed GIF files. These are larger than they should be, butare readable by standard GIF decoders..PPStill not as fast as we'd like.