baoyu-compress-image

Compress images to WebP or PNG with automatic tool selection.

1|2|Updated Feb 28, 2026
One-click install
npx skills add https://github.com/zhangdszq/vk-skills --skill baoyu-compress-image-zhangdszq
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: baoyu-compress-image
Source: https://github.com/zhangdszq/vk-skills/tree/main/baoyu-compress-image
Command: npx skills add https://github.com/zhangdszq/vk-skills --skill baoyu-compress-image-zhangdszq

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires sharp, and includes scripts (resource) components.

What problem does it solve?

Compresses images to WebP (default) or PNG with automatic tool selection.

Core Features & Use Cases

  • Automatic tool selection among sips, cwebp, ImageMagick, or sharp based on the target format and platform.
  • Batch processing with optional recursive directory traversal and quality/format customization.
  • CLI-like usage with JSON output for integration and scriptable results.

Quick Start

Run the image compressor on a file or directory with preferred output format and quality.

Frequently Asked Questions about baoyu-compress-image

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I batch compress images to WebP across a directory?

Batch compress images to WebP by targeting a directory instead of a single file. The tool supports recursive directory traversal and provides a batch summarization of the optimized file sizes.

What is the best way to compress PNG files on macOS?

The best way to compress PNG files is using automatic tool selection, which dynamically evaluates and picks sips, ImageMagick, or sharp based on your current platform and target format.

Does sharp work with WebP compression for CLI scripts?

Yes, sharp works with WebP compression. The tool implements CLI-like usage, allowing you to script image optimization with flags for format, quality, and JSON reporting.

Can I keep original images while optimizing a directory?

Yes, you can keep original images by using the keep originals flag. This preserves your source files while generating the compressed WebP or PNG outputs in the target directory.

How does automatic image compression tool selection work?

Automatic tool selection works by detecting your target format and platform, then dynamically choosing among sips, cwebp, ImageMagick, or sharp to execute the image compression.