How do I generate used files from a photo
Asked on 2024-07-30
1 search
To generate used files from a photo, you can follow the steps outlined in the session "Use HDR for dynamic image experiences in your app" from WWDC 2024. Here are the relevant steps:
- Call
cgimagedestination addimage: Start by adding an SDR (Standard Dynamic Range) CG image with an SDR CG color space. - Create a dictionary for the gain map: This dictionary should contain the actual pixel data of the gain map, a subdictionary that describes the height, width, and format of that data, and CG image metadata that describes how the pixel data should be converted to linear gain values.
- Add auxiliary data info: Use
cgimagedestination add auxiliarydatainfoand pass the newKCG image auxiliarydata type ISO gainmap keyalong with the info dictionary.
For more detailed information, you can refer to the chapter on "Saving images" in the session Use HDR for dynamic image experiences in your app (31:37).
Relevant Sessions
- Use HDR for dynamic image experiences in your app
- Analyze heap memory
- Discover Swift enhancements in the Vision framework
If you need more specific details or have another question, feel free to ask!

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.

Discover area mode for Object Capture
Discover how area mode for Object Capture enables new 3D capture possibilities on iOS by extending the functionality of Object Capture to support capture and reconstruction of an area. Learn how to optimize the quality of iOS captures using the new macOS sample app for reconstruction, and find out how to view the final results with Quick Look on Apple Vision Pro, iPhone, iPad or Mac. Learn about improvements to 3D reconstruction, including a new API that allows you to create your own custom image processing pipelines.

Keep colors consistent across captures
Meet the Constant Color API and find out how it can help people use your app to determine precise colors. You’ll learn how to adopt the API, explore its scientific and marketing potential, and discover best practices for making the most of the technology.
