On most websites, images make up more than half of the bytes a visitor downloads. Fixing them is often the quickest route to a faster site, better Core Web Vitals and fewer people leaving before the page loads. Here is the process we follow on client projects.
Choose the right format
- AVIF: the smallest files at good quality. Supported in current major browsers.
- WebP: widely supported, about a quarter to a third smaller than JPEG at similar quality.
- JPEG: a safe fallback for photos.
- PNG: for graphics that need transparency or sharp edges, though WebP often replaces it.
- SVG: for logos and icons. It stays sharp at any size and is tiny.
Avoid GIF for animation. A short MP4 or WebM video is far smaller.
Size images for where they appear
A 4000-pixel photo shown in a 400-pixel card wastes bandwidth. Export images at about twice their display width to cover high-density screens, and no more. Use the srcset and sizes attributes so a phone downloads a small version and a desktop downloads a larger one.
Compress with intent
- Use quality 75 to 85 for photos. The difference is rarely visible and the savings are large.
- Strip metadata such as location and camera data.
- Use Squoosh, ImageOptim or a build step with Sharp rather than exporting by eye.
- Check the result on a real phone, not only a large monitor.
Let Next.js do the heavy work
The next/image component resizes images, serves WebP or AVIF to browsers that support them, lazy loads below-the-fold images and reserves space to prevent layout shift. Always provide width and height or use fill inside a sized parent, and write meaningful alt text. Our App Router performance guide covers more of the framework.
Prioritize the hero image
The largest image above the fold is often your Largest Contentful Paint element. Do not lazy load it. Mark it with priority in Next.js, or add fetchpriority="high", and preload it if it is referenced from CSS. Lazy load everything else with loading="lazy".
Prevent layout shift
When an image loads without reserved space, text jumps down and your Cumulative Layout Shift score suffers. Set dimensions or an aspect-ratio in CSS so the browser reserves the space before the file arrives. A low-quality blur placeholder can make loading feel smoother.
Serve from a CDN with long cache lifetimes
- Use a CDN so images come from a location near the visitor.
- Set
Cache-Control: public, max-age=31536000, immutableon files with a content hash in the name. - Change the file name when you change the image, so caches update.
Handle icons and backgrounds
Use inline SVG or an icon sprite for interface icons instead of many small PNG files. For decorative backgrounds, prefer CSS gradients where possible and compress anything else. Do not load a large background image on mobile if it is hidden by the layout.
Audit your current pages
- Run PageSpeed Insights and read the "Properly size images" and "Serve images in next-gen formats" results.
- Open the browser's Network tab, filter by images and sort by size.
- Fix the five biggest files first.
- Test again and repeat monthly, since new content tends to bring new heavy images.
Put a limit in your workflow
Set an upload rule for editors: images over a certain size are resized automatically. A pipeline step that converts and compresses on upload keeps the problem from returning. Related reading: Optimizing Core Web Vitals for SEO.
A realistic example
A service page had six images, each exported at 4000 pixels wide as JPEG, for a total of 9 MB. After resizing to the display width, converting to WebP and lazy loading everything below the first screen, the page weighed 650 KB and the main image appeared in under two seconds on a mid-range phone. Total effort was about an hour, and no design changed.
A simple rule set for editors
- Upload images no wider than 2000 pixels.
- Name files with words, such as
invoice-dashboard.webp. - Write alt text that describes the image for someone who cannot see it.
- Use screenshots only when they show something readable at the size displayed.
Showing your product in images
Screenshots of software are among the heaviest images on a site, and also among the most persuasive. For a product such as the Lena Dena business platform, crop each screenshot to the part that matters, such as an invoice screen or the stock list, and export it at the size shown. Include the Hindi or Gujarati version of a screen to show multi-language support. For a chat product like our WhatsApp automation, a short image of a message next to the resulting spreadsheet row explains the value faster than a paragraph.
We build fast sites and audit slow ones. See our web development services and portfolio, or ask for a speed review.

