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

Support outputting higher bit-depth AVIF #4031

Closed
mertalev opened this issue Mar 16, 2024 · 1 comment · Fixed by #4036
Closed

Support outputting higher bit-depth AVIF #4031

mertalev opened this issue Mar 16, 2024 · 1 comment · Fixed by #4036

Comments

@mertalev
Copy link
Contributor

Feature request

What are you trying to achieve?

As a photo library, we convert and sanitize images to WebP and JPEG for performance. But these formats can compromise on color fidelity since they're limited to 8 bits. As a result, it's not uncommon for users to want to avoid using the converted images altogether.

AVIF, unlike these formats, allows for higher bit depths of 10 and 12. Combined with its higher compression, this helps bridge the gap between formats like WebP and the often very large originals.

AVIF also supports HDR, but this is out of scope for this request since it likely requires upstream changes in libvips.

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

#3358 changed AVIF to always have 8-bit output for compatibility with AOM builds. Defaulting to 8 bits would still maintain this behavior, but allow for higher bit depths when the API consumer knows their build supports this.

What would you expect the API to look like?

Similar to the TIFF output options, a bitdepth setting that defaults to 8 and can be configured to 10 or 12.

What alternatives have you considered?

P3 helps, but ideally it'd be complementary to this rather than an alternative.

Ultra HDR is a way to embed gain maps into JPEG. However, it's still limited in color fidelity and doesn't benefit from AVIF's better compression. libvips also doesn't currently support Ultra HDR, so it'd be quite a bit more work.

@mertalev
Copy link
Contributor Author

Oh, I just saw that libvips already supports HDR for AVIF and even has the same bitdepth parameter with options of 8, 10 or 12. That's exciting!

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

Successfully merging a pull request may close this issue.

1 participant