Resources · 98

Responsive images: test srcset, sizes and cropping

Deliver an appropriate variant without losing the subject, readability or layout stability.

· 3 min

Laptop displaying code on a desk Illustration · fictional scene

What this guide helps achieve

  • Measure the actual slot
  • Separate resolution and composition
  • Preserve subject and dimensions
  • Inspect the downloaded resource
  • Review quality and loading

Quick check

  • Should sizes always be 100vw?
  • Can mobile use a different crop?
  • How can the chosen file be confirmed?

Step-by-step method

  1. 01

    Measure the actual slot

    Record image width in each layout, not just viewport width. A column can occupy only part of the screen. Include text, zoom and narrow devices in acceptance checks.

    Output: Observed widths and ratios.

  2. 02

    Separate resolution and composition

    Use srcset and sizes to offer resolutions suited to displayed space. Use picture when crop or format must change. Retain a fallback image and a role-appropriate text alternative.

    Output: Variants and selection conditions.

  3. 03

    Preserve subject and dimensions

    Compare crops so essential labels, subjects and captions remain present. Reserve space for the displayed ratio; different compositions may need different ratio rules.

    Output: Crops and reserved space.

  4. 04

    Inspect the downloaded resource

    Record currentSrc, intrinsic dimensions, displayed slot and transferred bytes. Replay with controlled cache and relevant pixel densities. CSS reduction can still display an unnecessarily large file.

    Output: Actually transferred resource.

  5. 05

    Review quality and loading

    Check text, contrast, transparency and artefacts in final rendering. Avoid delaying essential initially visible images. Limit secondary-media work without making access depend on fragile scripting.

    Output: Quality and loading acceptance.

Fictional acceptance-test scenarios

These proposed cases are not client observations. Adapt data, permissions and acceptance criteria to your authorised environment.

Situation to exerciseResult to checkEvidence to retain
A card is 320 CSS pixels wide but sizes declares the whole viewport.Compare rendered width with the declaration to avoid unnecessarily heavy selection; test several densities and viewports.Measured width, currentSrc, dimensions and transferred bytes.
A mobile crop removes a detail needed to understand the scene.Choose context-appropriate cropping or an editorial variant, then review alternative text.Breakpoint screenshots and information still visible.
An image arrives after text without reserved space.Set suitable dimensions or aspect ratio and observe actual stability, without prioritising every image.Dimensions, loading order and observed layout movement.

Reusable worksheet

Complete with your authorised observations. These fields are a working template, not observed results.

FieldInformation to record
SlotWidths and ratios per layout
VariantsFormats, dimensions and bytes
Selectionsrcset, sizes, picture and received file
QualitySubject, alternative, zoom and loading

Worked example

Illustrative situation

Fictional example: a 340 px card receives a 2,400 px image prepared for full-width display.

Decision and expected evidence

Acceptance corrects the slot description, offers multiple variants and verifies resource selection while preserving necessary detail.

Distinguish the mechanisms

MechanismPurposeCheck or limitation
srcset and sizesResolution selectionDescribe the actual slot
pictureFormat or art directionRetain fallback img
CSSScreen dimensions and cropDoes not alone reduce transfer

Management indicators

IndicatorWhat it measuresFirst action
Transferred bytesCost of received variantCompare with actual use
ReadabilityInformation retained in renderingReview crop or compression
StabilitySpace reserved before receiptCorrect dimensions and ratios

Common pitfalls

  • Describe the actual slot
  • Retain fallback img
  • Does not alone reduce transfer

Frequently asked questions

Should sizes always be 100vw?

No. Describe the image slot: a card or column may not fill the viewport.

Can mobile use a different crop?

Yes when useful information remains. Check ratio, alternative and subject in each composition.

How can the chosen file be confirmed?

Inspect currentSrc and the actual transferred request under the tested cache and screen conditions.

Further reading and tools

Editorial resources to extend the method.

Official references

References consulted: . The method and worksheet propose checks to adapt to your context; they do not constitute certification.