Expand description
§image_to_console_core
A library for converting images to terminal friendly format.
§Basic usage example
use image::error::ImageResult;
use image_to_console_core::processor::{ImageProcessor, ImageProcessorOptions};
fn main() -> ImageResult<()> {
let img = image::open("path/to/image.png")?;
// Use default config
let option = ImageProcessorOptions::default();
let mut processor = ImageProcessor::new(img, option);
let result = processor.process();
// Exception handling (this is only shown, not handled, please refer to the actual use of the need)
let result = result.expect("Process image failed");
// result.lines contains the formatted terminal output
// you also can use display method to print
println!("{}", result.display());
Ok(())
}Re-exports§
Modules§
Macros§
- process_
images - A macro to process one or more images and return the processed results.
- show_
image - A macro to display a single image to the terminal using default options or custom options.
- show_
images - A macro to display multiple images to the terminal.
Structs§
- Auto
Resize Option - AutoResize Option struct
- Custom
Resize Option - CustomResize Option struct
Enums§
- Display
Mode - The protocol of display
- Processed
Image - Represents an image that has been processed for display purposes
- Resize
Mode - Resize Mode enum