Crates.io | image-visualizer |
lib.rs | image-visualizer |
version | 0.1.1 |
source | src |
created_at | 2021-03-27 13:59:24.574024 |
updated_at | 2021-03-27 14:57:22.632952 |
description | Provides an adapter to view images. |
homepage | |
repository | https://github.com/hediet/rust-visualizer/ |
max_upload_size | |
id | 374205 |
size | 98,357 |
A crate to visualize image instances of the image
create. Requires the crate visualizer-cli
to be installed globally.
Based on @hediet/visualization which also powers the Debug Visualizer extension for VS Code.
cargo install visualizer-cli
cargo add image-visualizer
Use the view!
macro to view a visualization.
The visualize
function creates a visualization for the given image.
use image::io::Reader as ImageReader;
use image_visualizer::{VisualizableImage, visualizer::view};
fn main() -> std::io::Result<()> {
let img = ImageReader::open("data/img.png")?.decode().unwrap();
view!(&img.visualize());
Ok(())
}