versatiles_image
Image processing and codec support for VersaTiles.
Overview
versatiles_image provides utilities and trait extensions for working with raster images in the VersaTiles ecosystem. It offers a unified interface for encoding, decoding, and transforming images across multiple formats.
This crate standardizes image operations used throughout the VersaTiles tile processing pipeline.
Features
- Multiple Codecs: Support for PNG, JPEG, WEBP, and AVIF formats
- Unified API: Consistent interface built on
image::DynamicImage - Format Conversion: Transcode between different image formats
- Image Operations: Scale, crop, flatten, and transform images
- Metadata Access: Query image dimensions, color types, and format information
- Test Utilities: Generate deterministic test images for development
Usage
Or see crates.io/crates/versatiles_image for version info and docs.rs/versatiles_image for API documentation.
Example
use ;
// Load an image
let img = load_from_bytes?;
// Convert format
let png_data = img.encode_to_format?;
let webp_data = img.encode_to_format?;
// Transform
let resized = img.resize?;
let cropped = img.crop?;
// Get metadata
let = img.dimensions;
println!;
API Documentation
For detailed API documentation, see docs.rs/versatiles_image.
Part of VersaTiles
This crate is part of the VersaTiles project, a toolbox for working with map tile containers in various formats.
For the complete toolset including CLI tools and servers, see the main VersaTiles repository.
License
MIT License - see LICENSE for details.