djpeg.1 7.6 KB

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