home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / falcon / graphics / jpeg4a / usage < prev   
Text File  |  1993-03-20  |  17KB  |  346 lines

  1. USAGE instructions for the Independent JPEG Group's JPEG software
  2. =================================================================
  3.  
  4. INTRODUCTION
  5.  
  6. This distribution contains software to implement JPEG image compression and
  7. decompression.  JPEG (pronounced "jay-peg") is a standardized compression
  8. method for full-color and gray-scale images.  JPEG is designed to handle
  9. "real-world" scenes, for example scanned photographs.  Cartoons, line
  10. drawings, and other non-realistic images are not JPEG's strong suit; on this
  11. sort of material you may get poor image quality and/or little compression.
  12.  
  13. JPEG is lossy, meaning that the output image is not necessarily identical to
  14. the input image.  Hence you should not use JPEG if you have to have identical
  15. output bits.  However, on typical real-world images, very good compression
  16. levels can be obtained with no visible change, and amazingly high compression
  17. is possible if you can tolerate a low-quality image.  You can trade off image
  18. quality against file size by adjusting the compressor's "quality" setting.
  19.  
  20. NOTE: the switch syntax has been redesigned since the v3 release of
  21. cjpeg/djpeg.  Switch names are now words instead of single letters.
  22.  
  23.  
  24. ATARI USAGE
  25.  
  26. This software has been compiled with a dos-like userinterface that 
  27. supports using wildcards ('*' and '?'). I have changed the names
  28. so "cjpeg" is now called "gif2jpg"  and "djpeg" is named "jpg2gif".
  29. The wildcard expansion works fine for TOS filesystems, but will give
  30. poor results on minix or other MiNT filesystems. But don't worry, most
  31. of the usual MiNT shell do the wildcard expansion themselves and pass 
  32. a list of files to our programs.
  33. jpg2gif and gif2jpg use the standard "ARGV" argument passing scheme.
  34. You can also install them in desktop as standard applications for ".gif"
  35. and ".jpg" files if you like to.
  36. All these changes have been done by Frank Möhle, germany. (that's me!)
  37. My internet adress is : 
  38. Frank.Moehle@arbi.informatik.uni-oldenburg.DE
  39.  have fun !
  40. Now let's continue with the general usage ...
  41.  
  42. GENERAL USAGE
  43.  
  44. We provide two programs, cjpeg to compress an image file into JPEG format,
  45. and djpeg to decompress a JPEG file back into a conventional image format.
  46.  
  47. The basic command line is:
  48.     cjpeg [switches] list of image files
  49. or
  50.     djpeg [switches] list of jpeg files
  51.  
  52. Each file named is compressed or decompressed.  The input file(s) are not
  53. modified; the output data is written to files which have the same names except
  54. for extension.  cjpeg always uses ".jpg" for the output file name's extension;
  55. djpeg uses one of ".gif", ".ppm", ".rle", or ".tga", depending on what output
  56. format is selected by the switches.
  57.  
  58. For example, to convert xxx.gif to xxx.jpg and yyy.ppm to yyy.jpg, say:
  59.     cjpeg xxx.gif yyy.ppm
  60.  
  61. On most systems you can use standard wildcards to specify the list of input
  62. files; for example, on DOS "djpeg *.jpg" decompresses all the JPEG files in
  63. the current directory.
  64.  
  65. If an intended output file already exists, you'll be asked whether or not to
  66. overwrite it.  If you say no, the program skips that input file and goes on to
  67. the next one.
  68.  
  69. You can intermix switches and file names; for example
  70.     djpeg -gif file1.jpg -targa file2.jpg
  71. decompresses file1.jpg into GIF format (file1.gif) and file2.jpg into Targa
  72. format (file2.tga).  Only switches to the left of a given file name affect
  73. processing of that file; when there are conflicting switches, the rightmost
  74. one takes precedence.
  75.  
  76. The currently supported image file formats are: PPM (PBMPLUS color format),
  77. PGM (PBMPLUS gray-scale format), GIF, Targa, and RLE (Utah Raster Toolkit
  78. format).  (RLE is supported only if the URT library is available, which it
  79. isn't on most non-Unix systems.)  cjpeg recognizes the input image format
  80. automatically, with the exception of some Targa-format files.  You have to
  81. tell djpeg which output format to generate.
  82.  
  83. The only JPEG file format currently supported is the JFIF format.  Support for
  84. the TIFF 6.0 JPEG format will probably be added at some future date.
  85.  
  86. All switch names may be abbreviated; for example, -grayscale may be written
  87. -gray or -gr.  Most of the "basic" switches can be abbreviated to as little as
  88. one letter.  Upper and lower case are equivalent (-GIF is the same as -gif).
  89. British spellings are also accepted (e.g., -greyscale), though for brevity
  90. these are not mentioned below.
  91.  
  92. CJPEG DETAILS
  93.  
  94. The basic command line switches for cjpeg are:
  95.  
  96.     -quality N    Scale quantization tables to adjust image quality.
  97.             Quality is 0 (worst) to 100 (best); default is 75.
  98.             (See below for more info.)
  99.  
  100.     -grayscale    Create monochrome JPEG file from color input.
  101.             Be sure to use this switch when compressing a grayscale
  102.             GIF file, because cjpeg isn't bright enough to notice
  103.             whether a GIF file uses only shades of gray.  By
  104.             saying -grayscale, you'll get a smaller JPEG file that
  105.             takes less time to process.
  106.  
  107.     -optimize    Perform optimization of entropy encoding parameters.
  108.             Without this, default encoding parameters are used.
  109.             -optimize usually makes the JPEG file a little smaller,
  110.             but cjpeg runs somewhat slower and needs much more
  111.             memory.  Image quality and speed of decompression are
  112.             unaffected by -optimize.
  113.  
  114.     -targa        Input file is Targa format.  Targa files that contain
  115.             an "identification" field will not be automatically
  116.             recognized by cjpeg; for such files you must specify
  117.             -targa to make cjpeg treat the input as Targa format.
  118.  
  119. The -quality switch lets you trade off compressed file size against quality of
  120. the reconstructed image: the higher the quality setting, the larger the JPEG
  121. file, and the closer the output image will be to the original input.  Normally
  122. you want to use the lowest quality setting (smallest file) that decompresses
  123. into something visually indistinguishable from the original image.  For this
  124. purpose the quality setting should be between 50 and 95; the default of 75 is
  125. often about right.  If you see defects at -quality 75, then go up 5 or 10
  126. counts at a time until you are happy with the output image.  (The optimal
  127. setting will vary from one image to another.)
  128.  
  129. -quality 100 will generate a quantization table of all 1's, eliminating loss
  130. in the quantization step (but there is still information loss in subsampling,
  131. as well as roundoff error).  This setting is mainly of interest for
  132. experimental purposes.  Quality values above about 95 are NOT recommended for
  133. normal use; the compressed file size goes up dramatically for hardly any gain
  134. in output image quality.
  135.  
  136. In the other direction, quality values below 50 will produce very small files
  137. of low image quality.  Settings around 5 to 10 might be useful in preparing an
  138. index of a large image library, for example.  Try -quality 2 (or so) for some
  139. amusing Cubist effects.  (Note: quality values below about 25 generate 2-byte
  140. quantization tables, which are considered optional in the JPEG standard.
  141. cjpeg emits a warning message when you give such a quality value, because
  142. some commercial JPEG programs may be unable to decode the resulting file.)
  143.  
  144. Switches for advanced users:
  145.  
  146.     -maxmemory N    Set limit for amount of memory to use in processing
  147.             large images.  Value is in thousands of bytes, or
  148.             millions of bytes if "M" is attached to the number.
  149.             For example, -max 4m selects 4000000 bytes.  If more
  150.             space is needed, temporary files will be used.
  151.  
  152.     -restart N    Emit a JPEG restart marker every N MCU rows, or every
  153.             N MCU blocks if "B" is attached to the number.
  154.             -restart 0 (the default) means no restart markers.
  155.  
  156.     -smooth N    Smooth the input image to eliminate dithering noise.
  157.             N, ranging from 1 to 100, indicates the strength of
  158.             smoothing.  0 (the default) means no smoothing.
  159.  
  160.     -verbose    Enable debug printout.  More -v's give more printout.
  161.     or  -debug    Also, version information is printed at startup.
  162.  
  163. The -restart option inserts extra markers that allow a JPEG decoder to
  164. resynchronize after a transmission error.  Without restart markers, any damage
  165. to a compressed file will usually ruin the image from the point of the error
  166. to the end of the image; with restart markers, the damage is usually confined
  167. to the portion of the image up to the next restart marker.  Of course, the
  168. restart markers occupy extra space.  We recommend -restart 1 for images that
  169. will be transmitted across unreliable networks such as Usenet.
  170.  
  171. The -smooth option filters the input to eliminate fine-scale noise.  This is
  172. often useful when converting GIF files to JPEG: a moderate smoothing factor of
  173. 10 to 50 gets rid of dithering patterns in the input file, resulting in a
  174. smaller JPEG file and a better-looking image.  Too large a smoothing factor
  175. will visibly blur the image, however.
  176.  
  177. Switches for wizards:
  178.  
  179.     -arithmetic    Use arithmetic coding rather than Huffman coding.
  180.             (Not currently supported for legal reasons.)
  181.  
  182.     -nointerleave    Generate noninterleaved JPEG file (not yet supported).
  183.  
  184.     -qtables file    Use the quantization tables given in the specified
  185.             file.  The file should contain one to four tables
  186.             (64 values each) as plain text.  Comments preceded by
  187.             '#' may be included in the file.  The tables are
  188.             implicitly numbered 0,1,etc.  If -quality N is also
  189.             specified, the values in the file are scaled according
  190.             to cjpeg's quality scaling curve.
  191.  
  192.     -sample HxV[,...]    Set JPEG sampling factors.  If you specify
  193.             fewer H/V pairs than there are components, the
  194.             remaining components are set to 1x1 sampling.  The
  195.             default setting is equivalent to "-sample 2x2".
  196.  
  197. The "wizard" switches are intended for experimentation with JPEG.  If you
  198. don't know what you are doing, DON'T USE THEM.  You can easily produce files
  199. with worse image quality and/or poorer compression than you'll get from the
  200. default settings.  Furthermore, these switches should not be used when making
  201. files intended for general use, because not all JPEG implementations will
  202. support unusual JPEG parameter settings.
  203.  
  204.  
  205. DJPEG DETAILS
  206.  
  207. The basic command line switches for djpeg are:
  208.  
  209.     -colors N    Reduce image to at most N colors.  This reduces the
  210.     or -quantize N    number of colors used in the output image, so that it
  211.             can be displayed on a colormapped display or stored in
  212.             a colormapped file format.  For example, if you have
  213.             an 8-bit display, you'd need to reduce to 256 or fewer
  214.             colors.  (-colors is the recommended name, -quantize
  215.             is provided only for backwards compatibility.)
  216.  
  217.     -gif        Select GIF output format.  Since GIF does not support
  218.             more than 256 colors, -colors 256 is assumed (unless
  219.             you specify a smaller number of colors).
  220.  
  221.     -pnm        Select PBMPLUS (PPM/PGM) output format (this is the
  222.             default format).  PGM is emitted if the JPEG file is
  223.             gray-scale or if -grayscale is specified; otherwise
  224.             PPM is emitted.
  225.  
  226.     -rle        Select RLE output format.  (Requires URT library.)
  227.  
  228.     -targa        Select Targa output format.  Gray-scale format is
  229.             emitted if the JPEG file is gray-scale or if
  230.             -grayscale is specified; otherwise, colormapped format
  231.             is emitted if -colors is specified; otherwise, 24-bit
  232.             full-color format is emitted.
  233.  
  234. Switches for advanced users:
  235.  
  236.     -blocksmooth    Perform cross-block smoothing.  This is slow, quite
  237.             memory-intensive, and only seems to improve the image
  238.             at very low quality settings (-quality 10 to 20 or so).
  239.             At normal quality settings it may make things worse.
  240.  
  241.     -grayscale    Force gray-scale output even if JPEG file is color.
  242.             Useful for viewing on monochrome displays.
  243.  
  244.     -maxmemory N    Set limit for amount of memory to use in processing
  245.             large images.  Value is in thousands of bytes, or
  246.             millions of bytes if "M" is attached to the number.
  247.             For example, -max 4m selects 4000000 bytes.  If more
  248.             space is needed, temporary files will be used.
  249.  
  250.     -nodither    Do not use dithering in color quantization.
  251.             By default, Floyd-Steinberg dithering is applied when
  252.             quantizing colors, but on some images dithering may
  253.             result in objectionable "graininess".  If that
  254.             happens, you can turn off dithering with -nodither.
  255.             -nodither is ignored unless you also say -colors N.
  256.  
  257.     -onepass    Use one-pass instead of two-pass color quantization.
  258.             The one-pass method is faster and needs less memory,
  259.             but it produces a lower-quality image.  -onepass is
  260.             ignored unless you also say -colors N.  Also,
  261.             the one-pass method is always used for gray-scale
  262.             output (the two-pass method is no improvement then).
  263.  
  264.     -verbose    Enable debug printout.  More -v's give more printout.
  265.     or  -debug    Also, version information is printed at startup.
  266.  
  267.  
  268. HINTS
  269.  
  270. Color GIF files are not the ideal input for JPEG; JPEG is really intended for
  271. compressing full-color (24-bit) images.  In particular, don't try to convert
  272. cartoons, line drawings, and other images that have only a few distinct
  273. colors.  GIF works great on these, JPEG does not.  If you want to convert a
  274. GIF to JPEG, you should experiment with cjpeg's -quality and -smooth options
  275. to get a satisfactory conversion.  -smooth 10 or so is often helpful.
  276.  
  277. Avoid running an image through a series of JPEG compression/decompression
  278. cycles.  Image quality loss will accumulate; after ten or so cycles the image
  279. may be noticeably worse than it was after one cycle.  It's best to use a
  280. lossless format while manipulating an image, then convert to JPEG format when
  281. you are ready to file the image away.
  282.  
  283. The -optimize option to cjpeg is worth using when you are making a "final"
  284. version for posting or archiving.  It's also a win when you are using low
  285. quality settings to make very small JPEG files; the percentage improvement
  286. is often a lot more than it is on larger files.
  287.  
  288. When making images to be posted on Usenet, we recommend using cjpeg's option
  289. -restart 1.  This option limits the damage done to a compressed image by
  290. netnews transmission errors.
  291.  
  292. The default memory usage limit (-maxmemory) is set when the software is
  293. compiled.  If you get an "insufficient memory" error, try specifying a smaller
  294. -maxmemory value, even -maxmemory 0 to use the absolute minimum space.  You
  295. may want to recompile with a smaller default value if this happens often.
  296.  
  297. On machines that have "environment" variables, you can define the environment
  298. variable JPEGMEM to set the default memory limit.  The value is specified as
  299. described for the -maxmemory switch.  JPEGMEM overrides the default value
  300. specified when the program was compiled, and itself is overridden by an
  301. explicit -maxmemory switch.
  302.  
  303. djpeg with two-pass color quantization requires a good deal of memory; on
  304. MS-DOS machines it may run out of memory even with -maxmemory 0.  In that case
  305. you can still decompress, with some loss of image quality, by specifying
  306. -onepass for one-pass quantization.
  307.  
  308. If more space is needed than will fit in the available main memory (as
  309. determined by -maxmemory), temporary files will be used.  (MS-DOS versions
  310. will try to get extended or expanded memory first.)  The temporary files are
  311. often rather large: in typical cases they occupy three bytes per pixel, for
  312. example 3*800*600 = 1.44Mb for an 800x600 image.  If you don't have enough
  313. free disk space, leave out -optimize (for cjpeg) or specify -onepass (for
  314. djpeg).  On MS-DOS and ATARI systems, the temporary files are created in the
  315. directory named by the TMP or TEMP environment variable, or in the current 
  316. directory if neither of those exist.  Amiga implementations put the temp files
  317. in the directory named by JPEGTMP:, so be sure to assign JPEGTMP: to a disk 
  318. partition with adequate free space.
  319.  
  320. DISCLAIMER
  321. ----------
  322.  
  323. THIS SOFTWARE IS NOT COMPLETE NOR FULLY DEBUGGED.  It is not guaranteed to be
  324. useful for anything, nor to be compatible with subsequent releases, nor to be
  325. an accurate implementation of the JPEG standard.  (See LEGAL ISSUES for even
  326. more disclaimers.)
  327.  
  328. Despite that, we believe that this software is pretty good, and if you find
  329. any problems with it, we'd like to know about them.  Please report problems
  330. by e-mail to jpeg-info@uunet.uu.net.
  331.  
  332.  
  333. COPYRIGHT
  334. ---------
  335. This software is copyright (C) 1992, Thomas G. Lane.
  336. The Atari specific parts are (C)1993 Frank Möhle.
  337.  
  338. Terms of distribution and use are the same as for the free IJG JPEG software;
  339. see its README file for details.
  340.  
  341. The authors make NO WARRANTY or representation, either express or implied,
  342. with respect to this software, its quality, accuracy, merchantability, or
  343. fitness for a particular purpose.  This software is provided "AS IS", and you,
  344. its user, assume the entire risk as to its quality and accuracy.
  345.  
  346.