#ansi #image #ascii #graphics #convert-images

ansinator_ansi_image

A Library defining specific structures for representing and converting an image in ansi

3 releases

0.1.2 Oct 12, 2022
0.1.1 Sep 19, 2022
0.1.0 Sep 16, 2022

#1559 in Text processing


Used in ansinator

MIT license

77KB
1.5K SLoC

github crates

Ansinator is a collection of CLI programs to convert images to various character representation with support for ANSI escape code sequence

Installation

Cargo:

You can install the binary crate directly

cargo install ansinator 

Manual Installation:

you can clone ansinator repo and build it locally

git clone https://github.com/dax99993/ansinator
cd ansinator 
cargo install --path .

Programs

  • Ascii
  • Block
  • Braile 8-dot
  • Uniblock (sextant)

Todo

  • Best fitting ascii character analysis
  • Simple animation

License

MIT

Compatibility

This application was design to work in any unicode terminal but the result might look different depending on the terminal font and settings. Testing has been performed only on Alacritty, Kitty, ST and rxvt-unicode, using the JetBrains Mono font.

Ascii

Probably will work for all terminals

  • Alacritty working
  • Kitty working
  • ST working
  • rxvt-unicode working except for truecolor, use terminalcolor instead

Braile

Probably will work on all terminals supporting Unicode Glyphs

  • Alacritty working
  • Kitty working
  • ST working
  • rxvt-unicode working

Block

Probably will work on all terminals supporting Unicode Glyphs

  • Alacritty working
  • Kitty working
  • ST working
  • rxvt-unicode working except for truecolor, use terminalcolor instead

Uniblock

Probably will work on all terminals supporting Unicode Glyphs, but it also depends on the way the terminal handles sextant characters.

  • Alacritty working but might look weird depending on the x,y character offset and the font
  • Kitty working
  • ST working but might look weird depending on the x,y character offset and the font
  • rxvt-unicode not working missing sextant characters (might be a misconfiguration of my part of the fonts)

Bugs

If find any bug or weird behaviour send an email to dax99993@gmail.com

Log

  • 0.2.3 Fixed bug in fixed background color for ascii, braile and uniblock, also fixed background color extension to end of line on some terminals.
  • 0.2.2 Fixed convertion in braile and block, and fixed resizing.
  • 0.2.1 added both GRADIENT mode with PATTERN mode in ascii, and change help message and flags.
  • 0.2.0 replace GRADIENT mode with PATTERN mode in ascii.
  • 0.1.1 Uniblock convertion added, and extra options as fixed foreground and background
  • 0.1.0 Basic ascii, braile, block

lib.rs:

ansi_image provides.

  • AnsiImage: A general representation of an image in ansi.

  • AnsiAscii: A representation of an image in ascii.

  • AnsiBlock: A representation of an image in unicode half-block characters and spaces.

  • AnsiBraile: A representation of an image in 8-dot Braile.

  • AnsiUniblock: A representation of an image in unicode sextant characters.

Dependencies

~14–25MB
~182K SLoC