chemharuka / PQ_HDR_to_Gain_Map_HDR

A tool to convert HDR file to Adaptive HDR (Gain Map / ISO HDR) in HEIC
15 stars 0 forks source link

Convert HDR files to Gain Map HDR

A macOS tool for converting HDR files to Adaptive HDR (Gain Map / ISO HDR)

Include:

  1. PQHDRtoGMHDR, which convert png, tiff etc. HDR file (in PQ HDR / HLG HDR) to Adaptive HDR (gain map heic file). The program will read a image as both SDR and HDR image, then calculate difference between two images as gain map.
  2. heic_hdr.py, a ChatGPT generated python script to convert all TIFF file to HEIC.

Usage

Convert any HDR to ISO_HDR.heic by PQHDRtoGMHDR:

./PQHDRtoGMHDR $file_dir $folder_dir

Batch convert all tiff file in a folder by heic_hdr.py:

  1. Download all files in a folder:

git clone https://github.com/chemharuka/PQ_HDR_to_Gain_Map_HDR.git

cd PQ_HDR_to_Gain_Map_HDR

chmod 711 ./PQHDRtoGMHDR

  1. run heic_hdr.py (default run with 8 threads, change it accroding to your chip's big core.)

python3 ./heic_hdr.py $folder_for_convert

You may need to change DIR of PQHDRtoGMHDR in heic_hdr.py before running. (in line44)

Sample

sample 1: DJI_1_0616_D

sample 2: DJI_1_0226_D

sample 3: DJI_1_0927_D

Note

FIXED: It's better to limit PQ HDR range in +2 eV, to avoid losing hightlight details.

FIXED: HDR headroom was limited to +2 eV, might improve in future.

Not support UltraHDR.