Process an image to create ASCII Art.
Output can be a text file (.txt) or an image (.jpg, .png). You can tune the different optionnal parameters of scripts to change the output result.
Using Python 3.8.0
OpenCV (4.4.0)
conda install -c conda-forge opencv
Pillow (8.0.0)
conda install -c conda-forge pillow
-
main.py, Main script to generate ASCII Art from a source image. You can override default parameters with the following argurments.
-i, --input
: Path to the input image (can be a video or you camera)-o, --output
: Path to the output file-r, --rows
: Number of ASCII rows-c, --columns
: Number of ASCII columns-d, --dictionnary
: Choose a dictionnary to use [simple, complex, vberthet]-f, --font
: [IMG only] Font to use-fs, --fontSize
: [IMG only] Size of the font-bg, --background
: [IMG only] Background color--show
: Show result--txt
: Force output to .txt file--unsave
: Force to unsave the output file--log
: Set level of logging [DEBUG, INFO, WARNING, ERROR, CRITICAL]
-
CameraOpenCV.py, script use to manage OpenCV camera object
TXT : python main.py -i sample.jpg -o sample.txt -r 256 -c 256 -d vberthet --txt --show
IMG : python main.py -i sample.jpg -o sample.png -r 256 -c 256 -d vberthet -f fonts/deja-vu/DejaVuSansMono-Bold.ttf -fs 8 -bg 255 --show
Device Camera : python main.py -i 0 -r 100 -c 100 -d vberthet -f fonts/deja-vu/DejaVuSansMono-Bold.ttf -fs 8 -bg 255 --show
Video File : python main.py -i sample.mp4 -r 100 -c 100 -d vberthet -f fonts/deja-vu/DejaVuSansMono-Bold.ttf -fs 8 -bg 255 --show