Mozilla introduces a new project called mozjpeg (Mozilla JPEG encoder/decoder project.) to provide a new production-quality JPEG encoder that helps to improve compression rates of jpeg images. Images are now integral part of every website in the internet. And the number of images is growing every day.
JPEG, the most popular lossy compressed image format on the Web, has been in use since 1992. JPEG is supported by every web browsers and image viewing softwares in the web. On a web page HTML, CSS are text files and relatively low in size. But images can “easily make up the bulk of the network traffic for a page load.”
Mozilla aims “to provide a production-quality JPEG encoder that improves compression while maintaining compatibility with the vast majority of deployed decoders.” Google is suggested to reduce file size of images by introducing a new type of file called webp. Webp is now supported by Google Chrome browser but is not used widely.
The mozjpeg version 1.0 release is a fork of libjpeg-turbo with ‘jpgcrush’ functionality added. The latter is a Perl script written by Loren Merritt which losslessly reduces file sizes by figuring out which progressive coding configuration uses the fewest bits. Results for mozjpeg range from 2-6 percent for PNGs encoded to JPEG by libjpeg-turbo and 10 percent on average for a sample of 1,500 JPEG files from Wikimedia.
Mozilla says it is not aware of any other production encoder that has this functionality built in, so the company decided to include it as mozjpeg’s first feature. The project’s next goal is to improve encoding by making use of trellis quantization.
Download JPGCrush Pearl Scrpit from Github