Image Manipulation Image Magick
GitHubOfficialFirst committed by jamesmontemagnoDistributed by GitHub
- Skill
- Tool integration
- Design and creative
- MIT
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a structured approach to leveraging ImageMagick for automated image manipulation tasks. It covers essential operations such as resizing, format conversion, and metadata retrieval, with cross-platform support for Windows (PowerShell) and Unix-based systems (Bash). The skill emphasizes robust patterns for batch processing, conditional logic based on image properties, and proper environment configuration.
What it does
- Resizes single or multiple images while maintaining aspect ratios.
- Extracts image dimensions and detailed metadata.
- Converts images between various file formats.
- Automates batch processing of image directories.
- Provides conditional logic to process images based on specific dimensions.
- Offers cross-platform patterns for PowerShell and Bash environments.
When to use it
- When you need to automate image resizing or thumbnail generation.
- When you need to extract metadata from large collections of images.
- When you need to perform batch format conversions.
- When you need to filter and process images based on their resolution or properties.
- When building automated pipelines for wallpaper or asset management.
Advantages
- Provides consistent patterns for both Windows and Linux/macOS.
- Includes robust error handling and path resolution for the ImageMagick executable.
- Demonstrates efficient batch processing techniques.
- Offers clear, reusable code patterns for common image tasks.
- Supports conditional processing to optimize performance.
Usage examples
- “Resize all images in the current directory to 427x240 pixels.”
- The agent will iterate through the files and apply the resize command to each, saving them with a prefix.
- “Get the dimensions of all images in a folder.”
- The agent will output a list of filenames paired with their respective width and height.
- “Only resize images that are larger than 1920 pixels wide.”
- The agent will check the metadata of each image and conditionally apply the resize operation.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/github/image-manipulation-image-magick/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip image-manipulation-image-magick.zip -d .agents/skills
Documentation by jamesmontemagno
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 atC:\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
fiExample 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"
doneExample 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"
doneExample 3: Get Detailed Image Information
PowerShell (Windows):
# Get verbose information about an image
& $magick identify -verbose path/to/image.jpgBash (Linux/macOS):
# Get verbose information about an image
magick identify -verbose path/to/image.jpgExample 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
doneGuidelines
Always quote file paths - Use quotes around file paths that might contain spaces
Use the
&operator (PowerShell) - Invoke the magick executable using&in PowerShellStore the path in a variable (PowerShell) - Assign the ImageMagick path to
$magickfor cleaner codeWrap in loops - When processing multiple files, use
ForEach-Object(PowerShell) orforloops (Bash)Verify dimensions first - Check image dimensions before processing to avoid unnecessary operations
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).SourcePattern: 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"
fiPattern: 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
convertinstead ofmagick(ImageMagick 6.x vs 7.x)
Files
- ATTRIBUTION.mdAdded by AutoGineer909 B
- LICENSELicence file added by AutoGineer1.0 KiB
- SKILL.md6.8 KiB
Requirements and compatibility
Written for: GitHub Copilot
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
The author says: Requires ImageMagick installed and available as `magick` on PATH. Cross-platform examples provided for PowerShell (Windows) and Bash (Linux/macOS).
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- First committed by
jamesmontemagno
- Publisher
- GitHub (Official)
- Distributed by
- GitHub
- Source
- github/awesome-copilot · skills/image-manipulation-image-magick · commit 797337f
- Licence
- MIT License (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
- Contributors
- jamesmontemagno
AutoGineer is not affiliated with or endorsed by jamesmontemagno or GitHub.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download image-manipulation-image-magick.zip