Image optimization with Next.js 15 Image, AVIF/WebP formats, blur placeholders, responsive sizes, and CDN loaders. Use when improving image performance, responsive sizing, or Next.js image pipelines.
View on GitHubyonatangross/skillforge-claude-plugin
ork
January 25, 2026
Select agents to install to:
npx add-skill https://github.com/yonatangross/skillforge-claude-plugin/blob/main/plugins/ork/skills/image-optimization/SKILL.md -a claude-code --skill image-optimizationInstallation paths:
.claude/skills/image-optimization/# Image Optimization
Production image optimization patterns for modern web applications.
## Overview
- Optimizing Largest Contentful Paint (LCP)
- Reducing page weight and bandwidth
- Implementing responsive images
- Adding blur placeholders for perceived performance
- Converting to modern formats (AVIF, WebP)
## Core Patterns
### 1. Next.js Image Component
```tsx
import Image from 'next/image';
// Static import (recommended for static assets)
import heroImage from '@/public/hero.jpg';
function Hero() {
return (
<Image
src={heroImage}
alt="Hero banner"
priority // Preload for LCP
placeholder="blur" // Automatic blur placeholder
quality={85}
sizes="100vw"
/>
);
}
// Remote images
<Image
src="https://cdn.example.com/photo.jpg"
alt="Remote photo"
width={800}
height={600}
sizes="(max-width: 768px) 100vw, 800px"
/>
```
### 2. Responsive Images with Sizes
```tsx
// Full-width hero
<Image
src="/hero.jpg"
alt="Hero"
fill
sizes="100vw"
style={{ objectFit: 'cover' }}
/>
// Sidebar image (smaller on large screens)
<Image
src="/sidebar.jpg"
alt="Sidebar"
width={400}
height={300}
sizes="(max-width: 768px) 100vw, 33vw"
/>
// Grid of cards
<Image
src={`/products/${id}.jpg`}
alt={product.name}
width={300}
height={300}
sizes="(max-width: 640px) 50vw, (max-width: 1024px) 33vw, 25vw"
/>
```
### 3. Blur Placeholders
```tsx
// Static imports get automatic blur
import photo from '@/public/photo.jpg';
<Image src={photo} alt="Photo" placeholder="blur" />
// Remote images need blurDataURL
<Image
src="https://cdn.example.com/photo.jpg"
alt="Photo"
width={800}
height={600}
placeholder="blur"
blurDataURL="data:image/jpeg;base64,/9j/4AAQSkZJRg..."
/>
// Generate blurDataURL at build time
import { getPlaiceholder } from 'plaiceholder';
export async function getStaticProps() {
const { base64 } = await getPlaiceholder('/public/photo.jpg');
return { props: { blurDataURL: base64