Skip to main content

Optimize your images with Google’s Guetzli compression algorithm

The following guide walks you through the steps of optimizing jpeg images using Google's new Guetzli compression algorithm.

Google unveiled Guetzli some time ago, a JPEG encoder that promises up to 35% smaller file sizes than achievable with current methods.

A 35% reduction would result in Ghacks saving hundreds of Megabytes of storage space, and a lot of bandwidth thanks to optimization. Google promises that Guetzli optimized images don't sacrifice quality for size.

One example: you have 1000 jpg images on your website. Each image has a size of 100 Kiloybte. If Guetzli manages to decrease the file size by 25%, you'd reduce the size of the images by 25,000 Kilobyte, or 25 Megabytes.

If these images get downloaded 10,000 times per month, you'd save 250,000 Kilobyte, or 250 Megabyte of traffic. Also, downloads would be faster on the user side of things.

Optimize your images with Google's Guetzli compression algorithm

running guetzli file optimizer

While you can head over to GitHub to grab your own personal version of the algorithm, and build it from source on Windows, POSIX or Mac OS X, it is probably not something that most webmasters are familiar enough with.

FileOptimizer is one of the programs that ships with Guetzli support already. The program is a universal file optimizer that you can download from the software's SourceForge page.

The program is simple. Drag and drop images, or other files, to the interface, select Optimize > Optimize All Files from the menu, and wait until the process completes.

You can drop folders on the interface, to have all files that FileOptimizer supports added to the queue automatically.

Guetzli is not one of the decoders that is used by default as it is not lossless. To enable Guetzli support in FileOptimizer, do the following:

  1. Open the fileoptimizer.ini file. You find it in the main user folder, e.g. C:\users\martin\fileoptimizer.ini
  2. Locate the parameter JPEGAllowLossy, and set it to true. This is done by replacing false in the line with true, so that the beginning of the line reads JPEGAllowLossy=true
  3. Restart FileOptimizer if it is running already.

guetzli optimize images

Once you have made the change, Guetzli is used as one of the algorithms to reduce the file size of jpg images loaded into the program interface.

Initial runs on some old Ghacks folders resulted in a reduction of about 15-20% on average. This is not bad, especially since I could not detect any quality deterioration on the optimized images.

One downside to this is that it takes some time to run Guetzli on images. How long depends on the size of the image, but it gets slow when the image hits 100 Kilobyte, and really slow (a minute or more) if it is crosses the 1 Megabyte limit. Still, it is probably worth it for webmasters. Best probably if you have a spare PC, or can keep your PC on over night to run the compression jobs then.

Now You: Do you optimize your images?

 

This article was first seen on ComTek's "TekBits" Technology News

HOME