DRC | da2a27e | 2017-03-18 16:15:14 -0500 | [diff] [blame] | 1 | .TH CJPEG 1 "18 March 2017" |
Thomas G. Lane | bd543f0 | 1991-12-13 00:00:00 +0000 | [diff] [blame] | 2 | .SH NAME |
| 3 | cjpeg \- compress an image file to a JPEG file |
| 4 | .SH SYNOPSIS |
| 5 | .B cjpeg |
| 6 | [ |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 7 | .I options |
Thomas G. Lane | 4a6b730 | 1992-03-17 00:00:00 +0000 | [diff] [blame] | 8 | ] |
| 9 | [ |
Thomas G. Lane | bd543f0 | 1991-12-13 00:00:00 +0000 | [diff] [blame] | 10 | .I filename |
| 11 | ] |
| 12 | .LP |
| 13 | .SH DESCRIPTION |
| 14 | .LP |
| 15 | .B cjpeg |
| 16 | compresses the named image file, or the standard input if no file is |
| 17 | named, and produces a JPEG/JFIF file on the standard output. |
Thomas G. Lane | 88aeed4 | 1992-12-10 00:00:00 +0000 | [diff] [blame] | 18 | The currently supported input file formats are: PPM (PBMPLUS color |
DRC | 90d6c38 | 2014-05-12 09:08:39 +0000 | [diff] [blame] | 19 | format), PGM (PBMPLUS grayscale format), BMP, Targa, and RLE (Utah Raster |
Thomas G. Lane | bd543f0 | 1991-12-13 00:00:00 +0000 | [diff] [blame] | 20 | Toolkit format). (RLE is supported only if the URT library is available.) |
| 21 | .SH OPTIONS |
Thomas G. Lane | 88aeed4 | 1992-12-10 00:00:00 +0000 | [diff] [blame] | 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 |
Thomas G. Lane | 5ead57a | 1998-03-27 00:00:00 +0000 | [diff] [blame] | 30 | .B \-BMP |
Thomas G. Lane | 88aeed4 | 1992-12-10 00:00:00 +0000 | [diff] [blame] | 31 | is the same as |
Thomas G. Lane | 5ead57a | 1998-03-27 00:00:00 +0000 | [diff] [blame] | 32 | .BR \-bmp ). |
Thomas G. Lane | 88aeed4 | 1992-12-10 00:00:00 +0000 | [diff] [blame] | 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: |
Thomas G. Lane | bd543f0 | 1991-12-13 00:00:00 +0000 | [diff] [blame] | 38 | .TP |
Guido Vollbeding | 5996a25 | 2009-06-27 00:00:00 +0000 | [diff] [blame] | 39 | .BI \-quality " N[,...]" |
Thomas G. Lane | bd543f0 | 1991-12-13 00:00:00 +0000 | [diff] [blame] | 40 | Scale quantization tables to adjust image quality. Quality is 0 (worst) to |
| 41 | 100 (best); default is 75. (See below for more info.) |
| 42 | .TP |
Thomas G. Lane | 88aeed4 | 1992-12-10 00:00:00 +0000 | [diff] [blame] | 43 | .B \-grayscale |
| 44 | Create monochrome JPEG file from color input. Be sure to use this switch when |
Thomas G. Lane | 5ead57a | 1998-03-27 00:00:00 +0000 | [diff] [blame] | 45 | compressing a grayscale BMP file, because |
Thomas G. Lane | 88aeed4 | 1992-12-10 00:00:00 +0000 | [diff] [blame] | 46 | .B cjpeg |
Thomas G. Lane | 5ead57a | 1998-03-27 00:00:00 +0000 | [diff] [blame] | 47 | isn't bright enough to notice whether a BMP file uses only shades of gray. |
Thomas G. Lane | 88aeed4 | 1992-12-10 00:00:00 +0000 | [diff] [blame] | 48 | By saying |
| 49 | .BR \-grayscale , |
| 50 | you'll get a smaller JPEG file that takes less time to process. |
| 51 | .TP |
Guido Vollbeding | 5829cb2 | 2012-01-15 00:00:00 +0000 | [diff] [blame] | 52 | .B \-rgb |
| 53 | Create RGB JPEG file. |
| 54 | Using this switch suppresses the conversion from RGB |
| 55 | colorspace input to the default YCbCr JPEG colorspace. |
Guido Vollbeding | 5829cb2 | 2012-01-15 00:00:00 +0000 | [diff] [blame] | 56 | .TP |
Thomas G. Lane | 88aeed4 | 1992-12-10 00:00:00 +0000 | [diff] [blame] | 57 | .B \-optimize |
Thomas G. Lane | bd543f0 | 1991-12-13 00:00:00 +0000 | [diff] [blame] | 58 | Perform optimization of entropy encoding parameters. Without this, default |
| 59 | encoding parameters are used. |
Thomas G. Lane | 88aeed4 | 1992-12-10 00:00:00 +0000 | [diff] [blame] | 60 | .B \-optimize |
Thomas G. Lane | bd543f0 | 1991-12-13 00:00:00 +0000 | [diff] [blame] | 61 | usually makes the JPEG file a little smaller, but |
| 62 | .B cjpeg |
Thomas G. Lane | 4a6b730 | 1992-03-17 00:00:00 +0000 | [diff] [blame] | 63 | runs somewhat slower and needs much more memory. Image quality and speed of |
| 64 | decompression are unaffected by |
Thomas G. Lane | 88aeed4 | 1992-12-10 00:00:00 +0000 | [diff] [blame] | 65 | .BR \-optimize . |
Thomas G. Lane | bd543f0 | 1991-12-13 00:00:00 +0000 | [diff] [blame] | 66 | .TP |
Thomas G. Lane | bc79e06 | 1995-08-02 00:00:00 +0000 | [diff] [blame] | 67 | .B \-progressive |
| 68 | Create progressive JPEG file (see below). |
| 69 | .TP |
Thomas G. Lane | 88aeed4 | 1992-12-10 00:00:00 +0000 | [diff] [blame] | 70 | .B \-targa |
Thomas G. Lane | bd543f0 | 1991-12-13 00:00:00 +0000 | [diff] [blame] | 71 | Input file is Targa format. Targa files that contain an "identification" |
| 72 | field will not be automatically recognized by |
| 73 | .BR cjpeg ; |
| 74 | for such files you must specify |
Thomas G. Lane | 88aeed4 | 1992-12-10 00:00:00 +0000 | [diff] [blame] | 75 | .B \-targa |
| 76 | to make |
Thomas G. Lane | bd543f0 | 1991-12-13 00:00:00 +0000 | [diff] [blame] | 77 | .B cjpeg |
Thomas G. Lane | 88aeed4 | 1992-12-10 00:00:00 +0000 | [diff] [blame] | 78 | treat the input as Targa format. |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 79 | For most Targa files, you won't need this switch. |
Thomas G. Lane | bd543f0 | 1991-12-13 00:00:00 +0000 | [diff] [blame] | 80 | .PP |
| 81 | The |
Thomas G. Lane | 88aeed4 | 1992-12-10 00:00:00 +0000 | [diff] [blame] | 82 | .B \-quality |
Thomas G. Lane | bd543f0 | 1991-12-13 00:00:00 +0000 | [diff] [blame] | 83 | switch lets you trade off compressed file size against quality of the |
Thomas G. Lane | 88aeed4 | 1992-12-10 00:00:00 +0000 | [diff] [blame] | 84 | reconstructed image: the higher the quality setting, the larger the JPEG file, |
| 85 | and the closer the output image will be to the original input. Normally you |
| 86 | want to use the lowest quality setting (smallest file) that decompresses into |
| 87 | something visually indistinguishable from the original image. For this |
DRC | 6fa5ebd | 2015-12-17 10:41:51 -0600 | [diff] [blame] | 88 | purpose the quality setting should generally be between 50 and 95 (the default |
| 89 | is 75) for photographic images. If you see defects at |
Thomas G. Lane | 88aeed4 | 1992-12-10 00:00:00 +0000 | [diff] [blame] | 90 | .B \-quality |
Thomas G. Lane | bd543f0 | 1991-12-13 00:00:00 +0000 | [diff] [blame] | 91 | 75, then go up 5 or 10 counts at a time until you are happy with the output |
| 92 | image. (The optimal setting will vary from one image to another.) |
| 93 | .PP |
Thomas G. Lane | 88aeed4 | 1992-12-10 00:00:00 +0000 | [diff] [blame] | 94 | .B \-quality |
Thomas G. Lane | bc79e06 | 1995-08-02 00:00:00 +0000 | [diff] [blame] | 95 | 100 will generate a quantization table of all 1's, minimizing loss in the |
Thomas G. Lane | bd543f0 | 1991-12-13 00:00:00 +0000 | [diff] [blame] | 96 | quantization step (but there is still information loss in subsampling, as well |
DRC | 6fa5ebd | 2015-12-17 10:41:51 -0600 | [diff] [blame] | 97 | as roundoff error.) For most images, specifying a quality value above |
| 98 | about 95 will increase the size of the compressed file dramatically, and while |
| 99 | the quality gain from these higher quality values is measurable (using metrics |
| 100 | such as PSNR or SSIM), it is rarely perceivable by human vision. |
Thomas G. Lane | bd543f0 | 1991-12-13 00:00:00 +0000 | [diff] [blame] | 101 | .PP |
Thomas G. Lane | 88aeed4 | 1992-12-10 00:00:00 +0000 | [diff] [blame] | 102 | In the other direction, quality values below 50 will produce very small files |
| 103 | of low image quality. Settings around 5 to 10 might be useful in preparing an |
| 104 | index of a large image library, for example. Try |
| 105 | .B \-quality |
| 106 | 2 (or so) for some amusing Cubist effects. (Note: quality |
Thomas G. Lane | bd543f0 | 1991-12-13 00:00:00 +0000 | [diff] [blame] | 107 | values below about 25 generate 2-byte quantization tables, which are |
Thomas G. Lane | 88aeed4 | 1992-12-10 00:00:00 +0000 | [diff] [blame] | 108 | considered optional in the JPEG standard. |
Thomas G. Lane | bd543f0 | 1991-12-13 00:00:00 +0000 | [diff] [blame] | 109 | .B cjpeg |
Thomas G. Lane | 88aeed4 | 1992-12-10 00:00:00 +0000 | [diff] [blame] | 110 | emits a warning message when you give such a quality value, because some |
Thomas G. Lane | bc79e06 | 1995-08-02 00:00:00 +0000 | [diff] [blame] | 111 | other JPEG programs may be unable to decode the resulting file. Use |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 112 | .B \-baseline |
| 113 | if you need to ensure compatibility at low quality values.) |
Thomas G. Lane | 88aeed4 | 1992-12-10 00:00:00 +0000 | [diff] [blame] | 114 | .PP |
DRC | 39ea562 | 2010-10-12 01:55:31 +0000 | [diff] [blame] | 115 | The \fB-quality\fR option has been extended in this version of \fBcjpeg\fR to |
| 116 | support separate quality settings for luminance and chrominance (or, in |
| 117 | general, separate settings for every quantization table slot.) The principle |
| 118 | is the same as chrominance subsampling: since the human eye is more sensitive |
| 119 | to spatial changes in brightness than spatial changes in color, the chrominance |
| 120 | components can be quantized more than the luminance components without |
| 121 | incurring any visible image quality loss. However, unlike subsampling, this |
| 122 | feature reduces data in the frequency domain instead of the spatial domain, |
| 123 | which allows for more fine-grained control. This option is useful in |
| 124 | quality-sensitive applications, for which the artifacts generated by |
| 125 | subsampling may be unacceptable. |
| 126 | .PP |
| 127 | The \fB-quality\fR option accepts a comma-separated list of parameters, which |
DRC | ccd1bfd | 2012-01-31 09:53:46 +0000 | [diff] [blame] | 128 | respectively refer to the quality levels that should be assigned to the |
DRC | 39ea562 | 2010-10-12 01:55:31 +0000 | [diff] [blame] | 129 | quantization table slots. If there are more q-table slots than parameters, |
| 130 | then the last parameter is replicated. Thus, if only one quality parameter is |
| 131 | given, this is used for both luminance and chrominance (slots 0 and 1, |
| 132 | respectively), preserving the legacy behavior of cjpeg v6b and prior. |
| 133 | More (or customized) quantization tables can be set with the \fB-qtables\fR |
| 134 | option and assigned to components with the \fB-qslots\fR option (see the |
| 135 | "wizard" switches below.) |
| 136 | .PP |
| 137 | JPEG files generated with separate luminance and chrominance quality are fully |
| 138 | compliant with standard JPEG decoders. |
| 139 | .PP |
| 140 | .BR CAUTION: |
| 141 | For this setting to be useful, be sure to pass an argument of \fB-sample 1x1\fR |
| 142 | to \fBcjpeg\fR to disable chrominance subsampling. Otherwise, the default |
| 143 | subsampling level (2x2, AKA "4:2:0") will be used. |
Guido Vollbeding | 5996a25 | 2009-06-27 00:00:00 +0000 | [diff] [blame] | 144 | .PP |
| 145 | The |
Thomas G. Lane | bc79e06 | 1995-08-02 00:00:00 +0000 | [diff] [blame] | 146 | .B \-progressive |
| 147 | switch creates a "progressive JPEG" file. In this type of JPEG file, the data |
| 148 | is stored in multiple scans of increasing quality. If the file is being |
| 149 | transmitted over a slow communications link, the decoder can use the first |
| 150 | scan to display a low-quality image very quickly, and can then improve the |
| 151 | display with each subsequent scan. The final image is exactly equivalent to a |
| 152 | standard JPEG file of the same quality setting, and the total file size is |
| 153 | about the same --- often a little smaller. |
Thomas G. Lane | bc79e06 | 1995-08-02 00:00:00 +0000 | [diff] [blame] | 154 | .PP |
Thomas G. Lane | 88aeed4 | 1992-12-10 00:00:00 +0000 | [diff] [blame] | 155 | Switches for advanced users: |
| 156 | .TP |
DRC | d657ba6 | 2012-01-27 09:41:20 +0000 | [diff] [blame] | 157 | .B \-arithmetic |
| 158 | Use arithmetic coding. |
| 159 | .B Caution: |
| 160 | arithmetic coded JPEG is not yet widely implemented, so many decoders will be |
| 161 | unable to view an arithmetic coded JPEG file at all. |
| 162 | .TP |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 163 | .B \-dct int |
| 164 | Use integer DCT method (default). |
| 165 | .TP |
| 166 | .B \-dct fast |
| 167 | Use fast integer DCT (less accurate). |
DRC | 8940e6c | 2014-05-11 09:46:28 +0000 | [diff] [blame] | 168 | In libjpeg-turbo, the fast method is generally about 5-15% faster than the int |
| 169 | method when using the x86/x86-64 SIMD extensions (results may vary with other |
| 170 | SIMD implementations, or when using libjpeg-turbo without SIMD extensions.) |
| 171 | For quality levels of 90 and below, there should be little or no perceptible |
| 172 | difference between the two algorithms. For quality levels above 90, however, |
| 173 | the difference between the fast and the int methods becomes more pronounced. |
| 174 | With quality=97, for instance, the fast method incurs generally about a 1-3 dB |
| 175 | loss (in PSNR) relative to the int method, but this can be larger for some |
| 176 | images. Do not use the fast method with quality levels above 97. The |
| 177 | algorithm often degenerates at quality=98 and above and can actually produce a |
DRC | 05524e6 | 2014-05-11 23:14:43 +0000 | [diff] [blame] | 178 | more lossy image than if lower quality levels had been used. Also, in |
| 179 | libjpeg-turbo, the fast method is not fully accelerated for quality levels |
| 180 | above 97, so it will be slower than the int method. |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 181 | .TP |
| 182 | .B \-dct float |
| 183 | Use floating-point DCT method. |
DRC | 05524e6 | 2014-05-11 23:14:43 +0000 | [diff] [blame] | 184 | The float method is mainly a legacy feature. It does not produce significantly |
DRC | 8940e6c | 2014-05-11 09:46:28 +0000 | [diff] [blame] | 185 | more accurate results than the int method, and it is much slower. The float |
| 186 | method may also give different results on different machines due to varying |
| 187 | roundoff behavior, whereas the integer methods should give the same results on |
| 188 | all machines. |
Thomas G. Lane | 88aeed4 | 1992-12-10 00:00:00 +0000 | [diff] [blame] | 189 | .TP |
| 190 | .BI \-restart " N" |
| 191 | Emit a JPEG restart marker every N MCU rows, or every N MCU blocks if "B" is |
| 192 | attached to the number. |
| 193 | .B \-restart 0 |
| 194 | (the default) means no restart markers. |
| 195 | .TP |
| 196 | .BI \-smooth " N" |
| 197 | Smooth the input image to eliminate dithering noise. N, ranging from 1 to |
| 198 | 100, indicates the strength of smoothing. 0 (the default) means no smoothing. |
| 199 | .TP |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 200 | .BI \-maxmemory " N" |
| 201 | Set limit for amount of memory to use in processing large images. Value is |
| 202 | in thousands of bytes, or millions of bytes if "M" is attached to the |
| 203 | number. For example, |
| 204 | .B \-max 4m |
DRC | da2a27e | 2017-03-18 16:15:14 -0500 | [diff] [blame] | 205 | selects 4000000 bytes. If more space is needed, an error will occur. |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 206 | .TP |
| 207 | .BI \-outfile " name" |
| 208 | Send output image to the named file, not to standard output. |
| 209 | .TP |
DRC | ab70623 | 2013-01-18 23:42:31 +0000 | [diff] [blame] | 210 | .BI \-memdst |
| 211 | Compress to memory instead of a file. This feature was implemented mainly as a |
| 212 | way of testing the in-memory destination manager (jpeg_mem_dest()), but it is |
| 213 | also useful for benchmarking, since it reduces the I/O overhead. |
| 214 | .TP |
Thomas G. Lane | 88aeed4 | 1992-12-10 00:00:00 +0000 | [diff] [blame] | 215 | .B \-verbose |
| 216 | Enable debug printout. More |
| 217 | .BR \-v 's |
| 218 | give more output. Also, version information is printed at startup. |
| 219 | .TP |
| 220 | .B \-debug |
| 221 | Same as |
| 222 | .BR \-verbose . |
DRC | 9665f5e | 2014-11-22 04:04:38 +0000 | [diff] [blame] | 223 | .TP |
| 224 | .B \-version |
| 225 | Print version information and exit. |
Thomas G. Lane | 88aeed4 | 1992-12-10 00:00:00 +0000 | [diff] [blame] | 226 | .PP |
| 227 | The |
| 228 | .B \-restart |
| 229 | option inserts extra markers that allow a JPEG decoder to resynchronize after |
| 230 | a transmission error. Without restart markers, any damage to a compressed |
| 231 | file will usually ruin the image from the point of the error to the end of the |
| 232 | image; with restart markers, the damage is usually confined to the portion of |
| 233 | the image up to the next restart marker. Of course, the restart markers |
| 234 | occupy extra space. We recommend |
| 235 | .B \-restart 1 |
| 236 | for images that will be transmitted across unreliable networks such as Usenet. |
| 237 | .PP |
| 238 | The |
| 239 | .B \-smooth |
| 240 | option filters the input to eliminate fine-scale noise. This is often useful |
Thomas G. Lane | 5ead57a | 1998-03-27 00:00:00 +0000 | [diff] [blame] | 241 | when converting dithered images to JPEG: a moderate smoothing factor of 10 to |
| 242 | 50 gets rid of dithering patterns in the input file, resulting in a smaller |
| 243 | JPEG file and a better-looking image. Too large a smoothing factor will |
| 244 | visibly blur the image, however. |
Thomas G. Lane | 88aeed4 | 1992-12-10 00:00:00 +0000 | [diff] [blame] | 245 | .PP |
| 246 | Switches for wizards: |
| 247 | .TP |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 248 | .B \-baseline |
Thomas G. Lane | 5ead57a | 1998-03-27 00:00:00 +0000 | [diff] [blame] | 249 | Force baseline-compatible quantization tables to be generated. This clamps |
| 250 | quantization values to 8 bits even at low quality settings. (This switch is |
| 251 | poorly named, since it does not ensure that the output is actually baseline |
| 252 | JPEG. For example, you can use |
| 253 | .B \-baseline |
| 254 | and |
| 255 | .B \-progressive |
| 256 | together.) |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 257 | .TP |
Thomas G. Lane | 88aeed4 | 1992-12-10 00:00:00 +0000 | [diff] [blame] | 258 | .BI \-qtables " file" |
Thomas G. Lane | bc79e06 | 1995-08-02 00:00:00 +0000 | [diff] [blame] | 259 | Use the quantization tables given in the specified text file. |
Thomas G. Lane | 88aeed4 | 1992-12-10 00:00:00 +0000 | [diff] [blame] | 260 | .TP |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 261 | .BI \-qslots " N[,...]" |
Thomas G. Lane | bc79e06 | 1995-08-02 00:00:00 +0000 | [diff] [blame] | 262 | Select which quantization table to use for each color component. |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 263 | .TP |
Thomas G. Lane | 88aeed4 | 1992-12-10 00:00:00 +0000 | [diff] [blame] | 264 | .BI \-sample " HxV[,...]" |
Thomas G. Lane | bc79e06 | 1995-08-02 00:00:00 +0000 | [diff] [blame] | 265 | Set JPEG sampling factors for each color component. |
| 266 | .TP |
| 267 | .BI \-scans " file" |
| 268 | Use the scan script given in the specified text file. |
Thomas G. Lane | 88aeed4 | 1992-12-10 00:00:00 +0000 | [diff] [blame] | 269 | .PP |
| 270 | The "wizard" switches are intended for experimentation with JPEG. If you |
Thomas G. Lane | bc79e06 | 1995-08-02 00:00:00 +0000 | [diff] [blame] | 271 | don't know what you are doing, \fBdon't use them\fR. These switches are |
Guido Vollbeding | 5996a25 | 2009-06-27 00:00:00 +0000 | [diff] [blame] | 272 | documented further in the file wizard.txt. |
Thomas G. Lane | bd543f0 | 1991-12-13 00:00:00 +0000 | [diff] [blame] | 273 | .SH EXAMPLES |
| 274 | .LP |
| 275 | This example compresses the PPM file foo.ppm with a quality factor of |
| 276 | 60 and saves the output as foo.jpg: |
| 277 | .IP |
Thomas G. Lane | 88aeed4 | 1992-12-10 00:00:00 +0000 | [diff] [blame] | 278 | .B cjpeg \-quality |
Thomas G. Lane | bd543f0 | 1991-12-13 00:00:00 +0000 | [diff] [blame] | 279 | .I 60 foo.ppm |
| 280 | .B > |
| 281 | .I foo.jpg |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 282 | .SH HINTS |
| 283 | Color GIF files are not the ideal input for JPEG; JPEG is really intended for |
| 284 | compressing full-color (24-bit) images. In particular, don't try to convert |
| 285 | cartoons, line drawings, and other images that have only a few distinct |
| 286 | colors. GIF works great on these, JPEG does not. If you want to convert a |
| 287 | GIF to JPEG, you should experiment with |
| 288 | .BR cjpeg 's |
| 289 | .B \-quality |
| 290 | and |
| 291 | .B \-smooth |
| 292 | options to get a satisfactory conversion. |
| 293 | .B \-smooth 10 |
| 294 | or so is often helpful. |
| 295 | .PP |
| 296 | Avoid running an image through a series of JPEG compression/decompression |
| 297 | cycles. Image quality loss will accumulate; after ten or so cycles the image |
| 298 | may be noticeably worse than it was after one cycle. It's best to use a |
| 299 | lossless format while manipulating an image, then convert to JPEG format when |
| 300 | you are ready to file the image away. |
| 301 | .PP |
| 302 | The |
| 303 | .B \-optimize |
| 304 | option to |
| 305 | .B cjpeg |
| 306 | is worth using when you are making a "final" version for posting or archiving. |
| 307 | It's also a win when you are using low quality settings to make very small |
| 308 | JPEG files; the percentage improvement is often a lot more than it is on |
Thomas G. Lane | bc79e06 | 1995-08-02 00:00:00 +0000 | [diff] [blame] | 309 | larger files. (At present, |
| 310 | .B \-optimize |
| 311 | mode is always selected when generating progressive JPEG files.) |
Thomas G. Lane | 88aeed4 | 1992-12-10 00:00:00 +0000 | [diff] [blame] | 312 | .SH ENVIRONMENT |
| 313 | .TP |
| 314 | .B JPEGMEM |
| 315 | If this environment variable is set, its value is the default memory limit. |
| 316 | The value is specified as described for the |
| 317 | .B \-maxmemory |
| 318 | switch. |
| 319 | .B JPEGMEM |
| 320 | overrides the default value specified when the program was compiled, and |
| 321 | itself is overridden by an explicit |
| 322 | .BR \-maxmemory . |
Thomas G. Lane | bd543f0 | 1991-12-13 00:00:00 +0000 | [diff] [blame] | 323 | .SH SEE ALSO |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 324 | .BR djpeg (1), |
Thomas G. Lane | bc79e06 | 1995-08-02 00:00:00 +0000 | [diff] [blame] | 325 | .BR jpegtran (1), |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 326 | .BR rdjpgcom (1), |
| 327 | .BR wrjpgcom (1) |
Thomas G. Lane | bd543f0 | 1991-12-13 00:00:00 +0000 | [diff] [blame] | 328 | .br |
Thomas G. Lane | 4a6b730 | 1992-03-17 00:00:00 +0000 | [diff] [blame] | 329 | .BR ppm (5), |
| 330 | .BR pgm (5) |
| 331 | .br |
Thomas G. Lane | bd543f0 | 1991-12-13 00:00:00 +0000 | [diff] [blame] | 332 | Wallace, Gregory K. "The JPEG Still Picture Compression Standard", |
| 333 | Communications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44. |
| 334 | .SH AUTHOR |
| 335 | Independent JPEG Group |
DRC | cf763c0 | 2013-01-01 09:51:37 +0000 | [diff] [blame] | 336 | .PP |
| 337 | This file was modified by The libjpeg-turbo Project to include only information |
DRC | ab70623 | 2013-01-18 23:42:31 +0000 | [diff] [blame] | 338 | relevant to libjpeg-turbo, to wordsmith certain sections, and to describe |
| 339 | features not present in libjpeg. |
DRC | 83aeb7b | 2016-02-17 20:05:44 -0600 | [diff] [blame] | 340 | .SH ISSUES |
DRC | 39ea562 | 2010-10-12 01:55:31 +0000 | [diff] [blame] | 341 | Support for GIF input files was removed in cjpeg v6b due to concerns over |
| 342 | the Unisys LZW patent. Although this patent expired in 2006, cjpeg still |
| 343 | lacks GIF support, for these historical reasons. (Conversion of GIF files to |
DRC | 83aeb7b | 2016-02-17 20:05:44 -0600 | [diff] [blame] | 344 | JPEG is usually a bad idea anyway, since GIF is a 256-color format.) |
Thomas G. Lane | 5ead57a | 1998-03-27 00:00:00 +0000 | [diff] [blame] | 345 | .PP |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 346 | Not all variants of BMP and Targa file formats are supported. |
Thomas G. Lane | bd543f0 | 1991-12-13 00:00:00 +0000 | [diff] [blame] | 347 | .PP |
| 348 | The |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 349 | .B \-targa |
Thomas G. Lane | bd543f0 | 1991-12-13 00:00:00 +0000 | [diff] [blame] | 350 | switch is not a bug, it's a feature. (It would be a bug if the Targa format |
| 351 | designers had not been clueless.) |