The important question: how does a WebP encoded screenshot look? if there's a huge field of a single color and some text written on the field, are there visible artifacts all around the text? This is a use case for PNG, and one where people can plainly see why a lossless format exists.
WebP has a lossless mode for that reason, and is almost a strict improvement over PNG [1].
“WebP seems to have about 10% better compression compared to libjpeg in most cases, except with 1500px images where the compression is about equal.”[1]
mozjpeg JPEGs + AVIF in a <picture> element is the way to go now. You will probably always want to serve JPEGs as an alternative WebP and AVIF and that makes WebP is a waste of disk space for lossy compression of photographs.
I'm amazed the “WebP is such a goated format” blog post made in to the front page of HN.
A deceptively hard to answer question!
Why is it hard?
Because both jpeg and WebP (which is really just a VP8 intra frame) can represent images with a variable amount of bits.
But it gets even trickier! How do you measure "savings"? Certainly you can produce 2 images with the same (or similar) bitrates with both webp and jpeg, but how do you say one is better than the other? How can you lower webp's bitrate until it's "quality" measure is the same as jpeg?
Quality metrics such as PSNR, SSIM, and VMAF all exist to try to give a "quality" metric. However, they all have their own flaws that allow an image compression format to get worse subjective quality will improving their objective score (For example, codecs that optimize for PSNR tend to be more blurry than codecs that target SSIM. Grass ends up looking like big blobs of green).
In fact, because x264 was often being beat by other codecs in those metrics they went out of their way to add "cheat" modes for the encoder! You can tell x264 to target PSNR or SSIM :D. Neither are the default.
Just some fun thoughts. Subjectively, I'd say WebP and the newer AVIF or HEIF does a better job than Jpeg (to my eyes). However, I could see why others might disagree.
They can do great with a clean original. But with an original that was already carefully mastered in JPEG format, with quality set to the bare minimum to get a good output... well, lossy compression is lossy, and when there isn't any margin for more loss, the results won't be good. (It's also true that since different lossy algorithms are, well, different, the interaction of two algorithms can be truly awful to look at).
Unfortunately, there are very few image editing pipelines which let one master in anything other than JPEG, PNG, or GIF.
At high quality settings jpeg is still pretty good for 8 bit photos. Newer formats support higher bit depths.