Loading...
Loading...
Compress PNG and JPEG screenshots in place using pngquant and jpegoptim, keeping the original format for maximum compatibility.
npx skill4agent add zc277584121/marketing-skills screenshot-compressionpngquantjpegoptimPrerequisites:andpngquantmust be installed on the system. The script will not install them automatically — it checks for their presence and prints install instructions if missing.jpegoptim
| Context | WebP Support |
|---|---|
| Browsers (Chrome/Firefox/Safari/Edge) | Yes |
| GitHub Issues/PRs | Yes |
| WeChat editor | No |
| Word / PowerPoint | No |
| Some forums/blog backends | Varies |
python /path/to/skills/screenshot-compression/scripts/compress_screenshots.py <files-or-directories>pngquantjpegoptim# macOS
brew install pngquant jpegoptim
# Ubuntu / Debian
sudo apt install pngquant jpegoptim
# CentOS / RHEL
sudo yum install pngquant jpegoptim| Flag | Default | Description |
|---|---|---|
| required | Image files or directories to compress |
| off | Recursively process directories |
| | pngquant quality range (min-max, 0-100) |
| | jpegoptim max quality (0-100) |
# Compress a single file
python .../compress_screenshots.py screenshot.png
# Compress all images in a directory
python .../compress_screenshots.py ./images/
# Recursive directory scan
python .../compress_screenshots.py ./docs/ --recursive
# High quality for code screenshots
python .../compress_screenshots.py *.png --png-quality 90-100
# Aggressive compression for thumbnails
python .../compress_screenshots.py *.jpg --jpeg-quality 70| Scenario | | |
|---|---|---|
| General screenshots (docs, web pages) | | |
| Code screenshots (need sharp text) | | |
| Thumbnails / previews (size priority) | | |
--strip-all.png.jpg.jpeg