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:

  1. Reading HDR Images: You can use the CIImage option expand 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.

  2. 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.
  3. Displaying HDR Images: Tone mapping is crucial for displaying HDR images optimally. The session discusses using the tonemap headroom filter for adaptive HDR files.

  4. 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.