image-optimization by aj-geddes/useful-ai-prompts
npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill image-optimization图像通常占页面权重的 50%。优化能显著提升性能,尤其是在移动网络上。
最小工作示例:
格式选择:
JPEG:
最适合:照片、复杂图像
压缩:有损(质量 70-85)
大小:约减少 50-70%
工具:ImageMagick, TinyJPEG
命令:convert image.jpg -quality 75 optimized.jpg
PNG:
最适合:图标、截图、透明图像
压缩:无损
大小:减少 10-30%
工具:PNGQuant, OptiPNG
命令:optipng -o3 image.png
WebP:
最适合:现代浏览器(90% 支持率)
压缩:比 JPEG/PNG 好 25-35%
后备方案:使用 <picture> 元素
工具:cwebp
命令:cwebp -q 75 image.jpg -o image.webp
SVG:
最适合:图标、徽标、简单图形
// ...(完整实现请参阅参考指南)
references/ 目录下的详细实现:
| 指南 | 内容 |
|---|
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 图像压缩与格式 | 图像压缩与格式 |
| 响应式图像 | 响应式图像 |
| 优化流程 | 优化流程 |
| 监控与最佳实践 | 监控与最佳实践 |
每周安装数
165
代码仓库
GitHub 星标数
116
首次出现
2026年1月21日
安全审计
安装于
opencode142
gemini-cli138
codex137
cursor127
claude-code123
github-copilot117
Images typically comprise 50% of page weight. Optimization dramatically improves performance, especially on mobile networks.
Minimal working example:
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)
Detailed implementations in the references/ directory:
| Guide | Contents |
|---|---|
| Image Compression & Formats | Image Compression & Formats |
| Responsive Images | Responsive Images |
| Optimization Process | Optimization Process |
| Monitoring & Best Practices | Monitoring & Best Practices |
Weekly Installs
165
Repository
GitHub Stars
116
First Seen
Jan 21, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode142
gemini-cli138
codex137
cursor127
claude-code123
github-copilot117
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
109,600 周安装
Gmail邮件搜索与导出工具 - Google Workspace CLI配方教程
619 周安装
Rust问题路由器:三层元认知框架解决Rust开发难题,提升代码质量与架构设计
621 周安装
Google Sheets 自动发送个性化邮件教程 - Gmail 批量邮件自动化方案
620 周安装
Google Workspace CLI 推送本地文件到 Apps Script 项目 | gws-apps-script-push 命令详解
620 周安装
Gmail批量自动回复邮件教程 - 使用Google Workspace CLI高效处理客户支持邮件
621 周安装
Appgram React Native SDK:一站式集成反馈、路线图、帮助中心等应用内功能
1 周安装