Open S1SYPHOS opened 5 years ago
Our GD lib implementation already supports webp as a source. You can toss webp images in your content folder and the thumbnails should be created correctly. I believe imagemagick can handle them as well, but I haven't tested that.
It would indeed be cool though to offer a conversion option for thumbs.
@bastianallgeier it seems the webp mime is not part of the defaults for $page->images() collection. please make it a first class image citizen there as well.
first class image citizen
I'm loving it :hamburger:
Tl;dr: Progressive jpegs are almost always better then webp, even though they are "larger".
The longer explication why: I went to perfnow()-conference, and saw a really interesting talk from Kornel Lesiński about "perceived performance" with images. Full video here: https://www.youtube.com/watch?v=jTXhYj2aCDU
Thanks for the video! Bit off-topic, but I especially like the interviewer at the end, nodding constantly like one of these nodding head figurines.
Anyhow, I'm still intrigued by offering WebP conversion for thumbnails, though not being enabled by default. Also, it seems to me that Chrome ('Hello Google') loads WebP progressively by default, and since most people these days are using it as default browser (and will continue to do so, I'm afraid), this is still a viable option - Google will improve WebP along with Chrome for better (perceived) performance. This alliance is what makes it an even more interesting choice!
The problem is that Safari does not work with WebP at all, which puts alot of ios devices out of the picture. You still need a Jpeg fallback today.
However, i did just release a WebP plugin for K3 that converts uploaded files but keeps the source file ... https://github.com/HashandSalt/kirby3-webp
The problem is that Safari does not work with WebP at all, which puts alot of ios devices out of the picture. You still need a Jpeg fallback today.
Apple has added support for WebP images in the upcoming versions of Safari that will ship with iOS 14 & macOS 11.
WebP would only ever need to be created alongside normal thumbnails IMHO, and .htaccess
taking over the rest, that way you get the fallback AND serve WebP to suitable browsers. What do you think, @HashandSalt? Then again, you'd loose ppl serving full images straight from the content folder ..
Would be great, if the core generates webp by default.
Hello there, I'd love to see WebP generation as part of Kirby's core; maybe alongside PNG / JPG generation in
media
folder?Current browser support for WebP images is somewhat decent (Chrome, Opera & most mobile browsers, and since 01/2019: Firefox!), globally just about 80%.
For GD / Imagick, there's a PHP lib which I co-authored a while ago that might be a good starting point: https://github.com/rosell-dk/webp-convert
Anyway, thanks for listening .. and making Kirby.