image-manipulation-image-magick

24
0
Source

Process and manipulate images using ImageMagick. Supports resizing, format conversion, batch processing, and retrieving image metadata. Use when working with images, creating thumbnails, resizing wallpapers, or performing batch image operations.

Install

mkdir -p .claude/skills/image-manipulation-image-magick && curl -L -o skill.zip "https://mcp.directory/api/skills/download/939" && unzip -o skill.zip -d .claude/skills/image-manipulation-image-magick && rm skill.zip

Installs to .claude/skills/image-manipulation-image-magick

About this skill

Image Manipulation with ImageMagick

This skill enables image processing and manipulation tasks using ImageMagick across Windows, Linux, and macOS systems.

When to Use This Skill

Use this skill when you need to:

  • Resize images (single or batch)
  • Get image dimensions and metadata
  • Convert between image formats
  • Create thumbnails
  • Process wallpapers for different screen sizes
  • Batch process multiple images with specific criteria

Prerequisites

  • ImageMagick installed on the system
  • Windows: PowerShell with ImageMagick available as magick (or at C:\Program Files\ImageMagick-*\magick.exe)
  • Linux/macOS: Bash with ImageMagick installed via package manager (apt, brew, etc.)

Core Capabilities

1. Image Information

  • Get image dimensions (width x height)
  • Retrieve detailed metadata (format, color space, etc.)
  • Identify image format

2. Image Resizing

  • Resize single images
  • Batch resize multiple images
  • Create thumbnails with specific dimensions
  • Maintain aspect ratios

3. Batch Processing

  • Process images based on dimensions
  • Filter and process specific file types
  • Apply transformations to multiple files

Usage Examples

Example 0: Resolve magick executable

PowerShell (Windows):

# Prefer ImageMagick on PATH
$magick = (Get-Command magick -ErrorAction SilentlyContinue)?.Source

# Fallback: common install pattern under Program Files
if (-not $magick) {
    $magick = Get-ChildItem "C:\\Program Files\\ImageMagick-*\\magick.exe" -ErrorAction SilentlyContinue |
        Select-Object -First 1 -ExpandProperty FullName
}

if (-not $magick) {
    throw "ImageMagick not found. Install it and/or add 'magick' to PATH."
}

Bash (Linux/macOS):

# Check if magick is available on PATH
if ! command -v magick &> /dev/null; then
    echo "ImageMagick not found. Install it using your package manager:"
    echo "  Ubuntu/Debian: sudo apt install imagemagick"
    echo "  macOS: brew install imagemagick"
    exit 1
fi

Example 1: Get Image Dimensions

PowerShell (Windows):

# For a single image
& $magick identify -format "%wx%h" path/to/image.jpg

# For multiple images
Get-ChildItem "path/to/images/*" | ForEach-Object { 
    $dimensions = & $magick identify -format "%f: %wx%h`n" $_.FullName
    Write-Host $dimensions 
}

Bash (Linux/macOS):

# For a single image
magick identify -format "%wx%h" path/to/image.jpg

