MR
Mayur Rathi
@github
⭐ 34.1k GitHub stars

Image-Manipulation-Image-Magick

Image-Manipulation-Image-Magick是一款code方向的AI技能,核心价值是Process and manipulate images using ImageMagick,可用于解决开发者在code领域的实际问题,帮助用户提升效率、自动化重复任务或优化工作流。

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

Last verified on: 2026-05-30
mkdir -p ./skills/image-manipulation-image-magick && curl -sfL https://raw.githubusercontent.com/github/awesome-copilot/main/skills/image-manipulation-image-magick/SKILL.md -o ./skills/image-manipulation-image-magick/SKILL.md

Run in terminal / PowerShell. Requires curl (Unix) or PowerShell 5+ (Windows).

Skill Content

# 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):**

powershell
# 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):**

bash
# 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):**

powershell
# 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):**

bash
# 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):**

powershell
# 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):**

bash
# 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):**

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

**Bash (Linux/macOS):**

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

Example 4: Process Images Based on Dimensions


**PowerShell (Windows):**

powershell
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):**

bash
for img in path/to/images/*; 

🎯 Best For

  • Claude users
  • GitHub Copilot users
  • Software engineers
  • Development teams
  • Tech leads

💡 Use Cases

  • Code quality improvement
  • Best practice enforcement

📖 How to Use This Skill

  1. 1

    Install the Skill

    Copy the install command from the Terminal tab and run it. The SKILL.md file downloads to your local skills directory.

  2. 2

    Load into Your AI Assistant

    Open Claude or GitHub Copilot and reference the skill. Paste the SKILL.md content or use the system prompt tab.

  3. 3

    Apply Image-Manipulation-Image-Magick to Your Work

    Open your project in the AI assistant and ask it to apply the skill. Start with a small module to verify the output quality.

  4. 4

    Review and Refine

    Review AI suggestions before committing. Run tests, check for regressions, and iterate on the skill output.

❓ Frequently Asked Questions

Is Image-Manipulation-Image-Magick compatible with Cursor and VS Code?

Yes — this skill works with any AI coding assistant including Cursor, VS Code with Copilot, and JetBrains IDEs.

Do I need specific dependencies for Image-Manipulation-Image-Magick?

Check the install command and Works With section. Most code skills only require the AI assistant and your codebase.

How do I install Image-Manipulation-Image-Magick?

Copy the install command from the Terminal tab and run it. The skill downloads to ./skills/image-manipulation-image-magick/SKILL.md, ready to use.

Can I customize this skill for my team?

Absolutely. Edit the SKILL.md file to add team-specific instructions, examples, or workflows.

⚠️ Common Mistakes to Avoid

Skipping validation

Always test AI-generated code changes, even for simple refactors.

Missing dependency updates

Check if the skill requires updated dependencies or new packages.

🔗 Related Skills