Hi tores54,
Testing the images in the Google Drive zip file, the majority of the images does indeed not end up with a generated webp image:
– 7NDNMLIqak0.jpg
– Fk5xo6hxgIY.jpg
– FRSbHtCKINQ.jpg
– o-PpIxUWSMA.jpg
– SkRpLtCsJRk.jpg
– STci4WCoyfA.jpg
– ZkrxrclxCQ0.jpg
krWpoj_yMH0.jpg does get a webp image.
The way the decision is made whether there’s going to be a webp image, is based on a filesize comparison.
Whenever you send an image for optimization 3 things happens:
– We check the filesize of the original image fetched from your site, and record this (original_filesize).
– We optimize the image using a set of algorithms to generate the lowest possible size, with a slight quality loss (unless you have lossless optimization enabled). We then record the size (optimized_filesize).
– We generate a webp image based on the original image. The webp image will still have a slight quality loss. We then record this size as well (optimized_webp_filesize).
We then do a check whether the generated webp image’s filesize is smaller than the optimized jpeg/png filesize. If it’s smaller, you’ll get the webp image returned. If it’s bigger you’ll not get the webp image returned. Since you’re then increasing the size of the page, which is what you’re trying to prevent in the first place by using the image optimize function.
Since WordPress has different sizes (thumbnail + scaled/resized versions) for each image, the outcome may differ for each image as well. In some cases there can be optimizations, in other cases, there won’t be.
If we take 7NDNMLIqak0.jpg as an example:
– The size when uploaded to WP is 1299518 bytes.
– The optimized jpeg size is 447307 bytes.
– The webp imag size is 457024 bytes.
The webp image is thus 9717 bytes larger than the jpeg.
Since the webp image is larger, it won’t be returned.
It’s also worth noting that webp generally turns out larger for large images, it’s just how the webp compression works.