
Modern Image Strategy: picture, AVIF, WebP, and the Format Fallback Ladder
Modern image formats cut the bytes behind most LCP images, and fetch priority influences when those bytes arrive. AVIF can save more than half the bytes of an equivalent JPEG, depending on content, encoder settings, and quality target; the picture element handles the negotiation natively.
TL;DR: Switching image formats is a relatively low-effort Largest Contentful Paint improvement in 2026, though web.dev's field analysis finds that download time is usually a small share of LCP compared with when the image request starts. AVIF became Baseline Newly available in January 2024 and Widely available in July 2026, and web.dev reports having seen savings of more than 50 percent versus JPEG, with the exact saving depending on content, encoder settings, and quality target (web.dev); WebP has been Widely available since March 2023 (Newly available since September 2020); Google's own study measured lossy WebP at 25 to 34 percent smaller than comparable JPEG (Google). The <picture> element with type-based source selection has been Widely available since 2018. The format compatibility problem is solved at the platform layer; what is left is operational — pipeline, CDN, fallback ladder, and the loading attributes (fetchpriority, loading, decoding) that turn the format win into a measurable LCP improvement.
Why image format is still worth getting right
On most pages the Largest Contentful Paint element is an image (web.dev). Download time is usually a small part of that timing — the same analysis found it is the shortest LCP subpart — so smaller files help most when they are paired with an early, high-priority request. On pages where the LCP image is large and fetched late, a well-tuned image setup can move LCP across the "good" threshold.
The savings from format alone are substantial. Switching a hero from JPEG to AVIF can save more than 50 percent — web.dev reports having seen savings at that level — though the saving depends on the image, encoder settings, and quality target (web.dev). Google measured lossy WebP at 25 to 34 percent smaller than JPEG. AVIF is usually smaller again than WebP. For illustration, if AVIF halves a 200 KB JPEG hero, that is roughly 100 KB saved before any other optimization runs.
The compatibility story is no longer the bottleneck. The <picture> element has been Baseline Widely available since 2018; AVIF reached cross-browser availability when Edge shipped support in version 121 (January 2024), the last core browser to do so (after Safari 16.1 on iOS in 2022, and Safari 16.4 on macOS and Firefox 113 in 2023), and is Baseline Widely available since July 2026 (web-features data, as of October 2026). The remaining work is operational: building the pipeline that produces the multiple formats, configuring the CDN that serves them, and writing the markup that orchestrates the fallback ladder.
AVIF, WebP, JPEG XL — the 2026 status
The format landscape has stabilized.
| Format | Baseline status | Compression vs JPEG | Notes |
|---|---|---|---|
| AVIF | Newly available January 2024; Widely available July 2026 | Savings >50% reported (depends on content, encoder settings, quality target) | Chrome 85 (2020), Safari iOS 16.1 / macOS 16.4 (2022-2023), Firefox 113 (2023), Edge 121 last (2024) |
| WebP | Newly available September 2020; Widely available March 2023 | 25-34% smaller at equivalent SSIM (Google) | Universal modern engine support; safe fallback when AVIF decoder absent |
| JPEG XL | Limited availability — Safari 17 (2023), Chrome 155 (October 2026), and Firefox 158 (October 2026) by default; not yet in Edge, as of October 2026 | No cited figure (varies by content) | Not Baseline; treat as enhancement only |
| AVIF (animated) | Same as AVIF | No cited figure vs GIF (varies by content) | Replaces animated GIF for short loops |
| WebP (animated) | Same as WebP | Much smaller than GIF (Google measured lossy animated WebP at 64% smaller) | Universal fallback for AVIF animation |
| HEIC | Safari 17+ only; not supported in Chrome, Edge, or Firefox | n/a | Apple camera format — do not serve HEIC to the web |
JPEG XL is the format whose browser status has moved most recently. Safari shipped it in 17 (2023). Chrome now decodes JPEG XL by default from Chrome 155, using the Rust-based jxl-rs decoder (Chrome 155 beta; stable October 2026); Firefox enables it by default from Firefox 158 (released October 2026), and Edge does not support it, as of October 2026 (MDN browser compat data). Until every core browser ships it by default, JPEG XL is Limited availability, not Baseline-safe, and should not be the default lossy format. JPEG XL is an Interop 2026 investigation effort (making the format testable), not a focus area; watch the Interop dashboard and the Baseline status for movement.
The animated-format story matters for product imagery. Animated WebP is much smaller than GIF for the same loop — Google measured lossy animated WebP at 64 percent smaller on average (Google). Animated AVIF has the same browser support as AVIF, though this article cites no measured size comparison with GIF for it. The migration is mechanical and should be standard for any product still serving GIFs above the fold.
HEIC is the format iPhones use for photos when the High Efficiency camera format is selected, which Apple recommends (Apple); photo libraries synced from iPhones can contain these files. Only Safari (17 and later) decodes HEIC; Chrome, Edge, and Firefox do not (MDN browser compat data, as of October 2026). Pipelines must convert HEIC to JPEG / WebP / AVIF before the image is served to the web; uploading HEIC directly produces a broken image for most visitors.
<picture> with type-based source selection
The <picture> element wraps multiple <source> elements followed by a single <img> fallback:
<picture>
<source type="image/avif" srcset="hero.avif">
<source type="image/webp" srcset="hero.webp">
<img src="hero.jpg" alt="...">
</picture>The browser walks the <source> elements in order. In this example, where no <source> has a media attribute, the first <source> whose type value the browser can decode wins; the browser fetches that resource and ignores the rest. If no <source> matches, the <img> element's src is used as the fallback.
Order matters. List AVIF before WebP before JPEG so the browser picks the best supported format first. A misordered source list ("WebP first, then AVIF") forces every modern browser to use WebP because the browser stops at the first matching <source>.
The <img> at the end serves two roles. It is the format fallback for browsers that recognize none of the <source> types — rare in 2026, since WebP is supported in every current engine, but the pattern is correct. It is also the element that participates in srcset, sizes, loading, decoding, and fetchpriority; those attributes go on the <img>, not on the <source> elements (with the exception of srcset and sizes, which work on both).
The type negotiation does not require @supports or feature detection. The browser silently skips <source> elements with unknown types. There is no broken-state visible to the user; if AVIF is not supported, the AVIF source is invisible to that browser and the next <source> is used.
srcset and sizes for resolution switching
A single image at a single size is wasteful for most layouts. srcset and sizes let the browser pick the right resolution for the user's actual rendering context.
<picture>
<source
type="image/avif"
srcset="hero-400.avif 400w, hero-800.avif 800w, hero-1600.avif 1600w, hero-2400.avif 2400w"
sizes="(min-width: 1024px) 50vw, 100vw">
<source
type="image/webp"
srcset="hero-400.webp 400w, hero-800.webp 800w, hero-1600.webp 1600w, hero-2400.webp 2400w"
sizes="(min-width: 1024px) 50vw, 100vw">
<img
src="hero-1600.jpg"
srcset="hero-800.jpg 800w, hero-1600.jpg 1600w"
sizes="(min-width: 1024px) 50vw, 100vw"
alt="...">
</picture>srcset declares the candidate widths available for each format. sizes tells the browser how wide the image will render at each viewport size, so it can pick the right candidate. The browser combines sizes (rendered width), srcset (available candidates), and the device pixel ratio to choose the optimal resource.
sizes is the load-bearing attribute. Get it wrong and the browser downloads too large or too small a candidate. Verify with browser DevTools' network panel sampling at three viewport widths — narrow mobile, tablet, full desktop — and confirm the actual fetched URL matches the rendered display size.
The density-based form of srcset (img@2x.avif 2x) is appropriate for fixed-pixel-size images — icons, logos, decorative elements that do not scale with the viewport. For responsive imagery, the width-based form (img-800.avif 800w) plus sizes is the right tool.
The <picture> element handles both art direction and resolution switching simultaneously. The <source> element's media attribute lets you change crops or compositions at breakpoints; the srcset attribute on the same <source> handles resolution within that breakpoint.
Art direction vs resolution switching
The two transformations are conceptually different and use different tools.
Resolution switching is the same image at different sizes for different display densities and viewport widths. Use srcset on a single <source> (or directly on <img>) with width or density descriptors. The image's content does not change; only the pixel count does.
Art direction is different crops, aspect ratios, or compositions per viewport — for example, a portrait crop on mobile and a landscape composition on desktop, or a hero image that includes the subject at large sizes and zooms to the subject's face at small sizes. Use multiple <source> elements with media queries:
<picture>
<source media="(max-width: 768px)" type="image/avif"
srcset="mobile-portrait-400.avif 400w, mobile-portrait-800.avif 800w"
sizes="100vw">
<source media="(min-width: 769px)" type="image/avif"
srcset="desktop-landscape-1200.avif 1200w, desktop-landscape-2400.avif 2400w"
sizes="50vw">
<img src="desktop-landscape-1200.jpg" alt="...">
</picture>Many product images need only resolution switching; art direction is for hero and editorial sections where the framing matters more than the resolution. Avoid art-direction sprawl — every variant multiplies the files the pipeline has to produce and cache. A reasonable rule is "art-direct only what the design system explicitly calls out as breakpoint-specific" rather than treating every responsive image as an art-direction candidate.
Loading attributes — loading, decoding, fetchpriority
Three attributes on the <img> element turn format wins into LCP improvements.
loading="lazy" defers fetch until the element is near the viewport. Apply it to images below the fold; the browser fetches the image only when the user scrolls toward it. The default is "eager", which fetches immediately; explicit loading="eager" is rarely needed but useful when overriding a lazy default established by a framework.
decoding="async" tells the browser that the next paint does not have to wait for the image to decode (MDN). It is safe for non-critical images.
fetchpriority="high" on the LCP image hints to the browser to fetch this image at a high priority relative to other images. The effect can be measurable — in web.dev's Google Flights test, LCP moved from 2.6 s to 1.9 s — and it matters most where many resources compete for limited bandwidth (web.dev). Set fetchpriority="high" on the hero image; do not set it on multiple images per page (the priority is meaningful only relative to other resources).
fetchpriority="low" on below-fold images that are also loading="lazy" yields bandwidth to higher-priority requests. Any effect depends on how many requests compete for bandwidth; lazy loading already defers these requests.
The combination matters:
<!-- LCP image -->
<img src="hero.jpg" alt="..." fetchpriority="high">
<!-- Above-the-fold but not LCP -->
<img src="logo.svg" alt="...">
<!-- Below-the-fold -->
<img src="thumb.jpg" alt="..." loading="lazy" decoding="async" fetchpriority="low">A key rule: do not set loading="lazy" on the LCP candidate. The deferral hurts LCP timing even when the image is technically above the fold. If you cannot identify the LCP candidate by hand, run Lighthouse and look at the LCP element it identifies; that element should be loading="eager" (or the default) and fetchpriority="high".
CDN responsibilities
A modern image CDN handles the operational pieces that would otherwise live in your build pipeline.
Format negotiation lets the server pick AVIF / WebP / JPEG based on the request's Accept header. The CDN serves, from a single source URL, the best format listed in the request's Accept header. With CDN-side format negotiation, the markup verbosity drops — a single <img src="hero.jpg"> can result in an AVIF response without a <picture> element, because the CDN reads Accept: image/avif,... and serves accordingly.
Responsive resizing materializes variants from a single source. Request a URL with width / height parameters (hero.jpg?w=800 or a path-based variant), the CDN generates the resized image on first request, caches it, and serves the cached variant subsequently. The build pipeline does not have to pre-generate every size; the CDN does it lazily.
Quality knobs differ per format. Quality scales are not comparable across formats or vendors: the same number does not give the same visual quality in different formats. Tune by format against your own imagery; do not use the same number across all formats.
Smart cropping (face / focal-point detection) is offered by Cloudinary, Imgix, Cloudflare Images, and others. Useful for art direction without manual variants — the CDN crops to the detected subject, eliminating the need to pre-generate a portrait crop for every image.
The cache strategy matters for hit rate. Long max-age headers (one year) plus content-addressed URLs (hash in the path) make cache invalidation by URL, not by header. When the source image changes, the URL changes; the old URL stays cacheable forever, the new URL is fresh.
Migration path
A focused image migration can produce a measurable LCP improvement, especially when it also fixes how early the LCP image is requested.
Audit the LCP image on the top 10 templates by traffic. Lighthouse identifies the LCP element on each page; the top templates are the highest-leverage targets. Replace the existing <img> with a <picture> element that includes AVIF and WebP <source> entries; keep JPEG as the <img> fallback.
Set fetchpriority="high" on the LCP image; set loading="lazy" on below-fold images. Verify the LCP element is identified correctly and is no longer marked loading="lazy".
Verify the LCP improvement in Lighthouse right away, then in field data as it accumulates — field dashboards aggregate over a window, so they lag the deployment.
For new content, push the format negotiation into the CDN so authoring tools see one URL and the CDN handles the format selection. The <picture> markup is still useful for art direction; the format negotiation can move to the CDN.
Continue rolling out across the remaining templates as bandwidth allows. Because the first 10 templates are chosen by traffic, they cover the most-visited templates first; the long tail produces smaller-but-still-real improvements.
Deliverables and acceptance criteria for the next planning cycle
- Audit the LCP image on your top 10 templates by traffic; convert each to
<picture>with AVIF + WebP + JPEG fallback ladder - Set
fetchpriority="high"on the LCP image; setloading="lazy"andfetchpriority="low"on below-fold images - Verify
sizesis correct on each<picture>— use DevTools network panel at three viewport widths and confirm the fetched candidate matches the rendered size - Configure your image CDN for format negotiation (
Acceptheader) so new content can use a single URL with CDN-driven format selection - Replace any animated GIFs above the fold with animated AVIF or animated WebP, or with a muted, looping
<video>(MP4 / WebM); the bandwidth saving is large, especially with video - Audit for HEIC uploads that bypass the conversion pipeline; HEIC renders only in Safari, so it breaks the image element for most visitors