Serve Images in Next-Gen Formats (WebP/AVIF): How to Fix It
- May 17, 2026
- Performance, Images

Serve Images in Next-Gen Formats (WebP/AVIF): How to Fix It
TL;DR — This audit fires when you're still serving JPEG or PNG where WebP or AVIF would deliver the same picture at a fraction of the bytes. Images are usually the heaviest thing on a page, so shipping them in an old format directly inflates load time and Largest Contentful Paint on the exact element users are waiting to see.
What this check flags
Lighthouse compares each image against a modern-codec version and reports the bytes you'd save by switching. WebP typically cuts 25–35% off a comparable JPEG; AVIF often cuts 50% or more at similar visual quality. On an image-heavy page that difference is measured in megabytes, and because the hero image is frequently the LCP element, the format you choose there decides how fast the page feels.
A real example, and the fix
A product page ships a hero as a plain JPEG:
<img src="/img/hero.jpg" width="1200" height="675" alt="Trail runner mid-stride">
<!-- 480 KB -->Encode modern variants and let the browser pick the best one it supports, falling back cleanly to JPEG on anything that can't decode AVIF or WebP:
<picture>
<source srcset="/img/hero.avif" type="image/avif">
<source srcset="/img/hero.webp" type="image/webp">
<img src="/img/hero.jpg" width="1200" height="675"
alt="Trail runner mid-stride" fetchpriority="high">
</picture>
<!-- AVIF ~180 KB, WebP ~300 KB, JPEG fallback preserved -->Same picture, roughly 60% fewer bytes for browsers that support AVIF, and zero risk for the ones that don't.
Which format wins where
WebP and AVIF are not interchangeable, and JPEG/PNG still have narrow jobs. Pick per image type rather than converting everything blindly.
| Image type | Best format | Why | Watch out for |
|---|---|---|---|
| Photographic hero / product shot | AVIF (WebP fallback) | Best compression at high quality | Slower encode; test decode on old devices |
| Screenshots, UI, flat graphics | WebP lossless or AVIF | Sharp edges without JPEG artifacts | PNG only if transparency + tiny |
| Transparency (logos, icons) | WebP / AVIF (both support alpha) | Smaller than PNG, keeps alpha | Consider SVG for simple shapes |
| Animated graphics | WebP or AVIF | Far smaller than animated GIF | Prefer real video (MP4) for long clips |
How to detect it
- Lighthouse / PageSpeed Insights: open "Serve images in next-gen formats" under Opportunities. It lists each legacy image with the estimated byte savings, so you know exactly which files to convert first.
- DevTools Network tab: reload with the Network panel open, sort by size, and filter to
Img. Anything large with a.jpgor.pngextension and aContent-Typeofimage/jpegorimage/pngis a conversion candidate. - Response headers check: confirm the server actually serves the modern format by checking the
Content-Typeheader of the delivered image — a.webpURL that returnsimage/jpegmeans your pipeline isn't doing what you think.
How to fix it
- Convert at the source. Batch-encode your library to AVIF and WebP with
sharp,cwebp/avifenc, or your build pipeline, keeping the original as a fallback. - Serve with
<picture>or content negotiation. Either list<source>variants by type, or have your CDN read theAcceptheader and return the best format automatically. - Let a CDN do it on the fly. Image CDNs (Cloudflare Images, Cloudinary, imgix) can transcode and resize per request, so you don't maintain variants by hand.
- Keep dimensions and priority right. Always set
width/heightto prevent layout shift, and addfetchpriority="high"to the LCP image so the format win actually lands on the metric. - Pair with lazy loading below the fold. Combine next-gen formats with lazy loading so offscreen images don't compete with the hero for bandwidth.
Why this one moves LCP more than most
Most performance audits shave milliseconds off scripting or rendering. This one attacks the single heaviest byte payload on a typical page, and that payload is often the LCP element itself. Cutting a 480 KB hero to 180 KB means the browser finishes downloading and painting the thing users are staring at far sooner — which is why format work shows up so cleanly in LCP improvements. It pairs naturally with deferring offscreen images and the broader discipline covered in image optimization: right format, right dimensions, right loading priority.
FAQ
Is AVIF always better than WebP?
For compression at a given quality, usually yes — but AVIF encodes slower and decodes a touch heavier on very old devices. Serve AVIF first with WebP as the middle fallback and JPEG as the floor, and you get the best of all three.
Will next-gen formats break older browsers?
Not if you use <picture> with a JPEG/PNG <img> fallback. Any browser that can't decode AVIF or WebP silently falls through to the legacy source. Support for both formats is now near-universal on current browsers regardless.
Does converting to WebP hurt image quality?
At sensible quality settings (around 75–80), the difference is invisible for photos while the file is far smaller. Compare a converted sample against the original before committing your encoder settings.
Should I convert PNGs too?
Yes, especially large ones. WebP and AVIF both support transparency and usually beat PNG on size. Keep PNG only for tiny assets where the overhead isn't worth it, or move simple graphics to SVG.
My images are already WebP but the audit still fires — why?
Either the server is serving them with the wrong Content-Type, or Lighthouse thinks AVIF would save meaningfully more. Check the delivered header, and consider adding an AVIF tier for your largest images.
Claude Vincent is a technical SEO consultant focused on crawlability, rendering, and AI-search visibility. He writes the field guides and case studies at SEO ProCheck, with a bias toward the durable, unglamorous work that decides whether search engines and AI answer engines can actually read and cite a site.
About SEO ProCheck
Technical SEO consulting and GEO strategy with 20 years of enterprise experience. Case studies, resources, and tools for search and AI visibility.
Work With Me
Technical SEO audits, GEO strategy, site migrations, and international SEO. Hourly consulting for teams who need hands-on support, not just reports.







