One of the greatest innovations to help improve the quality of HDR (“high dynamic range”) images is a technology known as a “gain map“. Their value is often misunderstood or overlooked, so in this article we’ll dive into what they are and why they are vastly better than the alternative.
TLDR summary: Always share HDR images with a gain map. This is easy to do and ensures that viewers who don’t have the same great screen as you will still see a beautiful image. Avoid sharing AVIF or JXL until gain maps are well supported in those formats. JPG gain maps offer excellent quality and are the best option in 2025.
Backstory: what happens when you share HDR images?
When sharing photos online, there has always been some variability in the experience (even for SDR or “standard dynamic range” images). The viewer may have different brightness, black point, wide gamut support, or differences in how their software renders the image. There are ways to manage it, but it’s just a reality.
In the world of HDR photography, the differences in experience are a bit bigger. This is a huge step forward in image quality through new technology, so naturally older SDR monitors simply cannot show an image as HDR. The HDR images are simply adapted to the capabilities of an SDR display (rather than clipping, which would obviously be bad). The result is that the best possible image is shown, based on the capabilities of the display. When done properly, the worse case scenario is the same SDR image you would have shared, but a vastly better HDR experience where possible.
HDR images may also be adapted to less-capable HDR displays. The number of stops of additional dynamic range a monitor offers over SDR is known as “HDR headroom”. A great HDR display (such as those on a modern MacBook Pro) offers up to 4 stops of dynamic range. A less capable display might offer only 1 or 2 stops. An SDR-only display would have 0 stops of headroom. These capabilities are dynamic. When you make the display brighter, the headroom available for HDR decreases. So an HDR image will often need adaptation even on an HDR display.
While the gaps will shrink over time, we will probably never avoid the need for adaptation. This is particularly common for mobile devices, which will have reduced headroom when used in bright ambient light (or in low power mode). And we are also likely to see the best displays continue to improve for at least the next decade. The current best HDR displays support 1,600 nits of peak brightness. However, the full HDR standard allows up to 10,000 nits and there are already multiple TVs which support this level of capability. We won’t see that in computers anytime soon, but 5-6 stops of HDR headroom may be in our future (6 is likely the upper limit for benefit).
To sum things up, your audience will either see:
- Your HDR image as you edited (if they have enough HDR headroom)
- An adapted version of your image (the best possible version for their SDR or limited HDR display)
HDR adaptation: gain maps vs tone mapping
In scenario #1, your HDR image is shown as you edited it. Any valid HDR encoding will support that. However, it is easy to take for granted that scenario #2 applies on displays less capable than yours (or when used in brighter ambient light, etc).
In scenario #2, there are various ways the image can be adapted. There are two options today:
- Let the computer automatically generate the SDR version of the image. This is known as “tone mapping“.
- The artist can provide the SDR version of the image. This is done with a “gain map“. You can think of this like embedding both the SDR and HDR version in the same file (in reality, one version is stored normally along with a map to derive the other – this helps minimize file size)
If you share an image without a gain map, then tone mapping is used. It’s just the default when you don’t provide a better way to adapt the image.
You can create a gain map using Web Sharp Pro v6, which gives you 100% control over the base SDR image (as well enabling you to share optimal HDR images on Instagram and Threads). You can also create a gain map using Lightroom or Adobe Camera RAW, which offer some artistic control over the SDR. Photomator also supports gain map exports, but offers no artistic control over the base SDR (and is therefore the same as letting MacOS tone map the image).
Rollover each to compare different versions.
Your HDR headroom and browser will affect rendering for the HDR images (#1 and #2).
Only the gain map (#1) is able to achieve a perfect match to both my original HDR and SDR edits (as created in Photoshop).
The HDR AVIF (#2) will appear close when viewed with 3+ stops of HDR headroom, but shows a minor color shift in the sky in Chrome. When it is viewed on a less capable display, it will degrade significantly (as shown in the SDR screen captures in #5-7)
#3 is a direct export of my SDR edit (for reference to show the version I intended to share). The remaining images are screenshots from a browser showing one of the above HDR images on an SDR display (text changed to label the image).
The gain map (#4) is a perfect match to the desired SDR result. The tone map versions based on the simple HDR AVIF (#5-7) vary by browser and all are significantly degraded from the desired SDR result.
Tone mapping has several downsides:
- The SDR experience is almost always visibly inferior to the results using a gain map created by a skilled photographer.
- An HDR-only image offers no creative control over how the image is adapted to less capable displays.
- Compare #3 (a direct export of my SDR image for reference) with #4-7. The gain map is the only version that looks the way I intended.
- HDR eliminates many of the creative tradeoffs affecting SDR. The optimal edit often involves very specific local changes that a global tone mapper will not address.
- For example, an SDR edit might show water in the foreground nearly as bright as the sunset sky (simply because we need to see water detail and the sky can’t be too bright if we wish to retain color in SDR). But in HDR, we can properly show the sky as brighter than the water. There is no global relationship between the SDR and HDR pixels, it depends on the image content.
- An AI-based tone mapper might help close the gap, but that only further exacerbate the next concern (variability from one browser to the next).
- Moderate HDR displays also degrade
- Any HDR display with less than the full headroom will use some tone mapping. The full HDR encoding above requires 3 stops of headroom. If your HDR display only supports 2 stops, you will see that the HDR AVIF (#2) is already significant degraded compared to the gain map (#1). The clouds have better detail/color and the water looks better.
- So the SDR tone map examples are the worst case, but a significant number of HDR displays would show a loss of quality as well.
- There is no standard!
- Compare versions #5-6 above. Chrome and Safari do not match.
- Every browser does it differently and is subject to change over time (Safari v17 was different than v18, next year might be something else, etc).
- Chrome (Edge/Brave/Opera) have the best tone mapping. It may be acceptable for some uses, but is still often inferior to a gain map.
- Safari 18 introduced updated tone mapping. It is not nearly as good as Chrome, but is much closer than v17.
- Safari 17 added tone mapping, but the results are truly awful.
- These results are subject to change over time (and they have changed many times in the past couple years).
- Other software (such as the Windows File Explorer, MacOS Finder, etc) may all use their own versions of tone mapping, or none at all.
- There appear to be no serious efforts to standardize tone mapping for HDR photos.
- Lack of support on old browsers. Tone mapping may not be supported, resulting in images that fail to render (or show as nearly black).
- The current version of FireFox will show HDR AVIF as a very dark image.
- Many older browsers are still in use and will simply refuse to show an HDR-only image.
- These issues apply to about 5% of browsers in early 2025. In time, these browsers will be updated/replaced to something which at least supports tone mapping.
- It creates more disparity between the printed and HDR version of the same image. Many photographers are concerned that the HDR image feels consistent with the print. This is easily achievable with a gain map, but not with tone mapping.
Gain maps offer several advantages:
- Artists can create a much higher quality SDR rendition for less capable displays (including limited HDR displays).
- It is possible to have 100% creative control of the image on any display, rather than only for the most capable displays (which are not the most common).
- The base SDR image is consistent with any print and can be printed. This makes the format vastly more attractive to the most skilled content creators.
- Renders consistently across browsers.
- Widely supported under an ISO standard.
What are the downsides to using a gain map?:
- There’s really only one: a gain map will increase file size by 15-30% (30% is typical for high quality). It is nowhere near doubling because a gain map uses a very creative approach to derive one version of the image from the other (rather than truly embedding two images in the same file).
- There are a few niche scenarios today where a piece of software might support HDR encoding but not a gain map (which would show the SDR version). This is very limited and quickly moving towards being a non-issue. Software supporting HDR image formats is generally adding gain map support, and we will soon be encoding gain maps in formats such as AVIF or HEIC (which can encode the base image as an HDR and the map is used to generate the SDR).
There are many misperceptions gain maps, because understanding them requires a solid understanding of both the art and software development. Here are a few key points to know about gain maps:
- Gain maps are not limited to JPG (or just intended for 8-bit formats).
- There are already implementations or proposals to use gain maps with HEIC, AVIF, JXL, PNG, TIF, and DNG.
- A JPG gain map is not an 8-bit HDR:
- A gain map is two images embedded in the same file (ie two 8-bit images when using JPG).
- That means an HDR JPG is actually based on 16-its of data (though the quality is not directly comparable to a 16-bit native format, there is more than enough data to avoid quantization / banding concerns when the image is properly encoded).
- Gain maps are NOT a “hack” to provide HDR in an 8-bit format, they are also critical to quality at much higher bit depths
- It is true that gain maps help overcome banding issues when encoding HDR in a JPG, but that they serve a much more important role.
- Higher bit depths do not help your HDR image adapt to an SDR display.
- The key reason to use JPG gain maps today is because they are 100% safe (even if you have a monitor and browser from 1990s, you’ll still see a great SDR image).
- Newer formats like AVIF / HEIC / JXL will be preferable to JPG – but only once we can safely use them with gain maps.
- That will offer smaller file sizes (typically 30% smaller) and even higher image quality (less risk of banding, less visible artifacts).
- SDR AVIF is already well supported, so AVIF with base image encoded as SDR is the most likely next major format (and likely to be a great option in 2026).
- Longer term, encoding a format like AVIF with a base HDR image will likely be the optimal choice. The base image is always shown at full quality, and you can therefore more aggressively compress a gain map with a base HDR image (because loss of quality is less of a concern in the less important SDR rendering). In the long run, these formats should allow high quality HDR gain maps which are smaller than the SDR-only JPGs we share today (though SDR will of course get much smaller with these formats as well).
- In some cases, sharing a simple HDR image will be transcoded (converted) to a gain map for you. This eliminates browser variability, but the results are almost universally terrible. Do not let a computer create your art, this is hardly better than automatic tone mapping. See: great HDR requires a great SDR in the gain map.
- It is important that transcoding software support both gain maps and high bit depth formats (such as AVIF). Both approaches will be widely used (ideally together), and therefore should be supported to ensure the output is comparable to the source.
Are there any alternatives?: ICC tone maps
Not every image is needs maximum quality. This creates a scenario where neither of the above approaches is ideal. The benefit of gain maps is lower and so the file size is therefore more of a concern. At the same time, browser variability in tone mapping is still a concern. And that’s why there are ongoing efforts to create a third option: ICC tone maps.
There are ongoing efforts to create a standardized way to embed a tone map into an image using an ICC profile with a LUT (lookup table). This does add to file size, but less than a gain map. Storing the tone map into a profile has a few benefits. First, it can eliminate browser by browser variability (at least once widely supported). And second, it allows for the tone mapping to be more customized to a specific image. For example, your phone might analyze the image or consider your use of portrait mode to pick the best ICC tone map to embed in the image.
This is an attractive option for mobile capture and sharing, where images are rarely edited by humans and file size is a frequent concern for bandwidth and power on a phone. It is unlikely to be a suitable replacement for gain maps for skilled artists editing their images. And it would not support the potential for better automated approaches where an AI might create the SDR rendition of a gain map.
Conclusions: gain maps vs tone mapping
HDR images must be adapted to less capable displays. Even as we move towards a future when all displays are updated to HDR, we will still have situations where some are less capable and require adaption. This is a long term concern, but is easily managed.
The key points to remember are:
- Gain maps offer superior image quality over tone mapping on most displays (anything less than the most capable HDR displays under optimal conditions).
- It is easy to create gain maps through Web Sharp Pro (which supports Photoshop) and Lightroom.
- Avoid sharing JXL or AVIF on the web until gain maps are well supported (they’ll be great later). JPG gain maps work very well and are the ideal format to use in 2025.
- ICC tone maps may be a good solution for automatically derived images (such as direct sharing of smart phone photos) to avoid browser variability, while minimizing file size impact.
- Tone maps offer the lowest quality for display on anything less that premium HDR displays, but may be the best choice when file size is much more important than image quality.