Hi there.
I'm stuck with the creation of files with a wide dynamic range (Smart HDR?) as iPhone 12 and later creates. They look bright on the OLED screen. What I'm trying to do currently is to create a HEIF or JPEG image with an embedded auxiliary grayscale HDR Gain Map. I have a script in Swift. It works well because I can see that AuxiliaryImageType (for HEIF) or MPImage2 for (JPEG) tag but my file still looks dull and flat. I didn't find anything in the Documentation. What might be wrong?
I think I found the reason why the gain map isn't showing any effect:
There seem to be two private {MakerApple}
EXIF tags controlling the HDR effect.
The one @anteo83 mentioned (0x21
) seems to control the global boost to brightness. I guess via some kind of gamma curve tone mapping.
But there is also the 0x30
which controls how much the embedded gain map adds to the effect. It seems to range between 0.0
and 8.0
, with 0.0
having the biggest effect.
When 0x30
is present, 0x21
doesn't need to be present to show the effects of the gain map. They also seem to work in tandem, with 0x21
adding to the global value and 0x30
controlling local values via gain map.
There is some great fun to be had with this. Check out the attached image on your XDR or OLED device in Photos. 😁
Edit: I was trying to attach an example image here, but Forums seem to convert the image, losing the gain map in the process. You can find it here.