1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//! VersaTiles image processing crate.
//!
//! This crate provides utilities and trait extensions built around the
//! [`image::DynamicImage`] type. It standardizes image encoding/decoding and high‑level
//! operations used in the VersaTiles pipeline.
//!
//! ### Features
//! - Unified access to multiple codecs (`PNG`, `JPEG`, `WEBP`, `AVIF`).
//! - Color parsing utilities (`color`)
//! - Trait extensions for:
//! - Conversion and encoding (`traits::convert`)
//! - Metadata and pixel introspection (`traits::info`)
//! - Common transformations (scaling, flattening, cropping; `traits::operation`)
//! - Deterministic test image generation (`traits::test`)
//!
//! ### Encoding and decoding a tile
//!
//! [`encode`] takes `quality` and `effort` for every format and ignores the one
//! a given codec has no use for — PNG has no quality setting, so it is `None`
//! here:
//!
//! ```
//! use versatiles_core::TileFormat;
//! use versatiles_image::{DynamicImage, GenericImageView, decode, encode};
//!
//! let image = DynamicImage::new_rgb8(256, 256);
//!
//! let blob = encode(&image, TileFormat::PNG, None, Some(6))?;
//! let decoded = decode(&blob, TileFormat::PNG)?;
//!
//! assert_eq!(decoded.dimensions(), (256, 256));
//! # Ok::<(), anyhow::Error>(())
//! ```
pub use *;
pub use ;
pub use *;