image-visualizer

Crates.ioimage-visualizer
lib.rsimage-visualizer
version0.1.1
sourcesrc
created_at2021-03-27 13:59:24.574024
updated_at2021-03-27 14:57:22.632952
descriptionProvides an adapter to view images.
homepage
repositoryhttps://github.com/hediet/rust-visualizer/
max_upload_size
id374205
size98,357
Henning Dieterichs (hediet)

documentation

README

Visualizer

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.

Installation

cargo install visualizer-cli
cargo add image-visualizer

Example

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(())
}

Screenshot

Commit count: 11

cargo fmt