| Crates.io | rascii_art_img |
| lib.rs | rascii_art_img |
| version | 0.4.7 |
| created_at | 2025-10-19 21:44:45.611862+00 |
| updated_at | 2025-10-19 21:52:29.607061+00 |
| description | Advanced ASCII Art Generator. Fork for imgii. |
| homepage | |
| repository | https://github.com/Stattek/RASCII |
| max_upload_size | |
| id | 1890956 |
| size | 64,208 |
Advanced ASCII Art Generator
Usage: rascii [OPTIONS] <FILENAME>
Arguments:
<FILENAME> Path to the image
Options:
-w, --width <WIDTH> Width of the output image. Defaults to 128 if width and height are not specified
-H, --height <HEIGHT> Height of the output image, if not specified, it will be calculated to keep the aspect ratio
-c, --color Whether to use colors in the output image
-e, --escape-each-char Whether all characters should have an ANSI color code before each character. Defaults to only escape colored strings upon color change
-i, --invert Inverts the weights of the characters. Useful for white backgrounds
-C, --charset <CHARSET> Characters used to render the image, from transparent to opaque. Built-in charsets: block, emoji, default, russian, slight, minimal [default: default]
-o, --char-override <CHAR_OVERRIDE> Character override. Ignores the current charset and repeats the desired string for the entirety of the output image
-h, --help Print help
-V, --version Print version
Available as a crate: RASCII has a very simple API allowing you to use RASCII from your programs without using the system shell.
Colored ASCII art generation: RASCII uses ANSI color codes to generate colored ASCII art.
[!NOTE] Your terminal emulator has to support
truecolor(don't worry, almost all modern terminal emulators do).
Super efficient colored output: RASCII (by default) never repeats the same ANSI color code if it is already active.
This makes a huge difference in images with little alternating colors, up to about 1800% reduction in output size. Woah!
Custom dimensions: RASCII allows you to give custom dimensions to the outputted ASCII art while keeping the aspect ratio (unless both dimensions are provided).
Custom charsets: RASCII allows you to use custom charsets to generate your ASCII art.
[!NOTE] The given charset must go from transparent to opaque.
[!NOTE] This is the recommended way of installing the RASCII CLI.
[!WARNING] You must have
~/.cargo/bin/in yourPATHto runrasciidirectly.
cargo install rascii_art_img
[!WARNING] this installation method is discouraged and only works for GNU/Linux or any other POSIX compatible systems!
git clone https://github.com/KoBruhh/RASCII && cd RASCII
chmod +x install.sh
./install.sh
Instead of using the unreliable system shell to call RASCII, you can add the
rascii_art_img crate to your project and use it in Rust!
To do so, run cargo add rascii_art_img to add RASCII to your Cargo project.
Here is a code example:
use rascii_art_img::{
render_to,
RenderOptions,
};
fn main() {
let mut buffer = String::new();
render_to(
r"/path/to/image.png",
&mut buffer,
&RenderOptions::new()
.width(100)
.colored(true)
.charset(&[".", ",", "-", "*", "£", "$", "#"]),
)
.unwrap();
}
[!NOTE] The emoji charset does not guarantee your outputs color will match the color of your image, this is just a coincidence that happened with Ferris.
You can use the --charset (or -C) CLI option to provide a custom charset to
use when generating some ASCII art.
The value of this must option must go from transparent to opaque, like so:
rascii --charset " ░▒▓█" --color ferris.png
Note that a charset similar to the above charset is available as a builtin named
block.
[!NOTE] There is a python script at repository root that can be used to generate the above contributor ASCII Art.
python contributors.py