Half the File Size: How Memory-Safe Rust Brought JPEG XL Back to Chrome

Half the File Size: How Memory-Safe Rust Brought JPEG XL Back to Chrome

ChromeJPEG XLRustWeb Ecosystem

Sources:Official blog and community discussion

On October 6, 2026, Google published a major announcement on its Chrome for Developers blog: starting with Chrome 155, the browser will officially ship with native decoding support for the JPEG XL image format. Three years ago, around the release of Chrome 110, the format was deprecated and subsequently removed from Chromium after internal assessments deemed it lacked sufficient ecosystem momentum. Today, the technology makes its comeback in Chrome’s core engine, rebuilt from scratch as a pure-Rust decoder. With Firefox planning to follow suit in its October stable release alongside existing support in Apple’s Safari, JPEG XL is shaking off its niche status and completing broad coverage across major web browsers.

Memory Safety Opens Doors That Compression Ratios Couldn’t

JPEG XL was never lacking in raw benchmark figures. Compared to ubiquitous legacy JPEG, it delivers 30% to 50% better compression density, alongside first-class support for HDR and lossless transcoding. Mountains of legacy JPEG images stored across the web can be losslessly converted into JPEG XL and reconstructed bit-for-bit whenever necessary. Efficiency gains of this magnitude substantially cut down blank-screen load latency for mobile users while directly slashing hefty bandwidth bills for cloud providers distributing imagery at scale.

JPEG XL Official Key Visual Figure: Official key visual of JPEG XL. Source: Official JPEG XL website.

Yet the real barrier that previously barred it from Chrome’s rendering pipeline was the looming threat of memory vulnerabilities in low-level code. Browser image decoders must ingest and parse untrusted binary streams straight from the open web, making them a perennial hunting ground for zero-day exploits. Historically, decoders implemented in C++ have suffered from out-of-bounds reads, heap overflows, and use-after-free vulnerabilities. This time, the Chrome engineering team fundamentally rethought their approach by integrating jxl-rs, a clean-sheet decoder written entirely in Rust. Rewriting this untrusted-data parser in a memory-safe language moves the line of defense directly into compilation, offering far greater protection than relying solely on post-hoc sandbox isolation.

Speed and Safety Without the Trade-Off

Eliminating memory risks does not come for free. In compute-intensive image decoding where every cycle counts, runtime safety checks can easily bottleneck instruction throughput. Modern codecs rely heavily on SIMD (Single Instruction, Multiple Data) vectorization to saturate data throughput across multi-core architectures. Previously, the Rust ecosystem faced steep hurdles with SIMD: developers wishing to invoke hardware-level vector instructions inside safe abstractions lacked stable language features and were frequently forced into unsafe blocks.

To remove this roadblock between performance and memory safety, the Rust community collaborated to stabilize the target_feature_11 capability, creating a verified path for safe SIMD invocations. Leveraging this infrastructure upgrade, the decoding team engineered jxl_simd, a dedicated SIMD abstraction layer modeled after Google’s Highway C++ library. As a result, the decoder contains zero unsafe blocks while squeezing maximum SIMD performance across architectures, matching the raw speed of traditional, non-memory-safe C++ implementations.

Interop Testing Defuses Format Tribalism

For any new web standard to land successfully, it must navigate the competing interests and divergent priorities of rival browser vendors. In the Web Platform Tests Interop 2026 proposal, JPEG XL unexpectedly emerged as the most requested item by the web development community. The Chrome team actively participated in the Interop 2026 JPEG XL Investigation, bringing exhaustive edge cases under shared test coverage. Once automated test suites proved that every browser engine rendered identical visual outputs according to specification, the long-standing argument that “the format lacks interoperability” collapsed.

Compression efficiency comparison against JPEG and other formats at Q85 quality Figure: Compression efficiency comparison between JPEG XL, JPEG, and other formats at Q85 quality setting. Source: Official JPEG XL website.

Format debates, however, have never truly ceased. Advocates champion JPEG XL as a universal drop-in format capable of replacing AVIF, PNG, WebP, and even certain TIFF workflows. Skeptics point to articles like “The case against JPEG XL,” arguing that AVIF remains superior for typical lossy web imagery; proponents promptly counter that such comparisons lack definitive methodology and overlook disparities in encoder optimization investment. Chrome’s pragmatic resolution is to leave the choice to developers: use JPEG XL for ultra-high-fidelity photography and granular progressive decoding, and stick with AVIF for general lossy web delivery.

Shifting Authority from Internal Roadmaps to the Community

In specialized capabilities like progressive loading—which dramatically enhances first-contentful-paint perception—vendor progress remains somewhat uneven. Currently, Chrome and Firefox enable progressive decoding by default on non-Android desktop builds, whereas Safari, despite being the earliest adopter, has yet to fully unlock libjxl’s progressive streaming potential. The announcement post was co-authored by Luca Versari, Moritz Firsching, and Philip Jägenstedt, and its core message extends well beyond compression ratios.

A format previously discarded has returned to the table because three critical requirements were met simultaneously: a decoder rewritten in a memory-safe language, zero performance degradation from the rewrite, and cross-browser behavioral consistency backed by automated test suites. The technical objections that justified its deprecation three years ago have been dismantled one by one.

References:

  • Chrome for Developers Blog
  • Official jpegxl.info Website
  • Interop 2026 JPEG XL Investigation
  • Hacker News Discussion
  • “The case against JPEG XL”