Lorixen.
EN

Largest Contentful Paint on a Hero Image: Size, Format and Preload

Short answer: When the hero image is your Largest Contentful Paint element, LCP is decided by how soon the browser discovers that image, how big the file is, and whether anything delays it. Serve a version sized for each screen width with srcset, encode it as AVIF or WebP at a sensible quality, remove loading="lazy" from it, add fetchpriority="high", and make sure it is a real <img> in the HTML rather than a CSS background. Measure before and after with PageSpeed Insights so you know which change actually moved the number.

Confirm the hero really is the LCP element

Do not assume. On many pages the LCP element is a heading or a paragraph, and image work would change nothing.

  1. Run the page through PageSpeed Insights and expand the "Largest Contentful Paint element" diagnostic. It names the element and shows a thumbnail.
  2. In Chrome DevTools, open the Performance panel, record a reload, and look for the LCP marker in the timings track. Clicking it highlights the element.
  3. Test on mobile settings. The LCP element on a phone is often different from desktop, because the hero is cropped or replaced by a smaller image.

The web.dev LCP article sets "good" at 2.5 seconds or less for the 75th percentile of visits.

Break LCP into its four parts

Google splits image LCP into four phases, and each fix targets one:

Phase What it means Typical hero problem
Time to first byte Server responds with HTML Slow hosting, no page cache
Resource load delay Gap before the image request starts Image only found by JavaScript or CSS
Resource load duration Download time File is several megabytes
Element render delay Gap between download and paint Render-blocking scripts, sliders, fade-in animations

The DevTools Performance panel shows these subparts when you click the LCP marker. Work on whichever is largest.

Size the image for each breakpoint

A 4000-pixel photo straight from a camera is the most common cause of slow hero LCP. A phone with a 390-pixel-wide screen at 3x density needs roughly 1200 pixels of width, not 4000.

Create a handful of widths, for example 640, 960, 1280, 1920 and 2560, and let the browser choose:

<img src="/img/hero-1280.avif"
     srcset="/img/hero-640.avif 640w, /img/hero-960.avif 960w,
             /img/hero-1280.avif 1280w, /img/hero-1920.avif 1920w,
             /img/hero-2560.avif 2560w"
     sizes="100vw" width="2560" height="1200"
     alt="Team fitting a kitchen in a bright family home"
     fetchpriority="high">

If the hero only fills part of the width on desktop, change sizes to match, for example (min-width: 1024px) 60vw, 100vw. A wrong sizes value makes the browser download a larger file than needed.

For art direction, such as a tighter crop on phones, use a <picture> element with media conditions on each <source>.

Pick the format: AVIF, WebP or JPEG

  • AVIF usually gives the smallest file at a given visual quality and is supported by current versions of the major browsers.
  • WebP is a safe, widely supported alternative and encodes faster.
  • JPEG remains a fallback for very old browsers.

With <picture>, list AVIF first, then WebP, then the JPEG in the <img>. Export at moderate quality and compare side by side at the actual display size; heavy compression artifacts on a hero look worse than a slightly larger file. Many CDNs and WordPress image plugins can produce these formats automatically.

Never lazy-load the hero

loading="lazy" tells the browser to wait until it knows the image is near the viewport, which requires layout first. For an image that is always above the fold, that only adds delay. Common traps:

  • WordPress adds loading="lazy" to content images by default; recent versions try to skip the first image, but themes and page builders sometimes override this.
  • Lazy-load plugins that swap src for data-src hide the image from the browser's preload scanner entirely.
  • Sliders often lazy-load every slide, including the first.

Inspect the hero's HTML in "View source" (not the live DOM) to see what the browser receives before any JavaScript runs.

fetchpriority and preload

Browsers start images at a lower priority until they know they are in the viewport. Adding fetchpriority="high" to the hero <img> tells the browser to fetch it early. The web.dev Fetch Priority guide explains how it interacts with other resources. Use it on one image per page; marking everything high defeats the purpose.

A <link rel="preload"> in the <head> helps when the image cannot be discovered from the HTML, for example when it is set in CSS:

<link rel="preload" as="image" href="/img/hero-1280.avif"
      imagesrcset="/img/hero-640.avif 640w, /img/hero-960.avif 960w,
                   /img/hero-1280.avif 1280w, /img/hero-1920.avif 1920w,
                   /img/hero-2560.avif 2560w"
      imagesizes="100vw" fetchpriority="high">

Keep imagesrcset and imagesizes identical to the <img> element, otherwise the browser may download two different files.

The background-image pitfall

Page builders love setting heroes as CSS background-image on a section. The browser cannot find that image until it has downloaded and parsed the stylesheet and matched the rule, which adds resource load delay. It also cannot use srcset or native lazy loading controls.

Options, from best to acceptable:

  1. Switch the section to an <img> element with object-fit: cover, positioned behind the text. Most builders have an "image" option for this.
  2. Keep the background but add a preload link as shown above.
  3. Inline the critical CSS so the rule is available immediately.

Also remove fade-in or zoom animations on the hero. An image that starts at opacity 0 and animates in delays the moment it counts as painted.

Measure before and after

  1. Record the current LCP from PageSpeed Insights (both lab and, if shown, field data) and note the LCP subpart timings from DevTools.
  2. Change one thing at a time: resize first, then format, then priority.
  3. Retest three times and take the middle result, since lab runs vary.
  4. After deploying, watch the field data in PageSpeed Insights and the Core Web Vitals report in Search Console over the following four weeks.

Google's "Optimize LCP" guide on web.dev has deeper detail on server and render delays if image fixes are not enough.

FAQ

Should I use a video instead of an image for the hero?

A video's poster image can become the LCP element, and autoplay videos are heavy. If you use one, give it a small, optimized poster and preload that poster like a hero image.

Does a CDN fix slow LCP on its own?

A CDN shortens download time and time to first byte, but it does not fix a 3 MB file, a lazy-loaded hero or a CSS background found late. Combine it with the steps above.

Is it okay to put fetchpriority on the logo too?

Keep high priority for the single element that is actually the LCP. The logo is usually small and loads quickly anyway.

If your hero still holds the page back after these changes, share the page with us and we will look at the waterfall together.

Sources

WhatsAppBook a call