A Practical Checklist for Faster Website Images
7 min read · Published
On many pages, images account for most of the bytes a visitor has to download. Trimming them is one of the quickest ways to make a site feel faster, especially on phones and slow connections. This checklist walks through the changes that matter most, in a sensible order.
1. Serve the size you display
Find the largest width an image is shown at and export it near that size, with some extra room if you want it sharp on high-density screens. A 4000-pixel photo displayed in a 800-pixel column wastes bandwidth. Resize before you compress, because fewer pixels means less data to encode.
2. Pick the right format
Use JPG, or WebP and AVIF where you can, for photographs. Use PNG or lossless WebP for screenshots and graphics with sharp edges and transparency. Use SVG for logos and icons. Choosing the right format often saves more than tuning the quality slider.
3. Compress with your eyes open
For lossy formats, start around 70 to 85 percent quality for photos and compare the preview at full size. Stop when you can just begin to see a difference, then step back. Keep your originals so you can re-export later without stacking compression.
4. Give images explicit dimensions
Setting width and height on your image elements lets the browser reserve space before the file arrives, which prevents the page from jumping as pictures load. That layout shift annoys visitors and counts against page experience.
5. Load below-the-fold images lazily
Browsers support a loading attribute that delays images far down the page until the visitor scrolls near them. Use it for images that are not visible on first load, but not for the main image at the top, which should load immediately because it affects how quickly the page looks ready.
6. Offer responsive versions
The srcset and sizes attributes let the browser pick an appropriately sized file for the device. A phone then downloads a smaller image than a large desktop monitor does. Exporting two or three widths of each important image is usually enough.
7. Write useful alt text
Alt text describes an image to people using screen readers and appears if the image fails to load. Describe what matters about the picture in a short phrase, and leave decorative images with an empty alt value so they are skipped.
8. Re-measure
After changes, test the page with a tool such as the performance panel in your browser’s developer tools and compare transferred bytes before and after. Check the pictures on a real phone, too. Speed work is only finished when the numbers improve and the images still look good.