Skip to content
Every tutorial here is 100% free — and always will be
LSLovableStudent

How do I optimise images?

Last checked 31 Aug 2026

Short answer

Resize images to their actual display size, compress them, convert to WebP/AVIF where practical, and lazy-load anything below the fold — ask Lovable to apply this across the project, not just one page.

The core steps

  1. Resize to display size. An image shown at 600px wide doesn't need to be 3000px wide — resize before or during upload.
  2. Compress. Even at the correct dimensions, unoptimised JPEG/PNG files are often 2-5x larger than they need to be.
  3. Use modern formats. WebP (or AVIF) gives similar quality at a smaller file size than JPEG/PNG for most photographic and graphic content.
  4. Lazy-load below-the-fold images. Anything not visible on initial load shouldn't compete for bandwidth with what is.
  5. Don't lazy-load the hero/LCP image — that one should load eagerly since it's what Core Web Vitals measures first.

How to ask Lovable

Review all images used in this project. Resize and compress any that are larger than their display size, convert suitable ones to WebP, and lazy-load images that appear below the fold. Leave the hero image loading eagerly.

Ongoing habit, not one-off

Every time you add a new image (product photo, blog header, team photo), apply the same rules — compression tends to be forgotten for anything added after the initial build.

What usually goes wrong

  • Converting every image to WebP without checking older browsers/exports still need it in a fallback format for edge cases (rare, but worth a quick check if you support very old browsers).
  • Compressing so aggressively that quality visibly degrades — aim for the smallest file size that still looks sharp, not the smallest possible file.
  • Forgetting images used as CSS backgrounds — these are often missed in a component-by-component review.

See /questions/how-do-i-lazy-load-images and /questions/how-do-i-improve-lcp for related fixes.

Sources

Was this answer helpful?

Related questions

Website made, maintained and hosted by PromptSites.com

PromptSites logo