Image Optimization

aj-geddes/useful-ai-prompts/skills/image-optimization

作者 aj-geddes3f5182cfd739无许可证355 个星标收录于 2026年10月8日更新于 2026年10月8日仓库7个月前更新

Optimize images for web to reduce file size without sacrificing quality. Use compression, modern formats, and responsive techniques for faster loading.

仅含说明Design & Creative
AI 生成的概览

指导网页图片优化,涵盖压缩、现代格式与响应式图片技术。

功能
该技能提供网页图片优化指导,在保持质量的同时减小文件体积。内容涵盖格式选择(JPEG、PNG、WebP、SVG)、压缩设置、响应式图片实现、优化流程以及监控最佳实践。它还包含一个组件模板和参考指南,但不附带脚本。
适用场景
适用于优化网站图片、实现响应式图片、提升页面性能或改善移动端体验,包括部署前的优化。
运行要求
不附带脚本或工具,仅为说明文档和参考文档。按照指导操作可能涉及外部图片工具,如 ImageMagick、TinyJPEG、PNGQuant、OptiPNG 或 cwebp,但阅读该技能本身不需要这些工具。

Image Optimization

Table of Contents

Overview

Images typically comprise 50% of page weight. Optimization dramatically improves performance, especially on mobile networks.

When to Use

  • Website optimization
  • Responsive image implementation
  • Performance improvement
  • Mobile experience enhancement
  • Before deployment

Quick Start

Minimal working example:

yaml
Format Selection:
JPEG:  Best for: Photographs, complex images  Compression: Lossy (quality 70-85)  Size: ~50-70% reduction  Tools: ImageMagick, TinyJPEG  Command: convert image.jpg -quality 75 optimized.jpg
PNG:  Best for: Icons, screenshots, transparent images  Compression: Lossless  Size: 10-30% reduction  Tools: PNGQuant, OptiPNG  Command: optipng -o3 image.png
WebP:  Best for: Modern browsers (90% support)  Compression: 25-35% better than JPEG/PNG  Fallback: Use <picture> element  Tools: cwebp  Command: cwebp -q 75 image.jpg -o image.webp
SVG:  Best for: Icons, logos, simple graphics// ... (see reference guides for full implementation)

Reference Guides

Detailed implementations in the references/ directory:

GuideContents
Image Compression & Formats [blocked]Image Compression & Formats
Responsive Images [blocked]Responsive Images
Optimization Process [blocked]Optimization Process
Monitoring & Best Practices [blocked]Monitoring & Best Practices

Best Practices

✅ DO

  • Follow established patterns and conventions
  • Write clean, maintainable code
  • Add appropriate documentation
  • Test thoroughly before deploying

❌ DON'T

  • Skip testing or validation
  • Ignore error handling
  • Hard-code configuration values

来源与署名

来源:aj-geddes/useful-ai-prompts位于skills/image-optimization提交3f5182c

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架