darktable icon indicating copy to clipboard operation
darktable copied to clipboard

Support HDR gain maps

Open kmilos opened this issue 1 year ago • 13 comments

The storage of SDR image + gain map is currently being standardized as ISO/CD 21496-1.

This is already used by Adobe in "enhanced" DNGs, in Google's UltraHDR JPEGs (see also libultrahdr), and by Apple in HDR iPhone HEICs.

libavif and libjxl also added preliminary support for it.

Ideally, both import and export should be supported.

This approach seems to be gathering more momentum in the market compared to e.g. "true" 10-bit HDR only containers.

Related:

https://gregbenzphotography.com/hdr-photos/jpg-hdr-gain-maps-in-adobe-camera-raw/

https://www.reddit.com/r/DarkTable/comments/1f421d0/how_to_export_an_hdr_image_taken_on_iphone/

kmilos avatar Aug 30 '24 08:08 kmilos

There is a PR for a lua script that can export UltraHDR, https://github.com/darktable-org/lua-scripts/pull/502.

The PR also includes instructions on how to create the gainmap.

wpferguson avatar Aug 30 '24 14:08 wpferguson

darktable already has some support for gain maps on import (mostly in DNGs, e.g. #10289)

ralfbrown avatar Aug 30 '24 16:08 ralfbrown

@ralfbrown Not the same thing, that one is for flat field correction in raw domain.

kmilos avatar Aug 30 '24 19:08 kmilos

Some relevant discussion on pixls.us (where the lua plugin came from) https://discuss.pixls.us/t/manual-creation-of-ultrahdr-images/45004

JLTastet avatar Sep 07 '24 17:09 JLTastet

This issue has been marked as stale due to inactivity for the last 60 days. It will be automatically closed in 300 days if no update occurs. Please check if the master branch has fixed it and report again or close the issue.

github-actions[bot] avatar Nov 07 '24 00:11 github-actions[bot]

Would make darktable way mure usefull with this. My phone can export in the ultraHDR format and it is huge bump in aestetic quality. Now I have to export to exr and then use libultrahdr (which does not work becouse libultrahdr expects half float rgba not half float rgb). Reslults would be better if I had not need to go throught intermidiate formats.

mcDandy avatar Nov 26 '24 08:11 mcDandy

+1

kanyck avatar Dec 26 '24 18:12 kanyck

This issue has been marked as stale due to inactivity for the last 60 days. It will be automatically closed in 300 days if no update occurs. Please check if the master branch has fixed it and report again or close the issue.

github-actions[bot] avatar Feb 25 '25 00:02 github-actions[bot]

There is a PR for a lua script that can export UltraHDR, darktable-org/lua-scripts#502.

The PR also includes instructions on how to create the gainmap.

Thanks for sharing this. May I know if this UltraHDR script uses monochrome or color gain map?

And what is the plan for darktable going forward? Will it include a color or monochrome gain map?

AndrewKeYanzhe avatar Oct 14 '25 08:10 AndrewKeYanzhe

Thanks for sharing this. May I know if this UltraHDR script uses monochrome or color gain map?

It depends on the mode, but for the most common cases it uses a single channel gainmap indeed. It's simple to fix though, just remove -M 0 from the ultrahdr_app calls e.g. here: https://github.com/darktable-org/lua-scripts/blob/master/contrib/ultrahdr.lua#L675, or send a PR to do so.

koto avatar Oct 14 '25 08:10 koto

This issue has been marked as stale due to inactivity for the last 60 days. It will be automatically closed in 300 days if no update occurs. Please check if the master branch has fixed it and report again or close the issue.

github-actions[bot] avatar Dec 14 '25 00:12 github-actions[bot]

Not stale, it has just been mentioned.

darkbasic avatar Dec 15 '25 09:12 darkbasic

Bot broken?

mcDandy avatar Dec 15 '25 14:12 mcDandy