Two Tools, Same Goals, Different Histories
ImageMagick is the universal command-line image manipulation tool. Created in 1987, used in production at every scale from one-off scripts to massive image pipelines.
GraphicsMagick is a fork of ImageMagick from 2002. The fork was driven by stability and performance concerns. GraphicsMagick has tighter focus, fewer features, but typically faster execution.
Both tools serve image processing pipelines. The choice depends on your specific workload and stability requirements. This post covers the practical comparison. For broader batch processing, see Batch Processing Files Guide.
Speed Comparison
For 1000 JPGs resized to 1024px wide:
| Tool | Time | Notes |
|---|---|---|
ImageMagick convert | 95 seconds | Baseline |
ImageMagick magick | 80 seconds | Newer command syntax |
GraphicsMagick gm convert | 55 seconds | Fork with optimizations |
| Sharp (Node.js) | 18 seconds | C++ libvips backend |
| libvips direct | 12 seconds | C native |
GraphicsMagick is roughly 30-40% faster than ImageMagick for batch operations. Sharp and libvips are dramatically faster but require Node.js or C dependencies.
For most CLI workflows: ImageMagick. For high-volume batch: GraphicsMagick or Sharp.
Feature Comparison
| Feature | ImageMagick | GraphicsMagick |
|---|---|---|
| Format support | 200+ formats | 90+ formats |
| Color profile (ICC) | Excellent | Good |
| Image compositing | Extensive | Adequate |
| HDR processing | Yes | Limited |
| Animation support | Good (GIF, MNG) | Basic |
| Vector formats (SVG) | Limited | Limited |
| Plugins / Extensions | Yes | Limited |
| Memory efficiency | Per-file | Better at scale |
| Stability | Mostly stable | More stable |
For specialty work (HDR, complex compositing): ImageMagick. For straightforward batch operations: GraphicsMagick.
Common Operations
For simple operations, syntax is similar:
Resize image:
# ImageMagick
convert input.jpg -resize 1024x output.jpg
# GraphicsMagick
gm convert input.jpg -resize 1024x output.jpg
Convert format:
# ImageMagick
convert input.png output.jpg
# GraphicsMagick
gm convert input.png output.jpg
Add watermark:
# ImageMagick
convert input.jpg watermark.png \
-gravity southeast -geometry +20+20 \
-composite output.jpg
# GraphicsMagick
gm composite -gravity southeast -geometry +20+20 \
watermark.png input.jpg output.jpg
GraphicsMagick uses a slightly different syntax for compositing.
Batch Resize Workflow
For resizing 100K product images:
ImageMagick approach:
mogrify -path output/ -resize 1024x -quality 90 *.jpg
mogrify is in-place but with -path it writes to a different directory.
GraphicsMagick approach:
for f in *.jpg; do
gm convert "$f" -resize 1024x -quality 90 "output/${f}"
done
For 100K images: ImageMagick takes ~3 hours, GraphicsMagick ~1.8 hours.
For batch automation, see Batch Processing Files Guide.
Parallel Processing
Both tools work in single-threaded mode by default. For parallel:
With GNU parallel:
ls *.jpg | parallel "gm convert {} -resize 1024x output/{}"
This runs N parallel jobs based on CPU cores. For 100K images on a 16-core CPU: ~7 minutes.
For ImageMagick:
parallel "convert {} -resize 1024x output/{}" ::: *.jpg
Same performance.
ImageMagick Policy XML
ImageMagick has a security policy file:
<!-- /etc/ImageMagick-7/policy.xml -->
<policy domain="resource" name="memory" value="2GiB"/>
<policy domain="resource" name="map" value="2GiB"/>
<policy domain="resource" name="width" value="32KP"/>
<policy domain="resource" name="height" value="32KP"/>
These limits prevent denial-of-service via large images. For high-resolution work, raise the limits.
For server environments, the policy file ensures stability under load.
GraphicsMagick's Advantage
GraphicsMagick was forked specifically for:
- Performance: optimized memory management
- Stability: fewer changes between versions
- Embeddability: cleaner library API
- Predictability: simpler feature set
For production servers running thousands of conversions per hour, GraphicsMagick's stability matters. ImageMagick has had multiple security CVEs over the years; GraphicsMagick has fewer.
Real-World Comparison
For a Cloudinary-style image pipeline:
| Workflow | Best fit |
|---|---|
| Per-request resize on web requests | Sharp (Node.js) for max speed |
| Nightly batch resize of 1M images | GraphicsMagick or libvips |
| One-off photo retouching | ImageMagick |
| Color profile-aware conversion | ImageMagick |
| Watermarking | ImageMagick |
| HDR tone mapping | ImageMagick |
| Server-side avatar resizing | Sharp or GraphicsMagick |
For most "I need a tool for image processing": ImageMagick. For specific high-volume batch: GraphicsMagick or Sharp.
Format Quality Differences
For JPG quality at the same setting:
| Tool | JPG quality 85 | File size (1080p) |
|---|---|---|
| ImageMagick | Reference | 280 KB |
| GraphicsMagick | Slightly better | 270 KB |
| Sharp (libvips) | Best | 250 KB |
GraphicsMagick uses slightly different JPG encoding parameters that produce 3-5% smaller files at similar quality.
For our image converter, Sharp is the engine for fastest conversion.
Color Profile Handling
ICC profile preservation:
| Tool | sRGB → AdobeRGB | AdobeRGB → DCI-P3 | CMYK → RGB |
|---|---|---|---|
| ImageMagick | Excellent | Excellent | Excellent |
| GraphicsMagick | Good | Good | Acceptable |
| Sharp | Good | Limited | Limited |
For color-critical work: ImageMagick. For general web image conversion: any of the three is fine.
For CMYK details, see CMYK vs RGB Printing.
Common Issues
ImageMagick "memory exhausted": policy.xml limits hit. Edit memory and map limits.
GraphicsMagick missing format support: PSD or TIFF subset not supported. Use ImageMagick.
Color shift after conversion: ICC profile lost. Use -profile flag explicitly.
Slow on large images: 4K+ images need more memory. Consider Sharp for high-resolution batch work.
Permission errors on write: file ownership and permissions issue, not tool problem.
Frequently Asked Questions
Should I switch from ImageMagick to GraphicsMagick?
For most workflows: stay with ImageMagick (broader features, better support). For high-volume batch on servers: consider GraphicsMagick.
Is Sharp faster than both?
Yes. Sharp uses libvips (C++) with sequential processing. 5-10x faster than ImageMagick for typical operations. Requires Node.js.
Can I run both ImageMagick and GraphicsMagick on the same server?
Yes. They install side-by-side without conflict. Different command names (magick/convert vs gm).
What about Pillow / PIL (Python)?
Pillow is Python's image library. Slower than ImageMagick but Pythonic API. Good for scripts that integrate with other Python code.
Does either tool support modern formats like AVIF and JPEG XL?
ImageMagick 7 supports AVIF. JPEG XL support is improving. GraphicsMagick has slower adoption of new formats.
How do I check which version is installed?
convert --version # ImageMagick
magick --version # ImageMagick 7+
gm version # GraphicsMagick
Related Reading
Bottom Line
For batch image processing: ImageMagick is the universal default with broadest feature support. GraphicsMagick is the high-volume server-side choice with better stability. Sharp/libvips for maximum speed in Node.js environments. Match the tool to your specific workload. Our image converter handles single-file conversions.



