imagemagick
Skill1 starsChanged 5 months agoApache-2.0View on GitHub
This skill should be used when the user asks to "resize an image", "convert an image" (PNG/JPEG/WebP/AVIF/HEIC/GIF/TIFF/etc.), "crop", "compress", "optimize", "composite", "watermark", "annotate", "montage", "make a thumbnail", "strip metadata", "batch process images", "make an animated GIF", "generate an image", "add a drop shadow", "make a placeholder/test image", "render text as an image", "make it look like paper/polaroid/folded", "make a favicon", "reduce the number of colors", "fix washed-out colors", "convert a color profile (ICC)", "dither an image", "draw shapes/lines on an image", "apply a displacement or warp", "make a tiny-planet photo", "tilt-shift effect", "add a vignette", "make a blurred image placeholder (LQIP)", "generate a favicon set", "watermark a folder of photos", "make a branded/styled QR code", or otherwise manipulate, inspect, or generate raster images from the command line with ImageMagick or GraphicsMagick.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- badgids/Story-Film-Skillstheir own version, first seen Aug 19, 2026
- woyorus/agent-skillstheir own version, first seen Apr 19, 2026
- rogue-dev-studio/ai-agents-roguetheir own version, first seen Jul 31, 2021
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- badgids/Story-Film-Skills★ 4same name
- rogue-dev-studio/ai-agents-rogue★ 2same name
- woyorus/agent-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository4 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- img-compareSkill
- img-optimizeSkill
- imgSkill
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 1 is distinctive, and 2 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
Never overwrite the user's originals unless explicitly asked.
- Very specific: line 26
Read a specific frame/page with index syntax: input.gif[0], document.pdf[0-2] — quote these in the shell.
- Very specific: line 59
After -crop, the image keeps its virtual canvas offset.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
ImageMagick
Guidance for performing image operations with the ImageMagick command-line tools.
First steps
- Confirm the toolchain:
magick -version(ImageMagick 7). If onlyconvert/identifyexist withoutmagick, it is ImageMagick 6; if onlygmexists, it is GraphicsMagick. Seereferences/gm-and-im6.mdfor syntax differences. - Inspect before you transform:
magick identify <file>for a one-liner,magick identify -verbose <file>for full detail (color profile, alpha, EXIF, quality estimate). - Never overwrite the user's originals unless explicitly asked. Write outputs to new filenames or a separate directory.
IM7 command model
magick [input-settings] input.img [operators] output.imgmagickreplacesconvert. The bareconvertstill works in IM7 but is deprecated (and on Windows collides with a system tool). Prefermagick.- Order matters. Settings (e.g.
-quality,-density,-background) persist and affect later operations; operators (e.g.-resize,-crop,-rotate) act immediately on the images currently in the stack. Settings placed before an input affect reading (-density 300 input.pdf); operators placed after affect the loaded image. - The output file is always the last argument. Its extension selects the encoder; force one explicitly with a prefix:
png32:out.png,jpeg:out.img. - Read a specific frame/page with index syntax:
input.gif[0],document.pdf[0-2]— quote these in the shell; brackets glob in zsh/bash.
Core operations quick reference
| Task | Command |
| Convert format | magick in.png out.webp |
| Resize to fit within box | magick in.jpg -resize 800x600 out.jpg |
| Thumbnail (strips metadata, fast) | magick in.jpg -thumbnail 200x200 out.jpg |
| Exact size, cropped to fill | magick in.jpg -resize 800x600^ -gravity center -extent 800x600 out.jpg |
| Crop region | magick in.png -crop 400x300+50+100 +repage out.png |
| Rotate | magick in.jpg -rotate 90 out.jpg |
| JPEG quality/size tradeoff | magick in.png -quality 85 out.jpg |
| Strip EXIF/metadata | magick in.jpg -strip out.jpg |
| Flatten transparency onto color | magick in.png -background white -flatten out.jpg |
| Animated GIF from frames | magick -delay 10 -loop 0 frame*.png out.gif |
| Contact sheet | magick montage *.jpg -tile 4x -geometry +5+5 sheet.png |
| Compare two images | magick compare -metric RMSE a.png b.png diff.png |
Geometry syntax (800x600, ^, !, >, <, %) is subtle — see references/geometry.md. Multi-step recipes (watermarking, PDF rasterization, batch patterns) are in references/recipes.md. For creating images from nothing — synthesized canvases, typesetting text files, shadows/polaroids/vignettes — see references/generative.md and the worked scripts/fold-paper.sh example. Encoder specifics (PNG8/32, WebP/AVIF/HEIC/JXL options, multi-res ICO, TIFF compression) are in references/formats.md; colorspaces, ICC profiles, palettes and dithering in references/color.md; the -draw vector language in references/drawing.md; -fx math, deep -distort, and morphology in references/fx-and-distort.md.
Batch processing
mogrifyedits in place and is the most common way users destroy originals. Always use-pathto redirect output:magick mogrify -path out/ -resize 50% *.jpg(createout/first).- For anything nontrivial, prefer an explicit shell loop with
magick— it is easier to verify and interrupt.magickdoes not create output directories; make them first:mkdir -p resized for f in *.png; do magick "$f" -resize 1200x "resized/${f%.png}.jpg"; done
Pitfalls
-resize 800x600fits within the box preserving aspect ratio; it does not produce exactly 800×600. Use^+-extentfor exact fill, or!to force distortion.- After
-crop, the image keeps its virtual canvas offset; add+repageor later operations behave strangely. - PDF/SVG input rasterizes at 72 DPI by default — set
-density 300before the input filename for usable resolution. PDF support requires Ghostscript and may be blocked by the systempolicy.xml. - Converting to JPEG silently drops the alpha channel (usually onto black). Flatten onto an explicit
-backgroundfirst. magick compareexits 1 when the images differ (0 = identical, 2 = error). That nonzero exit is normal output, but it aborts scripts running underset -e— append|| trueor check for exit 2 specifically.- Very large images can exhaust memory; check/raise limits with
-limit memory 2GiB -limit disk 4GiBor inspectmagick identify -list resource. - HDRI builds (
Q16-HDRIin-version) allow out-of-range pixel values; add-clampbefore writing if results look blown out after arithmetic operations.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

