Adding a gain map to HEIC images using macOS Sequoia?

Love_my_R5

Well-known member
Messages
196
Solutions
1
Reaction score
71
While viewing a JPEG-XL (iPhone 16 Pro lossless JPEG-XL) image on Sequoia (15.1.1), I used Preview to export the image to an HEIC format. To my surprise, the exported HEIC file is similar to an HDR PQ image but apparently uses gain mapping (see details in the Info window). Although it's difficult to tell from the PNG screenshot below, the dynamic range in the gain-mapped image is impressive especially when viewed on an HDR monitor.

Motivated by this example, I would like to find a way to convert other HEIC 10-bit HDR PQ images to take advantage of a gain-mapped approach. Can anyone suggest a tool (or tools) running on Sequoia that could be used to achieve this?

iPhone 16 Pro JPEG-XL image converted to HDR PQ with gain map. Photo credit: Alex Armitage

iPhone 16 Pro JPEG-XL image converted to HDR PQ with gain map. Photo credit: Alex Armitage
 
Motivated by this example, I would like to find a way to convert other HEIC 10-bit HDR PQ images to take advantage of a gain-mapped approach. Can anyone suggest a tool (or tools) running on Sequoia that could be used to achieve this?
As Siri would say, "I found this on the web."

https://gregbenzphotography.com/hdr-photos/apple-macos-ios-hdr-iso-gain-map-21496-1/

This makes a Sequoia upgrade desirable or mandatory. I hope Best Buy still has the Acer Nitro XV275K on sale for $499.
 
Last edited:
While viewing a JPEG-XL (iPhone 16 Pro lossless JPEG-XL) image on Sequoia (15.1.1), I used Preview to export the image to an HEIC format. To my surprise, the exported HEIC file is similar to an HDR PQ image but apparently uses gain mapping (see details in the Info window). Although it's difficult to tell from the PNG screenshot below, the dynamic range in the gain-mapped image is impressive especially when viewed on an HDR monitor.

Motivated by this example, I would like to find a way to convert other HEIC 10-bit HDR PQ images to take advantage of a gain-mapped approach. Can anyone suggest a tool (or tools) running on Sequoia that could be used to achieve this?

iPhone 16 Pro JPEG-XL image converted to HDR PQ with gain map. Photo credit: Alex Armitage

iPhone 16 Pro JPEG-XL image converted to HDR PQ with gain map. Photo credit: Alex Armitage
You don't mention the source of the other heic images but if they're from the iPhone they should have a gain map already.

Typically a gain mapped image has a base layer of the SDR version of the image together with a gain map which is used in conjunction with the base layer to produce the HDR image. The purpose of gain mapping is to allow display of the image properly on both an SDR display and an HDR display. With an SDR display, only the base layer is used.

If you are only interested in HDR then you don't need a gain map and just use the full HDR image (which won't display properly on an SDR display).

If you want to explore gain maps, Adobe have a free Gain Map demo App which you can find with a google search.

Dave
 
Last edited:
You don't mention the source of the other heic images but if they're from the iPhone they should have a gain map already.
Thanks for the explanation.

I'm using 10-bit HDR PQ HIF images taken with a EOS R5 (Mark I) camera. The iPhone 16 Pro JPEG-XL test images that I converted to HEIC were found online.
Typically a gain mapped image has a base layer of the SDR version of the image together with a gain map which is used in conjunction with the base layer to produce the HDR image. The purpose of gain mapping is to allow display of the image properly on both an SDR display and an HDR display. With an SDR display, only the base layer is used.

If you are only interested in HDR then you don't need a gain map and just use the full HDR image (which won't display properly on an SDR display).
As you describe, the Adaptive HDR standard seems to incorporate a SDR Base Layer plus a Gain Map whereas the ISO HDR doesn't. Both techniques show a similar HDR effect when viewed with an iPhone XS Max and both display a reasonable SDR image when the HDR display setting is disabled for my Mac monitor.
If you want to explore gain maps, Adobe have a free Gain Map demo App which you can find with a google search.
Thanks very much for the Adobe Gain Map demo app pointer. I find it a very helpful tool to get a better understanding of these techniques.

BTW, it turns out that it is possible to use macOS Sequoia (included apps) to add an Adaptive HDR Gain Map to HEIC (see https://discussions.apple.com/thread/255853768?sortBy=newest).

It's also very nice to see some of my HDR images to finally "pop". :-)
 

Keyboard shortcuts

Back
Top