If you’re building an app or site that stores, manipulates or serves a lot of images, 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.
It’s called Guetzli, and it works with existing browsers and image processing tools. Google says it allows for small file sizes without compromising much on image quality by targeting what’s known as the quantization stage of the compression process, which is where algorithms can squish files but end up with poorer quality images.
Ever been to a tech festival?
TNW Conference won best European Event 2016 for our festival vibe. See what's in store for 2017.
However, it’s worth noting that Guetzli is slower than other options out there. Its psychovisual 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.
In the examples above, you can see the uncompressed original image on the left, libjpeg in the middle and Guetzli’s result on the right; notice how Google’s solution has less ringing artifacts in both examples.
The JPEG encoder is open-source and available for you to download and implement in your own projects from this GitHub repository.