Google is trying to optimize the JPEG format by increasing compression by 35%. What kind of technology is this?

The JPEG image format appeared at the end of the last century, and it is not losing relevance, but, on the contrary, is gaining momentum. It would seem that what can be changed in a technology that is so old? Google felt that now is the time to optimize the format, namely to increase the efficiency of compression. What suggested by Google and how does the new technology work?

JPEG and corporate development

Google has proposed a new library for encoding images in JPEG format, which the company announced in its blog. The new product is called Jpegli, and, according to its creators, it provides up to 35% higher compression ratio compared to traditional codecs. At the same time, the image quality will be good, plus backward compatibility with previously used technologies is maintained.

According to the corporation, if JPEG files are made lighter, this will only bring benefits to both users and companies. As for the former, they will experience faster loading of graphic-rich web pages. Well, the latter will be able to make more optimal use of the volume of file storage, and the volume of data transmitted over the network may also decrease. Of course, this will be possible only if the library is widely used.

It is worth recalling that JPEG has several advantages, which have enabled the format to exist and be relevant for many years in a row. The fact is that when compressing a file, you can control the quality level, which makes it possible to flexibly respond to different tasks. In addition, JPEG also supports EXIF ​​technology, which allows you to store important metadata. Well, almost all graphic editors are compatible with this format – both well-known ones and pet projects with only a few users.

The new Google project, according to the authors, makes it possible to reduce noise and generally improve image quality. One of the technologies involved is the quantization heuristic that JPEG XL uses. They were also used optimized algorithms selection of quantization matrices and calculation of intermediate results. The library's authors also added more advanced color spaces.

Working with Jpegli does not create any problems, since images edited or created using this library are compatible with any technology with which the JPEG format is compatible. Accordingly, such “pictures” can be displayed on web pages, worked with in graphic editors, and viewed in any other programs.

What else?

According to Google representatives, both an encoder and a decoder are supplied with the library. They comply with all JPEG standards and are also backward compatible with libjpeg-turbo and MozJPEG.

libjpeg-turbo – high performance library for encoding and decoding JPEG images. Libjpeg-turbo is an API/ABI compatible fork of the classic libjpeg library, aimed at providing maximum image processing speed.

MozJPEG is a Mozilla project that started in 2014. Its goal is to create a high-quality JPEG encoder that will improve image compression while maintaining compatibility with existing decoders.

According to Google, the new library makes it possible to obtain higher quality output images after compression compared to the vast majority of existing solutions. The result looks clearer and visually: it is difficult to detect visible problems in the picture. All this is possible thanks to the use of a whole range of modern technologies.

In addition to quality, another advantage of the library is faster encoding and decoding operations. According to this parameter, the new solution is on par with or ahead of existing technologies. Accordingly, web developers can seamlessly integrate Jpegli into their existing workflows without sacrificing coding performance or memory usage.

Jpegli can be encoded using more than 10 bits per component. Traditional JPEG encoding solutions only offer 8-bit encoding per component, which results in visible banding artifacts in slow gradients. Jpegli's 10-bit and higher-bit encodings occur in the native 8-bit formalism, and the resulting images are fully compatible with 8-bit viewers. 10-bit dynamics is available as an API extension and requires changes to the application code to use it.

Some tests

In order not to be unfounded, Google developers conducted several tests. So, they packaged Cloudinary’s image dataset using Jpegli, libjpeg-turbo and MozJPEG into JPEG files. In this case, the images are presented in several copies with different bitrates.

A group of users (not from Google, they were recruited through various services) were asked to compare pairs of images obtained by working with different codecs (Jpegli, libjpeg-turbo and MozJPEG) in order to select the best ones.

The chart above shows the test results. To remove them, the Elo method was used.

The jpegli library is written in C++ and is distributed under the BSD license, allowing free use and modification of the code. It is fully API and ABI compatible with libjpeg62. Here is the link to the library itself.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *