home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / GRAPHICS / JPEGSRC.V4.lzh / cjpeg.1 < prev    next >
Text File  |  1993-01-14  |  8KB  |  259 lines

  1. .TH CJPEG 1 "4 November 1992"
  2. .SH NAME
  3. cjpeg \- compress an image file to a JPEG file
  4. .SH SYNOPSIS
  5. .B cjpeg
  6. [
  7. .BI \-quality " N"
  8. ]
  9. [
  10. .B \-grayscale
  11. ]
  12. [
  13. .B \-optimize
  14. ]
  15. [
  16. .B \-targa
  17. ]
  18. [
  19. .BI \-maxmemory " N"
  20. ]
  21. [
  22. .BI \-restart " N"
  23. ]
  24. [
  25. .BI \-smooth " N"
  26. ]
  27. [
  28. .B \-verbose
  29. ]
  30. [
  31. .B \-debug
  32. ]
  33. [
  34. .B \-arithmetic
  35. ]
  36. [
  37. .B \-nointerleave
  38. ]
  39. [
  40. .BI \-qtables " file"
  41. ]
  42. [
  43. .BI \-sample " HxV[,...]"
  44. ]
  45. [
  46. .I filename
  47. ]
  48. .LP
  49. .SH DESCRIPTION
  50. .LP
  51. .B cjpeg
  52. compresses the named image file, or the standard input if no file is
  53. named, and produces a JPEG/JFIF file on the standard output.
  54. The currently supported input file formats are: PPM (PBMPLUS color
  55. format), PGM (PBMPLUS gray-scale format), GIF, Targa, and RLE (Utah Raster
  56. Toolkit format).  (RLE is supported only if the URT library is available.)
  57. .SH OPTIONS
  58. All switch names may be abbreviated; for example,
  59. .B \-grayscale
  60. may be written
  61. .B \-gray
  62. or
  63. .BR \-gr .
  64. Most of the "basic" switches can be abbreviated to as little as one letter.
  65. Upper and lower case are equivalent (thus
  66. .B \-GIF
  67. is the same as
  68. .BR \-gif ).
  69. British spellings are also accepted (e.g.,
  70. .BR \-greyscale ),
  71. though for brevity these are not mentioned below.
  72. .PP
  73. The basic switches are:
  74. .TP
  75. .BI \-quality " N"
  76. Scale quantization tables to adjust image quality.  Quality is 0 (worst) to
  77. 100 (best); default is 75.  (See below for more info.)
  78. .TP
  79. .B \-grayscale
  80. Create monochrome JPEG file from color input.  Be sure to use this switch when
  81. compressing a grayscale GIF file, because
  82. .B cjpeg
  83. isn't bright enough to notice whether a GIF file uses only shades of gray.
  84. By saying
  85. .BR \-grayscale ,
  86. you'll get a smaller JPEG file that takes less time to process.
  87. .TP
  88. .B \-optimize
  89. Perform optimization of entropy encoding parameters.  Without this, default
  90. encoding parameters are used.
  91. .B \-optimize
  92. usually makes the JPEG file a little smaller, but
  93. .B cjpeg
  94. runs somewhat slower and needs much more memory.  Image quality and speed of
  95. decompression are unaffected by
  96. .BR \-optimize .
  97. .TP
  98. .B \-targa
  99. Input file is Targa format.  Targa files that contain an "identification"
  100. field will not be automatically recognized by
  101. .BR cjpeg ;
  102. for such files you must specify
  103. .B \-targa
  104. to make
  105. .B cjpeg
  106. treat the input as Targa format.
  107. .PP
  108. The
  109. .B \-quality
  110. switch lets you trade off compressed file size against quality of the
  111. reconstructed image: the higher the quality setting, the larger the JPEG file,
  112. and the closer the output image will be to the original input.  Normally you
  113. want to use the lowest quality setting (smallest file) that decompresses into
  114. something visually indistinguishable from the original image.  For this
  115. purpose the quality setting should be between 50 and 95; the default of 75 is
  116. often about right.  If you see defects at
  117. .B \-quality
  118. 75, then go up 5 or 10 counts at a time until you are happy with the output
  119. image.  (The optimal setting will vary from one image to another.)
  120. .PP
  121. .B \-quality
  122. 100 will generate a quantization table of all 1's, eliminating loss in the
  123. quantization step (but there is still information loss in subsampling, as well
  124. as roundoff error).  This setting is mainly of interest for experimental
  125. purposes.  Quality values above about 95 are
  126. .B not
  127. recommended for normal use; the compressed file size goes up dramatically for
  128. hardly any gain in output image quality.
  129. .PP
  130. In the other direction, quality values below 50 will produce very small files
  131. of low image quality.  Settings around 5 to 10 might be useful in preparing an
  132. index of a large image library, for example.  Try
  133. .B \-quality
  134. 2 (or so) for some amusing Cubist effects.  (Note: quality
  135. values below about 25 generate 2-byte quantization tables, which are
  136. considered optional in the JPEG standard.
  137. .B cjpeg
  138. emits a warning message when you give such a quality value, because some
  139. commercial JPEG programs may be unable to decode the resulting file.)
  140. .PP
  141. Switches for advanced users:
  142. .TP
  143. .BI \-maxmemory " N"
  144. Set limit for amount of memory to use in processing large images.  Value is
  145. in thousands of bytes, or millions of bytes if "M" is attached to the
  146. number.  For example,
  147. .B \-max 4m
  148. selects 4000000 bytes.  If more space is needed, temporary files will be used.
  149. .TP
  150. .BI \-restart " N"
  151. Emit a JPEG restart marker every N MCU rows, or every N MCU blocks if "B" is
  152. attached to the number.
  153. .B \-restart 0
  154. (the default) means no restart markers.
  155. .TP
  156. .BI \-smooth " N"
  157. Smooth the input image to eliminate dithering noise.  N, ranging from 1 to
  158. 100, indicates the strength of smoothing.  0 (the default) means no smoothing.
  159. .TP
  160. .B \-verbose
  161. Enable debug printout.  More
  162. .BR \-v 's
  163. give more output.  Also, version information is printed at startup.
  164. .TP
  165. .B \-debug
  166. Same as
  167. .BR \-verbose .
  168. .PP
  169. The
  170. .B \-restart
  171. option inserts extra markers that allow a JPEG decoder to resynchronize after
  172. a transmission error.  Without restart markers, any damage to a compressed
  173. file will usually ruin the image from the point of the error to the end of the
  174. image; with restart markers, the damage is usually confined to the portion of
  175. the image up to the next restart marker.  Of course, the restart markers
  176. occupy extra space.  We recommend
  177. .B \-restart 1
  178. for images that will be transmitted across unreliable networks such as Usenet.
  179. .PP
  180. The
  181. .B \-smooth
  182. option filters the input to eliminate fine-scale noise.  This is often useful
  183. when converting GIF files to JPEG: a moderate smoothing factor of 10 to 50
  184. gets rid of dithering patterns in the input file, resulting in a smaller JPEG
  185. file and a better-looking image.  Too large a smoothing factor will visibly
  186. blur the image, however.
  187. .PP
  188. Switches for wizards:
  189. .TP
  190. .B \-arithmetic
  191. Use arithmetic coding rather than Huffman coding.  (Not currently
  192. supported for legal reasons.)
  193. .TP
  194. .B \-nointerleave
  195. Generate noninterleaved JPEG file (not yet supported).
  196. .TP
  197. .BI \-qtables " file"
  198. Use the quantization tables given in the specified file.  The file should
  199. contain one to four tables (64 values each) as plain text.  Comments preceded
  200. by '#' may be included in the file.  The tables are implicitly numbered
  201. 0,1,etc.  If
  202. .B \-quality
  203. N is also specified, the values in the file are scaled according to
  204. .BR cjpeg 's
  205. quality scaling curve.
  206. .TP
  207. .BI \-sample " HxV[,...]"
  208. Set JPEG sampling factors.  If you specify fewer H/V pairs than there are
  209. components, the remaining components are set to 1x1 sampling.  The default
  210. setting is equivalent to \fB\-sample 2x2\fR.
  211. .PP
  212. The "wizard" switches are intended for experimentation with JPEG.  If you
  213. don't know what you are doing, \fBdon't use them\fR.  You can easily produce
  214. files with worse image quality and/or poorer compression than you'll get from
  215. the default settings.  Furthermore, these switches should not be used when
  216. making files intended for general use, because not all JPEG implementations
  217. will support unusual JPEG parameter settings.
  218. .SH EXAMPLES
  219. .LP
  220. This example compresses the PPM file foo.ppm with a quality factor of
  221. 60 and saves the output as foo.jpg:
  222. .IP
  223. .B cjpeg \-quality
  224. .I 60 foo.ppm
  225. .B >
  226. .I foo.jpg
  227. .SH ENVIRONMENT
  228. .TP
  229. .B JPEGMEM
  230. If this environment variable is set, its value is the default memory limit.
  231. The value is specified as described for the
  232. .B \-maxmemory
  233. switch.
  234. .B JPEGMEM
  235. overrides the default value specified when the program was compiled, and
  236. itself is overridden by an explicit
  237. .BR \-maxmemory .
  238. .SH SEE ALSO
  239. .BR djpeg (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. Arithmetic coding and interleaved output not yet supported.
  250. .PP
  251. Not all variants of Targa file format are supported.
  252. .PP
  253. The
  254. .B -targa
  255. switch is not a bug, it's a feature.  (It would be a bug if the Targa format
  256. designers had not been clueless.)
  257. .PP
  258. Still not as fast as we'd like.
  259.