What problem does it solve?
Image assets often contribute to larger website and app load times. This Skill automatically compresses images to WebP (default) or PNG, selecting the best available tool to minimize file size while preserving visual quality.
Core Features & Use Cases
- Automatic tool selection: sips → cwebp → ImageMagick → Sharp, choosing the fastest/most compatible compressor per input.
- Single-file and batch processing: compress one image or an entire directory, with optional recursive traversal and quality targets.
- Use case: Optimize product images for a storefront, blog thumbnails, or gallery assets with configurable output formats.
Quick Start
Use the baoyu-compress-image skill to compress a single image with default WebP output.
npx -y bun ${SKILL_DIR}/scripts/main.ts image.png
Directory example:
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