djpeg.1 7.3 KB

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