[−][src]Function asciifyer::convert_to_ascii
pub fn convert_to_ascii<S: AsRef<OsStr> + ?Sized>(
path: &S,
dimensions: Option<Dimension>
) -> String
Opens an image at a path and turns it into an ASCII string.
If the image is larger than the given dimensions, it will be
resized to those dimensions. If None
is passed, it will
use a width and height of 250.
Example
use asciifyer::{convert_to_ascii, Dimension}; // Scale the image down by half let dimensions = Dimension::new(300, 300); let ascii_image = convert_to_ascii("./image1.png", Some(dimensions)); println!("{}", ascii_image);