| Crates.io | versatiles_image |
| lib.rs | versatiles_image |
| version | 3.4.0 |
| created_at | 2024-07-06 13:20:58.29324+00 |
| updated_at | 2026-01-23 14:43:18.17846+00 |
| description | A toolbox for converting, checking and serving map tiles in various formats. |
| homepage | https://versatiles.org |
| repository | https://github.com/versatiles-org/versatiles-rs |
| max_upload_size | |
| id | 1294041 |
| size | 164,474 |
Image processing and codec support for VersaTiles.
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.
image::DynamicImagecargo add versatiles_image
Or see crates.io/crates/versatiles_image for version info and docs.rs/versatiles_image for API documentation.
use versatiles_image::{DynamicImage, ImageFormat, ImageConvert};
// Load an image
let img = DynamicImage::load_from_bytes(&image_data)?;
// Convert format
let png_data = img.encode_to_format(ImageFormat::PNG)?;
let webp_data = img.encode_to_format(ImageFormat::WEBP)?;
// Transform
let resized = img.resize(256, 256)?;
let cropped = img.crop(0, 0, 128, 128)?;
// Get metadata
let (width, height) = img.dimensions();
println!("Image size: {}x{}", width, height);
For detailed API documentation, see docs.rs/versatiles_image.
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.
MIT License - see LICENSE for details.