How to fix 'Serve images in next-gen formats' in Google PageSpeed
"Learn how to improve your Core Web Vitals by converting traditional JPG and PNG images to modern formats like WebP and AVIF."
If you’ve run a Lighthouse or Google PageSpeed Insights report lately, you’ve likely seen the recommendation to “Serve images in next-gen formats.”
What are Next-Gen Formats?
Next-gen formats refer to image formats like WebP and AVIF. These formats have superior compression and quality characteristics compared to their older JPEG and PNG ancestors.
Why it Matters
Serving images in these formats significantly reduces the amount of data a user needs to download, leading to:
- Faster Page Load Times
- Improved LCP (Largest Contentful Paint)
- Better Search Engine Rankings
How to Fix It
The easiest way to fix this is to convert your existing assets.
- Download your current images.
- Use MrCompress to convert them to WebP or AVIF.
- Replace the files on your server.
- Update your HTML to use the
<picture>tag for better fallback support.
<picture>
<source srcset="image.avif" type="image/avif">
<source srcset="image.webp" type="image/webp">
<img src="image.jpg" alt="Description">
</picture>
By making this simple switch, you’ll see an immediate boost in your performance scores.
Try it yourself
Apply what you've learned and optimize your images with maximum privacy.
Open MrCompress