How can I incorporate HDR gain map from JPEG / HEIC? #3153
Replies: 3 comments 3 replies
-
Hi @AttilaTheFun, I think libvips can read gain maps out of HEIC images -- just set the |
Beta Was this translation helpful? Give feedback.
-
Hi @jcupitt ! This is one of the sample images provided with iOS simulators: As you can see in this screenshot, iOS recognizes it as an HDR image even though it's only 8-bit. |
Beta Was this translation helpful? Give feedback.
-
Initial support for HDR JPG with gain maps in libvips: #4645 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
The iPhone for many years has had a "Smart HDR" feature which created "fake" HDR images by storing a HDR gain map in the image metadata of HEIC and JPEG images.
There is some discussion here about how to read / write these gain maps on iOS here:
https://gist.github.com/kiding/fa4876ab4ddc797e3f18c71b3c2eeb3a
I would like to read out this gain map and incorporate it with the image data using vips to create a true HDR image, and then save it out to a format that natively supports it like AVIF.
It sounds pretty straightforward to extract the gain map as a bitmap, but I'm not sure the best way to apply this to the vips image.
From that thread users suggested using a YCbCr color space and then multiplying the Y components by the bitmap values. I'm not sure how I would do that with vips though.
Beta Was this translation helpful? Give feedback.
All reactions