canghe-compress-image

Compress images to WebP or PNG using automatic tool selection across platforms.

429|102|Updated Feb 24, 2026
One-click install
npx skills add https://github.com/freestylefly/canghe-skills --skill canghe-compress-image
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: canghe-compress-image
Source: https://github.com/freestylefly/canghe-skills/tree/main/skills/canghe-compress-image
Command: npx skills add https://github.com/freestylefly/canghe-skills --skill canghe-compress-image

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 to reduce file size without compromising quality.

Core Features & Use Cases

  • Automatic tool selection (sips on macOS, cwebp for WebP, ImageMagick for wide format support, or Sharp for non-destructive processing) to optimize images efficiently.
  • CLI supports single-file and directory processing with optional recursive traversal, output customization, quality controls, and the ability to keep originals.
  • Use Case: photographers and content creators can batch-compress photo collections for web publishing or app delivery while maintaining acceptable visual quality.

Quick Start

Run the CLI on an image or a directory to automatically compress it to WebP (or PNG/JPEG per your choice) using the best available tool.

Frequently Asked Questions about canghe-compress-image

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

FAQPage Schema
How do I batch compress images to WebP from the command line?

Compressing images to WebP from the command line is done by running the tool on a directory with recursive traversal, using automatic selection of cwebp or Sharp to reduce file size while maintaining quality.

Does this image compression tool work across macOS, Linux, and Windows?

Yes, this image compression tool works across macOS, Linux, and Windows by automatically selecting the best available native tool, such as sips on macOS or ImageMagick and Sharp for wide format support.

Can I compress a directory of PNG files recursively while keeping the originals?

Yes, you can compress a directory of PNG files recursively while keeping the originals by enabling the optional preservation feature during CLI processing to ensure safe file operations.

What is the best way to convert and compress images for web publishing?

The best way to compress images for web publishing is using a CLI tool that automatically selects the optimal compression utility to output WebP or PNG formats with customizable quality settings.

How does automatic image compression tool selection work?

Automatic tool selection works by detecting the operating system and available utilities, then choosing among sips, cwebp, ImageMagick, or Sharp to perform non-destructive image processing and format control efficiently.