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

Enhancement: consider AVIF HDR support #247

Open
jcayzac opened this issue Aug 31, 2024 · 6 comments
Open

Enhancement: consider AVIF HDR support #247

jcayzac opened this issue Aug 31, 2024 · 6 comments

Comments

@jcayzac
Copy link

jcayzac commented Aug 31, 2024

Feature request

What are you trying to achieve?

Transform HDR AVIF images.

With both the AVIF format and HDR displays now being pretty much baseline, maybe it's time to start shipping prebuilt binaries that do support that?

When you searched for similar feature requests, what did you find that might be related?

I found an issue with a similar title, which was closed as "Completed" although Sharp still doesn't have HDR support.

What would you expect the API to look like?

No change in API, but using bitdepth: 10 in AvifOptions doesn't trigger an Expected 8 for bitdepth when using prebuilt binaries but received 10 of type number error. This means building libvips with HDR support.

What alternatives have you considered?

I think I have to look into trying to build binaries from source. Given I'm building my websites on the cloud (cloudflare pages) it's going to take some time to vendor the right binaries I guess.

Please provide sample image(s) that help explain this feature

https://github.com/AOMediaCodec/av1-avif/tree/master/testFiles/Netflix

@jcayzac
Copy link
Author

jcayzac commented Aug 31, 2024

Issue lovell/sharp#4031 was also closed, despite no working solution.

@lovell
Copy link
Owner

lovell commented Aug 31, 2024

I think I have to look into trying to build binaries from source.

Yes, sharp supports a globally-installed libvips compiled with support for a combination of libheif and HDR-enabled libaom, which is the correct approach should the prebuilt binaries not meet your needs.

@jcayzac
Copy link
Author

jcayzac commented Aug 31, 2024

@lovell So, I guess my feature request would be to have the prebuilt binaries support HDR? It's probably going to be raised more and more often…

@lovell
Copy link
Owner

lovell commented Sep 1, 2024

The only decent HDR displays I've seen are based on OLED tech, which provides the required brightness range. Mid to high end phones with smaller displays are increasingly using this, but larger panels are still relatively expensive. As you say, at some point this will change, but we're not there yet.

Perhaps you could investigate to see if the P3 ICC profile provides a more appropriate gamut than sRGB for the sort of devices your scenario needs to support?

@jcayzac
Copy link
Author

jcayzac commented Sep 5, 2024

My mistake. I thought the baseline of desktop displays on sale now supporting HDR10 meant usage was growing. It seems significant enough for all major browsers to already support HDR AVIF so it's now a baseline web capability according to MDN.

@lovell lovell transferred this issue from lovell/sharp Sep 5, 2024
@lovell
Copy link
Owner

lovell commented Sep 5, 2024

I've moved this issue to the sharp-libvips repo, which is home of the scripts that create the prebuilt libvips binaries and where this future possible enhancement would need to be tackled first.

The discussion at Fyrd/caniuse#6504 provides a good background on how support for this is slowly making its way (e.g. behind flags and with limitations) into web browsers. We should wait for the caniuse issue to be implemented/closed before continuing here.

Another thing to think about is that previous testing suggested HDR support in libaom increases its binary size by at least 2MB, so this needs to be checked/considered/minimised where possible.

@lovell lovell changed the title AVIF HDR support Enhancement: consider AVIF HDR support Sep 5, 2024
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

2 participants