Prompt

How do I create multiple image sizes for retina and mobile?

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

Latest observation

Nov 2, 2026OpenAI APIWeb search: off

A common way to do this is to create responsive image variants at a few sizes and let the browser choose the best one for the device.

1) Export multiple widths

For example, generate:

  • image-400.jpg — for small mobile screens
  • image-800.jpg — for standard desktop
  • image-1200.jpg — for large/retina screens

For retina displays, a good rule is to provide images at 2x the displayed size.

2) Use srcset and sizes

This is the modern HTML approach:

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

What this does

  • srcset tells the browser the available image files and their widths.
  • sizes tells the browser how wide the image will be rendered.
  • The browser then picks the best file for the screen and pixel density.

3) If you need different crops, use <picture>

If mobile and desktop need different compositions, use <picture>:

<picture>
  <source media="(max-width: 600px)" srcset="mobile-image.jpg">
  <source media="(min-width: 601px)" srcset="desktop-image.jpg">
  <img src="desktop-image.jpg" alt="Example image">
</picture>

4) Retina-specific option

If you just want 1x/2x versions, you can use density descriptors:

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

5) Tools to generate variants

You can automate this with:

  • ImageMagick
  • Sharp (Node.js)
  • Squoosh
  • Cloudinary / Imgix / ImageKit

Example with Sharp:

import sharp from "sharp";

await sharp("input.jpg").resize(400).toFile("image-400.jpg");
await sharp("input.jpg").resize(800).toFile("image-800.jpg");
await sharp("input.jpg").resize(1200).toFile("image-1200.jpg");

Best practice

  • Use modern formats like WebP or AVIF where possible.
  • Keep file sizes reasonable.
  • Always include an alt attribute.
  • Use srcset + sizes unless you need different crops, then use <picture>.

If you want, I can also show you how to do this in React, Next.js, WordPress, or with CSS background images.

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.