01 — Purpose

Images dominate page weight

Good image delivery improves performance and accessibility — users download only what they need.

Unoptimised hero photos and retina PNGs are still the fastest way to blow budgets. Delivery covers format, size, dimensions, loading strategy, and alt text together.

See the images pattern for markup, alt, and review checklist detail.

02 — Principles

Right bytes for the viewport

Serve appropriate dimensions and formats — not the largest file in the CMS.

  • responsive images — srcset and sizes for art direction and density
  • modern formats (AVIF, WebP, JPEG XL) with fallbacks where needed
  • compression appropriate to content — lossy for photos, careful for UI

Compare JPEG XL and AVIF for photographs

Try JPEG XL for photographs where subtle texture or gradients matter. Encode the same crop and dimensions as JPEG XL and AVIF. Adjust each encoder until the two versions look equally good at the intended display sizes, then compare the file sizes. Check download and render timings on a representative mobile device before adding another format to your pipeline.

Support checked 15 November 2026. Safari 17 shipped JPEG XL decoding. Chrome 155 and Firefox 158 enabled it by default in October 2026. See the release notes for Safari 17,Chrome 155and Firefox 158.

Put JPEG XL first when your comparison favours it. The browser chooses the first supported source and uses the JPEG<img> when neither modern format is supported. Use the same crop and aspect ratio in each file so the dimensions and alt text apply to all three.

<picture>
    <source srcset="/images/coast-960.jxl" type="image/jxl">
    <source srcset="/images/coast-960.avif" type="image/avif">
    <img
        src="/images/coast-960.jpg"
        width="960"
        height="640"
        alt="White waves breaking against dark rocks on the Cornish coast"
    >
</picture>

03 — Practice

Delivery checklist

Stable, fast, accessible — together.

  • width and height (or aspect-ratio) on every content image — prevents CLS
  • lazy-load below-the-fold images — not LCP hero assets
  • decode async where it helps main thread — measure on target devices
  • meaningful alt — decorative images use empty alt, not missing alt
  • CDN caching and sensible cache headers for static assets
<img
  src="/images/hero-800.webp"
  srcset="/images/hero-400.webp 400w, /images/hero-800.webp 800w"
  sizes="(min-width: 48rem) 800px, 100vw"
  width="800"
  height="450"
  alt="Team reviewing frontend standards on a projector screen"
  fetchpriority="high"
>

04 — Avoid

Image delivery failures

Oversized assets hurt everyone — especially on mobile networks.

  • 4000px-wide heroes displayed at 600px CSS width
  • lazy-loading the LCP image — delays largest paint
  • layout shift when images load without reserved space
  • loading every gallery thumbnail at full resolution upfront

05 — Close

Fast images help everyone

Less data, stable layout, usable alt text — one discipline, three wins.

Run image audits on templates with real content — not placeholder 20KB SVGs. Pair with Core Web Vitals and the performance review checklist.