imagemagick
Transform still images with ImageMagick v7
(magick command). Pairs well with vision.describe — describe an image to
decide what to do, then operate on it here. Always write to a new output file.
ImageMagick v7 uses magick in.png out.jpg. Legacy v6 uses convert; if only
convert exists, substitute it for magick in the examples below.
Setup health check (run first, every session)
Verify with one solo step:
[{ "tool": "os.shell.run", "args": { "cmd": "magick", "args": ["--version"] } }]
Outcome map:
exit 0 + Version: ImageMagick 7… → ready, proceed.
command not found: magick → try convert --version (v6); if also missing →
enter Setup playbook → "imagemagick missing".
Setup playbook (when prerequisites are missing)
imagemagick missing
Reply (solo reply step):
«ImageMagick не установлен. Могу поставить: brew install imagemagick. Поставить?»
On yes:
[{ "tool": "os.shell.run", "args": { "cmd": "brew", "args": ["install", "imagemagick"] } }]
On Linux: apt-get install imagemagick.
On Windows, offer this exact winget command after confirmation:
[{ "tool": "os.shell.run", "args": { "cmd": "winget", "args": ["install", "--id", "ImageMagick.ImageMagick", "-e"] } }]
When to use
- "Resize / crop / rotate this image", "convert PNG to JPG / WebP".
- "Compress this image", "make a thumbnail", "combine images into a montage".
- "Add a text caption / watermark to this image".
When NOT to use
- Understanding image content — use
vision.describe instead.
- Video frames / animation encoding — use the
ffmpeg skill.
- Multi-page PDF assembly from images — use the
pdf skill (magick can make a
PDF but page-level control lives in pdf).
Common operations
All examples invoke os.shell.run with cmd: "magick". The approval gate
surfaces each write.
| Goal |
args |
| Inspect dimensions/format |
["identify", "in.png"] |
| Convert PNG → JPG |
["in.png", "out.jpg"] |
| Convert → WebP |
["in.png", "-quality", "82", "out.webp"] |
| Resize to 800px wide |
["in.jpg", "-resize", "800x", "out.jpg"] |
| Thumbnail (fit 200x200) |
["in.jpg", "-thumbnail", "200x200", "thumb.jpg"] |
| Crop 300x300 from 10,10 |
["in.png", "-crop", "300x300+10+10", "+repage", "crop.png"] |
| Rotate 90° |
["in.jpg", "-rotate", "90", "rot.jpg"] |
| Compress JPG quality 75 |
["in.jpg", "-quality", "75", "small.jpg"] |
| Montage 2x2 grid |
["montage", "a.png", "b.png", "c.png", "d.png", "-tile", "2x2", "-geometry", "+4+4", "grid.png"] |
| Add caption |
["in.jpg", "-pointsize", "36", "-annotate", "+20+40", "Hello", "out.jpg"] |
Rules
- Always write to a NEW output path; never overwrite the source image.
- Use
magick identify first to learn dimensions/format before transforming.
- After a transform, optionally
vision.describe the result to confirm it
matches the user's intent for visual tasks.
- Echo the output path and final dimensions after each operation.
1---2name: imagemagick3description: Edit and convert images with the ImageMagick `magick` CLI — resize, crop, convert format, compress, rotate, montage, annotate. Use for any still-image transformation.4---5
6# imagemagick
7
8Transform still images with [ImageMagick](https://imagemagick.org/) v7
9(`magick` command). Pairs well with `vision.describe` — describe an image to
10decide what to do, then operate on it here. Always write to a new output file.
11
12> ImageMagick v7 uses `magick in.png out.jpg`. Legacy v6 uses `convert`; if only
13> `convert` exists, substitute it for `magick` in the examples below.
14
15## Setup health check (run first, every session)
16
17Verify with **one solo step**:
18
19```
20[{ "tool": "os.shell.run", "args": { "cmd": "magick", "args": ["--version"] } }]
21```
22
23Outcome map:
24- `exit 0` + `Version: ImageMagick 7…` → ready, proceed.
25- `command not found: magick` → try `convert --version` (v6); if also missing →
26 enter **Setup playbook → "imagemagick missing"**.
27
28## Setup playbook (when prerequisites are missing)
29
30### imagemagick missing
31
32Reply (solo `reply` step):
33
34> «ImageMagick не установлен. Могу поставить: `brew install imagemagick`. Поставить?»
35
36On yes:
37
38```
39[{ "tool": "os.shell.run", "args": { "cmd": "brew", "args": ["install", "imagemagick"] } }]
40```
41
42On Linux: `apt-get install imagemagick`.
43
44On Windows, offer this exact winget command after confirmation:
45
46```
47[{ "tool": "os.shell.run", "args": { "cmd": "winget", "args": ["install", "--id", "ImageMagick.ImageMagick", "-e"] } }]
48```
49
50## When to use
51
52- "Resize / crop / rotate this image", "convert PNG to JPG / WebP".
53- "Compress this image", "make a thumbnail", "combine images into a montage".
54- "Add a text caption / watermark to this image".
55
56## When NOT to use
57
58- Understanding image *content* — use `vision.describe` instead.
59- Video frames / animation encoding — use the `ffmpeg` skill.
60- Multi-page PDF assembly from images — use the `pdf` skill (`magick` can make a
61 PDF but page-level control lives in `pdf`).
62
63## Common operations
64
65All examples invoke `os.shell.run` with `cmd: "magick"`. The approval gate
66surfaces each write.
67
68| Goal | args |
69|---|---|
70| Inspect dimensions/format | `["identify", "in.png"]` |
71| Convert PNG → JPG | `["in.png", "out.jpg"]` |
72| Convert → WebP | `["in.png", "-quality", "82", "out.webp"]` |
73| Resize to 800px wide | `["in.jpg", "-resize", "800x", "out.jpg"]` |
74| Thumbnail (fit 200x200) | `["in.jpg", "-thumbnail", "200x200", "thumb.jpg"]` |
75| Crop 300x300 from 10,10 | `["in.png", "-crop", "300x300+10+10", "+repage", "crop.png"]` |
76| Rotate 90° | `["in.jpg", "-rotate", "90", "rot.jpg"]` |
77| Compress JPG quality 75 | `["in.jpg", "-quality", "75", "small.jpg"]` |
78| Montage 2x2 grid | `["montage", "a.png", "b.png", "c.png", "d.png", "-tile", "2x2", "-geometry", "+4+4", "grid.png"]` |
79| Add caption | `["in.jpg", "-pointsize", "36", "-annotate", "+20+40", "Hello", "out.jpg"]` |
80
81## Rules
82
831. Always write to a NEW output path; never overwrite the source image.
842. Use `magick identify` first to learn dimensions/format before transforming.
853. After a transform, optionally `vision.describe` the result to confirm it
86 matches the user's intent for visual tasks.
874. Echo the output path and final dimensions after each operation.