Libjpeg

From Wikipedia, the free encyclopedia

The correct title of this article is libjpeg. The initial letter is shown capitalized due to technical restrictions.

libjpeg is a library of computer programs created by the Independent JPEG Group which contain functions to manipulate JPEG images. It is written entirely in the C programming language. The current version of the library is 6b, although it has not been updated since 1998.

JPEG is a standardized compression method for full-color and gray-scale images. JPEG is intended for "real-world" scenes; cartoons and other non-realistic images are not its strong suit. JPEG is lossy, meaning that the output image is not identical to the input image. The user can trade off output image quality against compressed file size by adjusting a compression parameter.

A common error that users of the library sometimes stumble upon is "JPEG parameter struct mismatch: library thinks size is X, caller expects Y" where X and Y are some numbers in the range 400-500. The reason for the error is that the user is using a version of the header file, jpeglib.h, that is different from the version of the installed binaries. This occurs when two different versions of libjpeg have been installed. This can also occur where there is a mismatch in important compiler settings, such as those related to integer size or alignment.

The jpegtran command-line program is useful to optimize the compression of a JPEG file, convert between progressive and non-progressive JPEG formats, eliminate non-standard application-specific data inserted by some image programs, or to perform certain transformations on a file — such as grayscaling, or rotating and flipping (within certain limits) — all done "losslessly" (i.e. without decompressing and recompressing the data, and so causing a reduction of image quality due to generation loss).

[edit] External links