How To Install Mozjpeg 2.0, Improved JPEG Encoding Library.

Abhishek Rawal

Abhishek Rawal

@abhishek-fg9tRh Oct 26, 2024
Recently Mozilla announced its JPEG encoding library with following improvements as quoted from Mozilla blog itself
The major feature in this release is trellis quantization, which improves compression for both baseline and progressive JPEGs without sacrificing anything in terms of compatibility. Previous versions of mozjpeg only improved compression for progressive JPEGs.

Other improvements include:

  • The cjpeg utility now supports JPEG input in order to simplify re-compression workflows.
  • We’ve added options to specifically tune for PSNR, PSNR-HVS-M, SSIM, and MS-SSIM metrics.
  • We now generate a single DC scan by default in order to be compatible with decoders that can’t handle arbitrary DC scans.
For more detail, read : #-Link-Snipped-#

How To Install ?

- Download source code from <a href="https://github.com/mozilla/mozjpeg/releases/tag/v2.0" target="_blank" rel="nofollow noopener noreferrer">Release mozjpeg v2.0 · mozilla/mozjpeg · GitHub</a>
- Extract it
- Install required libs i.e autoconf, automake, make, nasm & libtool


Now let's build :
- cd mozjpeg-2.0
- autoreconf -fiv
- mkdir build
- cd build
- sh ../configure
- sudo make install

snapshot12 snapshot13

snapshot14

- Once completed, the libraries will be installed in /opt/libmozjpeg

snapshot17 snapshot15

For usage read MAN pages from : /opt/libmozjpeg/man

You can use jpegtran located under /opt/libmozjpeg/bin to compress the image.

snapshot18
This is for Linux users, for OS X & Windows users you can compile from source on your own & post the steps in the comment below.

Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • Abhishek Rawal

    Abhishek Rawal

    @abhishek-fg9tRh Jul 15, 2014

    Here's result of my test :

    snapshot19 snapshot23 snapshot22 snapshot21
  • Kaustubh Katdare

    Kaustubh Katdare

    @thebigk Jul 15, 2014

    That's good and would definitely help companies like Facebook who can save TBs of data through that optimisation; but I'd want something that brings a reduction of about 30-50%! That'd be killer!