
screenshot-compression
Compress PNG and JPEG screenshots in place using pngquant and jpegoptim, keeping the original format for maximum compatibility.
- Installs
- 3.8K
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/zc277584121/marketing-skills --skill screenshot-compression- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads screenshot-compression automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Skill: Screenshot Compression
Compress screenshot images (PNG/JPEG) in place while keeping the original format. Uses pngquant for PNG and jpegoptim for JPEG — both are highly effective for screenshot content (UI elements, text, flat colors).
Prerequisites:
pngquantandjpegoptimmust be installed on the system. The script will not install them automatically — it checks for their presence and prints install instructions if missing.
When to Use
The user has screenshot files that are too large and wants to reduce file size without changing format. Common scenarios:
- Preparing images for GitHub READMEs, blog posts, or documentation
- Reducing image sizes before committing to a repository
- Batch compressing a directory of screenshots
Why Keep Original Format (Not WebP)
WebP has better compression, but poor compatibility in some contexts:
| Context | WebP Support |
|---|---|
| Browsers (Chrome/Firefox/Safari/Edge) | Yes |
| GitHub Issues/PRs | Yes |
| WeChat editor | No |
| Word / PowerPoint | No |
| Some forums/blog backends | Varies |
Keeping PNG/JPEG ensures the compressed images work everywhere.
Default Workflow
python /path/to/skills/screenshot-compression/scripts/compress_screenshots.py <files-or-directories>
The script will:
- Check that
pngquantandjpegoptimare installed — if not, print install instructions and exit - Auto-detect file format by extension
- Compress each file in place (overwrites the original)
- Print per-file and total compression summary
Dependency Check
The script requires two system tools. If either is missing, it exits with install instructions instead of proceeding. Do not install them on behalf of the user — just relay the error message so the user can install them.
Install commands:
# macOS
brew install pngquant jpegoptim
# Ubuntu / Debian
sudo apt install pngquant jpegoptim
# CentOS / RHEL
sudo yum install pngquant jpegoptim
Script Options
| Flag | Default | Description |
|---|---|---|
paths (positional) | required | Image files or directories to compress |
-r, --recursive | off | Recursively process directories |
--png-quality | 80-95 | pngquant quality range (min-max, 0-100) |
--jpeg-quality | 85 | jpegoptim max quality (0-100) |
Examples
# 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
Quality Tuning Guide
| Scenario | --png-quality | --jpeg-quality |
|---|---|---|
| General screenshots (docs, web pages) | 80-95 | 85 |
| Code screenshots (need sharp text) | 90-100 | 90 |
| Thumbnails / previews (size priority) | 60-80 | 70 |
How It Works
PNG (pngquant)
- Quantizes 24-bit true color (16M colors) down to an 8-bit palette (256 colors)
- Uses Floyd-Steinberg dithering for smooth gradients
- Screenshots are ideal candidates — UI colors are typically well under 256 unique values
- Typical reduction: 60-80%
JPEG (jpegoptim)
- Re-encodes at the specified quality level
- Strips metadata (EXIF, ICC profiles, thumbnails) via
--strip-all - Optimizes Huffman tables
- Typical reduction: 20-50%
Important Notes
- Files are compressed in place — the original is overwritten. Back up files first if needed.
- Only
.png,.jpg, and.jpegfiles are processed. Other formats are silently skipped. - The script never installs dependencies. If tools are missing, it prints install instructions and exits.
FAQ
What does the screenshot-compression skill do?
Compress PNG and JPEG screenshots in place using pngquant and jpegoptim, keeping the original format for maximum compatibility.
How do I install screenshot-compression?
Run npx skills add https://github.com/zc277584121/marketing-skills --skill screenshot-compression in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/screenshot-compression/ (personal) or .claude/skills/screenshot-compression/ (project).
Which AI agents can use screenshot-compression?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is screenshot-compression safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains screenshot-compression?
It is published by zc277584121 in zc277584121/marketing-skills. It has 3,825 recorded installs.
More from zc277584121/marketing-skills
remove-ai-style
zc277584121/marketing-skills
Aggressively rewrite Chinese or English prose to remove AI-generated patterns. Use for de-AI polishing, natural-language rewrites, robotic or formulaic writing, and publication cleanup. Always run the bundled deterministic Markdown analyzer first, remove every editable exclamation mark, dash, and formulaic binary contrast, inspect every other reported location, then read the full article for semantic patterns the rules cannot enumerate.
browser-screenshot
zc277584121/marketing-skills
Take focused, region-specific screenshots from web pages using a dedicated headed Chrome profile with persistent login state. Navigates to the right page based on user context (URL, search query, social media post), locates the target region via DOM selectors, and crops to a clean, focused screenshot without attaching to the user's daily browser.
content-rewrite
zc277584121/marketing-skills
Adapt and rewrite content for different platforms (LinkedIn, X, Reddit, English blog, WeChat). Each platform has its own tone, format, and length requirements.
chrome-automation
zc277584121/marketing-skills
Automate Chrome browser tasks using agent-browser CLI. Navigate pages, fill forms, click buttons, take screenshots, extract data, and replay Chrome DevTools Recorder exports.
mermaid-to-image
zc277584121/marketing-skills
Convert Mermaid code blocks in Markdown files to PNG images using the mermaid.ink API.
image-generation
zc277584121/marketing-skills
Generate illustration images for articles and documentation with a Codex-first workflow, OpenAI API fallback, and Gemini fallback.
Popular marketing & seo skills
reddit-automation
flowkit-labs/skills
Find Reddit threads where people are genuinely asking for what you offer, then draft short, genuinely helpful replies — disclosing your affiliation honestly and naming your product only when it truly answers the question. Two moves: discovery — scan the right subreddits for real needs (recommendation asks, expressed pain, competitor mentions) and rank the few threads where you can actually help; drafting — write from real experience, respect each community's self-promo rules, and keep a human in the loop to review and post. This markets on Reddit the honest way: contribute value, disclose who you are, never astroturf. Distilled from the playbook behind doany.ai's Reddit agent. Triggers on "find reddit opportunities", "reddit marketing", "reddit automation", "reply on reddit for my product", "reddit community engagement", "reddit lead gen", or any ask to turn Reddit threads into genuine, disclosed marketing replies.
twitter-automation
101-skills/superpowers
Automate Twitter/X with posting, engagement, and user management via inference.sh CLI. Apps: x/post-tweet, x/post-create (with media), x/post-like, x/post-retweet, x/dm-send, x/user-follow. Capabilities: post tweets, schedule content, like posts, retweet, send DMs, follow users, get profiles. Use for: social media automation, content scheduling, engagement bots, audience growth, X API. Triggers: twitter api, x api, tweet automation, post to twitter, twitter bot, social media automation, x automation, tweet scheduler, twitter integration, post tweet, twitter post, x post, send tweet
twitter-automation
magentosh/superpowers
Automate Twitter/X with posting, engagement, and user management via inference.sh CLI. Apps: x/post-tweet, x/post-create (with media), x/post-like, x/post-retweet, x/dm-send, x/user-follow. Capabilities: post tweets, schedule content, like posts, retweet, send DMs, follow users, get profiles. Use for: social media automation, content scheduling, engagement bots, audience growth, X API. Triggers: twitter api, x api, tweet automation, post to twitter, twitter bot, social media automation, x automation, tweet scheduler, twitter integration, post tweet, twitter post, x post, send tweet
twitter-automation
qu-skills/superpowers
Automate Twitter/X with posting, engagement, and user management via inference.sh CLI. Apps: x/post-tweet, x/post-create (with media), x/post-like, x/post-retweet, x/dm-send, x/user-follow. Capabilities: post tweets, schedule content, like posts, retweet, send DMs, follow users, get profiles. Use for: social media automation, content scheduling, engagement bots, audience growth, X API. Triggers: twitter api, x api, tweet automation, post to twitter, twitter bot, social media automation, x automation, tweet scheduler, twitter integration, post tweet, twitter post, x post, send tweet
product-launch-video
heygen-com/hyperframes
Turn a product or marketing URL, pasted script, or brief into a product launch / promo video — SaaS promos, feature reveals, product demos, app and company launches. Use when the user wants to market, launch, promote, or reveal a product; the default for any commercial URL. Site tours / showcases of a website route here too — the brief carries the show-it-as-is intent. Unclear → /hyperframes.
twitter-automation
skills-shell/superpowers
Automate Twitter/X with posting, engagement, and user management via inference.sh CLI. Apps: x/post-tweet, x/post-create (with media), x/post-like, x/post-retweet, x/dm-send, x/user-follow. Capabilities: post tweets, schedule content, like posts, retweet, send DMs, follow users, get profiles. Use for: social media automation, content scheduling, engagement bots, audience growth, X API. Triggers: twitter api, x api, tweet automation, post to twitter, twitter bot, social media automation, x automation, tweet scheduler, twitter integration, post tweet, twitter post, x post, send tweet