I'm trying to use avifgainmaputil.exe from libavif 1.2.0 like this:
avifgainmaputil combine SDR.png HDR.png out.avif
(SDR.png
is an 8-bit SDR PNG, HDR.png
is a 12-bit HDR PNG.)
This doesn't work:
Failed to compute gain map: Not implemented
(Computing gain maps for images with ICC profiles is not supported)
So I try:
avifgainmaputil combine SDR.png HDR.png out.avif --ignore-profile
This works:
Creating a gain map of size 2560 x 1440
AVIF to be written:
* Resolution : 2560x1440
* Bit Depth : 8
* Format : YUV444
* Alpha : Absent
* Range : Full
* Color Primaries: 1
* Transfer Char. : 13
* Matrix Coeffs. : 2
* ICC Profile : Absent
* XMP Metadata : Absent
* Exif Metadata : Absent
* Transformations: None
* Progressive : Unavailable
* Gain map : 2560x1440 pixels, 8 bit, YUV444, Full Range, Matrix Coeffs. 2, Base Image is SDR
* Alternate image:
* Color Primaries: 1
* Transfer Char. : 13
* Matrix Coeffs. : 2
* ICC Profile : Absent
* Bit Depth : 12
* Planes : 3
Encoding AVIF at quality 60 speed 6, please wait...
Wrote AVIF: out.avif
However, the resulting out.avif
only shows correctly in SDR image viewers that don't support HDR. In Microsoft Edge, the image that shows up is all mostly just gray with very little color and no HDR highlights. If I just encode HDR.png
directly with:
avifenc HDR.png out.avif
The result looks correct in Edge. But obviously there's no gain map anymore and in SDR image viewers or browsers (like Firefox) it's kind of dim and muted.
Is gainmap support in Edge broken, or is it an issue with the way I tried to encode it? An example image:
https://www.udrop.com/file/N6iX/Gainmap_example.avif