English | 中文
A Python tool to convert Apple HDR HEIC files to EXR format while preserving HDR information. This tool extracts gain maps from Apple's proprietary HDR format and synthesizes them into standard HDR EXR files.
macOS Tahoe introduced HDR screenshot support, but the generated HEIC files with HDR information can only be viewed on Apple devices. This tool converts Apple HDR format to standard EXR format for easy sharing and editing in software like Adobe Photoshop, Camera Raw, and Affinity Photo, etc.
Important
To ensure full HDR information is preserved, you must first export your photo from the Mac Photos app as a JPEG, and in the export dialog, set the "Color Profile" to Original. Only this export method will include the Apple HDR gain map in the JPEG file. Directly using HEIC or other export options will not preserve the HDR gain map.(Suggestions for easier methods are welcome!)
Install dependencies:
pip install -r requirements.txt
Install ExifTool:
- macOS:
brew install exiftool
- Ubuntu/Debian:
sudo apt-get install exiftool
- Windows: Download from ExifTool website
python apple_hdr_converter.py input.jpeg
python heic_converter.py input.heic output.exr
--output
,-o
: Specify output EXR file path (default: input_name.exr)--tone-mapping
: Apply tone mapping to reduce brightness for SDR displays
# Basic conversion (outputs photo.exr)
python apple_hdr_converter.py photo.jpg
# Specify custom output path
python apple_hdr_converter.py photo.jpg --output my_hdr.exr
# With tone mapping
python apple_hdr_converter.py photo.jpg --tone-mapping
(All Python code in this repository was generated by Cursor)