google / libultrahdr

Ultra HDR is a true HDR image format, and is backcompatible. libultrahdr is the reference codec for the Ultra HDR format. The codecs that support the format can render the HDR intent of the image on HDR displays; other codecs can still decode and display the SDR intent of the image.
https://developer.android.com/guide/topics/media/platform/hdr-image-format
Apache License 2.0
142 stars 24 forks source link

Request: Decode support for images with Adobe gain map format #196

Closed gregbenz closed 1 month ago

gregbenz commented 1 month ago

It would be helpful to have support to decode images encoded with the Adobe gain map spec (images exported from Lightroom and Adobe Camera RAW).

If you attempt to decode such an image now, libultrahdr_app will throw "xml parse error, could not find attribute hdrgm:Version". That is confusing, as these image do include this XML tag.

Support for decoding is all that is needed, in order to support transcoding (such as for uploading to a website).

Note that support for iPhone (https://github.com/google/libultrahdr/issues/195) is more important based on probability of encountering such an image. There are likely considerably more iPhone images (as this is automatic and the sheer number of iPhones captures is enormous) than gain map exports from Adobe (which requires a knowledgeable user requesting HDR encoding for selected images and therefore is a smaller number of images). That said, the Adobe and Android specs are quite similar, so hopefully this is trivial to support the Adobe images.

ram-mohan commented 1 month ago

This is a duplicate of #116. The problem is while parsing the gainmap metadata, it sees that metadata contains, separate gainmap min, max, lambda for r, g and b. Currently the library handles same values for all channels. As a result parsing is stopped mid way and this manifests as "xml parse error, could not find attribute hdrgm:Version".

gregbenz commented 1 month ago

@ram-mohan Sorry I failed to remember that comment. Closing this duplicate.