python-imaging-librarylibjpeg-turbojpegoptimjpegtranmozjpeg

How is jpegtran related to libjpeg-turbo, jpegoptim, and mozjpeg?


From what I understand, jpegtran is included with libjpeg-turbo and it is used when saving an Image with optimize=True. Jpegoptim uses an identical algorithm as jpegtran, but requires the image to be temporarily saved to disk before it can be optimized, and jpegoptim has the additional ability to compress lossly.

Looking at the mozjpeg repo on Github, there are a lot of references to libjpeg-turbo, and it has way more stars, so my question is how are they related? Is mozjpeg a fork of libjpeg-turbo that does everything and more? I.e., is it possible to disable certain features in mozjpeg and end up with identical performance and results as libjpeg-turbo?


Solution

  • Yes, mozjpeg is a fork of libjpeg-turbo. In mozjpeg v1.0, they confirm it. Actually it's a combination of three technologies (progressive JPEG encoding, jpgcrush, and trellis quantization) to reduce the size of JPEG images. Progressive JPEG is supported in libjpeg-turbo, but jpgcrush and trellis quantization are not.

    mozjpeg's implementation of the libjpeg API includes an extensibility framework that allows new features to be added without modifying the transparent libjpeg compress/decompress structures.

    The JPEG files mozjpeg generates require much more time to compress than to decompress. When the default settings are used, mozjpeg is considerably slower than libjpeg-turbo or even libjpeg at compressing images. Thus, it is not generally suitable for real-time compression. It is best used as part of a web encoding workflow.

    Find more information from here.