Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
jimliu avatar

Baoyu Compress Image

  • 25.9k installs
  • 24.2k repo stars
  • Updated July 4, 2026
  • jimliu/baoyu-skills

baoyu-compress-image is a Claude Code skill that compresses images to WebP, PNG, or JPEG from the terminal using the best available local compressor.

About

baoyu-compress-image is a terminal skill that compresses images in a file or folder to WebP, PNG, or JPEG using whichever local compressor is available. It auto-selects among sips, cwebp, ImageMagick, and Sharp, and supports quality control, recursive traversal, keep-original, and JSON output. A developer runs it before deploy to shrink public/ or asset directories. It reports input size, output size, and reduction ratio per file.

  • Auto-selects sips, cwebp, ImageMagick, or Sharp
  • Outputs WebP (default), PNG, or JPEG
  • Recursive directory traversal with --recursive
  • JSON output mode for CI logs
  • Requires bun or npx to run the CLI

Baoyu Compress Image by the numbers

  • 25,878 all-time installs (skills.sh)
  • +386 installs in the week ending Jul 28, 2026 (Skillselion tracking)
  • Ranked #20 of 560 CLI & Terminal skills by installs in the Skillselion catalog
  • Security screen: LOW risk (skills.sh audit)
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
At a glance

baoyu-compress-image capabilities & compatibility

Free, no API key; runs against local image compressors.

Capabilities
image compression · webp conversion · asset optimization
Use cases
image generation
Platforms
macOS
Runs
Runs locally
Pricing
Free
From the docs

What baoyu-compress-image says it does

Compresses images using best available tool (sips → cwebp → ImageMagick → Sharp).
SKILL.md
description: 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.
SKILL.md
npx skills add https://github.com/jimliu/baoyu-skills --skill baoyu-compress-image

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs25.9k
repo stars24.2k
Security audit3 / 3 scanners passed
Last updatedJuly 4, 2026
Repositoryjimliu/baoyu-skills

How do I shrink images in my project folder without leaving the terminal or wiring up an image service?

Compress and convert images to WebP/PNG/JPEG from the terminal before deploy to cut page weight and bundle size.

Who is it for?

Developers shrinking image assets before deploy to reduce page weight or app bundle size without a hosted image service.

Skip if: Users who need cloud image transforms, on-the-fly resizing, or a CDN-backed image pipeline rather than a one-shot local compression pass.

When should I use this skill?

When the user asks to compress an image, optimize an image, convert to webp, or reduce image file size.

What you get

Images are re-encoded to a smaller format at a chosen quality, with per-file size and reduction ratio reported.

  • compressed image files
  • per-file size and reduction report

By the numbers

  • auto-selects among 4 compressors
  • supports 6 input extensions
  • default quality 80

Files

SKILL.mdMarkdownGitHub ↗

Image Compressor

Compresses images using best available tool (sips → cwebp → ImageMagick → Sharp).

Script Directory

Scripts in scripts/ subdirectory. {baseDir} = this SKILL.md's directory path. Resolve ${BUN_X} runtime: if bun installed → bun; if npx available → npx -y bun; else suggest installing bun. Replace {baseDir} and ${BUN_X} with actual values.

ScriptPurpose
scripts/main.tsImage compression CLI

Preferences (EXTEND.md)

Check EXTEND.md in priority order — the first one found wins:

PriorityPathScope
1.baoyu-skills/baoyu-compress-image/EXTEND.mdProject
2${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-compress-image/EXTEND.mdXDG
3$HOME/.baoyu-skills/baoyu-compress-image/EXTEND.mdUser 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]

Options

OptionShortDescriptionDefault
<input>File or directoryRequired
--output-oOutput pathSame path, new ext
--format-fwebp, png, jpegwebp
--quality-qQuality 0-10080
--keep-kKeep originalfalse
--recursive-rProcess subdirsfalse
--jsonJSON outputfalse

Examples

# Single file → WebP (replaces original)
${BUN_X} {baseDir}/scripts/main.ts image.png

# Keep PNG format
${BUN_X} {baseDir}/scripts/main.ts image.png -f png --keep

# Directory recursive
${BUN_X} {baseDir}/scripts/main.ts ./images/ -r -q 75

# JSON output
${BUN_X} {baseDir}/scripts/main.ts image.png --json

Output:

image.png → image.webp (245KB → 89KB, 64% reduction)

Extension Support

Custom configurations via EXTEND.md. See Preferences section for paths and supported options.

Related skills

Forks & variants (1)

Baoyu Compress Image has 1 known copy in the catalog totaling 25 installs. They canonicalize to this original listing.

How it compares

Use baoyu-compress-image for local batch asset shrinking; CDN image APIs suit runtime transforms instead.

FAQ

What image formats can it output?

WebP (the default), PNG, or JPEG, selected with the --format flag. It accepts .png, .jpg, .jpeg, .webp, .gif, and .tiff inputs.

What does it need installed?

It needs bun or npx to run the CLI script, and picks whichever image compressor is present locally: sips, cwebp, ImageMagick, or Sharp.

Is Baoyu Compress Image safe to install?

skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

CLI & Terminalfrontenddevops

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.