name: image-optimization description: 图像格式、响应式图像、懒加载和CDN集成。 allowed-tools: Read, Write, Edit, Bash, Glob, Grep
图像优化技能
提供图像优化的专业协助。
能力
- 优化图像格式(WebP、AVIF)
- 实现响应式图像
- 配置懒加载
- 设置图像CDN
- 处理模糊占位符
Next.js Image
import Image from 'next/image';
<Image
src="/hero.jpg"
alt="Hero"
width={1200}
height={600}
priority
placeholder="blur"
blurDataURL={blurData}
/>
响应式图像
<picture>
<source srcset="image.avif" type="image/avif" />
<source srcset="image.webp" type="image/webp" />
<img src="image.jpg" alt="" loading="lazy" />
</picture>
目标流程
- 图像优化
- 性能提升
- LCP优化