Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Ultra HDR #8036

Open
cmahnke opened this issue May 1, 2024 · 3 comments
Open

Add support for Ultra HDR #8036

cmahnke opened this issue May 1, 2024 · 3 comments

Comments

@cmahnke
Copy link

cmahnke commented May 1, 2024

I would like to suggest to add the addition of the Ultra HDR format as a new way to read and write HDR images.

From a technical point of view it's similar to the MPO format, that it's a JPEG image, containing an additional data stream. In case of Ultra HDR this data stream is a gainmap.

This way a reader implementation not aware of Ultra HDR only sees the SDR JPEG image.

There are currently several open enhancement requests to add the format to various well (and less well known) libraries and tools:

There is also a library

@radarhere
Copy link
Member

Are you aware of any small images (under 500kb) images that could be added to our test suite and distributed under the Pillow license?

@cmahnke
Copy link
Author

cmahnke commented Jun 25, 2024

@radarhere: It's possible to generate one using libultrahdr. What are the requirements, does it have to be somehow very colorful or something like that?

If it needs to be beautiful @gregbenz might be able to help out.

@gregbenz
Copy link

@cmahnke Happy to answer any questions here. I'm not clear what the intended use of this library/feature is. I'd be happy to consider any requests for a few sample images, though for testing code I would recommend creating dedicated test images to most easily and reliably validate results.

Is the goal here to alter the image (resize, compress, crop, rotate, flip), convert to another image format as is, filter, or to render for display? The first couple are well supported by libultrahdr and I'm assuming that's probably the intent here.

If you start changing image content (such as filtering), you'll have to get more involved (things can get pretty tricky and some edits would only be suitable if you're willing to render to SDR / HDR and give up the adaptive nature of a gain map). And actual display (such as in a browser) involves linear interpolation between the base SDR and full HDR rendering as appropriate for the encoding of the image relative to the display's available HDR headroom.

I have seen numerous issues with various efforts to render or transcode gain maps (improper alteration of metadata, gain map artifacts, scaling of the images before merge causing edge artiffacts, etc). If libultrahdr meets your needs, I would recommend leveraging that rather than trying to build the capability from scratch. It is supported by Google (who has been very supportive of gain maps in both Chrome and Android), well maintained, and aligned with efforts towards an official ISO standard for common file formats (supports JPG now, but the project team has mentioned AVIF / HEIF on the roadmap).

For anyone who has questions on gain maps, I have lots of information at https://gregbenzphotography.com/hdr-photos/jpg-hdr-gain-maps-in-adobe-camera-raw/ and https://gregbenzphotography.com/hdr/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants