-
Notifications
You must be signed in to change notification settings - Fork 802
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: avif support for Photon #35432
Comments
Related core enhancement:
Prior art for HEIC / HEIF images: #33494 |
cc'ing @flaviozavan for visibility; Is that something that's been on your radar for Photon? |
Photon supports AVIF as input, but is unable to output it. The code exists and works, but AVIF encoding is much slower than other formats. Therefore, we just convert it. If we were to enable encoding, we would need some async strategy, and a significant overhaul of how Photon works. This is not something we are currently looking into, but it's within the real of possibility if we can justify it. |
Thanks @flaviozavan. How does the CDN currently treat AVIF? (assuming the image is already converted to AVIF) Does it ignore it and the image is loaded locally? does it serve it as-is? does it convert it to other formats? Assuming the image is already AVIF, can it be resized by Photon? or is this too slow? I wonder if Photon can continue converting images only to webp, but if the source image is already AVIF will be able to transform it (resizing etc.) |
@haqadn, does it mean Jetpack now supports AVIF? |
@flaviozavan Sharing this ticket in core - https://core.trac.wordpress.org/ticket/61758#comment:12 - where we improved AVIF speed generation by ~20% (the default settings try too hard). Also important to make sure you are using the latest libavif encoder which has made significant strides in encoding speed. You may need to build your own imagick, but the results should be worth it, maybe allowing you to avoid the async strategy? Here are some stats you can compare by encoder version, the performance of the most recent encoder with (speed 6) seems quite good. Raising the speed to 7 would be even better. |
cc: @haqadn can we re-open this ticket as a tracking ticket for the addition of AVIF (serving) support for Photon, or would you prefer that I open a new ticket? |
cc: @yguyon |
Please find below some comparison data from September 2024. It is in line with AVIF 4:2:0 speed 7 (libavif+aom) being much closer to WebP (libwebp) than speed 5 for encoding time: Specifically, at web-range bpp, on 2-3 MP photos, assuming the default method 4 of libwebp is used, we roughly have for the same SSIMULACRA2 distortion: |
This came up on 9227005-zen |
Support References This comment is automatically generated. Please do not edit it.
|
Impacted plugin
Jetpack
What
Avif support for Photon
How
With the latest Edge version adding support for avif, all maintained browsers now support avif.
Work on adding avif support for WordPress core is made, and it might land with WordPress 6.5.
Is there a plan to add avif support for Photon?
Also, how currently Photon treats avif? Is it excluded from the CDN?
The text was updated successfully, but these errors were encountered: