New advertisers: 50% off your first month with code FIRSTMONTHSee slots
zc277584121 avatar

Screenshot Compression

Lossy in-place compression of PNG and JPEG screenshots using pngquant and jpegoptim, keeping the original formats.

skills.sh installs
3.8K
last updated
Aug 21, 2026
View on GitHub

What it does

  • Covers single files and directories, with optional recursive scanning for batch compression runs
  • Runs pngquant palette quantization for PNG and jpegoptim re-encoding with metadata stripping for JPEG
  • Checks for both tools first and exits with install instructions rather than installing anything
  • Designed for docs, READMEs, and blog posts where PNG and JPEG must stay compatible with editors and platforms

Install

$ npx -y skills add zc277584121/marketing-skills --skill screenshot-compression -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

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:

ContextWebP Support
Browsers (Chrome/Firefox/Safari/Edge)Yes
GitHub Issues/PRsYes
WeChat editorNo
Word / PowerPointNo
Some forums/blog backendsVaries

Keeping PNG/JPEG ensures the compressed images work everywhere.


Details

Repository
github.com/zc277584121/marketing-skills
First seen
May 16, 2026

More from zc277584121/marketing-skills

All 14

Similar to Screenshot Compression