Copy link to clipboard
Copied
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.]
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
[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:
Copy link to clipboard
Copied
@Rikk Flohr: Photography, something is amiss with exporting as JXL. See my previous post for details. Please consider moving to Bugs.
Copy link to clipboard
Copied
[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.
Copy link to clipboard
Copied
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.