Mozilla’s New JPEG Encoder Promises To Reduce File Size 10% On Average

Mozilla releases a tool called mozjpeg that cuts image file sizes by about 10 percent through sensible optimization.

Mozilla has announced a new JPEG encoder Mozjpeg that promises to reduce the file sizes by up to 10 percent on the standard JPEG images. Mozilla says, the motive behind the project is to create compatibility with “the vast majority” of arrayed decoders.

"Photos can easily make up the bulk of the network traffic for a page load," said senior technology strategist Josh Aas in a blog post. "Reducing the size of these files is an obvious goal for optimization."

To enhance the JPEG further, Mozilla team splits the ‘libjpeg-turbo’, a popular open-source JPEG codec, adding the ‘jpgcrush’ a popular Perl script written by Loren Merritt which losslessly shrinks the file sizes by figuring out which advanced coding configuration uses the least bits.

For sampling purposes, around 1,500 images have been taken from Wikimedia. The combination of these two applications results in an average reduction of 10 percent of the file size and for the PNG images encoded to the JPEG, the file size ranges from 2-6 percent.

This is the mozjpeg version 1.0 release and Mozilla plans to add more features to this tool like trellis quantization, an algorithm that should reduce the image sizes even further. The source code of the mozjpeg is available on the Github, under a BSD-style open source license.