Install jpegoptim powered by MozJPEG in CentOS / RedHat 7

by ,

We have by far the largest RPM repository with dynamic stable NGINX modules and VMODs for Varnish 4.1 and 6.0 LTS. If you want to install nginx, Varnish and lots of useful modules for them, this is your one stop repository to get all performance related software.
You have to maintain an active subscription in order to be able to use the repository!

The jpegoptim is the utility of choice for optimizing JPEG files. By default, it uses standard JPEG encoding library on your system. However, there is a relatively new player in town of JPEG encoders – MozJPEG.

MozJPEG encoder provides improvements compared to standard library by reducing the size of JPEG files further. So if you couple jpegoptim with MozJPEG, – you get furthermore smaller files without loosing any quality!

Install jpegoptim with MozJPEG support

Our repository has jpegoptim compiled with MozJPEG linked in statically. So all you need to do is add up our repository and install the package:

yum -y install
yum -y install jpegoptim

Use it!

Use jpegoptim as you would normally, by simply running jpegoptim /path/to/file, or while providing whatever switches required for your use cases. The optimized files will be just more lightweight, compared to standard libjpeg-turbo, at no cost of quality!

Example lossless optimization comparison

Using jpegoptim with standard JPEG encoder

beautiful-girl-stands-park_8353-5085.jpg 626×417 24bit N JFIF [OK] 69291 –> 67808 bytes (2.14%), optimized.

Using jpegoptim with MozJPEG

beautiful-girl-stands-park_8353-5085.jpg 626×417 24bit N JFIF [OK] 69291 –> 65898 bytes (4.90%), optimized.

Most of the files we tried provided similar extra 2-3% improvements. So no excuse not to leverage the power of MozJPEG!

Also published on Medium.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.