You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Adding a gain map to HEIC images using macOS Sequoia?

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?


- Pie Lover

P.S. Photo credit: Alex Armitage


Mac mini (M2, 2023)

Posted on Nov 25, 2024 3:28 PM

Reply
6 replies

Nov 25, 2024 5:07 PM in response to etresoft

Thanks for your reply. I was hoping to find a single app or a step-by-step guide of some sort.


I prefer the HEIC format especially for 10-bit HDR images. Several R-series Canon cameras support HDR PQ (Perception Quantization transfer curve). I configure the camera to capture both (compressed) RAW and HEIC images. I typically upload only the HEIF (in fact, I deliberately lower the resolution from 45 to about 20 megapixels to reduce size) to the computer for editing and organizing using Photos. The higher resolution (and 12-bit) RAW files are still available on the camera should they be needed (e.g. a large print of a highly cropped image).


I would like to retain the HEIC format but be able to take advantage of gain maps similar to JPEG-XL. I am also hoping that Canon will support JEPG-XL at some point in the future.


- Pie Lover

Nov 26, 2024 9:21 AM in response to BlueberryLover

BlueberryLover wrote:

Here's a recent Substack article that discusses Gain Maps: Process Apple Gain Map: The ImageIO & the Core Image approaches.

Thanks! That post even has code examples. That might prove very useful for some apps I'm working on.


Interestingly, it mentions that " ...when editing images in the Photos app, Apple also preserves the Gain Map in the final images". I believe that the same is true from Preview exports.

Just be careful. Photos and especially Preview are consumer apps. They can have some nifty features here and there, but you have to be careful with them. Sometimes they have horrible bugs too. There was one recent post where someone discovered that Preview in Sequoia wasn't properly handling colourspaces. Then I remember a Sonoma bug where Preview couldn't properly handle greyscale images. Preview is one of those apps that Apple seems to rewrite every year. It might use something fancy from that year's WWDC. But it might also break something like rotated annotations. I would recommend a more professional tool like Pixelmator Pro instead. Apparently, Apple does too.


And as far as that goes, all of Apple is for consumer products. As I mentioned, HEIC is a lossy format. It was designed for the CCD in iPhones. I think that link you posted discovered that too. When they applied the gain map at full resolution, they saw artifacts.


Nov 26, 2024 1:31 PM in response to etresoft

Thanks for the advice. I had downloaded the trial version of Pixelmator Pro but, in the end, didn't install it.


Gimp has support for converting images to JPEG-XL but, when I tried it with HEIC HDR PQ, the source file colour space did not seem to be interpreted correctly.


I am realizing that HEIC is not a very popular format (except for iPhone perhaps). As you suggest, many photographers prefer editing directly using their camera's RAW format. For my part, I like shooting HEIF+RAW. This approach provides the option to edit the RAW file if needed. I also think that HDR PQ is a good way to get started with HDR. Unfortunately, the HDR PQ variant isn't well supported by macOS (consumer) apps.


I'm curious to see how Apple integrates Pixelator Pro. Perhaps they'll follow the Final Cut Pro model.


- Pie Lover

P.S. Here's a YouTube overview of JPEG-XL (What It Is And Why You Should Care)



Adding a gain map to HEIC images using macOS Sequoia?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.