Group
  • Performance

    Optimize my images for the web

    Convert, compress, resize, and lazy-load images so pages stop shipping megabytes of unoptimized media.

    • Improve quality
    • Ship faster
    • Beginner
    • General

Free Prompt

My app ships images that were probably never optimized, and I want that fixed. First, inventory every image my app serves: static assets in the repo and, if my app stores user uploads, how those are served too. For each, note the format, file size, displayed dimensions, and actual file dimensions. Then fix what's wrong: 1. Convert images to modern formats (WebP, or AVIF where my stack supports it) with sensible compression, keeping originals untouched. 2. Resize images to the maximum dimensions they're actually displayed at. A 4000-pixel photo rendered at 600 pixels is waste. 3. Add responsive image markup (srcset or equivalent) where images serve across screen sizes, so phones don't download desktop-sized files. 4. Add lazy loading for images below the fold, but NOT for the hero or first visible image, which should load eagerly and have explicit dimensions to prevent layout shift. 5. For user uploads (if applicable): add server-side resizing and compression on upload so users can't upload a 12-megabyte avatar that gets served back at full size forever. Set explicit width and height (or aspect ratio) attributes on image elements so the page doesn't jump while loading. When done, report per page or component: weight before, weight after, and what changed.

What This Does / How This Helps

This finds every image your app serves and optimizes the lot: modern formats, correct dimensions, responsive markup, lazy loading below the fold, and server-side handling for uploads. Images are usually the single largest contributor to page weight in vibe-coded apps, because generated code happily references a stock photo straight from Unsplash at full resolution. The fix is mechanical and high-impact: it's common to cut page weight in half with image work alone. The layout-shift instruction matters too, since images without dimensions make pages jump around while they load, which reads as broken.

Want to skip doing this by hand?

Fortivibe audits your app for all of the areas these prompts cover (and more).

See What We Check

Related Prompts