image-compress-skill
Installation
SKILL.md
ImageCompressSkill
The intelligent image optimization engine for AI Agents. Smart routing between PNG quantization and WebP compression.
1. Smart Strategy Overview
The optimal compression strategy depends on the input content type and the target use case.
| Content Type | Primary Strategy | Toolchain | Target Format |
|---|---|---|---|
| Photographs | Lossy WebP | image -> libwebp |
.webp |
| Graphics / Logos / UI | Optimized PNG | image -> imagequant -> oxipng |
.png |
| Universal (Web) | WebP (High Compat) | image -> libwebp |
.webp |
| Universal (Archive) | Optimized PNG | image -> oxipng (Lossless) |
.png |
Decision Logic:
- Try WebP First (Default): For most web use cases, WebP offers the best size/quality ratio (30-90% reduction).
- Fallback to PNG: If the input is a simple graphic (low color count) OR if WebP results in a larger file (rare, but happens with simple shapes), use the Quantized PNG pipeline.
- Strict Quality: If the user demands "Lossless" or "No visual change", skip quantization and use only
oxipng(PNG) or Lossless WebP.