Crates.io | ndarray_images |
lib.rs | ndarray_images |
version | |
source | src |
created_at | 2025-01-12 16:48:26.356555+00 |
updated_at | 2025-02-07 22:23:35.655903+00 |
description | (De)serialize NDarrays to/from PNG |
homepage | |
repository | |
max_upload_size | |
id | 1513417 |
Cargo.toml error: | TOML parse error at line 17, column 1 | 17 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
(De)Serialize NDarray to/from PNG files.
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")?;
2D NDarrays can be saved as greyscale images:
image.save("image.png")?;
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")?;
Colour images can be saved in the same way:
image.save("image.png")?;