Skip to content

Latest commit

 

History

22 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

img2ascii

Convert images and GIFs to ascii characters.

GitHub Downloads (all assets, all releases)

A GIF of a Tyrannosaurus:
demo

Prerequisites

Usage

Make executable:

cd img2ascii
make

Show usage:

./img2ascii

or

./img2ascii --help

Converting an image to ascii:

./img2ascii image.png

To convert ascii to image:

./img2ascii --ascii-to-image file.txt output.png

URLs

Downloading images requires wget to be installed. Downloading the image will prompt confirmation before downloading:

./img2ascii 'https://example.com/image.png'

Tip

Args can still be used if you use URL.

Chroma Keying

Blocking out a color (like a green screen) can be used with the chroma command:

./img2ascii image.png --chroma='0,255,0'

optionally use thresholds:

./img2ascii image.png --chroma='0,255,0' --chroma-threshold=0.7

Alternatively, color names can be used, e.g. --chroma=green:

  • green
  • red
  • blue
  • white
  • black

Scaling

Large images can fill the entire terminal; the scale command can be used to prevent this:

./img2ascii image.png --scale=0.1

The autoscale option can also be used to fit inside the terminal:

./img2ascii image.png --autoscale

Colorizing Characters

Use colored arg to colorize ascii characters:

./img2ascii image.png --colored

Tip

This also works with GIFs.

GIFs

Duration of Animation

Specify number of times to loop GIF:

./img2ascii image.gif --gif-cycles=2

Specified time in seconds:

./img2ascii image.gif --gif-time=3

Or loop a GIF forever (cancel with ctrl+C):

./img2ascii image.gif --gif-loop

Speed of GIFs

The speed of a GIF can be changed via the gif-speed arg:

./img2ascii image.gif --gif-speed=0.5

Supported Images

  • png
  • jpg
  • gif

Credits

About

Convert images and GIFs to ascii art or ascii art to images [supports colors].

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages