Spend any time building online brands and you will undoubtedly stumble on the need to optimize the performance of your website. One of the things that will drive you bananas is Web Core Vitals. This was the case while working on Trunc (a log management platform) this week, Web Core Vitals was throwing a fit about the PNG images not being in the next-gen formats.
Being the skeptic that I am, I tend to believe most of what we see, and guidance that is pushed, is designed to better serve only one person – the platform pushing it. And at first, this is what I experienced with PNG to WEBP conversions and was all too excited to write an article saying – IT’S A USELESS OPTIMIZATION!!!
But, after diving a bit deeper I was surprised to find that it is not and on average you should expect 81% improvement in image size reduction, and a 70% improvement in network speed. I was a bit shocked by this, so decided to share some of the data in this article.
TLDR; Update Images to Next-Gen formats like WebP
Part 1: Skepticism with Next-Gen Image Formats
I was going through my “lighthouse” tests on a few pages and noticed I was getting dinged for a background image in one of the CTA’s I pushed. It looked like this:
I decided to do a test run focusing on /images/network-bg.png and converting it to a “next-gen” format using webp.
You can see what happened here:
You can see in the image that doing the PNG -> WEBP conversion seemed to have the opposite effect. It increased the size of the image. Not only was the size 5 KB’s bigger, but the speed to download was greater as well:
curl -D - https://trunc.org/images/network-bg.png > /dev/null % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 85405 100 85405 0 0 304k 0 --:--:-- --:--:-- --:--:-- 312k $ curl -D - https://trunc.org/images/network-bg.webp > /dev/null % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 89588 100 89588 0 0 474k 0 --:--:-- --:--:-- --:--:-- 491k
You can see that the network-bg.webp file took 491 KiB / second to transfer vs the network-bg.png which took 312k. That is 57.3% worse performance. I expected to see Web Core Vitals highlight this difference and get dinged even worse.
That’s not what happened though. You can see in the image below, the notice on network-bg.webp disappeared and it moved onto the next image.
What the heck!!! That’s not supposed to be right. The image is bigger, and it’s slower to download. Why is it now an improvement in terms of “next-gen formats”?
Had to better understand, and thankfully I had a lot of images to test with.
Part 2: Correcting my Skepticism With More Testing
Before going nuts I decided to take a grown approach, a new tactic I’m trying, and decided to test it a bit more. Having so many images loaded it was all about the time to go through the process than anything technical.
This is by no means statistically significant but does show some interesting stats confirming to me that it’s worth converting old formats to next-gen formats like WebP.
I analyzed 41 images and averaged a 81.85% savings in image size (measured in KiB).
I then analyzed the download speed of 10 of those images using curl://, similar to the commands I shared in Part I. And was pleasantly surprised when I saw a 71.66% improvement in speed (measured in KiB) after converting to WebP.
Yes, Convert to Next-Gen Image Formats
Take the time to convert your images. I still don’t know why the first image created the issue that it did. Testing again continues to yield the same results, so I am not sure. Maybe it has to do with the size of the original, compared to the others?
What I can say is next-gen formats are heavily weighted. Here is the output of converting all the images on the page I was testing (Noticed the Performance measure)
It jumped from an 83 (pictured earlier in the article) to an 89. That was specifically focused on image optimization, converting to WebP for all images loaded on the page.