Responsive Images in the High‑DPR Era and CSS image-set 2025
Published: Sep 22, 2025 · Reading time: 2 min · By Unified Image Tools Editorial
Beauty vs bytes: the optimum point is determined by srcset
/sizes
and CSS image-set()
.
TL;DR
-
Fixed‑width elements: prefer x‑descriptor (1x/2x); fluid layouts: w‑descriptor +
sizes
-
Background images behind text: switch per DPR using CSS
image-set()
-
Cap bitmap resolution to avoid over‑transfer even on high device pixel ratio screens
-
Handle LCP candidates separately with
fetchpriority="high"
-
Internal links: Srcset Generator tool, INP‑friendly delivery, Image priority & preload
Quick chooser
- Fixed card/thumbnail:
srcset="… 1x, … 2x"
- Hero/fluid layout:
srcset="… 800w, … 1200w" + sizes
- CSS background:
background-image: image-set(url(...@1x.avif) 1x, url(...@2x.avif) 2x)
Examples
<img
src="/imgs/card@1x.avif"
srcset="/imgs/card@1x.avif 1x, /imgs/card@2x.avif 2x"
width="320" height="200" alt="Card"
decoding="async" loading="lazy"
/>
<!-- Fluid layout: w + sizes -->
<img
src="/imgs/hero-1200.avif"
srcset="/imgs/hero-800.avif 800w, /imgs/hero-1200.avif 1200w, /imgs/hero-1600.avif 1600w"
sizes="(max-width: 768px) 92vw, 1200px"
width="1200" height="630" fetchpriority="high"
alt="Hero"
/>
.hero {
background-image: image-set(
url('/imgs/cover@1x.avif') 1x,
url('/imgs/cover@2x.avif') 2x
);
background-size: cover;
}
Frequent mistakes
- Always using
sizes: 100vw
→ selects larger images than needed, wasting bandwidth - Keeping 2x bitrate same as 1x → doubles file size; manage quality via PSNR/SSIM
- No 1x/2x prep for CSS backgrounds → blurry text or heavy payloads
Ops tips
- Generate
@1x/@2x
andw
steps in CI - Centralize
image-set()
definitions as theme variables for reuse - Tune LCP candidates separately (priority/preload)
Checklist
- [ ] Apply the rule: x for fixed, w+sizes for fluid
- [ ] Use CSS
image-set()
for high‑DPR care - [ ] Set
fetchpriority
for LCP candidates - [ ] Monitor wasteful transfer and blurriness together
Summary
To satisfy both “appearance” and “bytes” across devices, keep srcset
/sizes
/image-set()
in your toolbox.
Related Articles
Right-Size Images in 2025 — Layout-Backed Resizing That Cuts 30–70% Bytes
A workflow to derive correct target widths from layout, generate variants, and ship only what each device needs via srcset/sizes.
Responsive Images in 2025 — Srcset/Sizes Patterns That Actually Match Layout
Proven patterns to wire srcset/sizes so the browser picks the correct resource without overserving; includes LCP hints and lazy loading.
Image Optimization Basics 2025 — Foundations That Scale Without Guesswork
A practical, up-to-date starting guide covering the essential concepts that keep image delivery fast and beautiful across devices and locales.