Web Development
Optimise Images for the Web
2026-10-12 · 8 min read · Updated 2026-10-12

Choose the right format
Use WebP or AVIF for photos and illustrations, PNG only where transparency is truly needed, and SVG for logos and icons. Modern formats are much smaller at the same quality, which is the single biggest image win on most sites. Keep the original file, and generate the web version from it.
Resize before upload
Resize images to the largest size they will actually be shown at — a 400-pixel-wide image never needs to be 4000 pixels wide. A content management system will not fix this for you unless it is set up to. Check the largest display size first, then resize to match it.
Compress sensibly
Compress photos until you can just barely see the difference, then step back one notch. For most photos, a quality setting around 75–85 in WebP looks identical to the original at a fraction of the size. Compare before and after at full size, not in a thumbnail.
Lazy-load below the fold
Let images below the fold load only when the visitor scrolls near them, using the loading=“lazy” attribute. This makes the first view faster without removing any content. Always set width and height on images so the page does not jump as they load.
imageswebpperformance


