Expand description
image2 - a high-performance image processing library with wide support for a variety of file formats and data types
OpenImageIO is used for encoding and decoding images, it should be installed before
building image2
.
use image2::*;
fn main() -> Result<(), Error> {
// Load an image from disk
let image = Image::<f32, Rgb>::open("images/A.exr")?;
// Apply a `Filter`, in this case using the `Convert` filter to
// convert from `Rgb` to `Gray`
let conv = filter::convert::<f32, Rgb, f32, Gray>();
let mut dest = image.new_like_with_color::<Gray>();
dest.apply(conv, &[&image]);
// This is equivalent to:
let conv = filter::convert();
let dest: Image<f32, Gray> = image.run(conv, None);
// Save an image to disk
dest.save("test.jpg")?;
Ok(())
}
Re-exports§
Modules§
- filter
- Image processing filters
- io
- Image input/output
- kernel
- Convolutions kernels
- text
- Text
- texture
- OpenGL interop
- transform
- Image transforms
- window
- Display images
Structs§
- Async
Filter - A
Filter
that can be executed using async - Async
Pipeline - async-friendly
Pipeline
- Cmyk
- Four-channel, cyan, magenta, yellow and black
- Data
- Wraps image data slices, tagging them with a Color type
- DataMut
- Wraps mutable image data slices, tagging them with a Color type
- Gray
- Single-channel grayscale
- Hash
- Hash is used for content-based hashing
- Histogram
- Image histogram
- Hsv
- Three-channel hue, saturation and value color
- Image
- Image type
- Input
- Filter input
- Meta
- Image metadata
- Mmap
- Memory-mapped image data
- Pipeline
- Pipelines are used to compose several filters
- Pixel
- Normalized image data
- Rgb
- Three-channel red, green, blue
- Rgba
- Four-channel red, green, blue with alpha channel
- Srgb
- Log space, three-channel red, green, blue
- Srgba
- Log space, four-channel red, green, blue with alpha channel
- Xyz
- Three-channel CIE-XYZ
- Yuv
- Three-channel, luma, blue projection and red projection
- f16
- 16-bit float
A 16-bit floating point type implementing the IEEE 754-2008 standard
binary16
a.k.a “half” format.
Enums§
- Async
Mode - AsyncMode is used to schedule the type of iteration for an
AsyncFilter
- Error
- Enumerates possible errors
- Schedule
- Used to determine if a filter can be executed and interleaved at the pixel level or if the whole filter needs to be evaulated before moving to the next filter
Traits§
- Color
Color
trait is used to define color spaces- Filter
- Filters are used to manipulate images in a generic, composable manner
- Filter
Ext - Filter extension methods
- Image
Data - ImageData is used to hold pixel data for images
- Parallel
Iterator - Parallel version of the standard iterator trait.
- Type
- Type is used to represent supported image data types