JPEG XL Image Codec

Options

JPEG XL Image Codec

 

  1. Introduction to JPEG XL
  2. JPEG XL Technology
  3. Introduction of JPEG XL Codec in Expert RAW
  4. Conclusion

 

Introduction to JPEG XL

 

JPEG XL is a royalty-free raster graphics file format that supports both lossy and lossless compression. The proposal for the next-generation image coding standard, presented as ISO/IEC JTC1/SC29/WG1 at the 79th JPEG meeting in August 2017, was made public [3]. The standardization draft was crafted in July 2019. The compression technology behind JPEG XL, based on Google's PIK [1] and Cloudinary's FLIP [2], officially standardized the file format and coding system in October 2021 and March 2022, respectively. As implied by the "Long-Term" designation in its name, JPEG XL was developed with the aim of replacing legacy JPEG. JPEG XL supports both lossy and lossless compression, with features such as up to 32 bits per image component, RGB color format, wide color gamut, and support for modern image formats like HDR. 

 

JPEG XL outperforms traditional image codecs like JPEG and WebP, providing superior image quality and compression efficiency. In comparison to AVIF, while AVIF excels in lossy compression, JPEG XL surpasses in lossless compression. Additionally, JPEG XL strikes a balance between file size and image quality, delivering high compression without significant loss in visual fidelity. It outperforms AVIF in both encoding and decoding speeds [7]. Furthermore, JPEG XL offers efficient lossless recompression options for existing JPEG format images.

 

Let's delve deeper into the compression technology of the JPEG XL codec.

 

JPEG XL Technology

 

JPEG XL is composed of two main coding modes, as depicted in the figure below [4].

 

- VarDCT Mode (Variable Block Size DCT): Used for lossy compression focusing on the human visual system, it differs from traditional JPEG by employing a Discrete Cosine Transform (DCT) without the constraint of an 8x8 block size. JPEG XL utilizes a Variable Block Size DCT ranging from 2x2 to a maximum of 256x256 rectangular or square blocks. This allows the encoder to use smaller blocks where needed or choose more efficient block sizes for optimal compression efficiency. Additionally, JPEG XL employs not only Huffman coding but also LZ77 coding, Asymmetric Numeral Systems (ANS) coding [6], and Huffman coding for entropy coding. ANS is a recently introduced entropy coder that achieves compression efficiency similar to arithmetic coding while being significantly faster during decoding.

- Modular Mode: Primarily used for lossless compression, it enhances prediction performance by employing various predictors. This mode can be used internally within VarDCT for 2D data storage, and lossy compression is achievable through a modified Haar transform called "squeeze." Similar to VarDCT mode, Modular mode supports LZ77 coding, ANS, and Huffman coding for entropy coding.

CamcyclopediaExpert_3-1705555984508.png

 

As illustrated in the JPEG XL structure diagram, various coding tools have been developed, including XYB color transformation based on the LMS color model, feature extraction, edge-preserving filters, Gabor transforms, and context modelling techniques. These tools enhance compression efficiency. However, an increase in coding tools can improve compression efficiency while potentially raising computational complexity. Therefore, balancing compression efficiency and computational complexity is crucial for productizing a compression codec.

 

Next, we will discuss the compression ratio and subjective image quality comparison of the JPEG XL codec applied to Expert RAW, considering computational complexity.

 

Introduction of JPEG XL Codec in Expert RAW

 

Expert RAW compresses 16-bit linear RGB raw images losslessly using the JPEG codec and stores them in the DNG format, allowing for professional shooting and editing. DNG (Digital Negative) is an open, lossless raw image format developed by Adobe for digital photography.

 

Lossless JPEG, added to the JPEG standard as "ITU-T.81 Annex H Lossless mode of operation" in 1993, employs a technique entirely different from lossy JPEG standards [5]. It uses a prediction method based on the nearest three neighboring pixels (above, left, and upper left) and employs a straightforward method of Huffman coding for prediction errors. As seen in the compression results below, lossless compression can reduce file size by more than 2 times. However, due to its outdated compression technology, it still suffers from the significant drawback of large DNG file sizes for storing a single image.

CamcyclopediaExpert_2-1705555952976.png

 

Recently, Adobe introduced the DNG 1.7 standard, defining JPEG XL as a new codec for raw image compression alongside lossless JPEG. Consequently, Expert RAW adopted DNG 1.7, compressing raw images with JPEG XL and saving them as DNG files. The table below compares the file sizes of lossless compression and visually lossless compression between lossless JPEG and JPEG XL. JPEG XL achieves over 20% improvement in lossless compression efficiency and shows more than a 6-fold improvement in visually lossless compression.

CamcyclopediaExpert_1-1705555936574.png

 

The visually lossless compression of JPEG XL, despite its high efficiency, is challenging to distinguish from lossless compression, as seen below.

CamcyclopediaExpert_0-1705555838163.png

 

* The images above are for illustrative purposes and may vary depending on actual usage scenarios.

 

Now, with the adoption of the JPEG XL codec in Expert RAW on Galaxy smartphones, professional-quality images can be compressed into very small file sizes, alleviating concerns about storage capacity and enabling extensive photo shooting.

Conclusion

 

Expert RAW will continue its efforts to enhance compression efficiency and reduce computational complexity, ensuring that professionals can shoot and edit DNG images without the burden of storage constraints, thanks to the improvements in JPEG XL.

 

References:

[1] PIK: A new lossy/lossless image format for photos and the internet (https://github.com/google/pik)

[2] FUIF: Free Universal Image Format (https://github.com/cloudinary/fuif)

[3] JPEG XL Wikipedia (JPEG XL - Wikipedia)

[4] JPEG XL White Paper" (PDF). JPEG.org. 2021-01-29. Archived (PDF) from the original on 2 May 2021. Retrieved 2021-03-17.

[5] Lossless JPEG Wikipedia (Lossless JPEG - Wikipedia)

[6] Duda, J., Tahboub, K., Gadgil, N. J., and Delp, E. J., “The use of asymmetric numeral systems as an accurate replacement for Huffman coding,” in 2015 Picture Coding Symposium (PCS), 65 –69 (2015).

[7] It’s High Time to Replace JPEG With a Next-Generation Image Codec (cloudinary.com)

9 Comments