Prompt

How do I handle different image sizes for breakpoints and retina displays?

Technology / CDN & Edge Infrastructure1 observationLast seen Nov 3, 2026

Latest observation

Nov 3, 2026OpenAI APIWeb search: off

A good way to handle this is to separate two concerns:

  1. Responsive art direction / layout breakpoints: serve different image sizes for different viewport widths.
  2. High-density displays (retina / DPR): serve sharper images for devices with more device pixels.

Best practice: use srcset + sizes

For most responsive images, this is the simplest and most flexible solution.

<img
  src="photo-800.jpg"
  srcset="
    photo-400.jpg 400w,
    photo-800.jpg 800w,
    photo-1200.jpg 1200w,
    photo-1600.jpg 1600w
  "
  sizes="
    (max-width: 600px) 100vw,
    (max-width: 1200px) 50vw,
    33vw
  "
  alt="Example image"
/>

How it works

  • srcset lists available image files and their intrinsic widths.
  • sizes tells the browser how wide the image will actually be on the page at different breakpoints.
  • The browser uses those values plus the device pixel ratio to pick the best file.

This automatically handles:

  • mobile vs desktop breakpoints
  • retina displays
  • bandwidth optimization

For retina displays specifically

If you want to provide 1x and 2x versions, you can use pixel density descriptors:

<img
  src="photo.jpg"
  srcset="photo.jpg 1x, photo@2x.jpg 2x"
  alt="Example image"
/>

This is fine for simple cases, but w descriptors with sizes are usually better for responsive layouts.

If you need different crops, use <picture>

When the image itself should change shape or composition at different breakpoints, use <picture>:

<picture>
  <source
    media="(max-width: 600px)"
    srcset="photo-mobile-400.jpg 400w, photo-mobile-800.jpg 800w"
    sizes="100vw"
  />
  <source
    media="(min-width: 601px)"
    srcset="photo-desktop-800.jpg 800w, photo-desktop-1600.jpg 1600w"
    sizes="50vw"
  />
  <img src="photo-desktop-800.jpg" alt="Example image" />
</picture>

Use this when:

  • mobile needs a different crop than desktop
  • aspect ratio changes
  • you want to art-direct the image

Practical recommendations

  • Export images at a few sensible widths, such as: 400, 800, 1200, 1600.
  • Use srcset + sizes for responsive sizing.
  • Use picture only when the image content/crop changes.
  • Compress images well and prefer modern formats like WebP or AVIF when possible.

Common mistake

Avoid relying only on CSS width: 100% or only on @2x images. That won’t fully solve responsive breakpoints or load the most efficient file for each screen.

If you want, I can also show:

  • a real example for CSS/HTML
  • how to do this in React/Next.js
  • how to generate the image variants automatically

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.