-
Notifications
You must be signed in to change notification settings - Fork 254
Description
It seems the gamma of the P3 SDR base image produced by Adobe Lightroom is 0.455 (inverse of 2.2). PNG decoded from libjxl preserves this data, however, it looks like libavif does not, (Edit: irrelevant, but might also be something to look into) resulting in gain map gamma issue when combining base and alt PNG images (Gain Map Gamma is always equal to 1).
Way to reproduce
-
Download avif gain map sample file from https://helpx.adobe.com/camera-raw/using/gain-map.html. In this case, I use 01_base_hdr.avif as an example.
-
avifgainmaputil printmetadata 01_base_hdr.avif
Gain Map Gamma: R 0.25 (as fraction: 268435456/1073741824) G 0.25 (as fraction: 268435456/1073741824) B 0.25 (as fraction: 268435456/1073741824)
-
avifgainmaputil extractgainmap -q 100 01_base_hdr.avif 01_base_hdr_original_gain_map.jpeg -
avifgainmaputil swapbase -y 444 -q 100 --qalpha 100 --qgain-map 100 01_base_hdr.avif 01_base_sdr.avif -
avifdec.exe -d 16 01_base_hdr.avif 01_base_hdr.png -
avifdec.exe -d 16 01_base_sdr.avif 01_base_sdr.png -
avifgainmaputil combine --qgain-map 100 --depth-gain-map 10 --yuv-gain-map 444 -q 100 -y 444 -d 10 --cicp-base 9/16/9 --ignore-profile --cicp-alternate 9/1/9 -s 10 01_base_hdr.png 01_base_sdr.png 01_combined_base_hdr.avif -
avifgainmaputil printmetadata 01_combined_base_hdr.avif
Gain Map Gamma: R 1 (as fraction: 1/1) G 1 (as fraction: 1/1) B 1 (as fraction: 1/1)
avifgainmaputil.exe extractgainmap -q 100 01_combined_base_hdr.avif 01_combined_base_hdr_gain_map.jpg
Both gain maps should be quite similar, but they are not, as shown below.

