Image optimization strategies

One route per technique, from unoptimized to fully optimized. Each renders the same 21-image dataset as a responsive grid; each grid item links to a large detail view (the LCP element). The Lighthouse harness (pnpm benchmark:optimg) measures the live deploy — warm runs, one dpl, mobile and desktop — to compare image bytes and LCP.

Strategies

Measured results — desktop

StrategyLCP med (min–max) msCLSImage bytes (KB)
naive605(541–690)0.0049124
manual375(365–435)0.000888
auto348(339–385)0.000716
pixel-perfect305(279–372)0.000222
skeleton398(337–466)0.000716
lqip404(387–488)0.000716
cropped369(357–388)0.000785
final403(373–423)0.000222

Warm-cache Lighthouse 13 medians — desktop, 5 runs each on one deploy. Image bytes are the deterministic ranking; LCP is the secondary confirmation — see the README.

Key findings

  • Bytes wins go to pixel-perfect and final — 222 KB and 222 KB, ~69% under auto (716 KB) and 98% under naive. Exact sizes + widths derived from layout tokens means the CDN serves the slot file with no slack.
  • LQIP does not improve LCP — its LCP (404 ms) runs ~56 ms over auto (348 ms) at equal image bytes: the cost is decoding the placeholder, not the image. The above-fold LCP snaps now — the fade is exempted above the fold — so the placeholder never inflates the metric. LQIP's payoff is perceived speed: a filled slot instead of a white box while the real file streams.
  • final is the production pick — matches pixel-perfect on bytes (222 KB) while LQIP delivers instant visual feedback. The 98 ms LCP delta vs pixel-perfect is the cost of the LQIP layer (placeholder decode), not a fade — the above-fold image snaps.

Measured results — mobile

StrategyLCP med (min–max) msCLSImage bytes (KB)
naive28926(28901–29103)0.2579124
manual6547(6528–6592)0.0001148
auto3789(3779–3817)0.000597
pixel-perfect4523(4487–4674)0.000913
skeleton3803(3792–3832)0.000597
lqip3816(3805–3868)0.000597
cropped3611(3567–3633)0.000585
final4534(4504–4593)0.000913

Warm-cache Lighthouse 13 medians — mobile, 5 runs each on one deploy. Image bytes are the deterministic ranking; LCP is the secondary confirmation — see the README.

Desktop vs mobile — same code, the slot flips

StrategyDesktop (KB)Mobile (KB)
auto716597
pixel-perfect222913
final222913

pixel-perfect is the lightest on desktop (316 px 3-col thumb) and among the heaviest on mobile (full-width hero at DPR 1.75), whileauto does the reverse — it under-sizes the big mobile slot. Bytes compare within a mode; each row is one strategy's own desktop→mobile shift.