بنقرة واحدة
imagemagick
Image manipulation and conversion using ImageMagick inside a secure Docker container
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Image manipulation and conversion using ImageMagick inside a secure Docker container
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
| name | imagemagick |
| description | Image manipulation and conversion using ImageMagick inside a secure Docker container |
| runtime | docker |
Powerful image manipulation and conversion using ImageMagick running inside a Docker container. Resize, crop, rotate, apply effects, convert formats, create thumbnails, add watermarks, and more - all without installing ImageMagick locally.
This skill provides access to ImageMagick's comprehensive image processing capabilities through a containerized runtime. All processing happens inside an isolated Docker container with resource limits and no network access, ensuring security while maintaining full ImageMagick functionality.
Use this skill when you need to:
ImageMagick runs inside a Docker container, so Docker must be installed:
# macOS (using Homebrew)
brew install --cask docker
# Or download from: https://www.docker.com/products/docker-desktop
# Linux (Ubuntu/Debian)
sudo apt-get update
sudo apt-get install docker.io
# Start Docker service
sudo systemctl start docker
sudo systemctl enable docker
docker --version
docker ps # Should list running containers
Add to your .skill-engine.toml:
[skills.imagemagick]
source = "docker:dpokidov/imagemagick:latest"
runtime = "docker"
description = "ImageMagick image processing"
[skills.imagemagick.docker]
image = "dpokidov/imagemagick:latest"
entrypoint = "magick"
volumes = ["${PWD}:/workdir"]
working_dir = "/workdir"
memory = "1g"
network = "none"
rm = true
dpokidov/imagemagick:latest - ImageMagick Docker image (~100MB)magick - Runs ImageMagick 7.x command${PWD}:/workdir - Mounts current directory as /workdir in container/workdir - Sets container working directory1g - Limits container to 1GB RAMnone - Disables network access (processes local files only)true - Automatically removes container after executionImageMagick skill uses pass-through syntax - all arguments after -- are passed directly to ImageMagick:
skill run imagemagick -- [imagemagick command] [arguments]
All file paths are relative to your current directory, which is mounted as /workdir in the container.
# PNG to JPEG
skill run imagemagick -- convert input.png output.jpg
# JPEG to PNG
skill run imagemagick -- convert input.jpg output.png
# Convert to WebP
skill run imagemagick -- convert input.jpg output.webp
# Convert to GIF
skill run imagemagick -- convert input.png output.gif
# Convert to TIFF
skill run imagemagick -- convert input.jpg output.tiff
# Resize to exact dimensions (may distort)
skill run imagemagick -- convert input.jpg -resize 800x600! output.jpg
# Resize maintaining aspect ratio (fit within box)
skill run imagemagick -- convert input.jpg -resize 800x600 output.jpg
# Resize by width only (maintain aspect ratio)
skill run imagemagick -- convert input.jpg -resize 800 output.jpg
# Resize by height only
skill run imagemagick -- convert input.jpg -resize x600 output.jpg
# Resize by percentage
skill run imagemagick -- convert input.jpg -resize 50% output.jpg
# Shrink only (never enlarge)
skill run imagemagick -- convert input.jpg -resize 800x600\> output.jpg
# Enlarge only (never shrink)
skill run imagemagick -- convert input.jpg -resize 800x600\< output.jpg
# Basic thumbnail
skill run imagemagick -- convert input.jpg -thumbnail 150x150 thumb.jpg
# Square thumbnail (crop to center)
skill run imagemagick -- convert input.jpg -thumbnail 150x150^ -gravity center -extent 150x150 thumb.jpg
# Thumbnail with quality control
skill run imagemagick -- convert input.jpg -thumbnail 150x150 -quality 85 thumb.jpg
# Multiple thumbnails
skill run imagemagick -- convert input.jpg -thumbnail 300x300 large.jpg -thumbnail 150x150 medium.jpg -thumbnail 75x75 small.jpg
# Crop to 100x100 pixels starting at position 50,50
skill run imagemagick -- convert input.jpg -crop 100x100+50+50 output.jpg
# Crop from center
skill run imagemagick -- convert input.jpg -gravity center -crop 200x200+0+0 output.jpg
# Crop specific region
skill run imagemagick -- convert input.jpg -crop 400x300+100+50 output.jpg
# Remove extra canvas space
skill run imagemagick -- convert input.jpg -crop 100x100+50+50 +repage output.jpg
# Rotate 90 degrees clockwise
skill run imagemagick -- convert input.jpg -rotate 90 output.jpg
# Rotate 180 degrees
skill run imagemagick -- convert input.jpg -rotate 180 output.jpg
# Rotate 270 degrees (90 counter-clockwise)
skill run imagemagick -- convert input.jpg -rotate 270 output.jpg
# Flip horizontally
skill run imagemagick -- convert input.jpg -flop output.jpg
# Flip vertically
skill run imagemagick -- convert input.jpg -flip output.jpg
# Convert to grayscale
skill run imagemagick -- convert input.jpg -colorspace Gray output.jpg
# Sepia tone
skill run imagemagick -- convert input.jpg -sepia-tone 80% output.jpg
# Negate (invert colors)
skill run imagemagick -- convert input.jpg -negate output.jpg
# Adjust brightness
skill run imagemagick -- convert input.jpg -brightness-contrast 20x0 output.jpg
# Adjust contrast
skill run imagemagick -- convert input.jpg -brightness-contrast 0x30 output.jpg
# Adjust both brightness and contrast
skill run imagemagick -- convert input.jpg -brightness-contrast 10x20 output.jpg
# Colorize
skill run imagemagick -- convert input.jpg -colorize 30,0,0 output.jpg
# Blur
skill run imagemagick -- convert input.jpg -blur 0x8 output.jpg
# Gaussian blur
skill run imagemagick -- convert input.jpg -gaussian-blur 0x5 output.jpg
# Sharpen
skill run imagemagick -- convert input.jpg -sharpen 0x1 output.jpg
# Edge detection
skill run imagemagick -- convert input.jpg -edge 1 output.jpg
# Emboss
skill run imagemagick -- convert input.jpg -emboss 2 output.jpg
# Charcoal drawing
skill run imagemagick -- convert input.jpg -charcoal 2 output.jpg
# Oil painting
skill run imagemagick -- convert input.jpg -paint 4 output.jpg
# Sketch
skill run imagemagick -- convert input.jpg -sketch 0x20+120 output.jpg
# Simple border
skill run imagemagick -- convert input.jpg -border 10x10 -bordercolor black output.jpg
# Colored border
skill run imagemagick -- convert input.jpg -border 5x5 -bordercolor blue output.jpg
# Frame effect
skill run imagemagick -- convert input.jpg -frame 10x10+5+5 output.jpg
# Rounded corners
skill run imagemagick -- convert input.jpg -alpha set -background none -vignette 0x0 output.png
# Add watermark at bottom right
skill run imagemagick -- composite -gravity southeast watermark.png input.jpg output.jpg
# Add watermark with opacity
skill run imagemagick -- composite -dissolve 30 -gravity southeast watermark.png input.jpg output.jpg
# Center watermark
skill run imagemagick -- composite -gravity center watermark.png input.jpg output.jpg
# Overlay at specific position
skill run imagemagick -- composite -geometry +100+50 overlay.png input.jpg output.jpg
# Add text at top
skill run imagemagick -- convert input.jpg -pointsize 30 -fill white -annotate +10+40 "Sample Text" output.jpg
# Add text with background
skill run imagemagick -- convert input.jpg -gravity south -background black -fill white -pointsize 20 -annotate +0+10 "Copyright 2024" output.jpg
# Centered text
skill run imagemagick -- convert input.jpg -gravity center -pointsize 50 -fill red -annotate +0+0 "DRAFT" output.jpg
# Set JPEG quality (0-100, higher = better)
skill run imagemagick -- convert input.jpg -quality 85 output.jpg
# High quality
skill run imagemagick -- convert input.jpg -quality 95 output.jpg
# Web optimized (smaller file)
skill run imagemagick -- convert input.jpg -quality 75 -strip output.jpg
# Strip metadata
skill run imagemagick -- convert input.jpg -strip output.jpg
# PNG compression
skill run imagemagick -- convert input.png -quality 95 output.png
# Convert all PNGs to JPEGs
for file in *.png; do
skill run imagemagick -- convert "$file" "${file%.png}.jpg"
done
# Resize all images
for file in *.jpg; do
skill run imagemagick -- convert "$file" -resize 800x600 "resized_${file}"
done
# Create thumbnails for all images
for file in *.jpg; do
skill run imagemagick -- convert "$file" -thumbnail 150x150^ -gravity center -extent 150x150 "thumb_${file}"
done
# Convert multiple formats to PNG
for file in *.{jpg,gif,bmp}; do
skill run imagemagick -- convert "$file" "${file%.*}.png"
done
# Create grid montage
skill run imagemagick -- montage *.jpg -geometry +2+2 -tile 3x3 montage.jpg
# Montage with borders
skill run imagemagick -- montage *.jpg -geometry 200x200+5+5 -tile 4x output.jpg
# Labeled montage
skill run imagemagick -- montage *.jpg -label '%f' -geometry +2+2 labeled_montage.jpg
# Contact sheet
skill run imagemagick -- montage *.jpg -tile 5x -geometry 150x150+2+2 contact_sheet.jpg
# Convert images to PDF
skill run imagemagick -- convert image1.jpg image2.jpg image3.jpg output.pdf
# Convert all JPEGs to single PDF
skill run imagemagick -- convert *.jpg document.pdf
# PDF to images (one per page)
skill run imagemagick -- convert input.pdf -quality 100 page-%03d.jpg
# Extract specific page from PDF
skill run imagemagick -- convert input.pdf[0] first_page.jpg
# Get basic image info
skill run imagemagick -- identify input.jpg
# Detailed image info
skill run imagemagick -- identify -verbose input.jpg
# Check image format
skill run imagemagick -- identify -format "%m" input.jpg
# Get dimensions
skill run imagemagick -- identify -format "%wx%h" input.jpg
# Get file size
skill run imagemagick -- identify -format "%b" input.jpg
# Create blank image with text
skill run imagemagick -- convert -size 800x600 xc:white -pointsize 50 -fill black -annotate +100+300 "Hello World" text_image.jpg
# Create gradient background with text
skill run imagemagick -- convert -size 800x600 gradient:blue-white -pointsize 60 -fill white -annotate +50+300 "Welcome" gradient_text.jpg
# Resize and optimize for web
for img in *.jpg; do
skill run imagemagick -- convert "$img" \
-resize 1200x1200\> \
-quality 85 \
-strip \
"web_${img}"
done
skill run imagemagick -- convert input.jpg \
-bordercolor white -border 15 \
-bordercolor grey60 -border 1 \
-background none -rotate 6 \
-background white -flatten \
polaroid.jpg
skill run imagemagick -- convert input.jpg \
-background black \
-vignette 0x20 \
vignette.jpg
skill run imagemagick -- convert input.jpg \
-mattecolor white -frame 20x20+10+10 \
-mattecolor black -frame 3x3+0+0 \
framed.jpg
All file paths are relative to your current directory:
# Current directory files
cd /path/to/images
skill run imagemagick -- convert photo.jpg result.png
# Subdirectory files
skill run imagemagick -- convert input/photo.jpg output/result.png
# Absolute paths NOT supported - use relative paths
cd /path/to/images
skill run imagemagick -- convert photo.jpg result.png # ✓ Works
skill run imagemagick -- convert /path/to/images/photo.jpg result.png # ✗ Won't work
$PWD/photo.jpg → Container: /workdir/photo.jpg$PWD/images/photo.jpg → Container: /workdir/images/photo.jpgJPEG, PNG, GIF, TIFF, BMP, WebP, SVG, PDF, PSD, ICO, RAW (many variants)
JPEG, PNG, GIF, TIFF, BMP, WebP, PDF, ICO, and more
xc:white, xc:#FF0000)Use appropriate quality settings:
-quality 75-85-quality 90-95-quality 95-100Strip metadata for smaller files:
skill run imagemagick -- convert input.jpg -strip output.jpg
Batch process efficiently:
skill run imagemagick -- mogrify -resize 800x600 -quality 85 *.jpg
Use correct format for the use case:
# Check Docker status
docker ps
# Start Docker Desktop (macOS)
open /Applications/Docker.app
# Start Docker service (Linux)
sudo systemctl start docker
If processing large images, increase memory limit in .skill-engine.toml:
[skills.imagemagick.docker]
memory = "2g" # Increase to 2GB
Ensure you're in the correct directory:
# Check current directory
pwd
ls -la # Verify files exist
# Change to correct directory
cd /path/to/images
skill run imagemagick -- convert photo.jpg result.png
# Check file permissions
ls -la photo.jpg
# Make file readable
chmod 644 photo.jpg
# Use higher quality setting
skill run imagemagick -- convert input.jpg -quality 95 output.jpg
# Avoid multiple conversions (quality degrades)
# Bad: JPG → PNG → JPG (loses quality twice)
# Good: JPG → PNG (one conversion)
| Error | Cause | Solution |
|---|---|---|
| "No such file" | Wrong directory or path | Use pwd and ls to verify location |
| "Permission denied" | File permissions | chmod 644 filename |
| "Memory allocation failed" | Out of memory | Increase memory limit in config |
| "Cannot connect to Docker" | Docker not running | Start Docker Desktop/service |
| "Unable to open image" | Corrupted or unsupported file | Check file format with identify |
# convert (creates new file)
skill run imagemagick -- convert input.jpg -resize 800x600 output.jpg
# mogrify (modifies original - BE CAREFUL!)
skill run imagemagick -- mogrify -resize 800x600 image.jpg
# composite (overlay/watermark)
skill run imagemagick -- composite watermark.png input.jpg output.jpg
dpokidov/imagemagick:latest| Operation | Command |
|---|---|
| Convert format | convert input.png output.jpg |
| Resize | convert input.jpg -resize 800x600 output.jpg |
| Thumbnail | convert input.jpg -thumbnail 150x150^ -gravity center -extent 150x150 thumb.jpg |
| Rotate | convert input.jpg -rotate 90 output.jpg |
| Crop | convert input.jpg -crop 100x100+10+10 output.jpg |
| Grayscale | convert input.jpg -colorspace Gray output.jpg |
| Blur | convert input.jpg -blur 0x8 output.jpg |
| Sharpen | convert input.jpg -sharpen 0x1 output.jpg |
| Border | convert input.jpg -border 5x5 -bordercolor black output.jpg |
| Watermark | composite -gravity southeast watermark.png input.jpg output.jpg |
| Get info | identify input.jpg |
| To PDF | convert *.jpg output.pdf |
Docker container and image management with native docker CLI integration. Use when you need to manage containers, images, networks, volumes, or run Docker Compose.
Video and audio processing using FFmpeg inside a secure Docker container
MongoDB database client with Docker-based mongosh CLI
MySQL database client with Docker-based mysql CLI
PostgreSQL CLI client (psql) for database operations running inside a Docker container
Redis CLI client for cache and data store operations running inside a Docker container