imx
A Rust utility library for efficient image processing and manipulation. Designed for batch image operations, transparency handling, and letterbox removal with robust async support.
Features
- 🖼️ Asynchronous image processing using Tokio
- 🎨 Transparency removal and manipulation
- ✂️ Smart letterbox detection and removal
- 📏 Image dimension analysis
- 📝 Caption file handling
- 🔄 Batch processing capabilities
- 🛡️ Robust error handling with anyhow
Installation
Add this to your Cargo.toml
:
[]
= "0.1.0"
Usage Examples
Basic Image Processing
Process a single image to remove transparency:
use ;
use Result;
async
Batch Image Processing
Process multiple images in a directory:
use ;
use Result;
async
Image Analysis
Get image dimensions and check file types:
use ;
use Result;
Caption File Operations
Work with image captions:
use ;
async
File Renaming
Remove image extensions from filenames:
use ;
async
Supported Image Formats
The library supports the following image formats:
- JPEG (.jpg, .jpeg)
- PNG (.png)
- JPEG XL (.jxl)
- WebP (.webp)
Error Handling
All operations return Result
types with detailed error information:
io::Result
for basic file operationsanyhow::Result
for complex operations with rich error context
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License.