baoyu-compress-image

Compress images to WebP or PNG with automatic tool selection.

Updated Feb 13, 2026
One-click install
npx skills add https://github.com/chengyihua/nanobot-ts --skill baoyu-compress-image-chengyihua
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: baoyu-compress-image
Source: https://github.com/chengyihua/nanobot-ts/tree/main/skills/baoyu-compress-image
Command: npx skills add https://github.com/chengyihua/nanobot-ts --skill baoyu-compress-image-chengyihua

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. Use when user asks to "compress image", "optimize image", "convert to webp", or reduce image file size.

Core Features & Use Cases

  • Auto tool selection (sips → cwebp → ImageMagick → Sharp)
  • Batch processing for directories and single files
  • Output format choices and quality controls

Quick Start

Run the CLI on a file or directory to start compressing using the best available tool.

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 or PNG from the command line?

Batch compress images by running the CLI on a directory to automatically select the best available tool and output WebP or PNG files with optional quality settings.

What image formats are supported for automatic optimization?

Image optimization supports WebP, PNG, and JPEG formats, automatically detecting and applying the best tool to reduce file size for each input.

Do I need Node.js and the sharp package to compress images?

Yes, compressing images requires Node.js and the sharp package, though the tool also detects and uses system tools like sips, cwebp, or ImageMagick when available.

What's the best way to convert images to WebP on macOS?

Convert images to WebP by running the CLI, which automatically selects sips on macOS or falls back to cwebp, ImageMagick, or sharp based on availability.

Can I get JSON output summaries after batch processing a directory?

Yes, batch processing a directory can output human-readable progress or JSON summaries detailing the image compression results and file size reductions.

Why does image compression fail when system tools are missing?

Image compression fails without Node.js and sharp if no system tools are detected; the CLI requires at least one available tool among sips, cwebp, ImageMagick, or sharp to process images.