Resolution and Format Choices

Offer multiple sources, describe the display size, and lazy-load images that are not the LCP candidate.

Density with srcset and sizes

Sunlit valley with a winding river

srcset lists candidate widths; sizes tells the browser how wide the image will render so it can pick a file without downloading all of them.

Art direction and WebP with picture

Coastal cliff path suitable for a narrow crop

Use media on <source> when the crop should change (art direction). When you ship WebP files, add a type="image/webp" source before the JPEG fallback. Always keep a fallback <img> with intrinsic dimensions and meaningful alt.

Lazy loading

Mark below-the-fold images with loading="lazy". Leave the largest above-the-fold hero or product shot eager so LCP is not delayed.

Quiet harbour with moored boats

Important markup

<img
  src="photo-800.jpg"
  srcset="photo-800.jpg 800w, photo-1200.jpg 1200w"
  sizes="(width >= 48rem) 40rem, 100vw"
  alt="…"
  width="800"
  height="450"
  loading="lazy"
  decoding="async">

<picture>
  <source type="image/webp" srcset="photo.webp">
  <img src="photo.jpg" alt="…" width="800" height="450" loading="lazy">
</picture>