Crate image [−] [src]

This crate provides native rust implementations of image encoders and decoders and basic image manipulation functions.

Reexports

pub use color::ColorType::{Gray, RGB, Palette, GrayA, RGBA};
pub use imageops::FilterType::{Triangle, Nearest, CatmullRom, Gaussian, Lanczos3};
pub use image::ImageFormat::{PNG, JPEG, GIF, WEBP, PPM};
pub use dynimage::DynamicImage::{ImageRgb8, ImageRgba8, ImageLuma8, ImageLumaA8};

Modules

imageops

Image Processing Functions

math

Mathematical helper functions and types.

png

Decoding and Encoding of PNG Images

Structs

Frame

A single animation frame

Frames

Hold the frames of the animated image

ImageBuffer

Generic image buffer

Luma

Grayscale colors

LumaA

Grayscale colors + alpha channel

MutPixels

Mutable pixel iterator DEPRECATED: It is currently not possible to create a safe iterator for this in Rust. You have to use an iterator over the image buffer instead.

Pixels

Immutable pixel iterator

Rgb

RGB colors

Rgba

RGB colors + alpha channel

SubImage

A View into another image

Enums

ColorType

An enumeration over supported color types and their bit depths

DynamicImage

A Dynamic Image

FilterType

Available Sampling Filters

ImageError

An enumeration of Image Errors

ImageFormat

An enumeration of supported image formats. Not all formats support both encoding and decoding.

Traits

GenericImage

A trait for manipulating images.

ImageDecoder

The trait that all decoders implement

Pixel

A generalized pixel.

Primitive

Primitive trait from old stdlib, added max_value

Functions

load

Create a new image from a Reader

load_from_memory

Create a new image from a byte slice Makes an educated guess about the image format. TGA is not supported by this function.

load_from_memory_with_format

Create a new image from a byte slice

open

Open the image located at the path specified. The image's format is determined from the path's file extension.

save_buffer

Saves the supplied buffer to a file at the path specified.

Type Definitions

GrayAlphaImage

Sendable grayscale + alpha channel image buffer

GrayImage

Sendable grayscale image buffer

ImageResult

Result of an image decoding/encoding process

RgbImage

Sendable Rgb image buffer

RgbaImage

Sendable Rgb + alpha channel image buffer