Looking to compress image files for your app while maintaining the quality? You’ll want to consider implementing Google’s new image compression algorithm, which promises to reduce JPEG file sizes by 35 percent more than other methods.

Algorithm called Guetzli, works with existing browsers and image processing tools. According to Google, the algorithm allows for small file sizes without compromising much on image quality.

However, Guetzli is slower than the other options out there. Its psycho-visual model “approximates color perception and visual masking in a more thorough and detailed way than what is achievable by simpler color transforms and the discrete cosine transform,” and the search algorithm that Guetzli uses to achieve this is slower than alternatives like libjpeg.

Via Google Research Blog
Via Google Research Blog

In the examples above, uncompressed original image is on the left, libjpeg compressed image in the middle and Guetzli’s result on the right.

DOWNLOAD | The JPEG encoder is open-source and available to download and implement from this GitHub repository.