Skip to main content
Known Participant
Sep 24, 2024 4:42 AM UTC
Needs More Info

P: Certain raw files export unusually large with JPEG XL

In most cases, exporting AVIF and JPEG XL with corresponding settings produces files of fairly similar size. There's some variance as expected, some images compress a bit better with one format than another.

 

But certain raw files inexplicably compress very, very poorly with JXL. Here's a sample DNG file that exhibits the problem. https://drive.google.com/file/d/1Cs7TiY7LeA3CGUVCAzqKUl9pLSK6ek7X/view?usp=sharing

 

It seems common to DNGs produced by the AI denoising function or HDR merge tool, but that is not universal (I've found raws from the same camera that can be enhanced or made into HDR stacks and still compress normally on export)

 

The settings in the attached screenshot barely compress it at all from the original DNG! Despite said DNG containing over double the amount of pixels, and ostensibly less compression. The AVIF version with the same resolution and quality setting is over 80% smaller than either one. Again, on most images switching to AVIF at the same resolution and quality setting tends to result in fairly similar file sizes, not a 80-90% size reduction. Something about the attached DNG does not seem to be compressing properly on export.

 

[moved from bugs to discussions according to the community rules  - Mod.]

 

40 replies

Rick.Williams
Known Participant
Oct 30, 2024 9:27 PM UTC

I'm seeing similar results. I often use the Panorama stitch function to make high resolution panoramas from iPhone 48mpx files. They usually result in a .dng file that is about 150mb. An 80% JPEG XL export is running 250-300mb on many of these.

HDR and Rec 2020 if that matters.

Translate
Participating Frequently
Oct 26, 2024 4:03 PM UTC

Mine is doing this as well, JPEG is 12 MB but the JXL is ~60 MB, definitely something going on here. I'll be waiting for Adobe to release a statement or patch. Files were from both Canon and Nikon RAW files, not converted to DNG at any point, lossless 16-bit export. 

Translate
Rikk Flohr-Retired
Adobe Employee
Oct 17, 2024 4:19 PM UTC

Setting status

Translate
Rikk Flohr: Adobe Photography Org
Participant
Oct 15, 2024 6:43 PM UTC

This might be fixed in the latest version of camera raw/lightroom.  A quick test gets me JXL files at a similar size to AVIF when at high quality (very high is still a very large file size).

Translate
Participating Frequently
Oct 15, 2024 7:58 PM UTC

Thanks for the heads up. Do you know if they added 10-12 bit output for the JXL? So what you are saying is that a 16 bit JXL at 90 quality will still produce an image as large as a 12 bit Avif in 90% quality?

Translate
Participant
Oct 2, 2024 7:51 PM UTC

I've been seeing the same with all of my Nikon raw files (*.NEF) - Jpg-XL exported with lightroom or camera raw results in massive file sizes (compared to jpg) regardless of compression/quality/colour space settings.  At high quality, I'm getting 20mb+ JPG-XL and 8mb equivelent jpgs.  AVIF has no problem, and produces excellent quality images at much smaller file sizes than JPG.

Translate
johnrellis
Legend
Sep 25, 2024 8:14 PM UTC

[This post contains formatting and embedded images that don't appear in email. View the post in your Web browser.]

 

With your sample DNG, I made  a lot of measurements of file sizes, comparing exported JXLs with exported AVIFs and with JXLs produced by Imagemagick (which uses the reference "libjxl" reference library associated with the ISO standard).

 

For this photo, the JXLs are 2 to 3.2 times larger than the AVIFs and 3.6 to 6.7 times as large as those produced by Imagemagick.

 

DETAILS:

 

All the exports were with Prophoto and Bit Depth = 16.

 

DNG > JXL -- size of .jxl exported from the DNG

TIFF > JXL -- size of .jxl exported from a TIFF losslessly converted from the DNG

DNG > AVIF -- size of .avif exported from the DNG

TIFF > AVIF -- size of .avif exported from a TIFF losslessly converted from the DNG

Magic TIFF > JXL -- size of .jxl converted by Imagemagick from the TIFF 

 

 

(*) With Imagemagick, Quality = 100 means "lossless".

 

Note that Quality isn't directly comparable between formats and converter programs, though it ranges between 1 and 100 for all of them.

 

Observations:

 

- JXLs made by Imagemagick from the TIFF are 3.6 to 6.7 times smaller than LR's JXLs.

 

- AVIFs from the TIFF are 2 to 3.2 times smaller than JXLs.

 

- JXLs from the TIFF are 1.1 to 1.6 times smaller than from the DNG. I think this is because the DNG contains a Transparency Mask (an alpha channel) added by LR's Photo Merge, whereas that mask gets dropped when the DNG is converted to a TIFF.

Translate
GoldingD
Legend
Sep 24, 2024 4:23 PM UTC

The Enhanced DNG file contains a demosaiced file, which is typically 3 times the original file size as it now contains RGB channels. Additionally, the Enhanced DNG file also contains a copy of the original mosaic data (i.e. a copy of the original raw file (copy from Ian Lyons in ref 1)

 

 

 

They do not behave the same as normal DNG files

 

1) https://community.adobe.com/t5/lightroom-classic-discussions/why-are-dng-files-produced-bt-denoise-ai-6-times-larger-than-the-orignal/td-p/13748036

Translate
JtheNinjaAuthor
Known Participant
Oct 3, 2024 3:44 AM UTC

This has nothing to do with my post, I'm talking about the EXPORTED .jxl files, the size of the DNG is not what this discussion is about. Since the buffer is always RGB prior to compression, the fact that the enhanced DNGs are demosaiced is irrelevant.

Translate
johnrellis
Legend
Oct 3, 2024 11:47 PM UTC

[This post contains formatting and embedded images that don't appear in email. View the post in your Web browser.]

 

It's clear LR's JXL export is creating files that are much too large.

 

I randomly picked three raws from my test library, from a Sony 7M4, Canon R5, and Nikon Z8. I exported 16- and 8-bit JXLs (quality = 70), JPEGs (quality = 70), and AVIFs (10-bit, quality = 70), all Prophoto RGB. I used Imagemagick to create JXLs from the raws and from TIFFs exported from the raws (quality = 90).

 

As evidence the 16-bit JXLs are too large, consider that they are:

 

- the same size as the 8-bit JXLs.

- 2.7 - 3.7 times as large as 16-bit JXLs made by Imagemagick.

- 2.3 - 6.4 times as large as 10-bit AVIFs.

- 1.2 - 2.4 times as large as lossy DNGs (linear raws using JPEG XL compression).

- 2.5 - 3.4 times as large as 8-bit JPGs.

 

The quality values aren't directly comparable between the various formats and tools, but they directionally indicate a problem, especially considering that LR JXLs (quality = 70) are much larger than Imagmack JXLs (quality = 90).

 

You can download the raws and the output files here:

https://www.dropbox.com/s/vkgtowf0c5d2beh/jxl-size.2024-10-03.zip?dl=0 

 

The detailed measurements:

 

 

 

Translate