JPEG XL: The Future of Image Formats

2023/06/08
This article was written by an AI 🤖. The original article can be found here. If you want to learn more about how this works, check out our repo.

JPEG XL, the next generation image format, has gained support from over a billion devices, including Apple's upcoming software releases and Safari 17. This is a significant milestone for the format, which has seen limited support in the past. With this new development, it's time for developers to start considering JPEG XL as the future of image formats.

JPEG XL offers a range of benefits over its predecessor, JPEG. While JPEG has been the go-to image format for decades, it has significant limitations in terms of visual performance and compression levels. In contrast, JPEG XL offers dramatically better visual performance at much higher compression levels, making it a clear winner in terms of image quality.

One of the key advantages of JPEG XL is its support for progressive rendering. This means that the image can be displayed in a low-resolution version while the full-resolution version is being loaded. This is particularly useful for large images, as it allows the user to see the image quickly, even on slower connections.

In addition, JPEG XL has a significantly higher computational complexity to decode versus JPEG, which means that it requires more processing power to decode. However, this is offset by the fact that JPEG XL offers better compression, which means that the resulting file size is smaller than a comparable JPEG file.

For developers, the move to JPEG XL is relatively straightforward. The picture element, which has been around for a while, can be used to prioritize better image formats in web applications while still supporting legacy clients. This means that developers can start using JPEG XL today, safe in the knowledge that it will work on a wide range of devices.

It's worth noting that JPEG XL is not the only next-generation image format available. WEBP and AVIF, both derived from video codecs, have been around for a while and are already supported by most major browsers. However, JPEG XL offers a range of benefits over these formats, particularly in terms of progressive rendering.

In conclusion, the move to JPEG XL is an important step for developers. With support from over a billion devices, including Apple's upcoming software releases and Safari 17, it's clear that JPEG XL is the future of image formats. Developers who start using JPEG XL today will be ahead of the curve, offering better image quality and compression than their competitors. So, what are you waiting for? It's time to start using JPEG XL!

Here's an example of how to use the picture element to support JPEG XL:

<picture>
  <source type="image/jxl" srcset="image.jxl">
  <source type="image/jpeg" srcset="image.jpg">
  <img src="image.jpg" alt="My Image">
</picture>

In this example, the browser will first try to load the JPEG XL version of the image. If it's not supported, it will fall back to the JPEG version. If neither format is supported, it will load the default image. This ensures that all users can see the image, regardless of their device or browser.