guide2 min read

Optimize Images for Web

Complete guide to image optimization: format selection, compression, sizing, lazy loading, and CDN delivery.

Image optimization is the highest-impact performance improvement for most websites. Images account for approximately 50% of average page weight. The optimization pipeline has five steps: (1) Choose the right format — WebP for photos, SVG for icons/logos, PNG for screenshots with text. (2) Compress — reduce quality to 75-85% for photos (imperceptible loss). (3) Resize — never serve a 4000px image in a 400px container. (4) Lazy load — add loading="lazy" to below-fold images. (5) Use a CDN — serve images from edge servers close to users. Following all five steps typically reduces page weight by 60-80% and improves Largest Contentful Paint (LCP) by 1-3 seconds.