TECHNOLOGY

Chrome to Support JPEG XL Image Decoding Starting With Chrome 155

Chrome will be able to decode JPEG XL (.jxl) images from version 155. The decoder is written in Rust to avoid memory-safety bugs, and the team says it is also built to be fast.

Chrome to Support JPEG XL Image Decoding Starting With Chrome 155TECHNOLOGY

Image: Chrome · Uploaded by IntraGoals — usage rights confirmed

Chrome will support decoding images in the JPEG XL format (.jxl) starting with Chrome 155. The Chrome team announced that JPEG XL is a newer image format meant for modern web developers and photographers.

According to the post, JPEG XL offers 30-50% better compression than JPEG. It also supports lossless compression, built-in HDR (high dynamic range, which allows a wider range of brightness and color), and lossless transcoding of existing JPEG files. Transcoding here means converting a JPEG into JPEG XL without losing any image data.

The team does not present JPEG XL as the only choice. In general, it recommends trying both AVIF and JPEG XL to see which gives the best results. It expects JPEG XL to help most with high-quality or lossless compression, especially for photos, or where fine-grained progressive decoding is preferred. Progressive decoding means an image shows up gradually as it loads.

The post puts a lot of weight on safety. Image decoders are a common target for attackers, because they read complex, untrusted data straight from the network and run inside the browser's renderer process. Decoders written in memory-unsafe languages like C++ have historically had bugs such as out-of-bounds reads, heap overflows and use-after-free errors.

Chrome's security model relies on sandboxing and defense-in-depth, guided by what it calls the rule of two. The team describes sandboxing as a secondary layer of defense. To remove the risk at the source, it has integrated jxl-rs, a pure Rust implementation of the JPEG XL decoder.

Speed was the other concern. The team says a memory-safe decoder that is roughly as fast as the best non-memory-safe option is an easier choice than one with a big performance cost. Modern codecs depend on SIMD, which lets a processor handle many pieces of data in a single instruction. To use SIMD without writing unsafe code, the Rust feature target_feature_11 first had to be stabilized.

The team then built a SIMD abstraction layer called jxl_simd. It was inspired by the C++ Highway library, which was originally developed for libjxl, the C++ reference implementation of JPEG XL. With this, the team says it could write a multi-platform library that keeps its SIMD optimizations while limiting unsafe operations to a small number of highly vetted places.

The performance work in jxl-rs builds on what was done in libjxl. That includes a generic processing pipeline for steps that cross region borders, designed to minimize data copies. The team tracks the Rust version's performance on different hardware on a jxl-rs performance dashboard.

The team says it checked jxl-rs using fuzzing (feeding a program large amounts of unexpected input to find bugs) and AI review of the code. It reports that no memory safety bugs have been found across the implementation's entire history. The post also says it covers what the team learned about developer feedback and the web standards ecosystem.

Sources and further readingMengirimkan JPEG XL di Chrome | Blog | Chrome for Developers ↗
ABOUT THE DESK

Harsh DV

IntraGoals reports on important changes in technology and work. We check each story for clear writing, trusted sources and useful information before it is published.

KEEP READING

Latest from IntraGoals.

All latest stories ↗