libjpeg is a library designed to help you compress JPEG images.
The libjpeg library provides C code to read and write JPEG-compressed image files. The surrounding application program receives or supplies image data a scanline at a time, using a straightforward uncompressed image format.
All details of color conversion and other preprocessing/postprocessing can be handled by the library.
The library includes a substantial amount of code that is not covered by the JPEG standard but is necessary for typical applications of JPEG. These functions preprocess the image before JPEG compression or postprocess it after decompression.
They include colorspace conversion, downsampling/upsampling, and color quantization. The application indirectly selects use of this code by specifying the format in which it wishes to supply or receive image data. For example, if colormapped output is requested, then the decompression library automatically invokes color quantization.
A wide range of quality vs. speed tradeoffs are possible in JPEG processing, and even more so in decompression postprocessing. The decompression library provides multiple implementations that cover most of the useful tradeoffs, ranging from very-high-quality down to fast-preview operation.
On the compression side we have generally not provided low-quality choices, since compression is normally less time-critical. It should be understood that the low-quality modes may not meet the JPEG standard's accuracy requirements; nonetheless, they are useful for viewers.
By itself, the library handles only interchange JPEG datastreams --- in particular the widely used JFIF file format.
The library can be used by surrounding code to process interchange or abbreviated JPEG datastreams that are embedded in more complex file formats. (For example, this library is used by the free LIBTIFF library to support JPEG compression in TIFF).
What's New in This Release: [ read full changelog ]
· Add cjpeg -rgb option to create RGB JPEG files.
· Using this switch suppresses the conversion from RGB colorspace input to the default YCbCr JPEG colorspace. This feature allows true lossless JPEG coding of RGB color images
· .
· The recommended command for this purpose is currently cjpeg -rgb -block 1 -arithmetic.
· SmartScale capable decoder (introduced with IJG JPEG 8) required.
· Add option to disable the region adjustment in the transupp crop code.