The gm module provides an enhanced interface for GraphicsMagick, allowing users to process images efficiently. It automatically handles installation via pixi if the tool is not found locally.
When to Activate
- When converting images between different formats (e.g., JPG to PNG).
- When resizing images or performing batch transformations.
- When comparing two images or creating image montages.
- When needing image identification and metadata descriptions.
Core Principles & Rules
- Tool Reliability: Uses
pixito ensure GraphicsMagick is available across different environments. - Standard Commands: Supports all classic
gmsubcommands likeconvert,mogrify, andidentify.
Patterns & Examples
Convert Image
# Convert a JPG image to PNG format
x gm convert test.jpg test.png
Resize Image
# Resize an image to 300px width
x gm convert -resize 300 test.jpg output.jpg
List Formats
# View all supported image formats for conversion
x gm convert -list formats
Checklist
- Confirm the target operation (convert, resize, etc.).
- Verify input file paths and formats.