X

​Google works to make JPEG graphics smaller but not sucky

The Guetzli project shows there's room to improve the venerable compression tech. Too bad Google's software is slow and not so practical for most sites right now.

Stephen Shankland Former Principal Writer
Stephen Shankland worked at CNET from 1998 to 2024 and wrote about processors, digital photography, AI, quantum computing, computer science, materials science, supercomputers, drones, browsers, 3D printing, USB, and new computing technology in general. He has a soft spot in his heart for standards groups and I/O interfaces. His first big scoop was about radioactive cat poop.
Expertise Processors, semiconductors, web browsers, quantum computing, supercomputers, AI, 3D printing, drones, computer science, physics, programming, materials science, USB, UWB, Android, digital photography, science. Credentials
  • Shankland covered the tech industry for more than 25 years and was a science writer for five years before that. He has deep expertise in microprocessors, digital photography, computer hardware and software, internet standards, web technology, and more.
Stephen Shankland
3 min read
Guetzli JPEG compression comparsion
Enlarge Image
Guetzli JPEG compression comparsion

Google says its Guetzli compression produces JPEG images with fewer photo-degrading artifacts. These zoomed-in images show the original at left, Guetzli compression in the middle, and an alternative called libjpeg at right.

Google

It's a common problem: A website's text is smudged with stray pixels. It's as much fun as seeing white dog hairs on the black couch.

The culprit is the JPEG file format, which can compress graphics so they load faster on your PC and eat up less of your phone's monthly data plan. There have been lots of efforts to do better -- Microsoft's JPEG XR and Google's WebP and RAISR among them -- but their success has been limited by the ubiquity of JPEG support.

Now Google thinks it's found a better way to compress JPEG. In research published Thursday, it details technology called Guetzli that cuts JPEG file sizes by 35 percent in its testing. The idea isn't to replace JPEG, but tweak its settings to minimize the likelihood we'll notice problems when files are squeezed.

Smaller file sizes might seem an arcane technology concern, but they're crucial to fast-loading websites. The average web page has ballooned from about 1 megabyte five years ago to about 2.5MB today, according to the HTTP Archive, and bigger pages load slowly. The faster the web page, the happier everyone is: Speed means we buy more online, read more news pages and spend more time checking friends' social network activity.

For Google's Guetzli speed boost, researchers developed a test called Butteraugli designed to model human vision. Compression works by throwing out data that we won't notice is missing, and the point of Butteraugli is to automate testing of different compression settings. Guetzli fiddles with two particular parts of JPEG compression -- discrete cosine transform, which governs how details like object edges are recorded, and quantization, which governs which colors are preserved and which are sacrificed to cut file size.

"Butteraugli takes into account ... properties of vision that most JPEG encoders do not make use of," Google researchers said in a Guetzli research paper (PDF). They validated their results in a separate study detailing tests of Butteraugli with actual people (PDF).

That automation is key. Guetzli works by producing multiple candidates of compressed JPEGs and then comparing them to see which is best. If you want to try it, Google released Guetzli for free as open-source software.

Google isn't the only one trying this approach. Mozilla, maker of the Firefox web browser, began a project in 2014 called Mozjpeg designed to improve on standard compression engines. Google's tests showed that Guetzli outdoes Mozilla's tool by 29 to 45 percent.

Guetzli vs libjpeg JPEG compression example

Note how the Guetzli compression on the right is smoother but lacks some richer colors of the libjpeg compression in the center. The original image is on the left.

Google

There's no free lunch here, though. Guetzli may indeed produce better perceived quality at a given file size, but note for example how some green areas are washed out in the eye comparison image above. And although Google compared Guetzli to mozjpeg and another JPEG encoder called libjpeg, there are other options, too.

Another problem: speed of compressing images. "Guetzli is rather slow to encode," the researchers said, suggesting it's most likely useful on image-heavy websites. "Although Guetzli may be too slow for many practical uses, we hope that it can show direction for future image format design," the researchers said.

It's Complicated: This is dating in the age of apps. Having fun yet? These stories get to the heart of the matter.

Batteries Not Included: The CNET team reminds us why tech is cool.