Skip to main content
Known Participant
September 24, 2024

P: Certain raw files export unusually large with JPEG XL

  • September 24, 2024
  • 11 replies
  • 5636 views

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.]

 

11 replies

GoldingD
Legend
September 24, 2024

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

JtheNinjaAuthor
Known Participant
October 3, 2024

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.

johnrellis
Legend
October 3, 2024

[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: