
Baoyu Compress Image
Baoyu-compress-image compresses images to WebP or PNG format using the best available system tool (sips, cwebp, ImageMagick, or Sharp) selected based on what's installed. It serves developers and content creators who need to reduce image file sizes or convert images to optimized web formats. The skill eliminates the need to manually manage multiple image compression tools by automatically detecting and using the most suitable option available on the user's system.
- skills.sh installs
- 28.6K
- GitHub stars
- 27.4K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add jimliu/baoyu-skills --skill baoyu-compress-image --agent claude-codeInstalls into .claude/skills of the current project.
Files
Image Compressor
Tool auto-selection order: sips → cwebp → ImageMagick → Sharp.
Script Directory
{baseDir} = this SKILL.md's directory. Resolve ${BUN_X}: bun if installed; else npx -y bun; else suggest installing bun. Replace {baseDir} and ${BUN_X} with actual values.
| Script | Purpose |
|---|---|
scripts/main.ts | Image compression CLI |
Preferences (EXTEND.md)
First found wins:
| Priority | Path | Scope |
|---|---|---|
| 1 | .baoyu-skills/baoyu-compress-image/EXTEND.md | Project |
| 2 | ${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-compress-image/EXTEND.md | XDG |
| 3 | $HOME/.baoyu-skills/baoyu-compress-image/EXTEND.md | User home |
If none found, use defaults. EXTEND.md supports: default format, default quality, keep-original preference.
Usage
${BUN_X} {baseDir}/scripts/main.ts <input> [options]
${BUN_X} {baseDir}/scripts/main.ts image.png # → WebP, replaces original
${BUN_X} {baseDir}/scripts/main.ts image.png -f png --keep # keep PNG format and original
${BUN_X} {baseDir}/scripts/main.ts ./images/ -r -q 75 # directory, recursive
Sponsors
Details
- Repository
- github.com/jimliu/baoyu-skills
More from jimliu/baoyu-skills
All 24- Baoyu Format Markdown28.5K
- Baoyu Danger X To Markdown28.4K
- Baoyu Danger Gemini Web28.3K
- Baoyu Translate26.1K
- Release Skills25.9K
- Baoyu Youtube Transcript22.5K
- Baoyu Post To Weibo22K
- Baoyu Diagram15.9K
- Baoyu Wechat Summary10.2K
- Baoyu Imagine9.3K
- Baoyu Electron Extract8.2K
- Baoyu Image Cards6.2K
- Baoyu Post To Wechat34.8K
- Baoyu Image Gen34.1K
- Baoyu Infographic33.4K
- Baoyu Markdown To Html32.7K
- Baoyu Cover Image32.6K
- Baoyu Article Illustrator32.4K
- Baoyu Xhs Images31.8K
- Baoyu Slide Deck31.7K
- Baoyu Url To Markdown30.7K
- Baoyu Comic30.3K
- Baoyu Post To X29.2K