baoyu-compress-image
What it does
This skill reduces the file size of images while keeping them usable. It is for website owners, bloggers and anyone with heavy image files.
When to use it
- ✓When you have large images that slow down a website or email.
- ✓When you want to convert photos or graphics to WebP format.
- ✓When you need to compress a whole folder of images at once.
Skill link
https://github.com/JimLiu/baoyu-skills/blob/main/skills/baoyu-compress-image/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Compress all the photos in my blog folder to WebP so the pages load faster.”
5 new skills a week. 1 minute to read.
How it works
Your agent picks an available compression tool, converts each image to the chosen format and reports how much smaller each file became.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
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
Output: image.png → image.webp (245KB → 89KB, 64% reduction)
Options
| Option | Short | Description | Default |
|---|---|---|---|
<input> |
File or directory | Required | |
--output |
-o |
Output path | Same path, new ext |
--format |
-f |
webp, png, jpeg | webp |
--quality |
-q |
Quality 0-100 | 80 |
--keep |
-k |
Keep original | false |
--recursive |
-r |
Process subdirs | false |
--json |
JSON output | false |
Extension Support
Custom configurations via EXTEND.md. See Preferences section for paths and supported options.
FAQ
What formats can it output?
WebP is the default, and PNG is available if you want to keep that format.
Does it replace my original files?
By default the converted file replaces the original, but you can keep the original with an option.
Can it process a whole folder?
Yes. It can handle a directory, including subfolders, and you can set the quality.
Details
Original description by the author
Compresses images to WebP (default) or PNG with automatic tool selection. Use when user asks to "compress image", "optimize image", "convert to webp", or reduce image file size.
repo: JimLiu/baoyu-skills
Popularity
- GitHub stars
- 27k
- Ranking position
- #9950
- License
- MIT
- Updated
- 11/2/2026
Comments
- …
More skills from this repository
release-skills
27kGuides your agent through a release for any project: bumping the version, updating changelogs and publishing a GitHub release or tag.
baoyu-article-illustrator
27kHelps your agent add illustrations to an article by finding the spots that need visuals and creating images in one consistent style.
baoyu-comic
27kShows your agent how to create an educational comic with panels, art styles and tones, such as a biography or a tutorial.
baoyu-cover-image
27kGives your agent a way to create article cover images by combining palette, rendering style and mood in cinematic, widescreen or square sizes.
Similar skills
gifgrep
394kLets your agent search GIF libraries, preview results, download a GIF, and pull out a still frame or a contact sheet of frames.
meme-maker
394kLets your agent pick a meme template, add your own captions, and create the meme as an SVG or PNG image.
ios-icon-gen
280kLets your agent generate icons for iOS apps. It uses Apple symbols or icons from other sources to create the correct files.