This Google algorithm shrinks JPEGs without ruining their quality

Adjust Comment Print

Google Research has released details of its new and more efficient method for encoding JPEG images, promising to cut a third off JPEG image file-sizes with equal (or improved) appearance - but at the cost of greater time needed for compression, relative to the venerable libjpeg method that has been in use for decades.

As per Google's Research Blog and GitHub, Guetzli-generated JPEG files are up to 35 percent smaller than most current JPEGs encoded with the widely-used libjpeg encoder.

Google is devoting time to further reduce the size of existing JPEG image files with the primary aim of making web pages load faster. To accomplish this, Guetzli trades visual quality for a smaller file size at the quantization stage of image compression.

The new open source algorithm is called Guetzli, which is Swiss German for "cookie".

The underlying compression algorithms behind popular implementations of JPEG have always been lossy; once a web version has been generated from a high-quality original master, the lost pixel information can not be recovered (except, arguably by AI - another field of interest for Google's image researchers).

Guetzli specifically targets the quantisation stage in which the more visual quality loss is introduced, the smaller the resulting file.

According to Ars Technica, the encoder technically works by improving the quality of the JPEG images while keeping the size of the file constant.

JPEG compression has several steps, including color space transformation, discrete cosine transformation, and quantization. Smaller files are achieved by blurring together pixels that are similar, but only just enough to not distort the overall image's structure. Another upside is that the transition to using Guetzli will happen quietly in the background without any disruption to that next image search you perform looking for cute cats. Centre, standard JPEG compression. Google said it tested JPEGs compressed using the algorithm on "human raters", and they consistently prefered the Guetzil images over other JPEGs, even if the latter were larger files. The time between shots might be reduced if Guetzli compression is used. The algorithm used by the company allows it to compress JPEGs by up to 35% more than now available methods.

However, it's worth noting that Guetzli is slower than other options out there.