jp.ptn Posted August 22, 2023 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. lepr, Aikinai, lizardpeter and 1 other 4 Quote
webdove Posted August 31, 2023 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
iGeo Posted October 18, 2024 Posted October 18, 2024 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
John15 Posted December 11, 2024 Posted December 11, 2024 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
BBG3 Posted January 12 Posted January 12 I need to export my work to HEIC and Avif. cje and lizardpeter 2 Quote Affinity Designer | Affinity Photo | Affinity Publisher V2.6.2 ▪️ Mac: 2021 M1 MacBook Pro 16", 32GB memory, macOS Sequoia 15.4 ▪️ iPad: iPad Pro, 12.9": iPadOS 16.7.10, Apple Pencil 1
Ldina Posted January 12 Posted January 12 A big +1. Gain maps saved inside HEIC, AVIF, JPEG-XL AND JPEG formats will be important going forward. With HDR close to becoming mainstream, we will need Affinity apps to be able to generate and write gain maps to these file formats, so our files can be properly viewed on both SDR and HDR systems. cje, lizardpeter and BBG3 3 Quote 2024 MacBook Pro M4 Max, 48GB, 1TB SSD, Sequoia OS, Affinity Photo/Designer/Publisher v1 & v2, Adobe CS6 Extended, LightRoom v6, Blender, InkScape, Dell 30" Monitor, Canon PRO-100 Printer, i1 Spectrophotometer, i1Publish, Wacom Intuos 4 PTK-640 graphics tablet, 2TB OWC SSD USB external hard drive.
John15 Posted January 12 Posted January 12 @BBG3 Is it an HDR image or an SDR image? If you want to export a normal SDR image, first export to PNG, then use a converter such as libavif or ImageMagick. For HDR, you need to export as a 32-bit PNG with PQ or HLG transfer function and use libavif for AVIF export, but the command line arguments are a bit complicated. BBG3 1 Quote
BBG3 Posted January 13 Posted January 13 Hi @John15. Thank you for sharing that! You are awesome. ❤️ I mostly need to export my work for web purposes. I got the Libavif from this link https://formulae.brew.sh/formula/libavif Quote Affinity Designer | Affinity Photo | Affinity Publisher V2.6.2 ▪️ Mac: 2021 M1 MacBook Pro 16", 32GB memory, macOS Sequoia 15.4 ▪️ iPad: iPad Pro, 12.9": iPadOS 16.7.10, Apple Pencil 1
lizardpeter Posted June 21 Posted June 21 On 1/12/2025 at 2:28 PM, Ldina said: A big +1. Gain maps saved inside HEIC, AVIF, JPEG-XL AND JPEG formats will be important going forward. With HDR close to becoming mainstream, we will need Affinity apps to be able to generate and write gain maps to these file formats, so our files can be properly viewed on both SDR and HDR systems. Exactly. I was surprised to learn that Affinity couldn't do this. I may have to switch back to Photoshop. Quote
Ldina Posted June 21 Posted June 21 37 minutes ago, lizardpeter said: Exactly. I was surprised to learn that Affinity couldn't do this. I may have to switch back to Photoshop. I recently discovered that Graphic Converter 12 (Mac only, I think) can export a 32-bit HDR PNG image created in Affinity to HEIC 10-bit and retain HDR capability on my MacBook Pro M4 running Sequoia. (Thanks, @Oufti). FWIW. That doesn't diminish the fact that Affinity needs to be able to export to AVIF, HEIC, JPEG-XL and JPEG file formats, including gain maps. That's the future. Oufti and lizardpeter 2 Quote 2024 MacBook Pro M4 Max, 48GB, 1TB SSD, Sequoia OS, Affinity Photo/Designer/Publisher v1 & v2, Adobe CS6 Extended, LightRoom v6, Blender, InkScape, Dell 30" Monitor, Canon PRO-100 Printer, i1 Spectrophotometer, i1Publish, Wacom Intuos 4 PTK-640 graphics tablet, 2TB OWC SSD USB external hard drive.
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.