ndarray_images

Crates.iondarray_images
lib.rsndarray_images
version0.1.0
created_at2025-01-12 16:48:26.356555+00
updated_at2025-02-07 22:23:35.655903+00
description(De)serialize NDarrays to/from PNG
homepage
repository
max_upload_size
id1513417
size24,389
Freddy Wordingham (FreddyWordingham)

documentation

README

Image

(De)Serialize NDarray to/from PNG files.

Quick Start

Grayscale Images

Load

Greyscale images can be loaded into a floating point NDarray with values in the range [0, 1]:

let image: Array2<f32> = Array2::load("image.png")?;

Save

2D NDarrays can be saved as greyscale images:

image.save("image.png")?;

Colour Images

Load

Similarly, colour images can be loaded into a 3D NDarray with values in the range [0, 1]. If the image has transparency (an alpha channel) there will be 4 channels, otherwise there will be 3:

let image: Array3<f32> = Array3::load("image.png")?;

Save

Colour images can be saved in the same way:

image.save("image.png")?;
Commit count: 0

cargo fmt