Image Optimization Issues
What This Means
Unoptimized images are one of the most common causes of poor website performance. They contribute to slow page loads, poor Core Web Vitals scores, and excessive bandwidth usage.
Impact:
- Slow Largest Contentful Paint (LCP)
- High bandwidth costs
- Poor mobile experience
- Lower search rankings
- Increased bounce rates
How to Diagnose
1. PageSpeed Insights
Run PageSpeed Insights and check for:
- "Properly size images"
- "Serve images in next-gen formats"
- "Efficiently encode images"
- "Defer offscreen images"
2. DevTools Network Analysis
- Open DevTools > Network tab
- Filter by "Img"
- Check Size column for large images (>500KB is concerning)
- Note format (JPEG, PNG, WebP, AVIF)
3. Lighthouse Audit
DevTools > Lighthouse > Performance audit shows:
- Image optimization opportunities
- Potential savings in KB/MB
General Fixes
1. Resize Images Appropriately
Rule of thumb: Image dimensions should match display size.
| Display Size | Max Image Width |
|---|---|
| Full-width hero | 1920px |
| Content area | 1200px |
| Thumbnail | 400px |
| Icon | 100px |
2. Use Modern Formats
| Format | Best For | Browser Support |
|---|---|---|
| WebP | Most images | 97%+ |
| AVIF | Next-gen compression | 85%+ |
| JPEG | Photos (fallback) | 100% |
| PNG | Transparency needed | 100% |
| SVG | Icons, logos | 100% |
HTML with fallback:
<picture>
<source srcset="image.avif" type="image/avif">
<source srcset="image.webp" type="image/webp">
<img src="image.jpg" alt="Description">
</picture>
3. Compress Images
Tools:
- Squoosh - Online, visual comparison
- TinyPNG - Batch compression
- ImageOptim - Mac app
- ShortPixel - WordPress plugin
Target file sizes:
- Hero images: <200KB
- Content images: <100KB
- Thumbnails: <30KB
4. Implement Lazy Loading
<img src="image.jpg" loading="lazy" alt="Description">
Platform implementations:
- Shopify: Built-in lazy loading
- WordPress: Built-in since 5.5
- Custom: Use Intersection Observer
5. Set Explicit Dimensions
Always include width and height to prevent layout shift:
<img src="image.jpg" width="800" height="600" alt="Description">
6. Use CDN with Image Optimization
Many CDNs offer automatic optimization:
- Cloudflare Polish
- Imgix
- Cloudinary
- Shopify's CDN
- WordPress Jetpack
Platform-Specific Guides
| Platform | Guide |
|---|---|
| Shopify | Shopify Image Optimization |
| WordPress | WordPress Image Optimization |
| Squarespace | Squarespace Images |
| Webflow | Webflow Image Settings |
Verification
After optimizations:
- Re-run PageSpeed Insights
- Check LCP improvement
- Verify images still look acceptable
- Test on mobile devices
- Check bandwidth savings in Network tab
Automated Solutions
For ongoing optimization:
- CDN-based: Cloudinary, Imgix (transform on the fly)
- CMS plugins: ShortPixel, Smush (WordPress)
- Build tools: imagemin, sharp (development)
Further Reading
- LCP Issues
- CLS Issues (related to image dimensions)