src/3rdparty/libjpeg/djpeg.1
changeset 30 5dc02b23752f
equal deleted inserted replaced
29:b72c6db6890b 30:5dc02b23752f
       
     1 .TH DJPEG 1 "3 October 2009"
       
     2 .SH NAME
       
     3 djpeg \- decompress a JPEG file to an image file
       
     4 .SH SYNOPSIS
       
     5 .B djpeg
       
     6 [
       
     7 .I options
       
     8 ]
       
     9 [
       
    10 .I filename
       
    11 ]
       
    12 .LP
       
    13 .SH DESCRIPTION
       
    14 .LP
       
    15 .B djpeg
       
    16 decompresses the named JPEG file, or the standard input if no file is named,
       
    17 and produces an image file on the standard output.  PBMPLUS (PPM/PGM), BMP,
       
    18 GIF, Targa, or RLE (Utah Raster Toolkit) output format can be selected.
       
    19 (RLE is supported only if the URT library is available.)
       
    20 .SH OPTIONS
       
    21 All switch names may be abbreviated; for example,
       
    22 .B \-grayscale
       
    23 may be written
       
    24 .B \-gray
       
    25 or
       
    26 .BR \-gr .
       
    27 Most of the "basic" switches can be abbreviated to as little as one letter.
       
    28 Upper and lower case are equivalent (thus
       
    29 .B \-BMP
       
    30 is the same as
       
    31 .BR \-bmp ).
       
    32 British spellings are also accepted (e.g.,
       
    33 .BR \-greyscale ),
       
    34 though for brevity these are not mentioned below.
       
    35 .PP
       
    36 The basic switches are:
       
    37 .TP
       
    38 .BI \-colors " N"
       
    39 Reduce image to at most N colors.  This reduces the number of colors used in
       
    40 the output image, so that it can be displayed on a colormapped display or
       
    41 stored in a colormapped file format.  For example, if you have an 8-bit
       
    42 display, you'd need to reduce to 256 or fewer colors.
       
    43 .TP
       
    44 .BI \-quantize " N"
       
    45 Same as
       
    46 .BR \-colors .
       
    47 .B \-colors
       
    48 is the recommended name,
       
    49 .B \-quantize
       
    50 is provided only for backwards compatibility.
       
    51 .TP
       
    52 .B \-fast
       
    53 Select recommended processing options for fast, low quality output.  (The
       
    54 default options are chosen for highest quality output.)  Currently, this is
       
    55 equivalent to \fB\-dct fast \-nosmooth \-onepass \-dither ordered\fR.
       
    56 .TP
       
    57 .B \-grayscale
       
    58 Force gray-scale output even if JPEG file is color.  Useful for viewing on
       
    59 monochrome displays; also,
       
    60 .B djpeg
       
    61 runs noticeably faster in this mode.
       
    62 .TP
       
    63 .BI \-scale " M/N"
       
    64 Scale the output image by a factor M/N.  Currently supported scale factors are
       
    65 M/N with all M from 1 to 16, where N is the source DCT size, which is 8 for
       
    66 baseline JPEG.  If the /N part is omitted, then M specifies the DCT scaled
       
    67 size to be applied on the given input.  For baseline JPEG this is equivalent
       
    68 to M/8 scaling, since the source DCT size for baseline JPEG is 8.
       
    69 Scaling is handy if the image is larger than your screen; also,
       
    70 .B djpeg
       
    71 runs much faster when scaling down the output.
       
    72 .TP
       
    73 .B \-bmp
       
    74 Select BMP output format (Windows flavor).  8-bit colormapped format is
       
    75 emitted if
       
    76 .B \-colors
       
    77 or
       
    78 .B \-grayscale
       
    79 is specified, or if the JPEG file is gray-scale; otherwise, 24-bit full-color
       
    80 format is emitted.
       
    81 .TP
       
    82 .B \-gif
       
    83 Select GIF output format.  Since GIF does not support more than 256 colors,
       
    84 .B \-colors 256
       
    85 is assumed (unless you specify a smaller number of colors).
       
    86 .TP
       
    87 .B \-os2
       
    88 Select BMP output format (OS/2 1.x flavor).  8-bit colormapped format is
       
    89 emitted if
       
    90 .B \-colors
       
    91 or
       
    92 .B \-grayscale
       
    93 is specified, or if the JPEG file is gray-scale; otherwise, 24-bit full-color
       
    94 format is emitted.
       
    95 .TP
       
    96 .B \-pnm
       
    97 Select PBMPLUS (PPM/PGM) output format (this is the default format).
       
    98 PGM is emitted if the JPEG file is gray-scale or if
       
    99 .B \-grayscale
       
   100 is specified; otherwise PPM is emitted.
       
   101 .TP
       
   102 .B \-rle
       
   103 Select RLE output format.  (Requires URT library.)
       
   104 .TP
       
   105 .B \-targa
       
   106 Select Targa output format.  Gray-scale format is emitted if the JPEG file is
       
   107 gray-scale or if
       
   108 .B \-grayscale
       
   109 is specified; otherwise, colormapped format is emitted if
       
   110 .B \-colors
       
   111 is specified; otherwise, 24-bit full-color format is emitted.
       
   112 .PP
       
   113 Switches for advanced users:
       
   114 .TP
       
   115 .B \-dct int
       
   116 Use integer DCT method (default).
       
   117 .TP
       
   118 .B \-dct fast
       
   119 Use fast integer DCT (less accurate).
       
   120 .TP
       
   121 .B \-dct float
       
   122 Use floating-point DCT method.
       
   123 The float method is very slightly more accurate than the int method, but is
       
   124 much slower unless your machine has very fast floating-point hardware.  Also
       
   125 note that results of the floating-point method may vary slightly across
       
   126 machines, while the integer methods should give the same results everywhere.
       
   127 The fast integer method is much less accurate than the other two.
       
   128 .TP
       
   129 .B \-dither fs
       
   130 Use Floyd-Steinberg dithering in color quantization.
       
   131 .TP
       
   132 .B \-dither ordered
       
   133 Use ordered dithering in color quantization.
       
   134 .TP
       
   135 .B \-dither none
       
   136 Do not use dithering in color quantization.
       
   137 By default, Floyd-Steinberg dithering is applied when quantizing colors; this
       
   138 is slow but usually produces the best results.  Ordered dither is a compromise
       
   139 between speed and quality; no dithering is fast but usually looks awful.  Note
       
   140 that these switches have no effect unless color quantization is being done.
       
   141 Ordered dither is only available in
       
   142 .B \-onepass
       
   143 mode.
       
   144 .TP
       
   145 .BI \-map " file"
       
   146 Quantize to the colors used in the specified image file.  This is useful for
       
   147 producing multiple files with identical color maps, or for forcing a
       
   148 predefined set of colors to be used.  The
       
   149 .I file
       
   150 must be a GIF or PPM file. This option overrides
       
   151 .B \-colors
       
   152 and
       
   153 .BR \-onepass .
       
   154 .TP
       
   155 .B \-nosmooth
       
   156 Don't use high-quality upsampling.
       
   157 .TP
       
   158 .B \-onepass
       
   159 Use one-pass instead of two-pass color quantization.  The one-pass method is
       
   160 faster and needs less memory, but it produces a lower-quality image.
       
   161 .B \-onepass
       
   162 is ignored unless you also say
       
   163 .B \-colors
       
   164 .IR N .
       
   165 Also, the one-pass method is always used for gray-scale output (the two-pass
       
   166 method is no improvement then).
       
   167 .TP
       
   168 .BI \-maxmemory " N"
       
   169 Set limit for amount of memory to use in processing large images.  Value is
       
   170 in thousands of bytes, or millions of bytes if "M" is attached to the
       
   171 number.  For example,
       
   172 .B \-max 4m
       
   173 selects 4000000 bytes.  If more space is needed, temporary files will be used.
       
   174 .TP
       
   175 .BI \-outfile " name"
       
   176 Send output image to the named file, not to standard output.
       
   177 .TP
       
   178 .B \-verbose
       
   179 Enable debug printout.  More
       
   180 .BR \-v 's
       
   181 give more output.  Also, version information is printed at startup.
       
   182 .TP
       
   183 .B \-debug
       
   184 Same as
       
   185 .BR \-verbose .
       
   186 .SH EXAMPLES
       
   187 .LP
       
   188 This example decompresses the JPEG file foo.jpg, quantizes it to
       
   189 256 colors, and saves the output in 8-bit BMP format in foo.bmp:
       
   190 .IP
       
   191 .B djpeg \-colors 256 \-bmp
       
   192 .I foo.jpg
       
   193 .B >
       
   194 .I foo.bmp
       
   195 .SH HINTS
       
   196 To get a quick preview of an image, use the
       
   197 .B \-grayscale
       
   198 and/or
       
   199 .B \-scale
       
   200 switches.
       
   201 .B \-grayscale \-scale 1/8
       
   202 is the fastest case.
       
   203 .PP
       
   204 Several options are available that trade off image quality to gain speed.
       
   205 .B \-fast
       
   206 turns on the recommended settings.
       
   207 .PP
       
   208 .B \-dct fast
       
   209 and/or
       
   210 .B \-nosmooth
       
   211 gain speed at a small sacrifice in quality.
       
   212 When producing a color-quantized image,
       
   213 .B \-onepass \-dither ordered
       
   214 is fast but much lower quality than the default behavior.
       
   215 .B \-dither none
       
   216 may give acceptable results in two-pass mode, but is seldom tolerable in
       
   217 one-pass mode.
       
   218 .PP
       
   219 If you are fortunate enough to have very fast floating point hardware,
       
   220 \fB\-dct float\fR may be even faster than \fB\-dct fast\fR.  But on most
       
   221 machines \fB\-dct float\fR is slower than \fB\-dct int\fR; in this case it is
       
   222 not worth using, because its theoretical accuracy advantage is too small to be
       
   223 significant in practice.
       
   224 .SH ENVIRONMENT
       
   225 .TP
       
   226 .B JPEGMEM
       
   227 If this environment variable is set, its value is the default memory limit.
       
   228 The value is specified as described for the
       
   229 .B \-maxmemory
       
   230 switch.
       
   231 .B JPEGMEM
       
   232 overrides the default value specified when the program was compiled, and
       
   233 itself is overridden by an explicit
       
   234 .BR \-maxmemory .
       
   235 .SH SEE ALSO
       
   236 .BR cjpeg (1),
       
   237 .BR jpegtran (1),
       
   238 .BR rdjpgcom (1),
       
   239 .BR wrjpgcom (1)
       
   240 .br
       
   241 .BR ppm (5),
       
   242 .BR pgm (5)
       
   243 .br
       
   244 Wallace, Gregory K.  "The JPEG Still Picture Compression Standard",
       
   245 Communications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44.
       
   246 .SH AUTHOR
       
   247 Independent JPEG Group
       
   248 .SH BUGS
       
   249 To avoid the Unisys LZW patent,
       
   250 .B djpeg
       
   251 produces uncompressed GIF files.  These are larger than they should be, but
       
   252 are readable by standard GIF decoders.