| Crates.io | gen-ascii-art |
| lib.rs | gen-ascii-art |
| version | 0.1.0 |
| created_at | 2025-04-20 22:35:04.955021+00 |
| updated_at | 2025-04-20 22:35:04.955021+00 |
| description | Generate colorful or grayscale ASCII art from images and GIFs directly in your terminal. |
| homepage | |
| repository | https://github.com/ss-sonic/gen-ascii-art |
| max_upload_size | |
| id | 1642066 |
| size | 452,499 |
A command-line tool written in Rust to convert images and GIFs into ASCII art, with options for color, contrast, inversion, and animation looping.
--color).Below are examples generated from input files like example.png and example.gif found in the repository.
Grayscale Output (from example.png)
Command: gen-ascii-art -i example.png -w 80

Color Output (from example.gif, requires terminal support)
Command: gen-ascii-art -i example.gif -w 80 --color
Add a screenshot showing the colorful ANSI output for the GIF here.
--color mode). Most modern terminals (Windows Terminal, iTerm2, GNOME Terminal, Kitty, etc.) do.Once the crate is published on crates.io, you can install it directly using Cargo:
cargo install gen-ascii-art
This command will download the source code, compile it, and install the binary (gen-ascii-art) into your Cargo binary path (~/.cargo/bin/ by default), making it available to run directly from your terminal.
Clone the repository and build the release executable:
git clone <your-repo-url> # Replace with actual URL later
cd gen-ascii-art # Assumes directory name matches crate name
cargo build --release
The executable will be located at ./target/release/gen-ascii-art.
After installing with cargo install gen-ascii-art, you can run the command directly:
gen-ascii-art -i <input_path> [OPTIONS]
If you built from source, you would run it like this:
./target/release/gen-ascii-art -i <input_path> [OPTIONS]
Arguments:
-i, --input <PATH>: Path to the input image or GIF file.Options:
-w, --width <WIDTH>: Width of the output ASCII art in characters [default: 100].--invert: Invert the character map (useful for images with dark backgrounds).--contrast <FACTOR>: Adjust contrast (1.0 = normal, >1.0 = higher) [default: 1.0].--color: Output ASCII art with ANSI colors (uses a more detailed character set and applies a subtle blur).--loop-gif: Loop GIF animation indefinitely (only applies if input is a GIF).-h, --help: Print help information.-V, --version: Print version information.Examples:
# Simple grayscale conversion (after installation)
gen-ascii-art -i image.png -w 120
# Color conversion with higher contrast
gen-ascii-art -i photo.jpg -w 150 --color --contrast 1.5
# Process a GIF, looping, with inverted mapping for dark background
gen-ascii-art -i animation.gif -w 80 --invert --loop-gif
# Process a GIF with color
gen-ascii-art -i animation.gif -w 90 --color --loop-gif
# If running from build directory (after building from source)
# ./target/release/gen-ascii-art -i image.png -w 120