craft-imageoptimize
craft-imageoptimize copied to clipboard
AVIF support
It would be nice to have AVIF support in Image Optimize.
So I did look into adding support for AVIF -- I think technically, you could add support for it right now if you wanted to, you'd just need to configure another image variant creator.
The issue is that the tooling around AVIF isn't that great right now. You either need to download a raw binary, or you need to install the Go runtime, and some other server-side setup that's a bit messy at the moment.
I'm very likely to support this soon-ish anyway, but keep in mind that the encoding time for AVIF images is also quite long.
Hey Andrew Thanks for the response. It's true the technology has to mature a bit more. And browser support has to grow too. But nice to have it on the horizon.
I'm going to keep this open if you don't mind... I do plan to do it!
I know we have talked this over too @khalwat - Just read this over at Smashing Magazine which might provide more insight on AVIF encoding improvements.
Since Jan 1st 2021, AVIF encoding had a ~47% improvement in transcode time (this is speed 6, the current default for libavif) and across the calendar year a 73% improvement. Since July, there’s also been a 72% improvement in transcode times at speed 9 (on-the-fly-encoding).
Yeah the tooling is definitely getting there! One previously rather large downside is what it took to install the needed packages, but I'll see if that has improved as well.
Was wondering, is there any update on this? Not sure if it's easier atm to generate avif?
Is there any progress on this, with libavif being past 1.0.0?
So technically ImageOptimize has always supported avif, or any other format you might want, via the config:
'imageVariantCreators' => [
// webp variant creator
'cwebp' => [
'commandPath' => '/usr/bin/cwebp',
'commandOptions' => '',
'commandOutputFileFlag' => '-o',
'commandQualityFlag' => '-q',
'imageVariantExtension' => 'webp',
],
],
ref: https://github.com/nystudio107/craft-imageoptimize/blob/develop-v4/src/config.php#L223
Where you can add whatever variant creator you want, including avif
. But yes, I do want to formalize it now that it has reached 1.0.0 and is more widely accepted.