Thomas G. Lane | bd543f0 | 1991-12-13 00:00:00 +0000 | [diff] [blame^] | 1 | .TH CJPEG 1 "11 December 1991" |
| 2 | .SH NAME |
| 3 | cjpeg \- compress an image file to a JPEG file |
| 4 | .SH SYNOPSIS |
| 5 | .B cjpeg |
| 6 | [ |
| 7 | .BI \-Q " quality" |
| 8 | ] |
| 9 | [ |
| 10 | .B \-oTIad |
| 11 | ] |
| 12 | [ |
| 13 | .I filename |
| 14 | ] |
| 15 | .LP |
| 16 | .SH DESCRIPTION |
| 17 | .LP |
| 18 | .B cjpeg |
| 19 | compresses the named image file, or the standard input if no file is |
| 20 | named, and produces a JPEG/JFIF file on the standard output. |
| 21 | The currently supported image file formats are: PPM (PBMPLUS color |
| 22 | format), PGM (PBMPLUS gray-scale format), GIF, Targa, and RLE (Utah Raster |
| 23 | Toolkit format). (RLE is supported only if the URT library is available.) |
| 24 | .SH OPTIONS |
| 25 | .TP |
| 26 | .BI \-Q " quality" |
| 27 | Scale quantization tables to adjust image quality. Quality is 0 (worst) to |
| 28 | 100 (best); default is 75. (See below for more info.) |
| 29 | .TP |
| 30 | .B \-o |
| 31 | Perform optimization of entropy encoding parameters. Without this, default |
| 32 | encoding parameters are used. |
| 33 | .B \-o |
| 34 | usually makes the JPEG file a little smaller, but |
| 35 | .B cjpeg |
| 36 | runs much slower. Image quality and speed of decompression are unaffected by |
| 37 | .BR \-o . |
| 38 | .TP |
| 39 | .B \-T |
| 40 | Input file is Targa format. Targa files that contain an "identification" |
| 41 | field will not be automatically recognized by |
| 42 | .BR cjpeg ; |
| 43 | for such files you must specify |
| 44 | .B \-T |
| 45 | to force |
| 46 | .B cjpeg |
| 47 | to treat the input as Targa format. |
| 48 | .TP |
| 49 | .B \-I |
| 50 | Generate noninterleaved JPEG file (not yet supported). |
| 51 | .TP |
| 52 | .B \-a |
| 53 | Use arithmetic coding rather than Huffman coding (not currently |
| 54 | supported for legal reasons). |
| 55 | .TP |
| 56 | .B \-d |
| 57 | Enable debug printout. More |
| 58 | .BR \-d 's |
| 59 | give more output. Also, version information is printed at startup. |
| 60 | .PP |
| 61 | The |
| 62 | .B \-Q |
| 63 | switch lets you trade off compressed file size against quality of the |
| 64 | reconstructed image: the higher the |
| 65 | .B \-Q |
| 66 | setting, the larger the JPEG file, and the closer the output image will be to |
| 67 | the original input. Normally you want to use the lowest |
| 68 | .B \-Q |
| 69 | setting (smallest file) that decompresses into something visually |
| 70 | indistinguishable from the original image. For this purpose the |
| 71 | .B \-Q |
| 72 | setting should be between 50 and 95; the default of 75 is often about right. |
| 73 | If you see defects at |
| 74 | .B \-Q |
| 75 | 75, then go up 5 or 10 counts at a time until you are happy with the output |
| 76 | image. (The optimal setting will vary from one image to another.) |
| 77 | .PP |
| 78 | .B \-Q |
| 79 | 100 will generate a quantization table of all 1's, eliminating loss in the |
| 80 | quantization step (but there is still information loss in subsampling, as well |
| 81 | as roundoff error). This setting is mainly of interest for experimental |
| 82 | purposes. |
| 83 | .B \-Q |
| 84 | values above about 95 are |
| 85 | .B not |
| 86 | recommended for normal use; the compressed file size goes up dramatically for |
| 87 | hardly any gain in output image quality. |
| 88 | .PP |
| 89 | In the other direction, |
| 90 | .B \-Q |
| 91 | values below 50 will produce very small files of low image quality. Settings |
| 92 | around 5 to 10 might be useful in preparing an index of a large image library, |
| 93 | for example. Try |
| 94 | .B \-Q |
| 95 | 2 (or so) for some amusing Cubist effects. (Note: |
| 96 | .B \-Q |
| 97 | values below about 25 generate 2-byte quantization tables, which are |
| 98 | considered optional in the JPEG standard. |
| 99 | .B cjpeg |
| 100 | emits a warning message when you give such a |
| 101 | .B \-Q |
| 102 | value, because some commercial JPEG programs may be unable to decode the |
| 103 | resulting file.) |
| 104 | .SH EXAMPLES |
| 105 | .LP |
| 106 | This example compresses the PPM file foo.ppm with a quality factor of |
| 107 | 60 and saves the output as foo.jpg: |
| 108 | .IP |
| 109 | .B cjpeg \-Q |
| 110 | .I 60 foo.ppm |
| 111 | .B > |
| 112 | .I foo.jpg |
| 113 | .SH SEE ALSO |
| 114 | .BR djpeg (1) |
| 115 | .br |
| 116 | Wallace, Gregory K. "The JPEG Still Picture Compression Standard", |
| 117 | Communications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44. |
| 118 | .SH AUTHOR |
| 119 | Independent JPEG Group |
| 120 | .SH BUGS |
| 121 | Arithmetic coding and interleaved output not yet supported. |
| 122 | .PP |
| 123 | Not all variants of Targa file format are supported. |
| 124 | .PP |
| 125 | The |
| 126 | .B -T |
| 127 | switch is not a bug, it's a feature. (It would be a bug if the Targa format |
| 128 | designers had not been clueless.) |
| 129 | .PP |
| 130 | Not as fast as we'd like. |