Sorry, we don't support your browser.  Install a modern browser
This post is closed.

File 'format' option in thumb() driver - to convert to WebP, AVIF, etc.#160

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.

3 years ago
30
?

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).

3 years ago
5
?

Big Sur is out, so now saving to webp is even more important - we can’t give the clients any more excuses…

3 years ago
1
?

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.

3 years ago
3
?

webp and even more important: avif!

3 years ago
3
?

It would be so great to be able to use webp but much more avif!

3 years ago
4
?

please please please please please please please please please please please please please pretty please with sugar on top 🙏

3 years ago
1
?

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!

3 years ago
3
Changed the status to
Planned
3 years ago
1
Changed the status to
In progress
3 years ago
3
Changed the status to
In upcoming releases
3 years ago
7

​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

3 years ago
?

OMG, are we getting AVIF, too, on 3.6? 🙏

3 years ago
?

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?

3 years ago

We currently rely on support via https://github.com/claviska/SimpleImage/issues/260 for gd

3 years ago
Changed the status to
Completed
2 years ago
1