Python tools for Image Ascii Art.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


This is a simple, light and optimized image-to-ascii and ascii-to-image converter. It now supports image and video.

1. Image to Ascii

This conversion is implemented by mapping the intensity of pixel to characters with different shape.

Command option

-f | --file is input image path.

-s | --scale controls the output size.

-a | --aspect controls the aspect of height and width.

-w | --write-file is the output ascii txt path.


# lazy style: the default output is ${img_file}.txt
python -f imgs/erke.jpg

# adjust sampling step, the output is larger if it is samller
python -f imgs/erke.jpg -s 2

# complete style
python -f imgs/erke.jpg -s "auto" -w out.txt



You can adjust the font size of text editor for better view.

2. Ascii to Image

It calls the text drawing API of PIL to implement the rendering of ascii text to image.

python -f imgs/kenan.txt -w imgs/kenan_ascii.jpg

3. Video conversion

python -f videos/kenan.mp4 -s 1 -e 360 -w res/kenan.gif -p 10 --step=10 --scale=0.25 --sampling-step=6

More videos to see BaiduYun.