image-compression
它能做什么
这项技能检查图片是否已为网页进行了适当压缩。适用于发布大量图片的网站所有者和设计师。
适用场景
- ✓当你的照片远大于实际所需尺寸的时候。
- ✓当页面因图片过大而加载缓慢的时候。
- ✓当你希望在构建流程中加入压缩的时候。
技能链接
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/image-compression/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请压缩我网站上的照片,使其加载更快,同时画质不变差。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会审查图片文件,并建议压缩设置,例如 JPEG 照片约 70% 到 85% 的质量。它建议照片使用有损压缩,图形使用无损压缩。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Compress images without quality loss
Uncompressed images are often 5-10x larger than needed—proper compression dramatically reduces page weight and load times with minimal visual impact.
Quick Reference
- Compress JPEG to 70-85% quality (often visually identical)
- Use lossy compression for photos, lossless for graphics
- Automate compression in build process
- Can reduce file sizes by 60-80% without visible quality loss
Check
Analyze if images are properly compressed without significant quality loss.
Fix
Compress images using tools like ImageOptim, TinyPNG, or automated build processes.
Explain
Explain how proper compression can reduce image sizes by 60-80% with minimal quality impact.
Code Review
Review image assets, markup, and delivery configuration related to Compress images without quality loss. Flag exact files or components where format choice, sizing, or loading behavior violates the rule, and describe how to confirm the fix in DevTools.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/images/image-compression
常见问题
建议使用什么质量设置?
这项技能建议 JPEG 照片使用 70% 到 85%,观众通常看不出差别。
提到了哪些工具?
这项技能提到了 ImageOptim 和 TinyPNG,以及在构建流程中的自动化。
文件可以缩小多少?
这项技能指出,在没有明显画质损失的情况下,文件大小通常可以减少 60% 到 80%。
详情
作者的原始描述
Use when reviewing image assets, markup, and CDN or build transforms related to Compress images without quality loss. Check encoded size, rendered size, loading strategy, and above-the-fold impact together.
热度
- GitHub 星标
- 75k
- 排名
- #2883
- 许可证
- MIT
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
frontendchecklist
75k使用命令行工具,依据 380 多条关于无障碍、速度、SEO 和安全的规则,检查前端代码和线上页面。
frontend-checklist-global
75k依据全部 386 条 Front-End Checklist 规则审查前端项目,并为发现的每个问题给出具体修复方法。
404-page
75k检查你的页面缺失提示是否提供有用的链接,并返回真正的 404 状态,帮助迷路的访客找到方向。
about-page
75k审查你的网站是否有清晰的关于页面,说明由谁运营,以建立访客和搜索引擎的信任。