MozJPEG reduces file sizes of JPEG images while retaining quality and compatibility with the vast majority of the world's deployed decoders.
MozJPEG is based on libjpeg-turbo. Please send pull requests to libjpeg-turbo if the changes aren't specific to newly-added MozJPEG-only compression code. This project aims to keep differences with libjpeg-turbo minimal, so whenever possible, improvements and bug fixes should go there first.
It's compatible with libjpeg API and ABI, and can be used as a drop-in replacement for libjpeg. MozJPEG makes tradeoffs that are intended to benefit Web use cases and focuses solely on improving encoding, so it's best used as part of a Web encoding workflow.
MozJPEG is meant to be used as a library in graphics programs and image processing tools. We include a demo cjpeg
tool, but it's not intended for serious use. We encourage authors of graphics programs to use MozJPEG's C API instead.
jpegtran
) to losslessly reduce file size.See BUILDING.