jp.ptn Posted August 22, 2023 Share Posted August 22, 2023 I have an iPhone 13, which can take HDR photos but not in RAW format. When I use the Panorama function in the built-in Camera app, the result is SDR and often distorted, so on my latest holidays I thought I'd take many photos planning to stitch them together afterwards somehow. I was happy to find AP has such a feature, and was quite happy with the results. That is, until I imported the newly made panorama to my Photos app. It was SDR, which is IMO a significant reduction in quality and prevents me from replacing the multiple shots with the single panorama I wanted in the first place. Not knowing what the issue was, I posted on these forums trying to find out what was going on, if I was doing something wrong. After some help from your staff and going down a rabbit hole that took me to discussions on Github and tools made with Python, I found out that 1) .HEIC files do have a HDR gain map encoded as an auxiliary image, and 2) an EXIF tag needs to be set for the gain map to display properly on Photos. And even though all of this was based on unofficial data, it seems that Apple is opening up on how to handle such HDR files, as shown in a WWDC video from this year. Setting the EXIF tag is something I can rely on 3rd-party tools for, but there's nothing I can do to about the HDR gain maps outside AP; it has to support .HEIC HDR gain maps in order to make HDR panoramas from such photos. That feature alone would make AP a front-row companion to Photos to me. Hope such support someday finds its way to AP. Aikinai and lepr 2 Quote Link to comment Share on other sites More sharing options...
webdove Posted August 31, 2023 Share Posted August 31, 2023 I second this request. The documentation says "HEIF open 4 Includes depth map, loaded as second layer. Depth maps are upsampled." it should also say "HEIF open does not support the iphone gain maps that render the image in HDR" so we would all understand that for the moment the iphone HDR heic images cannot be properly opened with Afinity Photo 2. Aikinai 1 Quote Link to comment Share on other sites More sharing options...
iGeo Posted October 18 Share Posted October 18 Hey OP, Can you share some more details about the Exif tag that needs to be set for hdr? And how to go about it? Thank you! Quote Link to comment Share on other sites More sharing options...
John15 Posted 2 hours ago Share Posted 2 hours ago On 10/18/2024 at 10:29 AM, iGeo said: Can you share some more details about the Exif tag that needs to be set for hdr? And how to go about it? Apple Photos in iPhone supports HDR without HDR gain maps as well. For example, HEIC in 10-bit or AVIF in 10- or 12-bit. However if you already have a (inverse) tone-mapped HDR image as: an SDR image and a corresponding single-channel HDR gain map, you might be able to create an HEIC file that could work with Apple Photos by reverse engineering this article (roughly following these steps, which I haven't tried myself): Create a new "gain map" with appropriately chosen values for "maker33" and "maker48" that makes the script in the article above produce the original HDR gain map. Create a new HEIF file with the SDR image as the primary image and the above gain map (in an 8-bit greyscale form with half the resolution as the primary SDR image) stored as an auxiliary image with aux-type "urn:com:apple:photo:2020:aux:hdrgainmap" (https://github.com/strukturag/libheif can do that) Using exiftool, set the following tags: Store the chosen "maker33" and "maker48" values as EXIF tags "Apple:HDRHeadroom" and "Apple:HDRGain" respectively (see https://exiftool.org/TagNames/Apple.html) Set "XMP:HDRGainMapVersion" to 65536 (see https://exiftool.org/TagNames/XMP.html#HDRGainMap) (hopefully not necessary 🤞) Set "QuickTime:AuxiliaryImageType" to "urn:com:apple:photo:2020:aux:hdrgainmap" (see https://exiftool.org/TagNames/QuickTime.html#ItemPropCont, this tag is not writable; so this step is not actually possible) Apple doesn't publish documentation to describe how an HEIC file with an HDR gain map can be created in a way that Apple supports it. So the above steps are just my guesses, and is definitely not reliable. (Plug: If you want to convert an HDR HEIC file from your iPhone to a "normal" HDR file without gain maps, that could be read by AP, you can try this Python package that I made: https://github.com/johncf/apple-hdr-heic) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.