Smart Image Compressor
Paste the following prompt into your AI chat to install this skill:
Please install @user_72991e7a/smart-image-compressor according to https://skillhub.cn/install/skillhub.md.
About this skill
Problem
Images for uploads, chat attachments, and blog posts are often too large. A 4000x3000 photo or high-resolution screenshot can slow down APIs and increase bandwidth costs, while manually tuning format and quality can easily make text screenshots blurry.
How It Works
The skill uses Pillow to compress images. Instead of applying a fixed quality=50, it selects a strategy based on target compression ratio and format behavior:
- JPEG quality tuning: suits photos; searches the quality range and can optionally remove EXIF.
- PNG optimization: preserves transparency where possible, suggests JPEG conversion for opaque PNGs, and optimizes indexed palettes.
- WebP conversion: can reduce size further at comparable quality, but compatibility with older platforms such as WeChat should be considered.
- Proportional resizing: oversized images can be scaled first using --max-width before compression.
It can generate a compression report and, if needed, read before and after images for visual comparison. By default it writes original-name_compressed.ext, preserving the source file.
Boundaries
It fits common cases where size must drop without obvious quality loss, especially photos, screenshots, UI assets, and WebP output. If the source is already under 100KB, gains may be limited. Transparent PNG to JPEG requires a white background fill, and users should be told explicitly. Very low quality settings can cause visible artifacts.
Use Cases
- Compress a 4000px blog photo to 1920px width and about 30% of the original size without overwriting the source file.
- Shrink transparent UI icon PNGs while preserving alpha, avoiding JPEG conversion and background artifacts.
- Create WebP versions of chat attachments to reduce size at comparable quality, noting older-platform compatibility.
- Batch-compress screenshot assets by target ratio across JPEG, PNG, and WebP, then report before and after results.
Best For
- Frontend engineers who need blog images small enough to upload without blurring text screenshots.
- Client developers who want WebP versions of chat attachments with clear notes about WeChat compatibility.
- Product designers who batch-compress UI screenshots and need transparent PNGs to stay intact.
- Independent developers who want high-resolution photos reduced to a target size while controlling EXIF retention.
Related Skills
Creates themed learning sites by generating flashcards, lessons, quizzes, index, and progress pages into a deployable website.
End-to-end mathematical optimization modeling with Gurobi and Python, covering data validation, code generation, solving, result analysis, and iterative revision.
Executes an Eversheet Web CDP login using externally supplied baseUrl, username, and password, then verifies the page reaches a logged-in home state.
Clarify product goals, user flows, pages, data, and permissions, then output an implementation-ready development prompt and lightweight spec.