Web Performance & Media

Image Optimization for Core Web Vitals: WebP, AVIF, and Compression Best Practices

Learn how modern image formats and sensible compression settings reduce page weight and improve Largest Contentful Paint (LCP), with a comparison of PNG, JPEG, WebP, and AVIF.

Cover image for the guide: Image Optimization and Core Web Vitals LCP Benchmark

Summary

  • Images are often the largest part of a page's download size, so they strongly affect loading speed and Core Web Vitals.
  • Converting JPEG and PNG images to WebP commonly reduces file size by roughly a quarter to a third, according to Google's own WebP comparisons.
  • Google's guidance is for Largest Contentful Paint (LCP) to occur within 2.5 seconds, and large hero images are a common cause of slow LCP.
  • Browser-based compression tools process images on your own device, so sensitive graphics are not uploaded to a remote server.

Why Image Performance Dictates Google Rankings

Core Web Vitals are part of the page experience signals Google uses in ranking, though Google also states that relevance and content quality matter more, so speed alone will not carry a weak page. Largest Contentful Paint (LCP), the time required to render the largest visible element in the viewport, is frequently determined by an image.

Serving a 3.4MB uncompressed smartphone photo as your blog's hero banner delays the largest contentful paint, uses more mobile data, and gives visitors a reason to leave before the page appears.

Format Showdown: PNG vs. JPEG vs. WebP vs. AVIF

Selecting the optimal file container format is the single most impactful lever in your web asset pipeline:

FormatBest Use CaseTransparency?Compression Efficiency
PNGPixel-art, logos, screenshots with sharp textYes (Alpha)Moderate (Lossless)
JPEGPhotographs, complex gradients, legacy fallbacksNoGood (Lossy)
WebPUniversal web graphics, photos, transparent UIYes (Alpha)Better (about 25 to 34% smaller than JPEG)
AVIFNext-gen photographic compression, HDR contentYes (Alpha)Newest (often much smaller than JPEG)

Practical Compression Rules of Thumb

To optimize your digital catalog or publication without degrading visual quality, follow these quantitative rules:

  • Never upload raw camera dimensions: Scale high-resolution graphics down to their maximum display size (e.g. 1200px or 1600px width for desktop banners).
  • Aim for light files: pages whose images stay under about 150KB each load quickly on most mobile connections. Treat this as a practical target, not a rule.
  • Set compression quality around 80%: for JPEG and WebP this usually keeps artifacts hard to notice while cutting file size substantially compared with maximum quality. Check the result at the size it will be displayed.
  • Always specify width and height attributes in HTML: Explicit dimensional attributes prevent Cumulative Layout Shift (CLS) as assets stream into the document.

Frequently asked questions

Is WebP supported by all modern web browsers?

Yes. WebP is supported by all current major browsers, including Google Chrome, Apple Safari (iOS and macOS), Mozilla Firefox, Microsoft Edge, and Opera. Very old browser versions may not support it, so check the browsers your audience uses.

What is the difference between lossy and lossless compression?

Lossy compression discards image information and can introduce visible artifacts. Lossless compression preserves decoded pixel values. Size reduction depends on the original image, format, encoder, and settings; compare the actual exported file with the original.

More guides

Suggestions welcome

Need a tool that is not here yet?

Tell us what you are trying to do. Requests and bug reports shape what we build next.

Suggest a tool