The built-in thumb() driver always saves images in JPG format. Newer, better formats exist, and have become standardised - such as WebP. Newer, even better formats are already on the horizon - like AVIF. Some page metric tools - like Google’s PageSpeed - will actually penalise your ranking if your images are saved in “legacy” formats, like JPG or PNG.
Kirby uses gd or imagemagick to process images behind the scenes, and both these packages already support converting images to WebP. Both packages are also working on supporting AVIF already. It would be great if Kirby could allow us to choose the format we prefer our images saved to, perhaps with a “format:” config option.
Depending on the chosen format, other options might be available - WebP has more settings than JPG - but Kirby could provide generic defaults, just as it does now for JPG. This would ensure that the syntax could be extended, without breaking backwards compatibility with old code.
I have a few photographer clients - every image > 10Mb. I have to resize every image on the site, no exception. Being able to save them as lossless WebP would be amazing, and help me get more work (no loss of quality is important for photographers).
Big Sur is out, so now saving to webp is even more important - we can’t give the clients any more excuses…
It would save time if we could have options based on the file type. Like, if the file is jpg, then convert to webp, but if the file is gif then convert to png.
webp and even more important: avif!
It would be so great to be able to use webp but much more avif!
please please please please please please please please please please please please please pretty please with sugar on top 🙏
Yes Avif would be important for me too – like Kirby handling all that conversions etc – upload a jpeg or png and make a scrset (valid, with sizes) with avif and webp …that’ll be the dream!
Something like this integrated natively would be super great to make it much easier to always provide the “best” image automatically:
https://www.industrialempathy.com/posts/image-optimizations
OMG, are we getting AVIF, too, on 3.6? 🙏
PHP 8.1 will include AVIF support in gd by default - https://php.watch/versions/8.1/gd-avif - will we get support for AVIF in Kirby at the same time?
We currently rely on support via https://github.com/claviska/SimpleImage/issues/260 for gd