ansipix

Crates.ioansipix
lib.rsansipix
version2.0.0
created_at2021-12-10 17:58:42.24319+00
updated_at2025-01-27 12:34:38.309217+00
descriptionConvert images to ANSI strings to print in a terminal
homepage
repositoryhttps://github.com/RubixDev/ansipix
max_upload_size
id495810
size14,854
Silas Groh (RubixDev)

documentation

README

ansipix

A Rust library for converting images to ANSI strings to print in a terminal

Usage

Get an ANSI string

let img = ansipix::of_image(&image::open("example.png").unwrap(), (50, 50), 100, false);
println!("{}", img);

Refer to the docs for more information.

Specify a different filter type

ansipix uses the image crate for reading and resizing the image. The [of_image] function uses [FilterType::Nearest] for resizing. You can specify a different one with the [of_image_with_filter] function.

use image::imageops::FilterType;

let img = ansipix::of_image_with_filter(&image::open("example.png").unwrap(), (32, 32), 255, false, FilterType::Triangle);
println!("{}", img);
Commit count: 19

cargo fmt