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

Support encoding linear half float images #279

Closed cgohlke closed 2 weeks ago

cgohlke commented 1 month ago

As mentioned in discussion #143 and issue #268, it would be nice to be able to encode linear half float (16-bit float) images.

Passing a raw image with img.fmt=UHDR_IMG_FMT_64bppRGBAHalfFloat, img.ct=UHDR_CT_LINEAR, and intent=UHDR_HDR_IMG to the uhdr_enc_set_raw_image function currently (version 1.1.1) fails with 'unsupported input pixel format for hdr intent 4, expects one of {UHDR_IMG_FMT_24bppYCbCrP010, UHDR_IMG_FMT_32bppRGBA1010102}'.

gregbenz commented 1 month ago

concur, this would be very helpful to have 16-bit linear half float RGB support

isenberg commented 1 month ago

Yes, would be good to have, but more for reading not writing.

I needed some format which can easily written by open source tools and used in my #292 RGB int 16+16+16, but RGBA float 16+16+16 or RGBA float 16+16+16+16 would also be fine for me.

Example to write it: magick infile.tif -depth 16 -define quantum:format=floating-point RGB:outfile.raw Or for 16+16+16+16 with alpha channel use RGBA:outfile.raw.

gregbenz commented 2 weeks ago

Thank you!