| Crates.io | ansimake |
| lib.rs | ansimake |
| version | 0.1.0 |
| created_at | 2025-12-18 07:52:11.85028+00 |
| updated_at | 2025-12-18 07:52:11.85028+00 |
| description | Quickly convert pixel images of ANSI art created with AI to actual ANSI art |
| homepage | https://github.com/jondot/ansimake |
| repository | https://github.com/jondot/ansimake |
| max_upload_size | |
| id | 1991924 |
| size | 448,736 |
Quickly convert pixel images of ANSI art created with AI to actual ANSI art.
cargo install ansimake
Or build from source:
git clone https://github.com/yourusername/ansimake.git
cd ansimake
cargo build --release
ansimake image.png
ansimake [OPTIONS] <IMAGE_PATH>
Options:
-b, --bw Convert to black and white
-w, --width <WIDTH> Output width (maintains aspect ratio if height not specified)
--height <HEIGHT> Output height (overrides aspect ratio if specified with width)
-t, --tolerance <TOL> Color tolerance/distance threshold (default: 0)
-B, --blocks Use block characters with foreground colors only
-h, --help Print help
The goal was to built a tool that converts an ansi-looking source image to its actual ANSI output, and so it works best in these conditions
# Convert with custom width
ansimake photo.jpg -w 100
# Black and white conversion
ansimake image.png -b
# Use block mode for simpler rendering
ansimake image.png -B
# Color quantization for smoother output
ansimake image.png -t 15
use ansimake::{Image, ConversionConfig};
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Load an image
let img = Image::load("image.png")?;
// Optionally convert to grayscale
let img = img.to_grayscale();
// Configure conversion
let config = ConversionConfig {
size: (80, 24),
use_blocks: true,
color_tolerance: 10.0,
..Default::default()
};
// Convert to ANSI art
let ansi_art = img.to_ansi(&config);
println!("{}", ansi_art);
Ok(())
}
MIT License - see LICENSE file for details
Contributions are welcome! Please feel free to submit a Pull Request.