baoyu-compress-image

Compress webp, png, and jpeg images using automatic tool selection with optional JSON summaries.

24.8k|2.8k|Updated Jan 13, 2026
One-click install
npx skills add https://github.com/JimLiu/baoyu-skills --skill baoyu-compress-image-jimliu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: baoyu-compress-image
Source: https://github.com/JimLiu/baoyu-skills/tree/main/skills/baoyu-compress-image
Command: npx skills add https://github.com/JimLiu/baoyu-skills --skill baoyu-compress-image-jimliu

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

Compresses images using best available tool to minimize file sizes while preserving quality.

Core Features & Use Cases

  • Automatic tool selection: sips → cwebp → ImageMagick → Sharp for best results.
  • Batch processing: compress single files or directories with optional recursion and original retention.
  • Output options: direct files or JSON summaries for batch runs, with optional keeping of originals.

Quick Start

Compress a folder of PNG/JPG images to WebP using the default quality settings.

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 in a directory recursively?

Batch compress images by targeting a directory to recursively process webp, png, and jpeg files. You can optionally retain originals and output a JSON summary detailing the compression results for the entire batch run.

What is the best way to convert png and jpeg files to webp automatically?

Automatically convert png and jpeg files to webp by selecting the best available compression tool from sips, cwebp, ImageMagick, or Sharp. This minimizes file sizes while preserving image quality across different operating systems.

Does this image compression tool require ImageMagick to be installed?

No, ImageMagick is not strictly required. The tool automatically detects the best available compression utility across platforms, sequentially checking for sips, cwebp, ImageMagick, and Sharp to process your images.

Can I keep original images after batch processing them?

Yes, you can keep original images during batch processing. The tool provides an optional retention feature to preserve your source files while saving the compressed webp, png, or jpeg outputs alongside them.

How does automatic tool selection work for image optimization?

Automatic tool selection works by sequentially detecting available system utilities from sips to cwebp, ImageMagick, and Sharp. It enforces cross-platform tool detection to ensure safe file handling and optimal image compression.

Why compress images using Sharp instead of other command line tools?

Compressing images with Sharp provides a robust fallback when command line tools like sips or cwebp are unavailable. It ensures consistent cross-platform image optimization, reducing file sizes while preserving quality for webp, png, and jpeg formats.