Skip to content
Skillpedia
Images & icons27k · #9950

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.md

Copy 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

Use this skill to help me: https://github.com/JimLiu/baoyu-skills/blob/main/skills/baoyu-compress-image/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

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

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills