AI Agent Hub
Back to skills
Image Compressor icon

Image Compressor

Design & Media Updated 2026.08.30

Paste the following prompt into your AI chat to install this skill:

Please follow https://skillhub.cn/install/skillhub.md to install @user_472d0abf/oustorearing.

About this skill

Problem to Solve

When compressing images in batches, the tricky part is matching the right strategy to each asset: photos benefit from lossy compression, screenshots from PNG quantization, icons from lossless optimization, and transparent images from preserving the alpha channel. Choosing tools manually can miss files or accidentally convert transparent PNGs to JPEG.

How the Skill Works

The skill takes a folder path, recursively scans selected image formats, and checks whether local tools such as pngquant, mozjpeg, cwebp, and oxipng are available. If they are missing, it falls back to Pillow-based optimization. It selects a strategy based on image characteristics: photos are processed as JPEG, screenshots as 8-bit PNG, small icons with lossless optimization, and transparent images with transparency-preserving quantization. It supports options such as -q quality, -o output directory, -r recursive mode, --dry-run preview, and --check-quality PSNR, while running in parallel by default.

Boundaries and Caveats

Do not place the output directory inside the source folder, because compressed files may be processed again. Quality below 40 can produce obvious artifacts. If PNG tools are unavailable, transparent areas may be flattened to white before JPEG conversion. It is suitable for local batch asset cleanup, not as the sole quality check before high-fidelity delivery.

Use Cases

  • Compress product screenshots and detail-page images before uploading asset files.
  • Recursively compress PNG, JPG, and WEBP folders into a new output directory before website release.
  • Preview file counts and formats with dry-run, then compress using a chosen quality setting.
  • Preserve alpha channels for transparent icons by using PNG quantization instead of flattening to white.

Best For

  • Designers organizing product assets who need folder-based compression and alpha preservation.
  • Frontend engineers optimizing web assets who need to reduce image sizes before release.
  • Static-site developers who want recursive processing with a separate output directory.
  • Operations staff managing asset libraries who need dry-run preview before batch compression.