Crate image2[][src]

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

pub use halide_runtime as halide;
pub use kernel::Kernel;
pub use transform::Transform;

Modules

filter

Image processing filters

io

Image input/output

kernel

Convolutions kernels

transform

Image transforms

window

Display images

Structs

AsyncFilter

A Filter that can be executed using async

AsyncPipeline

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

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

Xyz

Three-channel CIE-XYZ

f16

16-bit float

Enums

AsyncMode

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

FilterExt

Filter extension methods

ParallelIterator

Parallel version of the standard iterator trait.

Type

Type is used to represent supported image data types

Type Definitions

Channel

Channel is an alias for usize used to identify channel values in function arguments

Point

(x, y) coordinates

Region

Region of interest

Size

Image (width, height)