JA EN

Core Web Vitals and Image Optimization - Practical Methods to Improve LCP, CLS, and INP

· 9 min read

Core Web Vitals and Images - Why Images Dominate Performance Scores

Core Web Vitals are Google's user experience metrics, used as ranking signals since 2021. Of the three metrics (LCP, CLS, INP), LCP and CLS are directly and significantly affected by image optimization. HTTP Archive data shows images comprise approximately 50% of total page transfer weight, making image optimization the highest-leverage performance improvement opportunity.

Each metric's relationship to images:

Google PageSpeed Insights data reports that approximately 72% of pages with "poor" LCP have images as their LCP element. Image optimization alone can potentially improve LCP for the vast majority of underperforming pages.

LCP Improvement - Five Strategies to Accelerate Image Loading

When the LCP element is an image, the entire pipeline from network delivery through decode to paint must be optimized. LCP equals the sum of resource load time, rendering delay, server response time, and client processing time.

Strategy 1 - Preload for early fetch: <link rel="preload" as="image" href="hero.webp"> initiates fetch during HTML parsing. For responsive images use imagesrcset and imagesizes attributes. Preloading improves LCP by 200-500ms by bypassing CSS/JS parse delays.

Strategy 2 - Optimal format and size: WebP is 25-35% smaller than JPEG; AVIF is 40-50% smaller. Build AVIF → WebP → JPEG fallback chains with <picture>. Serve viewport-appropriate sizes via srcset and sizes.

Strategy 3 - CDN and caching: Edge-cache via CloudFront or Cloudflare minimizing physical distance latency. Set Cache-Control: public, max-age=31536000, immutable for long-term caching with content-hash URLs for cache busting.

Strategy 4 - fetchpriority attribute: <img fetchpriority="high"> explicitly elevates LCP image fetch priority in the browser's resource scheduler.

Strategy 5 - Server-side rendering: Including LCP image URLs directly in HTML enables fetch without waiting for JavaScript execution. SPAs where image URLs are determined post-JS-execution suffer significant LCP degradation.

CLS Prevention - Eliminating Image-Caused Layout Shifts

CLS quantifies unexpected content movement during page load. Images are among the largest CLS contributors - without proper measures, the entire page jumps when images finish loading.

How images cause CLS: Browsers don't know image dimensions until load completes. Unknown-dimension images are treated as height zero, pushing subsequent content down by the actual height upon load - measured as layout shift degrading CLS scores.

CLS prevention patterns:

Lazy-loaded image CLS measures: Always specify width/height on loading="lazy" images. Display LQIP (Low Quality Image Placeholder) preventing shift on full image load. Use Intersection Observer to begin loading as images approach viewport, aiming for pre-loaded state upon display.

INP and Image Decoding - Avoiding Main Thread Blocking

INP (Interaction to Next Paint), replacing FID as a Core Web Vital in March 2024, measures time from user interaction (click, tap, key) to next paint update, evaluating overall page interactivity. Image decode processing blocking the main thread for extended periods degrades INP.

When image decoding impacts INP:

INP optimization techniques:

Lazy Loading Strategy - loading Attribute and Intersection Observer

Lazy loading defers off-viewport image loading, prioritizing resources needed for initial display. Proper implementation improves LCP while reducing total page transfer. However, incorrect implementation risks worsening LCP.

Native lazy loading (loading="lazy"): HTML-only implementation requiring no JavaScript. Browsers automatically determine viewport distance and initiate loading at appropriate timing. Chrome begins loading approximately 1250px (fast connection) or 2500px (slow connection) before viewport. Critical: Never set loading="lazy" on LCP elements - this delays LCP image loading, severely degrading scores.

Intersection Observer advanced control: rootMargin: '200px' enables fine-grained threshold control. Supports load-state animations (fade-in) and custom priority logic (prioritizing images closer to screen center).

Best practices: Above-the-fold images get loading="eager" (default) + fetchpriority="high". Below-fold images get loading="lazy". Pages with 20+ images see dramatic effects - 60-80% initial transfer reduction. Display LQIP (20x20px blurred) or dominant color placeholders maintaining UX during load.

Data-Driven Improvement Priorities and Effect Measurement

Image optimization encompasses many techniques, but simultaneous implementation isn't necessary. Prioritize highest-impact measures based on real data, quantitatively measuring each intervention's effect.

Impact ranking (typical cases):

Measurement methods: Chrome DevTools Lighthouse for local lab data. PageSpeed Insights for CrUX field data (75th percentile of real users). Web Vitals JS library (import {onLCP, onCLS, onINP} from 'web-vitals') for collecting real user metrics sent to GA4. Search Console Core Web Vitals report for page-group pass/fail status and ranking impact assessment.

Related Articles

Image Lazy Loading Implementation Guide - Choosing Between loading=lazy and IntersectionObserver

Learn how to improve web page initial load speed with image lazy loading, covering both native API and JavaScript approaches with practical examples.

Image Loading Strategy Design - Mastering preload, fetchpriority, and decoding

Deep dive into three HTML attributes that optimize image loading. Learn the correct usage and combinations of preload, fetchpriority, and decoding for LCP improvement.

Web Image Performance Audit - Practical Guide to Core Web Vitals Improvement

Learn how to audit image impact on web performance. Covers LCP improvement, CLS prevention, and transfer size reduction with actionable techniques.

Web Image Optimization Checklist - 15 Actionable Items for Production

A comprehensive 15-item checklist for web image optimization. Concrete techniques and priorities that directly improve Core Web Vitals scores.

Complete Image SEO Guide - Boost Search Traffic with Alt Text, File Names, and Size Optimization

Comprehensive image SEO techniques to maximize traffic from image search. Covers alt attribute writing, file naming conventions, structured data, and Core Web Vitals optimization.

Image Gallery Performance Optimization - Techniques for Fast Display of Large Collections

Optimize performance for gallery pages with hundreds of images. Covers virtual scrolling, progressive loading, memory management, and efficient layout calculation with practical implementations.

Related Terms