- Create ASCII art file from image file
You need to install these before running the app:
- Pillow
Just run:
pip install pillow
git clone https://github.com/TohidEq/py-img-to-ascii && cd py-img-to-ascii
your images must be .png
Edit main.py
by any editor you want
Change value of Consts
in top of file:
SHOW_PREVIEW
: print preview of every ASCII
CUSTOM_SCALE
is the base of scale images to ASCII, if you set it to :
"w"
:meanswidth
, ASCII'swidth
will be scale toCUSTOM_WIDTH
and auto calculate theheight
"h"
:meansheight
, ASCII'sheight
will be scale toCUSTOM_HEIGHT
and auto calculate thewidth
"b"
:meansboth
, ASCII'swidth
will be scale toCUSTOM_WIDTH
andheight
will beCUSTOM_HEIGHT
"n"
:meansnone
, ASCII will not be scale and it is same as the image size
CUSTOM_CHARACTERS
: What you want to fill your ASCII with? Put them there, just remember to attention to order: from the darkest char, to the brightest char
# True or False, preview of ascii
SHOW_PREVIEW = True
# "w"=width, "h"=height, "b"=both, "n"=none
CUSTOM_SCALE = "w"
# width/height character
CUSTOM_WIDTH = 50
CUSTOM_HEIGHT = 100
# Darkest character to the brightest character
CUSTOM_CHARACTERS = "█▓▒░ "