testing image to ascii converter

This commit is contained in:
Vomitblood 2024-07-15 14:23:27 +08:00
parent 4148c6dc9b
commit 6d4701b36d

View file

@ -2,12 +2,12 @@ use image::GenericImageView;
use std::io::Write; use std::io::Write;
fn convert_images_to_ascii() -> std::io::Result<()> { fn convert_images_to_ascii() -> std::io::Result<()> {
let path = std::path::Path::new("/home/vomitblood/Pictures/staging/vomitbloodnft 1080p.png"); let path = std::path::Path::new("/home/vomitblood/Pictures/bad-rats.jpg");
let img = image::open(path).unwrap(); let img = image::open(path).unwrap();
let ascii_art = convert_image_to_unicode_small(&img); let ascii_art = convert_image_to_unicode_small(&img);
let output_path = std::path::Path::new("/home/vomitblood/Pictures/staging/vomitbloodnft.txt"); let output_path = std::path::Path::new("/home/vomitblood/Downloads/bruh.txt");
let mut file = std::fs::File::create(output_path)?; let mut file = std::fs::File::create(output_path)?;
file.write_all(ascii_art.as_bytes())?; file.write_all(ascii_art.as_bytes())?;