Token导航 LogoToken导航TokenDH.com
图像处理只读github未标认证来源可访问许可证需确认审计通过

compress-images压缩图像

Agent Skill

用于辅助图像生成、图片编辑、视觉素材处理或图像模型工作流。它适合让 Agent 根据文本生成图片、处理背景、整理视觉提示词或调用相关图像工具。使用时需要确认输入图片、版权来源、输出格式和模型限制;涉及人物、品牌、商品或公开展示素材时,应额外核对授权、真实性和内容合规边界。

总安装

1,053

周安装

43

GitHub Stars

22

下载量

341
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:compress-images(压缩图像)
来源仓库:https://github.com/rameerez/claude-code-startup-skills
仓库路径:skills/compress-images
安装命令:
npx skills add https://github.com/rameerez/claude-code-startup-skills --skill compress-images
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/rameerez/claude-code-startup-skills --skill compress-images

简介

批量将图片转换为 WebP 格式并优化至单图低于 100KB。

  • 保留原始文件于 originals/ 子目录,避免数据丢失。
  • 适用于网站性能优化、SEO 提升的视觉资源处理需求。
  • 会自动更新内容中对图片路径的引用关系。compress-images 属于图像处理类 Skill,可作为该场景下的辅助能力补充。
  • 安装前建议确认目标目录结构及图片版权许可状态。

SKILL.md

Image Compression Skill

Compress all images in $ARGUMENTS (or app/assets/images/content/ if no path provided) to WebP format, optimized for SEO performance (target: under 100KB per image).

Process

  1. Create originals folder - Create originals/ subfolder inside the target directory and move source files there. Never destroy source files.
  2. Compress each image (JPG, PNG, GIF) from originals/ to the parent directory as .webp
  3. Iterate until all images are under 100KB - check sizes after each pass, re-compress any that exceed the target
  4. Report results with before/after sizes
  5. Update references in content files from old extensions to .webp

File Structure

target-directory/
├── originals/           # High-quality source files preserved here
│   ├── hero.jpg
│   └── feature.png
├── hero.webp            # Compressed, web-optimized
└── feature.webp

Iterative Compression Algorithm

IMPORTANT: Keep compressing until ALL images are under 100KB. Check sizes after each pass and re-compress any that exceed the target.

Step 1: Initial pass (q 70)

cwebp -q 70 -resize 1200 0 originals/image.jpg -o image.webp
ls -lh image.webp  # Check size

Step 2: If still over 100KB, reduce quality progressively

# Try these in order until under 100KB:
cwebp -q 60 -resize 1200 0 originals/image.jpg -o image.webp
cwebp -q 50 -resize 1200 0 originals/image.jpg -o image.webp
cwebp -q 45 -resize 1200 0 originals/image.jpg -o image.webp
cwebp -q 40 -resize 1200 0 originals/image.jpg -o image.webp
cwebp -q 35 -resize 1200 0 originals/image.jpg -o image.webp

Step 3: For stubborn images, also reduce dimensions

# If q 35 at 1200px is still over 100KB, reduce to 1000px:
cwebp -q 30 -resize 1000 0 originals/image.jpg -o image.webp
cwebp -q 25 -resize 1000 0 originals/image.jpg -o image.webp

Real-World Results (Reference)

From actual compression run on content images:

ImageOriginalFirst TryFinalSettings Used
waves.jpg198KB33KB33KBq 70, 1200px (1 pass)
calendar.jpg246KB42KB42KBq 70, 1200px (1 pass)
floating.jpg230KB43KB43KBq 70, 1200px (1 pass)
cash.jpg409KB88KB88KBq 70, 1200px (1 pass)
knot.jpg395KB96KB96KBq 70, 1200px (1 pass)
floating-dark.jpg414KB94KB94KBq 70, 1200px (1 pass)
keyboard2.jpg459KB102KB102KBq 70, 1200px (1 pass, acceptable)
perpetual.jpg565KB130KB96KBq 40, 1200px (3 passes)
keyboard.jpg718KB196KB98KBq 25, 1000px (5 passes)

Key Insights

  1. Most images (under 500KB source) compress fine with default settings (q 70, 1200px)
  2. Large detailed images (500KB+) often need multiple passes
  3. Very large images (700KB+) may need both lower quality AND smaller dimensions
  4. Keyboard/tech photos with fine detail are hardest to compress - expect 4-5 passes
  5. Soft/blurry images compress much better than sharp detailed ones

After Compression

  1. Verify ALL files under 100KB: ls -lh *.webp - re-run compression on any exceeding target
  2. Update content files referencing old extensions (.jpg,.png) to use.webp
  3. Test that images render correctly in the application
  4. Original files remain in originals/ folder for future reference or re-compression

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

38.55%
按下载量换算131

Claude

26.98%
按下载量换算92

Cursor

18.22%
按下载量换算62

Gemini CLI

9.09%
按下载量换算31

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills