Productivity
baoyu-compress-image avatar

baoyu-compress-image

Compress images automatically to WebP, PNG, or JPEG using optimized CLI tools like cwebp, ImageMagick, and Sharp.

Introduction

The baoyu-compress-image skill provides a streamlined, automated workflow for image optimization. Designed for developers, content creators, and system administrators, this tool intelligently selects the most efficient compression engine available on your system—prioritizing sips, cwebp, ImageMagick, or Sharp—to reduce file sizes while maintaining visual quality. It is an essential utility for web performance tuning, storage space management, and preparing assets for deployment.

  • Intelligent tool detection: Automatically selects the best local compression binary.

  • Flexible format support: Converts images seamlessly to WebP (default), PNG, or JPEG.

  • Batch and recursive processing: Supports single file conversion or recursive directory optimization to handle entire asset libraries.

  • Configurable quality: Fine-tune compression levels using a simple numeric scale from 0 to 100.

  • Integration ready: Provides both standard console output and JSON formatted feedback for integration into larger CI/CD or automation pipelines.

  • Requires Node.js and Bun runtime environment.

  • Respects custom user preferences defined via EXTEND.md files at the project, XDG config, or home directory levels.

  • Typical usage involves passing a file or directory path, with options to keep the original files or process subfolders recursively.

  • Recommended for tasks like "optimize image," "compress folder," "convert to webp," or "reduce file size" when interacting with an AI agent.

Repository Stats

Stars
16,756
Forks
1,953
Open Issues
1
Language
TypeScript
Default Branch
main
Sync Status
Idle
Last Synced
Apr 29, 2026, 07:44 AM
View on GitHub