โ† Back to BlogOptimization

How to Optimize Images for Core Web Vitals (LCP, CLS & FID)

Images are the #1 cause of poor Core Web Vitals scores. Learn exactly how to optimize every image on your site to improve LCP, prevent layout shifts, and pass Google's performance thresholds.

๐Ÿ“… March 1, 2026โฑ 12 min read

What Are Core Web Vitals?

Core Web Vitals are a set of real-world performance metrics that Google uses to evaluate the quality of a user's experience on your website. Since May 2021, they have been a confirmed ranking factor in Google Search. Getting good Core Web Vitals scores directly improves your SEO performance.

The three Core Web Vitals metrics are:

  • LCP (Largest Contentful Paint): How long it takes for the largest visible content element to load. Target: under 2.5 seconds.
  • CLS (Cumulative Layout Shift): How much the page layout unexpectedly shifts during loading. Target: under 0.1.
  • INP (Interaction to Next Paint): How quickly the page responds to user interactions. Target: under 200ms.

Images are the primary cause of poor LCP and CLS scores. Getting these right is the single most impactful thing most websites can do for performance.

LCP: Making Your Hero Image Load Fast

The Largest Contentful Paint element on most pages is the hero image โ€” the large banner or feature image at the top of the page. Here's how to optimise it:

1. Use the Right Format

Convert your hero image to WebP. WebP files are 25โ€“35% smaller than equivalent JPEG files with no perceptible quality difference. Use our free JPG to WebP converter to make the switch in seconds.

2. Size the Image Correctly

Never serve a 4000ร—3000px image in an 800px-wide container. This wastes bandwidth and delays LCP. Resize your hero image to the maximum width it will be displayed at โ€” usually 1400โ€“1920px for full-width banners. Use our Image Resize tool to set exact dimensions.

3. Compress Aggressively

At WebP quality 75โ€“80, your hero image will look identical to the original but be dramatically smaller. Use our Compress Image tool and aim for under 200KB for a hero image.

4. Set fetchpriority="high" on the Hero

The browser has no way of knowing which image is most important until it parses the HTML. Add fetchpriority="high" to your hero image tag to tell the browser to prioritise it above other resources on the page.

5. Add Width and Height Attributes

Always add explicit width and height attributes to your img tags. This reserves space for the image before it loads, preventing layout shifts (CLS). Modern browsers use the width/height ratio to calculate the correct amount of vertical space to reserve before the image downloads.

6. Preload the Hero Image

Use a link rel="preload" tag in your head section to tell the browser to fetch the hero image as soon as possible, before the HTML is fully parsed. This alone can improve LCP by 500msโ€“1s on many sites.

CLS: Preventing Layout Shifts from Images

Cumulative Layout Shift is caused by content that moves after it loads. Images without dimensions are the biggest culprit โ€” when an image loads without reserved space, it pushes everything below it down the page.

Always Reserve Space with Width and Height

In HTML, setting width and height on images tells the browser the exact aspect ratio before the image downloads. Modern browsers use this to reserve the correct amount of space, preventing layout shift. This is one of the most impactful single changes you can make to a web page.

Use CSS aspect-ratio

If you're using CSS to control image dimensions, apply an aspect-ratio property to the container element. This tells the browser to reserve a fixed ratio of space for the container, even before its contents load. Pair it with object-fit: cover on the image itself to fill the space correctly.

Avoid Injecting Images with JavaScript

Images loaded dynamically after the page renders (via JavaScript) cause layout shifts because the browser has already laid out the page. Render images server-side wherever possible, and avoid inserting images into the DOM after the initial paint.

Serving Responsive Images

Different devices need different image sizes. A desktop with a 4K monitor benefits from a 2560px image. A mobile phone only needs 390px. Serving one large image to all devices wastes bandwidth and hurts LCP on mobile.

Use the HTML srcset attribute to tell the browser which image to use at each screen size. Combined with the sizes attribute, this lets the browser choose the most appropriate image for the current viewport and display density. Create multiple sizes using our Image Resize tool โ€” export at 400px, 800px, and 1600px widths, then convert all to WebP.

Lazy Loading Below-Fold Images

For images below the fold (below the initially visible viewport), add loading="lazy" to the img tag. This tells the browser not to download those images until the user scrolls near them, dramatically improving initial page load time and LCP.

Important: Never lazy-load your hero or above-the-fold images. Only apply lazy loading to images that are definitely below the initial viewport. Lazy-loading the hero image is one of the most common LCP mistakes and can add 1โ€“2 seconds to your LCP score.

Real-World Impact: Before and After

A typical content website that implements all these optimisations sees:

MetricBeforeAfter
LCP4.2s (Poor)1.8s (Good)
CLS0.24 (Poor)0.02 (Good)
Page weight2.8 MB680 KB
PageSpeed score4289

These are real-world numbers from sites that have applied the techniques above. The most common quick win is switching hero images from oversized PNGs or JPEGs to correctly-sized WebP files with a preload hint.

Measuring Your Core Web Vitals

Use these tools to measure and track your improvements:

  • Google PageSpeed Insights (pagespeed.web.dev) โ€” Free, instant analysis of any URL
  • Chrome DevTools Lighthouse โ€” Built into Chrome, run locally on any page including staging
  • Google Search Console โ€” Shows Core Web Vitals data aggregated from your real users
  • WebPageTest โ€” Advanced waterfall analysis, filmstrip view, and multi-location testing

Aim for "Good" scores on all three Core Web Vitals: LCP under 2.5s, CLS under 0.1, and INP under 200ms.

Checklist: Core Web Vitals Image Optimisation

Work through this checklist on your most important pages first (homepage, landing pages, top blog posts):

  • Hero image converted to WebP format
  • Hero image resized to actual display dimensions (not served oversized)
  • Hero image compressed to under 200KB
  • Hero image has fetchpriority="high" attribute
  • All images have explicit width and height attributes
  • Below-fold images have loading="lazy" attribute
  • Responsive srcset images served to mobile vs desktop
  • PageSpeed Insights score above 75 on mobile

FAQ

Do Core Web Vitals directly affect my Google ranking?

Yes. Since May 2021, Core Web Vitals are a confirmed ranking signal in Google Search. Pages with "Good" scores have a competitive advantage over pages with "Poor" or "Needs Improvement" scores, all else being equal.

What is the single most impactful change I can make?

For most sites, converting the hero image from JPEG/PNG to WebP and adding a preload hint delivers the biggest LCP improvement with the least effort. This alone can move you from "Poor" to "Good" on many pages.

How long does it take for improvements to be reflected in Search Console?

Google Search Console aggregates Core Web Vitals data from real users over a 28-day rolling window. After making changes, wait 4 weeks and compare the before/after data in the Core Web Vitals report.

Do I need to fix CWV on every page?

Focus on your highest-traffic pages first. Google evaluates each URL independently, but the pages that most affect your rankings are those that generate the most impressions in Search.

Yes โ€” all 30+ tools on PixlTools are completely free to use.

JPG, PNG, WEBP, and PDF are supported across our various tools.

No โ€” images are processed and deleted immediately. We never store your files.

Try Our Free Image Tools

30+ free online tools to compress, resize, convert and optimize your images.

Explore All Tools โ†’

Get notified of new tools

We ship new image tools regularly. Join 2,000+ creators on the list.

No spam. Unsubscribe anytime.