How safe/risky do y’all think it is to assume WebP as a baseline for content images? (instead of JPEG/PNG)
Feel free to look here before you vote: https://caniuse.com/webp
28 replies
@zachleat Been debating this all year, and checking caniuse, and debating, and checking. I think it’s safe. But I still haven’t removed those JPG “fallbacks” yet.
@zachleat not sure what "baseline" means. If it's <img src="/fediverse/zachleat@fediverse.zachleat.com/111416997301771801/thing.webp"> then ahahaha no chance.
If <picture><source srcset="thing.webp" type="image/webp"><img src="/fediverse/zachleat@fediverse.zachleat.com/111416997301771801/thing.png"></picture> counts as "using webp as a baseline" then totally, no problem with that. (Although if you're doing that anyway, then might as well add avif, etc, etc.)@sil I meant baseline as in <img src="thing.webp" alt="…">, yep!
@zachleat voted for "I would not currently do this" :-) On the grounds that there's very little reason to do it; if you're switched-on enough to know about webp then you can write <picture> instead of <img>, and making multiple versions of your images is a one-time-only effort.
My blog (https://blog.imkhoi.com) current uses .WEBP and has had no issues. Most browsers support .WEBP nowadays.
@khoi @zachleat ...exactly because you used the word "most" there, is why :) I agree; it'd probably be fine to use webp alone everywhere, but being sure of that is hard. I am sure of it for pngs and jpegs. So, if I put any effort into thinking about this question whatsoever, I might as well put that effort into using both inside a <picture>, and that's what I do.
@sil @khoi @zachleat This (for why I voted no on WebP).
I also have learned Can I Use is not guaranteed to be accurate and browser vendors (Safari) actively tweak support charts via PRs to make their support for a technology look better than it is. I no longer decide based on its charts.
Also also, lack of support outside browsers given the images I use sometimes get pulled into non-web contexts.
"Never" is a bit much, so it's not my choice, but currently? Nope.
But in as little as ten years? Maybe so.
@jgamble whew, you’re right that copy is bad—I edited the options
as @jgamble noted, the use of "Never" in the first poll option was not quite good enough—I’ve edited the options which means y’all get to vote again 😅
@zachleat Not all clients are browsers, so no. Then there’s not just image viewing programs, but also image thumbnailers, messaging apps…
If you sent an image to get printed on an ID card, how likely do you think it is to work with WebP? Hell, Bing can barely handle PNG favicons.
I wouldn’t expect WebP to be supported by default.
@zachleat This is funny to me because I recently added a few images to the caniuse site and I only used webp 😅 Fairly comfortable with that given the audience.
@zachleat I have been advising to keep JPEG as the canonical copy and generate webp/avif from that since you can generate a JPEG XL version from it losslessly, unlike webp
@zachleat it might be just slightly early, but i’d go with it, depending on the audience. if ~100% compatibility and/or support for older devices is a goal, perhaps offering a fallback to jpeg with a <picture> tag might cover it
@zachleat Depends on the target group. But in most cases it should be definitely safe.
@zachleat mastodon polls are very energetic
@zachleat I use AVIF with WebP fallback. I think the more interesting debate is about the future of JXL:
https://dev.to/jonarnes/get-ready-for-jpeg-xl-today-204j
https://bugs.chromium.org/p/chromium/issues/detail?id=1178058#c84
@zachleat apologies for barging in on an old post like this, but I believe jpegli, a new jpeg encoder from the JXL people, will be released next year. In what testing I've done and seen from other people, the JPEGs it produces are smaller and higher quality than what cwebp can do. So to me even if webp is a safe choice, I see little reason to use it when legacy jpeg continues to improve year after year.
@lonjil it does seem to be between a rock and a hard place right now