-
Notifications
You must be signed in to change notification settings - Fork 27k
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 AVIF #20765
Add support for AVIF #20765
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This image was generated with - avif --input='./test/integration/image-optimizer/public/test.svg' --quality=90 --output='./test/integration/image-optimizer/public' --overwrite --verbose
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
The new Azure tests seem a little flakey, but otherwise all tests pass and this PR is ready for review. |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good 👍
Have you measured performance for converting to avif compared to webp?
If we are going to start using avif as the default, then we don't want to slow down image processing and lose the magic of this API.
Additionally, it looks like browsers don't support images smaller than 16x16: lovell/sharp#2289 (comment)
@styfle Thanks for reviewing the PR.
No; however, in my limited unscientific usage, there’s no discernible difference. That said, I’d be more than happy to run and publish some benchmarks here - are you looking for specific metrics? Just ops/second or CPU/memory usage too?
Actually, following the linked issues, it looks like they’ve all been fixed in sharp v0.27? |
This comment has been minimized.
This comment has been minimized.
Good question! Lets do both 🙂 I think the important thing to test is how it handles different sized source images as well as different source formats. |
This comment has been minimized.
This comment has been minimized.
@styfle I ran some benchmarks, and they're now available at https://github.com/paambaati/avif-benchmark#avif-vs-webp-conversion-benchmark tl;dr Benchmark summary Average calculated over 1000 runs.
|
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR and benchmarks!
We can use this to run some more benchmarks with real websites and see how it performs 👍
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
FYI you don't need to keep this PR merged with canary, we'll update and land it when we're ready! |
This PR will need a rework as |
@timneutkens I'll close this PR for now. I looked at the PR that removed The change delta is huge and I'm not even sure where to start. |
Can you re-open this PR because of adding Sharp support in v11.0.2-canary.20 #27346 ? |
@ArianHamdi BAM! #27432 |
Pass 2 of #20381 after I did a rebase (my bad, sorry).
This PR adds support for generating AVIF images, now that Sharp v0.27.0 supports the format.