Performance: Image optimization with next/image
HIGH IMPACT
This affects page load speed by reducing image file size and optimizing delivery, improving Largest Contentful Paint (LCP).
import Image from 'next/image'; export default function MyComponent() { return <Image src="/photo.jpg" alt="Sample photo" width={800} height={600} />; }
<img src="/photo.jpg" alt="Sample photo" width="800" height="600" />
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Standard <img> tag | Minimal | 1 reflow per image load | High paint cost for large images | [X] Bad |
| next/image component | Minimal | Single reflow with optimized image | Lower paint cost due to smaller images | [OK] Good |