What is Jpegli, Google’s New JPEG Coding Library? Explained

In Short
  • Jpegli is a new coding library from Google for JPEG compression.
  • It reduces the size of the JPEGs by 35% without losing much quality.
  • It's much faster than WebP and achieves a higher score than other libraries such as MozJPEG and libjpeg-turbo.

If you’ve been extensively interacting with the internet, you may have noticed that some of the major elements that make the internet such as images and links have gone through a paradigm shift in the last decade. The internet is faster, and a bit more secure. We’ve observed major changes in images on the web, from WebP, AVIF, and now Jpegli, a new image coding library that Google recently released. So what exactly is it and why does it matter? Let’s find out.

What is Jpegli?

Jpegli is Google’s new open-source JPEG coding library which aims to massively decrease the size of JPEGs while retaining the quality of the image and preventing artifacts that you’d usually find in compressed images. The “li” at the end means “small” in Swiss German dialects.

It’s backward-compatible meaning Jpegli images can be opened by programs that support JPEGs, can help reduce the size of a regular JPEG image by 35%, and uses 10+ bits per component rather than traditional JPEG coding solutions that offer only 8 bits per component. It’s also more efficient.

Jpegli is a tad bit better than WebP thanks to its faster and higher-quality compression. It can save storage while speeding up the load times of web pages.

How Does Jpegli Work?

At its core, Jpegli uses four key things to achieve more compression without taking a hit in quality. They are Adaptive Quantization, Improved Matrix Selection, Precise Calculations, and Optional Advanced Colorspace.

Fixed Quantization in JPEGs is the primary reason for their mediocre quality. Jpegli uses adaptive quantization, which, in layman’s terms, adjusts which elements in an image need to be retained based on image regions. This thereby reduces the noise and keeps the details intact while achieving 35% compression. Jpegli takes a part of this feature from the books of another popular open-source library called JPEG XL.

Google Jpegli library benchmarks
Image Courtesy: Google

Google calls it “Spatially modulating the dead zone” based on its psychovisual modeling in one of its projects called Butteraugli. The project helps estimate the similarities between two images and how we perceive them by giving it a scalar score and plotting the spatial map of the level of differences.

In Google’s testing, Jpegli scored higher than traditional coding libraries such as Mozilla’s MozJPEG and libjpeg-turbo. In simple terms, this means Jpegli can compress images more efficiently than other coding platforms.

What Does Jpegli Mean for the Web?

Nothing. The web, for the most part, has adopted WebPs. To better understand the difference between WebP and Jpegli, consider WebP a suitcase and Jpegli an upgraded duffel bag. The suitcase gives you options to store neatly folded Images to ensure maximum quality but all porters may not recognize the suitcase.

On the other hand, Jpegli is an upgrade to your old duffel bag (JPEG). It uses smart techniques to compress the files while being recognized by porters (existing JPEG viewers). In simple words, WebP is an image format while Jpegli is an encoder/decoder for the JPEG format.

So, will the web start using Jpegli soon? No, because it has already adopted WebPs for the most part. However, expect Jpegli to be used in different image formatting tools that offer compressing functionality. Parts of the web that still use JPEGs could make use of Jpegli to make web pages faster, but as it stands now, WebPs will dominate the web assets for years from now.

JPEGs could use Jpeglis encoding, but we wouldn’t know because the images would still be in JPEG format. WebP image format, on the other hand, is here to stay because it’s more versatile with support for compressing PNGs, animated images, and alpha transparency as well.

What are your thoughts on the new Jpegli coding library released by Google? Let us know in the comments below.

Comments 1
  • AK says:

    It seems Google isn’t interested in JPEG XL at all.

Leave a Reply