# screenshot-compression

Shrinks PNG and JPEG screenshots without converting their format. Use it before adding images to documentation or committing them to a repository.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 3800 installs
- Author: zc277584121
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/zc277584121/marketing-skills/tree/HEAD/skills/screenshot-compression/SKILL.md
- Updated: 2026-08-28
- HTML: https://affpapa.org/en/nevibecode/skills/screenshot-compression

## What it does

The skill runs the Python script `compress_screenshots.py`. It picks a tool based on the file extension: `pngquant` for PNG and `jpegoptim` for JPEG. Pass image files or directories; add `--recursive` to include nested folders. The script reports results for each file and a combined summary.

Compression replaces the original files. Keep copies first if you need to preserve them. Only `.png`, `.jpg`, and `.jpeg` files are handled; other formats are skipped. Both `pngquant` and `jpegoptim` must be installed on the system. The script checks for them but does not install them, so processing stops if either tool is missing.

Adjust output quality with `--png-quality` and `--jpeg-quality`. PNG processing reduces the color palette; JPEG processing re-encodes the image and removes metadata. This is an in-place workflow, so backups matter.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add zc277584121/marketing-skills --skill screenshot-compression -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/screenshot-compression/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/screenshot-compression/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add zc277584121/marketing-skills --skill screenshot-compression -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/screenshot-compression/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add zc277584121/marketing-skills --skill screenshot-compression -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/screenshot-compression/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install zc277584121/marketing-skills screenshot-compression
```

2. **Manually: put the files in place**
- File: `.github/skills/screenshot-compression/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add zc277584121/marketing-skills --skill screenshot-compression -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/zc277584121/marketing-skills --path skills/screenshot-compression
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/screenshot-compression/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add zc277584121/marketing-skills --skill screenshot-compression -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/zc277584121/marketing-skills/tree/HEAD/skills/screenshot-compression/SKILL.md

## When to use it
- shrink PNG screenshots before a commit
- compress JPEG images for documentation
- process screenshot files in a directory
- scan nested folders for supported images

## Example prompts
- Compress `screenshot.png` and keep its format.
- Process the images in `./docs/`, including nested folders.
- Compress `*.jpg` using JPEG quality `70`.

## Similar
- [baoyu-compress-image](https://affpapa.org/en/nevibecode/skills/baoyu-compress-image.md) — skill · 28200 installs
- [screenshot-optimization](https://affpapa.org/en/nevibecode/skills/screenshot-optimization.md) — skill · 3500 installs
- [excalidraw](https://affpapa.org/en/nevibecode/skills/agents365-ai-excalidraw.md) — skill · 4600 installs
- [tldraw-skill](https://affpapa.org/en/nevibecode/skills/tldraw-skill.md) — skill · 3700 installs
- [hand-drawn-diagrams](https://affpapa.org/en/nevibecode/skills/hand-drawn-diagrams.md) — skill · 2800 installs
- [beautiful-mermaid](https://affpapa.org/en/nevibecode/skills/beautiful-mermaid.md) — skill · 1800 installs

From the same set: [zc277584121/marketing-skills](https://affpapa.org/en/nevibecode/by/zc277584121/marketing-skills.md) — 9 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
