ImageMagick — Command-Line Image Processing

You are an expert in ImageMagick, the powerful command-line tool for creating, editing, compositing, and converting images. You help developers automate image processing pipelines using ImageMagick's `convert`, `mogrify`, `composite`, and `identify` commands — batch resizing, format conversion, watermarking, thumbnail generation, PDF manipulation, and complex image compositing for web applications, print production, and data visualization.

25 stars

Best use case

ImageMagick — Command-Line Image Processing is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

You are an expert in ImageMagick, the powerful command-line tool for creating, editing, compositing, and converting images. You help developers automate image processing pipelines using ImageMagick's `convert`, `mogrify`, `composite`, and `identify` commands — batch resizing, format conversion, watermarking, thumbnail generation, PDF manipulation, and complex image compositing for web applications, print production, and data visualization.

Teams using ImageMagick — Command-Line Image Processing should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/imagemagick/SKILL.md --create-dirs "https://raw.githubusercontent.com/ComeOnOliver/skillshub/main/skills/TerminalSkills/skills/imagemagick/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/imagemagick/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How ImageMagick — Command-Line Image Processing Compares

Feature / AgentImageMagick — Command-Line Image ProcessingStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

You are an expert in ImageMagick, the powerful command-line tool for creating, editing, compositing, and converting images. You help developers automate image processing pipelines using ImageMagick's `convert`, `mogrify`, `composite`, and `identify` commands — batch resizing, format conversion, watermarking, thumbnail generation, PDF manipulation, and complex image compositing for web applications, print production, and data visualization.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# ImageMagick — Command-Line Image Processing

You are an expert in ImageMagick, the powerful command-line tool for creating, editing, compositing, and converting images. You help developers automate image processing pipelines using ImageMagick's `convert`, `mogrify`, `composite`, and `identify` commands — batch resizing, format conversion, watermarking, thumbnail generation, PDF manipulation, and complex image compositing for web applications, print production, and data visualization.

## Core Capabilities

### Basic Operations

```bash
# Resize
magick input.jpg -resize 800x600 output.jpg        # Fit within 800x600
magick input.jpg -resize 800x600^ output.jpg        # Fill 800x600 (crop overflow)
magick input.jpg -resize 50% output.jpg             # Scale to 50%
magick input.jpg -resize 800x600! output.jpg        # Exact size (distort)

# Format conversion
magick input.png output.webp                         # PNG → WebP
magick input.svg -density 300 output.png             # SVG → high-res PNG
magick input.pdf[0] output.jpg                       # First page of PDF → JPG

# Quality and compression
magick input.jpg -quality 80 output.jpg              # JPEG quality 80%
magick input.png -strip -quality 85 output.webp      # Strip metadata, WebP quality

# Crop
magick input.jpg -crop 500x500+100+50 output.jpg    # 500x500 from position (100,50)
magick input.jpg -gravity center -crop 1:1 output.jpg # Center square crop

# Rotate
magick input.jpg -rotate 90 output.jpg
magick input.jpg -auto-orient output.jpg             # Fix EXIF rotation
```

### Batch Processing

```bash
# Resize all JPGs in directory
magick mogrify -resize 1200x1200 -quality 85 *.jpg

# Convert all PNGs to WebP
for f in *.png; do magick "$f" -quality 80 "${f%.png}.webp"; done

# Generate thumbnails (200x200, center crop)
mkdir -p thumbnails
for f in images/*.jpg; do
    magick "$f" -resize 200x200^ -gravity center -extent 200x200 \
        "thumbnails/$(basename "$f")"
done

# Batch watermark
for f in photos/*.jpg; do
    magick "$f" watermark.png -gravity southeast -composite \
        "watermarked/$(basename "$f")"
done
```

### Compositing and Effects

```bash
# Add text watermark
magick input.jpg -gravity southeast \
    -fill 'rgba(255,255,255,0.5)' -pointsize 24 \
    -annotate +10+10 '© 2026 Company' output.jpg

# Overlay image watermark
magick input.jpg watermark.png \
    -gravity center -compose dissolve -define compose:args=30 \
    -composite output.jpg

# Create social media card (1200x630)
magick -size 1200x630 gradient:'#667eea'-'#764ba2' \
    -font Helvetica-Bold -pointsize 48 -fill white \
    -gravity center -annotate +0-50 'My Blog Post Title' \
    -pointsize 24 -annotate +0+30 'Read more at example.com' \
    og-image.png

# Contact sheet (grid of images)
magick montage images/*.jpg -geometry 200x200+5+5 -tile 4x3 contact-sheet.jpg

# Animated GIF from images
magick -delay 50 frame_*.png -loop 0 animation.gif

# Compare images (diff)
magick compare image1.png image2.png diff.png
```

