Image Resizer Free
Back to Home
Performance Engineering•11 min read

Web Image Optimization for Core Web Vitals (LCP & CLS)

Images account for over 50% of the total byte weight of the average webpage. According to Google Lighthouse audits, unoptimized images are the single most common cause of poor Largest Contentful Paint (LCP) and Cumulative Layout Shift (CLS) scores.

By Ark Barua • Web Performance Lead•Updated September 2026

1. Fixing Largest Contentful Paint (LCP)

LCP measures how long it takes for the largest above-the-fold content block (almost always a hero image or promotional banner) to become fully visible. Google recommends an LCP under 2.5 seconds.

Rule 1: Never Lazy-Load Your Hero Image

Adding loading="lazy" to your above-the-fold LCP image delays network requests until the browser finishes calculating layout geometry, adding 500ms–1500ms of unnecessary delay. Keep hero images eager.

Rule 2: Add Priority Hints

Use fetchpriority="high" on your LCP hero element. This signals to the browser's preload scanner to fetch the image concurrently with render-blocking CSS.

Rule 3: Serve Next-Gen Formats (WebP)

Converting hero assets from legacy JPEG to compressed WebP typically cuts payload size by 30% to 50%, accelerating download times over mobile 4G networks.

2. Eliminating Cumulative Layout Shift (CLS)

CLS measures unexpected layout shifts while a user reads a page. When an image without specified dimensions loads, the browser suddenly jumps subsequent text downward, creating jarring visual disruption.

The Solution: Always Declare Explicit Width & Height Attributes

Always supply the native width and height on the HTML element. Modern browsers automatically calculate the aspect ratio and reserve the container space before the image finishes downloading:

<img src="hero.webp" width="1200" height="630" alt="Hero banner" class="w-full h-auto" />

3. Implementing Modern Responsive Images (srcset & picture)

Never send a desktop 2400px wide image to an iPhone screen with a 390px viewport. Use responsive markup to let the browser request the exact size it needs:

<picture>
  <source srcset="hero-400.webp 400w, hero-800.webp 800w, hero-1200.webp 1200w" type="image/webp" />
  <img src="hero-800.jpg" width="1200" height="630" alt="Responsive product showcase" loading="lazy" decoding="async" />
</picture>

Optimize your web graphics now

Resize images to exact display widths and export to WebP for instant performance gains.

Resize Images for Web →