I’m trying to create two images a .webp and a .jpg everytime a thumb is created by Kirby.
Afterwards I want to use a few htaccess lines to detect if the browser supports webp images and then replace all jpg images with webp.
What would be a good approach to do this?
I think of something like “splitting” the IM thumb driver. One with all the jpg options and commands and one for webp. Maybe someone already achieved it?
@fabianmichaelsaid once adding webp to kirby might be difficult.
imageset plugin could create picuture element with different srcsets for each file with a custom snippet (no htacess needed then).
Btw with mozjpeg vs webp its not actually the only issue. This will have to eventualy be tackled somehow.
Webp might suck now but it will only get better as it ages. Mozjpeg is on limits of jpeg. Webp is also much better alternative to animated gifs.
And most importantly there are things like BPG coming into browsers. Which might blow all of the rest away. So there will be time (i think very soon) where your clients will have jpegs but you will need to serve something different.