Skip to content

Responsive images

images chosen by the browser for their layout

What it is

Responsive images let a browser choose a suitable image resource for the place a picture occupies. A small screen may need fewer pixels than a large one, and a high-density display may need more than a standard-density display of the same layout size. The page can describe its available resources and the expected display conditions so the browser can select one that fits.

HTML provides several ways to express the choices. A srcset list can associate candidate files with widths or pixel-density descriptors. A sizes attribute can describe an expected layout slot when width descriptors are used. The browser uses this information along with its actual conditions. A picture element can also provide a different crop for a particular layout or offer a different encoding supported by the recipient.

Image dimensions are another part of the design. Accurate width and height information can help the browser reserve space before an image arrives. The displayed size can still respond to CSS. Verify the relationship between the declared dimensions, the resources’ actual pixels and the layout, especially where a page uses crops of different shapes.

  • Small prints clipped to a line on a pale wall
    Photo: jkdvmim / Pixabay
  • Curving strips of translucent photographic film
    Photo: Kitos_LAB / Pixabay

Use the concept in a decision

Put “What are responsive images?” to work in a real decision. We can help relate the concept to the system you are building or buying. Interfaces that load quickly, work on a phone and behave the same in every browser your customers happen to use.

Explore our services Get in touch

Test the assumptions behind the term

Use the explanation and linked work to frame questions for your project. We can examine the assumptions with you before a tool is chosen. Directed full‑stack GIS map development — full‑stack mapping, from database to browser

Directed full‑stack GIS map development Get in touch

Why it matters

Sending the largest available photograph to every visitor can increase download time and data use. Sending a small version everywhere can make an important image blurry when it is displayed larger or at higher density. The site can offer useful choices and let the browser pick among them. Verify the browser’s actual choice at different viewport widths, display densities and cache states.

Different layouts can change the image’s slot in ways the viewport width alone does not explain. A wide desktop page might give an image only part of its width in a grid. A narrower layout can place the same picture across a whole column. An inaccurate sizes declaration can cause the selected resource to be larger or smaller than the layout needs. Derive it from the component’s actual breakpoints.

Art direction is a separate decision about what the reader sees. A portrait on a small screen may need a tighter crop if the full scene makes the important person too small. The crop still needs to preserve what the image contributes, and its text alternative should keep that meaning. Inspect the resource and composition together at the layout where people see it.

What it looks like in practice

Imagine a portrait in a profile and on a wide article page. Measure the display slot in each use. Generate smaller derivatives that preserve the intended crop and enough candidates for the display densities the product cares about. Use an ordinary image fallback and supply the expected sizes for the width-based candidates. Check that the decoded image looks sharp at the actual rendered size.

Make the network test part of the review. In a fresh browser at a small viewport, observe the selected resource and measure the slot. Repeat at the same width with a higher-density setting and then at a wider layout. A warm cache can affect which resource the browser reuses, so exercise a return visit separately. Record the resource dimensions, content type and bytes next to the captured result.

Engineer’s stylesheet and asset delivery case study records a trial of a modern format for the brand mark. The trial file was larger, so the site kept the existing format. The same case describes checking original pixel dimensions against the actual display size. Measure the selected file, its bytes and its appearance under the conditions readers use to see whether each candidate should be offered.

Include the initial layout before the image has decoded. Reserve the correct proportions and look for a later shift. If the portrait moves between a sidebar and a wide column, test both placements and ensure the metadata describes the resource used in each.

When the image belongs at the top of an article, check how early the browser finds it and whether the page defers it. A below-the-fold gallery and an opening portrait can have different loading policies while sharing the same candidate-generation pipeline. Compare the initial page request, the moment the first photograph appears and the downloads caused by scrolling. Repeat in a realistic connection profile, since a large resource that arrives instantly from the local cache can mask a substantial cost on the first visit. Keep the loading priority decision close to the image’s role so it stays correct when the layout moves.

Where it goes wrong

If the sizes value describes the full screen, the browser can fetch an unnecessarily large resource for an image in a narrow column. Compare the expected and measured widths around layout changes. Keep the media conditions in the markup aligned with the CSS, or use a design that makes the slot clear through a supported default.

A resource can also declare an inaccurate width or contain a crop different from what the layout assumes. Verify the actual dimensions of the files offered. If a candidate was resized from a smaller master, it can use more bytes without improving detail. Check the delivered pixels at the native sizes and densities that motivated the candidate.

Finally, review the whole image experience. A picture can have correct network behaviour while its crop loses an important detail, its reserved area is inaccurate, or its alternative no longer describes the visible subject. A useful responsive image delivers appropriate bytes, leaves the layout stable and preserves meaning across the contexts in which it appears.

Further reading

Glossary

Choose for your actual constraints

Describe the workflow, the existing interfaces and the users who need the change. We can define a testable delivery and a handover that lets your team maintain it.

See what it costs Get in touch

Make the terminology practical

Ask how “What are responsive images?” applies to your organisation. A concrete example from your current system is enough to start the discussion.

Explore our services
welcome@engineer.company +45 50 10 61 84 Copenhagen, Denmark
QR code for Responsive images
Take this page with youhttps://engineer.company/glossary/responsive-images/