Installing the module :
~ git clone https://github.com/gabriel-dahan/img-to-ascii/
~ cd img-to-ascii/
# Linux / MacOS
~ python3 -m pip install -U .
# Windows
~ py -3 -m pip install -U .
Consider using the --user
parameter if you're not a root/admin user.
Importing the module :
import imgtoascii
img = imgtoascii.Img('example.png')
img.to_ascii(out_file = "example.ascii.txt")
img = imgtoascii.Img('example.png')
text = img.to_ascii()
print(text)