### Image Information

```bash
# Get image details
magick identify image.jpg
# image.jpg JPEG 3024x4032 3024x4032+0+0 8-bit sRGB 4.2MB

magick identify -verbose image.jpg | head -30     # Full metadata

# Get dimensions as variables
WIDTH=$(magick identify -format '%w' image.jpg)
HEIGHT=$(magick identify -format '%h' image.jpg)
```

## Installation

```bash
brew install imagemagick                   # macOS
apt install imagemagick                   # Ubuntu/Debian
# Or download from https://imagemagick.org/script/download.php
```

## Best Practices

1. **mogrify for in-place** — Use `mogrify` to modify files in-place; `convert`/`magick` for creating new files
2. **WebP for web** — Convert to WebP with quality 80; 30-50% smaller than JPEG at similar quality
3. **Strip metadata** — Use `-strip` to remove EXIF data; reduces file size and protects privacy
4. **Auto-orient** — Always `-auto-orient` before processing; fixes rotation from phone cameras
5. **Thumbnail with crop** — `-resize WxH^` then `-extent WxH` for perfect thumbnails; fill → center crop
6. **Resource limits** — Set `-limit memory 256MiB -limit disk 1GiB` for batch jobs; prevents OOM on large images
7. **Pipeline with pipes** — `magick input.jpg - | magick - -resize 50% output.jpg` for chaining without temp files
8. **SVG at high DPI** — Use `-density 300` before input for SVG/PDF; controls rasterization quality

Related Skills

yt-outline

25
from ComeOnOliver/skillshub

Build detailed step-by-step YouTube video outlines with demo prep, screen-share sequences, and visual planning. Use this skill whenever the user says "create an outline", "outline this video", "video outline", "build the outline", "production outline", or has an approved brief and packaging and needs the final pre-production document before demo prep and filming. Use when working with yt outline. Trigger with 'yt', 'outline'.

vertex-ai-pipeline-creator

25
from ComeOnOliver/skillshub

Vertex Ai Pipeline Creator - Auto-activating skill for GCP Skills. Triggers on: vertex ai pipeline creator, vertex ai pipeline creator Part of the GCP Skills skill category.

tutorial-outline-creator

25
from ComeOnOliver/skillshub

Tutorial Outline Creator - Auto-activating skill for Technical Documentation. Triggers on: tutorial outline creator, tutorial outline creator Part of the Technical Documentation skill category.

sklearn-pipeline-builder

25
from ComeOnOliver/skillshub

Sklearn Pipeline Builder - Auto-activating skill for ML Training. Triggers on: sklearn pipeline builder, sklearn pipeline builder Part of the ML Training skill category.

processing-computer-vision-tasks

25
from ComeOnOliver/skillshub

Process images using object detection, classification, and segmentation. Use when requesting "analyze image", "object detection", "image classification", or "computer vision". Trigger with relevant phrases based on skill purpose.

processing-api-batches

25
from ComeOnOliver/skillshub

Optimize bulk API requests with batching, throttling, and parallel execution. Use when processing bulk API operations efficiently. Trigger with phrases like "process bulk requests", "batch API calls", or "handle batch operations".

presentation-slide-outliner

25
from ComeOnOliver/skillshub

Presentation Slide Outliner - Auto-activating skill for Visual Content. Triggers on: presentation slide outliner, presentation slide outliner Part of the Visual Content skill category.

preprocessing-data-with-automated-pipelines

25
from ComeOnOliver/skillshub

Process automate data cleaning, transformation, and validation for ML tasks. Use when requesting "preprocess data", "clean data", "ETL pipeline", or "data transformation". Trigger with relevant phrases based on skill purpose.

pipeline-monitoring-setup

25
from ComeOnOliver/skillshub

Pipeline Monitoring Setup - Auto-activating skill for Data Pipelines. Triggers on: pipeline monitoring setup, pipeline monitoring setup Part of the Data Pipelines skill category.

performance-baseline-creator

25
from ComeOnOliver/skillshub

Performance Baseline Creator - Auto-activating skill for Performance Testing. Triggers on: performance baseline creator, performance baseline creator Part of the Performance Testing skill category.

orchestrating-deployment-pipelines

25
from ComeOnOliver/skillshub

Deploy use when you need to work with deployment and CI/CD. This skill provides deployment automation and orchestration with comprehensive guidance and automation. Trigger with phrases like "deploy application", "create pipeline", or "automate deployment".

linux-commands-guide

25
from ComeOnOliver/skillshub

Linux Commands Guide - Auto-activating skill for DevOps Basics. Triggers on: linux commands guide, linux commands guide Part of the DevOps Basics skill category.