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
160 stars 28 forks source link

Request: Decode support for images with Apple gain map format #195

Open gregbenz opened 3 months ago

gregbenz commented 3 months ago

It would be helpful to have support to decode images captured with an iPhone, which includes JPG and HEIC images with the Apple gain map format. This would help to transcode images captured with an iPhone (such as for uploading to web services).

If you attempt to decode such an image now, libultrahdr_app will throw "xml parse error, could not find attribute hdrgm:Version".

Support for decoding is all that is needed. Output in the Android format (and ultimately with the ISO gain map spec when finalized) is sufficient.

gregbenz commented 3 months ago

https://developer.apple.com/documentation/appkit/images_and_pdf/applying_apple_hdr_effect_to_your_photos

xs1vr commented 3 months ago

👍🏻 , not only Apple but HEIC in general

for example S24U, FX7U, OP12 - all of them support Ultra HDR but as soon as you enable HEIC mode it's gone

I saw that the whole UHDR library is based around JPEG files and to be honest isn't that a bit stupid? I'd understand if it was Android 8-9 but Android 14 when most of the phones are shipping with HEIC files that actually save 2-3 times of the storage..?

Is this possible to be done?

ram-mohan commented 3 months ago

@xs1vr we are in the process of integrating hevc and av1 codecs and extending uhdr_codec_t of ultrahdr_api.h to include heic and avif. Inspite of lesser coding efficiency, jpeg is also useful as it has less cpu burden on embedded devices.