X

Mozilla works to squeeze more life out of JPEG

The Firefox developer releases a tool called mozjpeg that cuts image file sizes by about 10 percent through judicious optimization. The goal: a faster Web.

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
2 min read
Firefox logo

JPEG, the decades-old image format, shows no signs of disappearing. That's why Mozilla announced a project Wednesday to try to shave another 10 percent off images compressed with the standard.

The non-profit organization behind Firefox announced a project called mozjpeg that aims to compress JPEGs more intelligently. Smaller file sizes means Web pages load faster, and Mozilla is deeply interested in improving the Web's performance.

"Photos can easily make up the bulk of the network traffic for a page load," said senior technology strategist Josh Aas in a blog post. "Reducing the size of these files is an obvious goal for optimization."

It's a tweak of an existing open-source tool called libjpeg-turbo that's used to create JPEGs. On top of that it adds a tool called jpgcrush that picks the best compression options without sacrificing any image quality.

Mozilla's tests show the encoder squeezes 10 percent off a sample of 1,500 images on Wikimedia. It also can improve on PNG images, typically shrinking file sizes by 2 to 6 percent.

Google, too, has been trying to speed up the Web with a variety of methods including an entirely new graphics format called WebP. Companies including Facebook are big WebP fans, but Mozilla so far isn't on board.

"We are not convinced that WebP is 40 percent better than JPEG," spokesman Justin O'Kelly said, referring to Mozilla's 2013 analysis of WebP.

Aas said image compression could improve substantially one way or another, but even so, JPEG will remain widely used and therefore be worth improving:

Production JPEG encoders have largely been stagnant in terms of compression efficiency, so replacing JPEG with something better has been a frequent topic of discussion. The major downside to moving away from JPEG is that it would require going through a multi-year period of relatively poor compatibility with the world's deployed software. We (at Mozilla) don't doubt that algorithmic improvements will make this worthwhile at some point, possibly soon. Even after a transition begins in earnest though, JPEG will continue to be used widely.

The mozjpeg software is at version 1.0 now, but more changes are likely -- for example the incorporation of an approach called Trellis quantization.