# For multiple images
for img in path/to/images/*; do
    magick identify -format "%f: %wx%h\n" "$img"
done

Example 2: Resize Images

PowerShell (Windows):

# Resize a single image
& $magick input.jpg -resize 427x240 output.jpg

# Batch resize images
Get-ChildItem "path/to/images/*" | ForEach-Object { 
    & $magick $_.FullName -resize 427x240 "path/to/output/thumb_$($_.Name)"
}

Bash (Linux/macOS):

# Resize a single image
magick input.jpg -resize 427x240 output.jpg

# Batch resize images
for img in path/to/images/*; do
    filename=$(basename "$img")
    magick "$img" -resize 427x240 "path/to/output/thumb_$filename"
done

Example 3: Get Detailed Image Information

PowerShell (Windows):

# Get verbose information about an image
& $magick identify -verbose path/to/image.jpg

Bash (Linux/macOS):

# Get verbose information about an image
magick identify -verbose path/to/image.jpg

Example 4: Process Images Based on Dimensions

PowerShell (Windows):

Get-ChildItem "path/to/images/*" | ForEach-Object { 
    $dimensions = & $magick identify -format "%w,%h" $_.FullName
    if ($dimensions) {
        $width,$height = $dimensions -split ','
        if ([int]$width -eq 2560 -or [int]$height -eq 1440) {
            Write-Host "Processing $($_.Name)"
            & $magick $_.FullName -resize 427x240 "path/to/output/thumb_$($_.Name)"
        }
    }
}

Bash (Linux/macOS):

for img in path/to/images/*; do
    dimensions=$(magick identify -format "%w,%h" "$img")
    if [[ -n "$dimensions" ]]; then
        width=$(echo "$dimensions" | cut -d',' -f1)
        height=$(echo "$dimensions" | cut -d',' -f2)
        if [[ "$width" -eq 2560 || "$height" -eq 1440 ]]; then
            filename=$(basename "$img")
            echo "Processing $filename"
            magick "$img" -resize 427x240 "path/to/output/thumb_$filename"
        fi
    fi
done

Guidelines

  1. Always quote file paths - Use quotes around file paths that might contain spaces
  2. Use the & operator (PowerShell) - Invoke the magick executable using & in PowerShell
  3. Store the path in a variable (PowerShell) - Assign the ImageMagick path to $magick for cleaner code
  4. Wrap in loops - When processing multiple files, use ForEach-Object (PowerShell) or for loops (Bash)
  5. Verify dimensions first - Check image dimensions before processing to avoid unnecessary operations
  6. Use appropriate resize flags - Consider using ! to force exact dimensions or ^ for minimum dimensions

Common Patterns

PowerShell Patterns

Pattern: Store ImageMagick Path

$magick = (Get-Command magick).Source

Pattern: Get Dimensions as Variables

$dimensions = & $magick identify -format "%w,%h" $_.FullName
$width,$height = $dimensions -split ','

Pattern: Conditional Processing

if ([int]$width -gt 1920) {
    & $magick $_.FullName -resize 1920x1080 $outputPath
}

Pattern: Create Thumbnails

& $magick $_.FullName -resize 427x240 "thumbnails/thumb_$($_.Name)"

Bash Patterns

Pattern: Check ImageMagick Installation

command -v magick &> /dev/null || { echo "ImageMagick required"; exit 1; }

Pattern: Get Dimensions as Variables

dimensions=$(magick identify -format "%w,%h" "$img")
width=$(echo "$dimensions" | cut -d',' -f1)
height=$(echo "$dimensions" | cut -d',' -f2)

Pattern: Conditional Processing

if [[ "$width" -gt 1920 ]]; then
    magick "$img" -resize 1920x1080 "$outputPath"
fi

Pattern: Create Thumbnails

filename=$(basename "$img")
magick "$img" -resize 427x240 "thumbnails/thumb_$filename"

Limitations

  • Large batch operations may be memory-intensive
  • Some complex operations may require additional ImageMagick delegates
  • On older Linux systems, use convert instead of magick (ImageMagick 6.x vs 7.x)

More by github

View all →

penpot-uiux-design

github

Comprehensive guide for creating professional UI/UX designs in Penpot using MCP tools. Use this skill when: (1) Creating new UI/UX designs for web, mobile, or desktop applications, (2) Building design systems with components and tokens, (3) Designing dashboards, forms, navigation, or landing pages, (4) Applying accessibility standards and best practices, (5) Following platform guidelines (iOS, Android, Material Design), (6) Reviewing or improving existing Penpot designs for usability. Triggers: "design a UI", "create interface", "build layout", "design dashboard", "create form", "design landing page", "make it accessible", "design system", "component library".

425

excalidraw-diagram-generator

github

Generate Excalidraw diagrams from natural language descriptions. Use when asked to "create a diagram", "make a flowchart", "visualize a process", "draw a system architecture", "create a mind map", or "generate an Excalidraw file". Supports flowcharts, relationship diagrams, mind maps, and system architecture diagrams. Outputs .excalidraw JSON files that can be opened directly in Excalidraw.

483

microsoft-docs

github

Query official Microsoft documentation to understand concepts, find tutorials, and learn how services work. Use for Azure, .NET, Microsoft 365, Windows, Power Platform, and all Microsoft technologies. Get accurate, current information from learn.microsoft.com and other official Microsoft websites—architecture overviews, quickstarts, configuration guides, limits, and best practices.

402

azure-deployment-preflight

github

Performs comprehensive preflight validation of Bicep deployments to Azure, including template syntax validation, what-if analysis, and permission checks. Use this skill before any deployment to Azure to preview changes, identify potential issues, and ensure the deployment will succeed. Activate when users mention deploying to Azure, validating Bicep files, checking deployment permissions, previewing infrastructure changes, running what-if, or preparing for azd provision.

352

plantuml-ascii

github

Generate ASCII art diagrams using PlantUML text mode. Use when user asks to create ASCII diagrams, text-based diagrams, terminal-friendly diagrams, or mentions plantuml ascii, text diagram, ascii art diagram. Supports: Converting PlantUML diagrams to ASCII art, Creating sequence diagrams, class diagrams, flowcharts in ASCII format, Generating Unicode-enhanced ASCII art with -utxt flag

82

azure-resource-visualizer

github

Analyze Azure resource groups and generate detailed Mermaid architecture diagrams showing the relationships between individual resources. Use this skill when the user asks for a diagram of their Azure resources or help in understanding how the resources relate to each other.

61

You might also like

flutter-development

aj-geddes

Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.

284790

drawio-diagrams-enhanced

jgtolentino

Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.

212415

godot

bfollington

This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.

205286

nano-banana-pro

garg-aayush

Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.

217234

ui-ux-pro-max

nextlevelbuilder

"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."

169198

rust-coding-skill

UtakataKyosui

Guides Claude in writing idiomatic, efficient, well-structured Rust code using proper data modeling, traits, impl organization, macros, and build-speed best practices.

165173

Stay ahead of the MCP ecosystem

Get weekly updates on new skills and servers.