Work with HDR
Asked on 06/16/2025
1 search
To work with HDR in your app, you can refer to the session titled "Use HDR for dynamic image experiences in your app" from WWDC 2024. This session covers various aspects of handling HDR images, including reading, editing, displaying, and writing HDR images. Here are some key points:
-
Reading HDR Images: You can use the
CIImage
optionexpand HDR
to support the Apple gain map image format and read adaptive HDR files. This allows you to load images as HDR for maximum fidelity. -
Editing HDR Images: There are different strategies for editing HDR images:
- HDR Strategy: Simplifies implementation by tracking only one image, but some edit operations may not support HDR.
- SDR and Gain Strategy: Preserves the original gain map, which is useful for tone mapping and backward compatibility.
- SDR and HDR Strategy: Allows tuning edits for both SDR and HDR, but adds complexity.
-
Displaying HDR Images: Tone mapping is crucial for displaying HDR images optimally. The session discusses using the
tonemap headroom
filter for adaptive HDR files. -
Saving HDR Images: The session provides guidance on saving HDR images, including using the
write heaf representation
method for adaptive HDR files.
For more detailed information, you can watch the session Use HDR for dynamic image experiences in your app starting from the "Read HDR images" chapter.
If you are interested in capturing HDR content, you might also want to check out the session "Capture HDR content with ScreenCaptureKit," which discusses capturing HDR streams and configuring them for different display types.

Use HDR for dynamic image experiences in your app
Discover how to read and write HDR images and process HDR content in your app. Explore the new supported HDR image formats and advanced methods for displaying HDR images. Find out how HDR content can coexist with your user interface — and what to watch out for when adding HDR image support to your app.

Capture HDR content with ScreenCaptureKit
Learn how to capture high dynamic colors using ScreenCaptureKit, and explore new features like HDR support, microphone capture, and straight-to-file recording.