screenshot-compression

zc277584121/marketing-skills · updated Apr 8, 2026

MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.

$npx skills add https://github.com/zc277584121/marketing-skills --skill screenshot-compression
0 commentsdiscussion
summary

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).

skill.md

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: pngquant and jpegoptim must 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:

  1. Check that pngquant and jpegoptim are installed — if not, print install instructions and exit
  2. Auto-detect file format by extension
  3. Compress each file in place (overwrites the original)
  4. 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 .jpeg files are processed. Other formats are silently skipped.
  • The script never installs dependencies. If tools are missing, it prints install instructions and exits.
how to use screenshot-compression

How to use screenshot-compression on Cursor

AI-first code editor with Composer

1

Prerequisites

Before installing skills in Cursor, ensure your development environment meets these requirements:

  • Cursor installed and configured on your development machine
  • Node.js version 16.0+ with npm package manager (verify with node --version)
  • Active project directory or workspace where you want to add screenshot-compression
2

Execute installation command

Execute the skills CLI command in your project's root directory to begin installation:

$npx skills add https://github.com/zc277584121/marketing-skills --skill screenshot-compression

The skills CLI fetches screenshot-compression from GitHub repository zc277584121/marketing-skills and configures it for Cursor.

3

Select Cursor when prompted

The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:

◆ Which agents do you want to install to?
│ ── Universal (.agents/skills) ── always included ────
│ • Amp
│ • Antigravity
│ • Cline
│ • Codex
│ ●Cursor(selected)
│ • Cursor
│ • Windsurf
4

Verify installation

Confirm successful installation by checking the skill directory location:

.cursor/skills/screenshot-compression

Reload or restart Cursor to activate screenshot-compression. Access the skill through slash commands (e.g., /screenshot-compression) or your agent's skill management interface.

Security & Verification Notice

We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.

Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.

List & Monetize Your Skill

Submit your Claude Code skill and start earning

GET_STARTED →

Use Cases

User Story & Requirements Generation

Create detailed user stories, acceptance criteria, and feature specs

Example

Generate user stories for 'password reset feature' with acceptance criteria, edge cases, and test scenarios

Reduce spec writing time by 50%, ensure comprehensive coverage

Competitive Analysis

Research competitors, compare features, identify gaps

Example

Analyze 5 competitor products, create feature comparison matrix, suggest differentiation opportunities

Complete competitive research in 2 hours instead of 2 days

Roadmap Prioritization

Evaluate features using frameworks (RICE, ICE, Kano) and create prioritized backlogs

Example

Score 20 feature ideas using RICE framework, generate prioritized roadmap with rationale

Make data-driven prioritization decisions faster

Stakeholder Communication

Draft PRDs, status updates, and stakeholder presentations

Example

Create executive summary of Q3 roadmap, monthly progress report, feature launch announcement

Save 3-5 hours/week on communication overhead

Implementation Guide

Prerequisites

  • Claude Desktop or compatible AI client
  • Access to product documentation and roadmap tools (Jira, Notion, etc.)
  • Understanding of product management frameworks (RICE, Jobs-to-be-Done, etc.)
  • Stakeholder contact information and communication channels

Time Estimate

30-60 minutes to see productivity improvements

Installation Steps

  1. 1.Install product management skill
  2. 2.Start with user story generation for known feature
  3. 3.Progress to competitive analysis: research 2-3 competitors
  4. 4.Use for roadmap prioritization: apply RICE/ICE scoring
  5. 5.Draft stakeholder communications and refine based on feedback
  6. 6.Build template library for recurring PM tasks
  7. 7.Share effective prompts with product team

Common Pitfalls

  • Not validating competitive research—verify facts before sharing
  • Accepting user stories without involving engineering team
  • Over-relying on frameworks without qualitative judgment
  • Not customizing outputs to company culture and communication style
  • Skipping stakeholder validation of generated requirements

Best Practices

✓ Do

  • +Validate research and competitive analysis with real data
  • +Collaborate with engineering when generating technical requirements
  • +Customize frameworks and templates to your company context
  • +Use skill for first drafts, refine with stakeholder input
  • +Document successful prompt patterns for PM tasks
  • +Combine AI efficiency with human judgment and intuition

✗ Don't

  • Don't publish competitive analysis without fact-checking
  • Don't finalize user stories without engineering review
  • Don't make prioritization decisions solely on AI scoring
  • Don't skip customer validation of generated requirements
  • Don't ignore company-specific context and culture

💡 Pro Tips

  • Provide context: company goals, constraints, customer feedback
  • Ask for alternatives: 'Show 3 ways to prioritize this roadmap'
  • Request stakeholder-specific formatting: 'Executive summary vs. engineering spec'
  • Use skill for 70% generation + 30% customization to company needs

When to Use This

✓ Use When

Use for user story writing, competitive research, roadmap prioritization, stakeholder communication, and PRD drafting. Best for reducing repetitive documentation and research work.

✗ Avoid When

Avoid for strategic product vision (requires deep customer empathy), pricing decisions (needs market and financial expertise), or when face-to-face customer discovery is more valuable than speed.

Learning Path

  1. 1Basic: user stories, feature specs, status updates
  2. 2Intermediate: competitive analysis, prioritization frameworks, PRDs
  3. 3Advanced: product strategy, go-to-market planning, OKR setting
  4. 4Expert: product vision, market positioning, business model innovation

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.
general reviews

Ratings

4.558 reviews
  • Amelia Choi· Dec 20, 2024

    screenshot-compression is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • Chen Bhatia· Dec 20, 2024

    screenshot-compression reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Kaira Agarwal· Dec 16, 2024

    Useful defaults in screenshot-compression — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • Kofi Agarwal· Dec 12, 2024

    Keeps context tight: screenshot-compression is the kind of skill you can hand to a new teammate without a long onboarding doc.

  • Aanya Nasser· Dec 12, 2024

    screenshot-compression has been reliable in day-to-day use. Documentation quality is above average for community skills.

  • Aditi Abbas· Nov 23, 2024

    screenshot-compression has been reliable in day-to-day use. Documentation quality is above average for community skills.

  • Nikhil Flores· Nov 11, 2024

    screenshot-compression reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Amina Chen· Nov 11, 2024

    screenshot-compression is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • Nikhil Zhang· Nov 7, 2024

    I recommend screenshot-compression for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Nikhil Anderson· Oct 26, 2024

    screenshot-compression reduced setup friction for our internal harness; good balance of opinion and flexibility.

showing 1-10 of 58

1 / 6