djpeg.1 7.8 KB

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