Module image
Image processing and manipulation.
image provides basic image processing functions and methods
for loading and saving images in various formats.
Supports PNG, JPEG, GIF, WebP, BMP, TIFF, and more.
The main types are DynamicImage for format-agnostic image handling
and ImageBuffer for typed pixel access.
Use open to load images from files
and DynamicImage::save to write them.
Common operations include resizing, cropping, rotating, color conversion, and pixel-level manipulation.
Examples
Load an image and resize it:
use ;
let img = open.expect;
let resized = img.resize;
resized.save.expect;
Create a new image programmatically:
use ;
let img = from_fn;
// Access individual pixels.
let pixel = img.get_pixel;
assert_eq!;
Convert between formats:
use open;
let img = open.expect;
img.save.expect;
Modules
-
buffer
Iterators and other auxiliary structure for the
ImageBuffertype. - codecs Encoding and decoding for various image file formats.
- error Contains detailed error representation.
- flat Image representations for ffi.
- imageops Image Processing Functions
-
io
deprecated io module the original io module has been renamed to
image_reader - math Mathematical helper functions and types.
- metadata Types describing image metadata