panimg-cli-0.2.0 is not a library.
panimg
A next-generation image processing CLI built in Rust. Modern alternative to ImageMagick with first-class AI agent support.
Features
- 31 commands covering format conversion, transforms, filters, color manipulation, animation, compositing, text rendering, and more
- Structured output: Human-readable by default,
--format jsonfor machine consumption - Dry-run support: Preview operations with
--dry-runbefore executing - Schema introspection:
--schemareturns parameter definitions as JSON - Capabilities discovery:
--capabilitieslists all supported commands, formats, and features - Pipeline engine: Chain multiple operations in a single read/write pass
- Batch processing: Process multiple files with glob patterns and parallel execution
- Consistent syntax: All flags use
--key valueformat - Memory-safe: Built in Rust with zero unsafe code in the core pipeline
- Fast: SIMD-accelerated resize via
fast_image_resize
Installation
Or build from source:
# Binary at target/release/panimg
Optional codecs
Enable additional format support with feature flags:
Quick Start
# Show image metadata
# Convert formats
# Resize
# Crop, rotate, flip
# Color adjustments
# Filters
# Color effects
# Drawing
# Text rendering
# Compositing
# GIF animation
# Image comparison
# Pipeline (multi-step)
# Batch processing
# Dry-run & schema
Commands
Basic Operations
| Command | Description |
|---|---|
info |
Show image metadata and properties |
convert |
Convert image between formats |
resize |
Resize an image with multiple fit modes |
crop |
Crop a rectangular region |
rotate |
Rotate by 90, 180, or 270 degrees |
flip |
Mirror horizontally or vertically |
auto-orient |
Auto-rotate based on EXIF orientation |
Color Adjustments
| Command | Description |
|---|---|
brightness |
Adjust image brightness |
contrast |
Adjust image contrast |
hue-rotate |
Rotate image hue |
saturate |
Adjust color saturation |
grayscale |
Convert to grayscale |
invert |
Invert (negate) colors |
sepia |
Apply sepia tone effect |
tint |
Tint with a color |
posterize |
Reduce color levels per channel |
Filters
| Command | Description |
|---|---|
blur |
Apply Gaussian blur |
sharpen |
Sharpen using unsharp mask |
edge-detect |
Detect edges (Laplacian kernel) |
emboss |
Apply emboss effect |
Drawing & Compositing
| Command | Description |
|---|---|
draw |
Draw shapes (rect, circle, line) |
text |
Draw text with embedded or custom fonts |
overlay |
Composite one image on another |
trim |
Auto-crop whitespace or similar-colored borders |
diff |
Compare two images and visualize differences |
Animation
| Command | Description |
|---|---|
frames |
Extract individual frames from animated GIF |
animate |
Assemble images into animated GIF |
gif-speed |
Change animation playback speed |
Workflow
| Command | Description |
|---|---|
pipeline |
Run multiple operations in a single read/write pass |
batch |
Process multiple files with glob patterns |
Supported Formats
| Format | Decode | Encode | Notes |
|---|---|---|---|
| JPEG | Yes | Yes | Quality 1-100 |
| PNG | Yes | Yes | |
| WebP | Yes | Yes | Quality 1-100 |
| GIF | Yes | Yes | Animated GIF support |
| BMP | Yes | Yes | |
| TIFF | Yes | Yes | |
| QOI | Yes | Yes | |
| AVIF | Yes | Yes | Requires avif feature |
| JPEG XL | Yes | No | Requires jxl feature, decode only |
| SVG | Yes | No | Requires svg feature, rasterization only |
AI Agent Integration
panimg is designed for seamless integration with AI agents and automation scripts:
# Discover capabilities programmatically
# Get parameter schemas for any command
# Preview operations without side effects
# All output is structured JSON when requested
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error |
| 2 | Input file error (not found, permission denied, decode failure) |
| 3 | Output issue (write failure, file exists) |
| 4 | Unsupported format |
| 5 | Bad arguments |
Error Output
Errors are structured and include actionable suggestions:
{
}
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT License (LICENSE-MIT)
at your option.