PlugWiki

baoyu-compress-image skill: compress images to WebP, PNG or JPEG

Baoyu's skill that makes your agent shrink images to WebP, PNG or JPEG with whichever compressor your machine has.

Installs
28.4K
on skills.sh
Stars
27.2K
on GitHub
Files
1
besides SKILL.md
Updated
Nov 2026
last repo commit

baoyu-compress-image loads when you ask to compress or optimize an image, convert to WebP, or reduce file size. Your agent runs one bundled TypeScript script on a file or a folder. Output defaults to WebP at quality 80, and the script prints the size before and after.

SKILL.md lists the tool order as sips, cwebp, ImageMagick, Sharp, but the script's own check differs: for WebP output (the default) it tries cwebp, then ImageMagick's convert, then Sharp, and it uses sips only for PNG or JPEG output on macOS. By default the original is not deleted but renamed to <name>_original.<ext>, unless you ask to keep it with --keep. You need bun or npx. Read the permissions note about in-place overwrites.

Good for

  • Bloggers and developers who need smaller image files for the web
  • Anyone converting a folder of PNG or JPEG files to WebP in one go
  • Agent users who want compression to run as a command, not a manual export

Install baoyu-compress-image

Claude Code

  1. 1

    Copy this prompt.

    Install the baoyu-compress-image skill in Claude Code. Run this command:
    
    npx skills add https://github.com/jimliu/baoyu-skills --skill baoyu-compress-image
    
    Then check that it loaded and tell me how to use it.
  2. 2

    Paste it into Claude Code. It shows the change and asks before running it.

Requires Node.js.

From its listing on skills.sh. Source.

What's in the skill

When it loads

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.

Sections in SKILL.md

  1. Script Directory
  2. Preferences (EXTEND.md)
  3. Usage
  4. Options
  5. Examples
  6. Extension Support

Key facts

Installs on skills.sh
28,358 as of 2026-11-02
Last repo commit
2026-11-01

What it includes

  • Compress a file or folder; default WebP at quality 80

    Takes a file or directory. Supported extensions in the script are png, jpg, jpeg, webp, gif and tiff.

    Try: “Compress ./images recursively to WebP at quality 75.”

    Runs code · scripts/main.ts <input>

  • webp (default), png or jpeg

    Runs code · --format / -f

  • 0 to 100, default 80

    Runs code · --quality / -q

  • Keep the original file where it is

    Without it, the script renames the original to <name>_original.<ext> before writing the new file.

    Runs code · --keep / -k

  • Include subfolders

    Runs code · --recursive / -r

  • Custom output path; JSON result

    Runs code · --output / -o and --json

  • WebP: cwebp, ImageMagick, Sharp; PNG/JPEG: sips on macOS

    Runs code · Tool auto-selection

  • Default format, quality and keep-original setting

    Files · EXTEND.md preferences

From the official docs

Permissions

Medium risk

The script renames and overwrites image files on your disk. Run it on a copy first, or pass --keep.

What it can do

  • Read your data
  • Create and change things
  • Delete things
  • Read-only mode

Watch out for

  • It renames and replaces your images

    Without --keep, originals are renamed to _original and the compressed file takes the old name. If the input is already in the target format, the script writes the output over the input file. Back up first. github.com

  • Recursive mode touches whole folders

    With --recursive the script processes every supported image in all subfolders. Point it at the folder you mean. github.com

Technical details
Talks tonpx -y bun downloads bun if it is not installed
Scopes
  • Reads image files and folders you name

  • Renames originals to <name>_original.<ext> and writes compressed files

  • Runs sips, cwebp, convert (ImageMagick) or Sharp

Questions

What does baoyu-compress-image do?

It compresses images to WebP by default, or to PNG or JPEG, by running one script on a file or folder. It picks cwebp, ImageMagick (convert), Sharp or, on macOS for PNG and JPEG output, sips, depending on the output format and what is installed. The Sharp fallback loads the sharp npm package, which the skill does not bundle.

How do I install it in Claude Code, the Claude app or Codex?

Use the install box at the top of this page. You also need bun or npx on your machine, so the script can run.

Will it delete my original images?

Not by default. The script renames the original to <name>_original.<ext> and writes the compressed file in its place, unless you pass --keep; with --keep and the same output format, the script writes <name>-compressed.<ext> next to the original. SKILL.md summarises this as "replaces original". If the input is already in the target format, the script writes over it, so use --keep or copy the folder first.

Does it need an API key?

No key appears in SKILL.md or the script. It runs local tools on your files.

Is it safe?

It changes files on disk: it renames originals and writes new ones, and it can run npx -y bun to fetch bun. Try it on a copy of a folder first, and use --keep if you need originals untouched.

Which image types does it handle?

The script collects png, jpg, jpeg, webp, gif and tiff files when you give it a folder.

Information

updated Nov 2, 2026

Folder
skills/baoyu-compress-image

jimliu/baoyu-skillsskills.sh

Sources

Docs, issue trackers and discussions this page is built from.

Show all 4
  1. baoyu-compress-image SKILL.md · github.com
  2. scripts/main.ts · github.com
  3. baoyu-skills README · github.com
  4. skills.sh listing · skills.sh

Updated Nov 2, 2026.