PNG Image Compression
Paste the following prompt into your AI chat to install this skill:
Please follow https://skillhub.cn/install/skillhub.md to install @user_34ee2070/image-compression1.
About this skill
Problem to solve
When PNG screenshots, assets, or batched images are too large, manual compression and repeated setting tweaks are tedious. image-compression focuses on compressing PNG files: provide a file path or directory and get a measurable size reduction.
How it works
- Lossless mode: uses
optimize=Trueandcompress_level=9, typically reducing size by1-30%. It suits screenshots, UI captures, and text-heavy images where sharpness matters. - Lossy mode: quantizes to 256 colors with
Image.Quantize.MEDIANCUT, then saves withoptimize=True, typically reducing size by50-80%. It suits photos, gradients, or images where smaller file size is the priority. - Batch processing: pass a directory to process PNGs in a folder.
compress_png.pysupports arguments such as--output,--overwrite, and--lossy, making it easier to write results to a target path or replace originals. - Result reporting: after compression, it reports original size, compressed size, and savings percentage for quick validation.
Scope and cautions
This skill covers PNG compression only; it does not resize, reformat, or alter image content. If the user does not specify a mode, ask whether lossless or lossy is preferred. For color-critical images or images with many color layers, prefer lossless mode. Lossy mode reduces the number of colors, so visual results depend on the image content.
Use Cases
- Compress an oversized PNG screenshot before sending it to a collaborator, choosing lossless or lossy based on the need.
- Batch-compress PNG assets in a folder, write results to an output directory, and report savings.
- Keep text and UI edges sharp in a PNG screenshot by using lossless compression and checking the reduction.
- Reduce photo-like PNGs with 256-color lossy compression when visual changes are acceptable.
Best For
- Frontend or QA engineers who need to compress UI screenshots for bug reports or docs.
- Design collaborators who need to shrink multiple PNG assets before packaging or sharing.
- Data labeling or asset-curation staff who need batch PNG compression with output tracking.
- Indie developers who need to reduce PNG screenshot or demo image weight quickly.
Related Skills
Converts image sequences, videos, or screen recordings into GIFs with Python, supporting timing, looping, optimization, and quick command-line use.
Adds white text, a yellow bar, and optional translucent masks to photos using OpenCV and Pillow.
Call Mew image and design APIs in two stages to create an emotional background and compose a share-ready quote check-in poster.
Generate felt-craft pendant designs, part breakdowns, and structured analysis from a product image or Base64 input.