How to Optimize the Largest Contentful Paint Image

Make a hero or other LCP image smaller, discoverable earlier and higher priority without accidentally lazy-loading it.

On this page14 sections
  1. Identify LCP
  2. Correct dimensions
  3. Compress/format
  4. Early discovery
  5. Avoid lazy
  6. fetchpriority/preload
  7. Retest
  8. Worked example: a slow hero image
  9. Practical takeaway
  10. Try it on a real image
  11. Continue reading
  12. Frequently asked questions
  13. Editorial note
  14. Sources and further reading

For optimize LCP image, file size is only one part of performance. Discovery, request priority, responsive selection, intrinsic dimensions, caching, decode, and paint can matter just as much as the number of kilobytes in the file.

The LCP image needs to be appropriately small, discoverable early, and given sensible priority. Optimizing only one of those three can leave the bottleneck elsewhere.

Use field data when available. A lab run is valuable for diagnosis, but real-user conditions determine whether the page actually meets the LCP threshold for visitors.

Short version: Start with the image’s actual job, remove waste the layout cannot use, encode once from a good source, and verify the result in the real page. Smaller is useful only while the image remains visually and technically fit for purpose.

Identify LCP

Largest Contentful Paint measures when the largest relevant image or text block in the viewport is rendered. web.dev recommends a good LCP of 2.5 seconds or less for at least 75% of visits.

For an image LCP, examine the full chain: server response, when the browser discovers the resource, its priority, transfer size, decode time, and when the layout can paint it. A late-discovered 80 KB hero can lose to an earlier 140 KB hero.

In DevTools, find the actual LCP element and its network request. Note when the request starts, its priority, transfer size, and whether CSS or JavaScript delayed discovery. That timeline tells you whether to compress, preload, change markup, or change priority.

Correct dimensions

Pixel dimensions place a hard ceiling on how much visual information the file contains. If an image will never render wider than the content container, shipping a many-thousand-pixel original usually transfers detail the layout cannot use.

Do not confuse sensible downscaling with arbitrary shrinking. Responsive layouts can need several source widths, and high-density displays may benefit from a larger candidate. The goal is a deliberate set of dimensions tied to real rendered sizes.

Compress/format

This part of optimize LCP image is best understood as a trade-off rather than a fixed rule. The right choice depends on the visual role of the image, the publishing environment, and what happens to the file after it leaves the editor.

Use representative files and verify the result in the real destination. A workflow that looks good on one sample can fail on transparency, fine text, gradients, noisy photographs, or very large source dimensions.

Early discovery

Largest Contentful Paint measures when the largest relevant image or text block in the viewport is rendered. web.dev recommends a good LCP of 2.5 seconds or less for at least 75% of visits.

For an image LCP, examine the full chain: server response, when the browser discovers the resource, its priority, transfer size, decode time, and when the layout can paint it. A late-discovered 80 KB hero can lose to an earlier 140 KB hero.

Avoid lazy

Native lazy loading delays image fetches that are not immediately needed. That is useful below the fold, where the visitor may never scroll far enough to see the resource.

For images already visible on load—especially a likely LCP image—lazy loading can add delay instead of removing it. Loading strategy should therefore follow viewport importance, not a rule that every image must use loading="lazy".

Use the first viewport as the dividing line. Images well below it are good lazy-loading candidates; images already needed to construct the first screen should normally be discoverable without waiting for a scroll threshold.

fetchpriority/preload

fetchpriority="high" can tell the browser that an image deserves higher fetch priority. It is most useful for a small number of truly important resources such as an LCP candidate that the browser might otherwise prioritize too conservatively.

Do not mark every visible image high priority. Priority is relative; promoting too many resources makes the hint less useful and can steal bandwidth from stylesheets, fonts, scripts, or the one image that actually matters most.

In DevTools, find the actual LCP element and its network request. Note when the request starts, its priority, transfer size, and whether CSS or JavaScript delayed discovery. That timeline tells you whether to compress, preload, change markup, or change priority.

Retest

This part of optimize LCP image is best understood as a trade-off rather than a fixed rule. The right choice depends on the visual role of the image, the publishing environment, and what happens to the file after it leaves the editor.

Use representative files and verify the result in the real destination. A workflow that looks good on one sample can fail on transparency, fine text, gradients, noisy photographs, or very large source dimensions.

Worked example: a slow hero image

For optimize LCP image, assume PageSpeed Insights or DevTools identifies a homepage hero as the LCP element. The file is 350 KB—not outrageous—but the request starts late because the image is injected by JavaScript and also marked for lazy loading. Converting it to 220 KB helps transfer time, but the page can remain slow because discovery and scheduling are still wrong.

A complete optimize LCP image fix would make the resource discoverable early in initial markup, avoid lazy-loading the LCP candidate, use an appropriate responsive source, reserve its layout space, and consider fetchpriority="high" only when that hint addresses a real priority problem. Then measure again.

Practical takeaway

For optimize LCP image, make one decision at a time and verify it in the final destination. Use the page’s actual dimensions, content type, compatibility needs, and user-visible result as the constraints. The goal is not to win a synthetic file-size contest; it is to publish an image that is efficient, understandable, and reliable for its job.

Try it on a real image

Use the compressor to apply this article to a real source image. Step 3: Compress the LCP image The image operation runs in your browser, which makes it practical to compare dimensions, format, output bytes, and visual quality without first sending the selected image to a remote compression endpoint.

Continue reading

Frequently asked questions

Should LCP be lazy?

Lazy-load offscreen images, but avoid delaying an image that is visible immediately and likely to become the LCP element.

Preload LCP?

Optimize the entire LCP loading path: server response, early discovery, priority, transfer size, decode, and rendering. web.dev uses 2.5 seconds or less at the 75th percentile as the good LCP threshold.

What is fetchpriority high?

What is fetchpriority high is best understood in the context of optimize LCP image: separate the specific concept from dimensions, format, compression, metadata, and delivery so you know which part of the workflow it changes.

How small should LCP be?

Optimize the entire LCP loading path: server response, early discovery, priority, transfer size, decode, and rendering. web.dev uses 2.5 seconds or less at the 75th percentile as the good LCP threshold.

Editorial note

Image formats, browser behavior, WordPress media support, and search guidance can change. This article is written to distinguish durable principles from version-specific behavior; version-sensitive claims should be rechecked during scheduled content refreshes.

Sources and further reading

Continue the series8 parts

Image Performance & Core Web Vitals

  1. Image Optimization for Website Speed
  2. How Images Affect Core Web Vitals
  3. How to Optimize the Largest Contentful Paint Image
  4. Should You Lazy Load Images?
  5. Why You Shouldn’t Lazy Load Your Hero Image
  6. Responsive Images: How srcset and sizes Work
  7. How Image Dimensions Help Prevent Layout Shift (CLS)
  8. When Should You Use fetchpriority=”high” on Images?