consolelog.tools

Responsive Image Generator

Build production responsive image markup — srcset with width or density descriptors, a sizes attribute from declarative rules, <picture> with AVIF/WebP sources, or Next.js / Gatsby components. It transforms URLs for Cloudinary, imgix and the Next image optimizer, estimates the bytes AVIF and WebP save over JPEG, and audits your markup for the mistakes that hurt LCP and CLS (a lazy + high-priority conflict, missing aspect-ratio, empty alt).

About this ToolHow it works, benefits & use cases

Most responsive-image tools just stitch together a srcset string. This one treats the whole markup as the unit and adds the parts that actually move your Core Web Vitals. You enter a source path and alt text, choose an output format (a plain <img> with srcset, a <picture> with AVIF and WebP sources, a Next.js <Image>, a Gatsby <StaticImage>, or plain HTML), then decide whether to serve width descriptors (640w, 1024w) for fluid layouts or density descriptors (1x, 2x, 3x) for fixed-size images like avatars. A declarative sizes builder turns breakpoint rules into "(min-width: 768px) 50vw, 100vw" so the browser picks the right candidate. When you point at a CDN the candidate URLs are rewritten correctly for Cloudinary, imgix, or the Next image optimizer; otherwise it uses the filename-suffix convention. As you edit, the tool estimates how many bytes AVIF and WebP save over JPEG at your largest width, shows a live preview at your chosen aspect-ratio, and runs an audit that flags the mistakes that hurt LCP and CLS: a lazy + fetchpriority=high conflict, a missing aspect-ratio, an empty alt, or a single-format <picture>. The entire configuration lives in a shareable URL.

How to Use

  1. 1Start from a preset (Hero, Card thumbnail, Avatar density, or Next.js Image) or configure by hand.
  2. 2Enter the image path and a descriptive alt text, then pick an output format.
  3. 3Choose width or density descriptors, then toggle the candidate widths (320-2560) or densities (1x-3x).
  4. 4For width descriptors, build the sizes attribute by adding breakpoint rules; the last rule is the fallback.
  5. 5Set loading, decoding, fetchpriority and an aspect-ratio, and optionally pick a CDN to rewrite the URLs.
  6. 6Copy the generated markup (and the aspect-ratio CSS), or share the URL.

Key Benefits

  • Five output formats: <img>, <picture> with AVIF/WebP, Next.js <Image>, Gatsby <StaticImage>, and plain HTML
  • Width descriptors for fluid layouts or density (1x/2x/3x) descriptors for fixed-size images
  • A declarative sizes builder that produces (min-width: ...) rules with a fallback
  • CDN URL transforms for Cloudinary, imgix, and the Next.js image optimizer
  • A deterministic byte-savings estimate showing AVIF vs WebP vs JPEG at your largest width
  • A live audit that catches the lazy + fetchpriority=high conflict, missing aspect-ratio (CLS), and empty alt
  • Aspect-ratio CSS to reserve layout space and a shareable URL for the whole configuration

Common Use Cases

  • Generating a full <picture> with AVIF/WebP sources and a JPEG fallback for a hero image
  • Serving a fixed-size avatar with 1x/2x/3x density descriptors instead of widths
  • Producing a Next.js <Image> with priority, a sizes string, and the right quality setting
  • Wiring up Cloudinary or imgix transform URLs across a set of breakpoints
  • Auditing existing markup for the lazy + high-priority conflict and missing aspect-ratio CLS risk

html — updates live as you adjust settings

<img
  src="/images/hero-1920w.jpg"
  srcset="/images/hero-640w.jpg 640w, /images/hero-1024w.jpg 1024w, /images/hero-1920w.jpg 1920w"
  sizes="(min-width: 768px) 50vw, 100vw"
  alt="Descriptive alt text"
  loading="lazy"
  decoding="async"
  style="aspect-ratio: 16/9;"
/>

Reserves the box height before the image loads

.responsive-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16/9;
  object-fit: cover;
}
Estimated size at largest width
jpeg
506 KB
webp
354 KB
avif
253 KB

AVIF is roughly 50% smaller than JPEG here. Rough estimate — actual sizes depend on the encoder and image content.

Preview

aspect-ratio 16/9
srcset candidates
/images/hero-640w.jpg 640w, /images/hero-1024w.jpg 1024w, /images/hero-1920w.jpg 1920w
sizes
(min-width: 768px) 50vw, 100vw
Looks good — no errors or warnings

Presets

Custom configuration — adjust any option below.

Source

Resolution candidates

Widths (w descriptors)

sizes rules

Tell the browser the rendered width at each breakpoint. The last rule has no min-width — it is the fallback.

px
fallback (no min-width)

sizes="(min-width: 768px) 50vw, 100vw"

Loading & performance

CDN / transform

srcset, sizes, and the browser's job

A responsive image hands the browser a menu of candidate files via srcset and a hint about how big the image will render via sizes. The browser then picks the smallest file that still looks sharp at the device's resolution. Width descriptors (640w) suit fluid layouts; density descriptors (2x) suit fixed-size images like avatars and icons.

Why AVIF and WebP, and why aspect-ratio

A <picture> with AVIF and WebP sources lets modern browsers download a much smaller file while older ones fall back to JPEG — often a 50% byte saving with no visible quality loss. Always set an aspect-ratio so the layout reserves space before the image loads; otherwise the page jumps as images arrive and your Cumulative Layout Shift score suffers.

Was this tool helpful?

Share Your Experience

Help others discover this tool!

Related tools