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

Baoyu Compress Image

  • 19 installs
  • 12 repo stars
  • Updated March 4, 2026
  • ideacco/baoyu-skills-openclaw

Baoyu Compress Image is an agent skill that shrinks image payloads using sips, cwebp, ImageMagick, or sharp through a Bun compression script.

About

Baoyu Compress Image is a Bun-driven compression skill for solo builders who ship marketing sites, SaaS dashboards, or storefronts with heavy screenshots and hero art. The agent runs a small CLI that walks folders (optionally recursive), picks the best available toolchain on the host—Apple sips, Google cwebp, ImageMagick, or sharp—and writes smaller outputs while reporting compression ratios. Use it when Lighthouse flags oversized images, when you need WebP variants without hand-tuning every asset, or when you want JSON summaries for automated PR checks. It stays phase-specific to shipping performance work rather than creative direction: you still choose quality and format, but the skill removes repetitive ffmpeg-style trial and error across machines.

  • Auto-detects compressor: sips on macOS, cwebp for WebP, ImageMagick convert, or sharp fallback
  • Supports png, jpg, jpeg, webp, gif, tiff with quality flag and optional keep-original
  • Recursive directory mode with JSON output for agent-parseable CI logs
  • Bun script with per-file input/output size ratio reporting
  • Format targets: webp, png, jpeg

Baoyu Compress Image by the numbers

  • 19 all-time installs (skills.sh)
  • Ranked #1,569 of 2,245 Frontend Development skills by installs in the Skillselion catalog
  • Security screen: LOW risk (skills.sh audit)
  • Data as of Aug 2, 2026 (Skillselion catalog sync)
npx skills add https://github.com/ideacco/baoyu-skills-openclaw --skill baoyu-compress-image

Add your badge

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

Listed on Skillselion
Installs19
repo stars12
Security audit3 / 3 scanners passed
Last updatedMarch 4, 2026
Repositoryideacco/baoyu-skills-openclaw

What it does

Batch-compress PNG/JPEG/WebP assets for faster pages by auto-picking sips, cwebp, ImageMagick, or sharp via a Bun CLI.

Who is it for?

Best when you're optimizing static assets on Mac or Linux CI runners with mixed ImageMagick/cwebp availability.

Skip if: Vector SVG workflow, responsive srcset generation only (no bytes written), or cloud CDN auto-optimization you already pay for.

When should I use this skill?

User needs to compress, convert, or batch-shrink images for a web project.

What you get

You get smaller WebP/PNG/JPEG files plus ratio stats (and optional JSON) ready to commit before deploy.

  • Compressed image files at chosen format and quality
  • Optional JSON manifest with input/output sizes and ratios

By the numbers

  • 5 compressor/format paths: sips, cwebp, imagemagick, sharp with webp/png/jpeg targets
  • 6 supported input extensions including gif and tiff

Files

SKILL.mdMarkdownGitHub ↗

Image Compressor

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

Script Directory

Scripts in scripts/ subdirectory. Replace ${SKILL_DIR} with this SKILL.md's directory path.

ScriptPurpose
scripts/main.tsImage compression CLI

Preferences (EXTEND.md)

Use Bash to check EXTEND.md existence (priority order):

# Check project-level first
test -f .baoyu-skills/baoyu-compress-image/EXTEND.md && echo "project"

# Then user-level (cross-platform: $HOME works on macOS/Linux/WSL)
test -f "$HOME/.baoyu-skills/baoyu-compress-image/EXTEND.md" && echo "user"

┌────────────────────────────────────────────────────────┬───────────────────┐ │ Path │ Location │ ├────────────────────────────────────────────────────────┼───────────────────┤ │ .baoyu-skills/baoyu-compress-image/EXTEND.md │ Project directory │ ├────────────────────────────────────────────────────────┼───────────────────┤ │ $HOME/.baoyu-skills/baoyu-compress-image/EXTEND.md │ User home │ └────────────────────────────────────────────────────────┴───────────────────┘

┌───────────┬───────────────────────────────────────────────────────────────────────────┐ │ Result │ Action │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ Found │ Read, parse, apply settings │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ Not found │ Use defaults │ └───────────┴───────────────────────────────────────────────────────────────────────────┘

EXTEND.md Supports: Default format | Default quality | Keep original preference

Usage

npx -y bun ${SKILL_DIR}/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)
npx -y bun ${SKILL_DIR}/scripts/main.ts image.png

# Keep PNG format
npx -y bun ${SKILL_DIR}/scripts/main.ts image.png -f png --keep

# Directory recursive
npx -y bun ${SKILL_DIR}/scripts/main.ts ./images/ -r -q 75

# JSON output
npx -y bun ${SKILL_DIR}/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.

OpenClaw Migration Notes

  • Migration mode: OpenClaw native first
  • Preserved directories:
  • scripts: yes
  • references: no
  • prompts: no
  • External dependencies: bun
  • Risk level: low
  • Environment variables (detected): HOME
  • Config compatibility: keep original .baoyu-skills/<skill>/EXTEND.md behavior and add OpenClaw-compatible path in runtime wrappers when needed.

OpenClaw Preflight Checks

  • Confirm bun is available when script examples use npx -y bun ....

Detected env vars: HOME

OpenClaw Failure Fallback

  • If runtime dependency is missing, stop execution and return exact install/setup command.

Related skills

How it compares

CLI skill package for batch local compression—not a hosted image CDN or browser-only canvas tweak.

FAQ

Who is baoyu-compress-image for?

Developers shipping web frontends who want an agent-invokable compressor instead of manual Preview or ad-hoc sharp one-liners.

When should I use baoyu-compress-image?

Before release when bundle or LCP audits fail on images, when converting heroes to WebP, or when batch-processing a public/ or assets/ folder.

Is baoyu-compress-image safe to install?

It runs shell commands and rewrites image files—check Security Audits on this page and use --keep or backups on production asset trees.

Frontend Developmentfrontendintegrations

This week in AI coding

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

unsubscribe anytime.