Claude
Skills
Sign in
Back

manipulate-image

Included with Lifetime
$97 forever

Manipulate images - resize, crop, convert, add alpha, transform, compress, and analyze. Use when user needs any image manipulation, format conversion, or image information.

Ads & Marketingscripts

What this skill does


# Image Tools

Swiss army knife for image manipulation powered by Pillow.

## First Use

Run setup check:

```bash
bash "${CLAUDE_PLUGIN_ROOT}/skills/manipulate-image/scripts/check-setup.sh"
```

If it fails, read the install guide:
`${CLAUDE_PLUGIN_ROOT}/skills/manipulate-image/scripts/install.md`

## Running Commands

```bash
SCRIPTS="${CLAUDE_PLUGIN_ROOT}/skills/manipulate-image/scripts"
"$SCRIPTS/run.sh" <command> [args...]
```

## Available Commands

| Command | What it does | Instruction file |
|---------|-------------|-----------------|
| `resize` | Scale to width/height/percentage | [resize-and-scale.md](instructions/resize-and-scale.md) |
| `thumbnail` | Generate max-size thumbnail | [resize-and-scale.md](instructions/resize-and-scale.md) |
| `crop` | Crop by box or center | [crop-and-trim.md](instructions/crop-and-trim.md) |
| `trim` | Auto-trim whitespace borders | [crop-and-trim.md](instructions/crop-and-trim.md) |
| `pad` | Pad to target size with color | [crop-and-trim.md](instructions/crop-and-trim.md) |
| `convert` | Change format (PNG/JPG/WebP) | [convert-and-compress.md](instructions/convert-and-compress.md) |
| `compress` | Reduce file size | [convert-and-compress.md](instructions/convert-and-compress.md) |
| `alpha` | Add/remove/transparent alpha | [alpha-and-composite.md](instructions/alpha-and-composite.md) |
| `composite` | Overlay images | [alpha-and-composite.md](instructions/alpha-and-composite.md) |
| `rotate` | Rotate by degrees | [transform.md](instructions/transform.md) |
| `flip` | Flip horizontal/vertical | [transform.md](instructions/transform.md) |
| `info` | Show dimensions, format, mode | [analyze.md](instructions/analyze.md) |
| `metadata` | Extract EXIF data | [analyze.md](instructions/analyze.md) |

## Workflow

1. Run `check-setup.sh` if this is the first use or you hit errors
2. Read the instruction file for the operation the user needs
3. Run `run.sh <command>` with the right arguments
4. Show the user the result

## Transparent Background from AI-Generated Images

When removing backgrounds from images generated by `image-tools:generate-image` (or similar AI tools):

1. **Sample the actual background color** (AI never produces exact colors):
   ```bash
   # from PIL import Image; print(Image.open("image.png").getpixel((0,0)))
   ```

2. **Remove with `--feather`** (activates HSV chroma key + spill suppression):
   ```bash
   run.sh alpha <image> --transparent "<actual R,G,B>" --tolerance 15 --feather 40 -o <output>
   run.sh trim <output> -o <final>
   ```

**Chroma key palette** (the generate-image skill picks the best one based on subject colors):

| Color | Exact RGB | Hex | Approximate AI output |
|-------|-----------|-----|-----------------------|
| Green | `0, 255, 0` | `#00FF00` | varies around `(0-20, 240-255, 0-20)` |
| Magenta | `255, 0, 255` | `#FF00FF` | varies around `(235-255, 0-20, 235-255)` |
| Blue | `0, 0, 255` | `#0000FF` | varies around `(0-20, 0-20, 235-255)` |
| Yellow | `255, 255, 0` | `#FFFF00` | varies around `(235-255, 235-255, 0-20)` |

**Always sample the actual corner pixel** — Gemini never produces the exact requested RGB.

**Why `--feather` matters**: Without it, you get binary transparency with colored halos. With it, the algorithm uses HSV hue detection (handles imprecise colors), Gaussian-blurred alpha edges, and spill suppression that removes background color contamination from outline pixels.

See the `image-tools:generate-image` skill for chroma key color selection rules.

## Quick Reference

All commands accept: `input` (file or directory for batch), `-o`/`--output`.

Related in Ads & Marketing