Images often account for most page weight. This guide covers optimization techniques for faster loading.
Modern Image Formats#
Format Comparison#
| Format | Best For | Browser Support |
|---|---|---|
| WebP | Photos, graphics | 97%+ |
| AVIF | High compression | 85%+ |
| JPEG | Photos (fallback) | 100% |
| PNG | Transparency | 100% |
| SVG | Icons, illustrations | 100% |
Picture Element for Fallbacks#
Loading code block...
Responsive Images#
Loading code block...
Lazy Loading#
Loading code block...
Next.js Image Optimization#
Loading code block...
Build-Time Optimization#
Loading code block...
CDN Configuration#
Loading code block...
Always specify dimensions, use modern formats with fallbacks, and lazy load below-the-fold images.