A Python program that converts images into ASCII representations, and vice versa.
along with its .txt colleague.along with its .txt colleague.
What about starting from the ASCII circle and creating a real image? This is the result:
Now we have a symmetry. Not that bad.
Clone the project:
git clone https://github.com/agarnung/asciimage.git
Install required dependencies (it is recommended tu use a virtual environment):
python3 -m pip install -r requirements.txt
Run the program in the root folder, e.g.:
python3 asciimage.py --mode to_ascii --file /home/alejandro/Pictures/lena.png --scale 0.43 --ascii_cols 100 --out ./results --font_color white --font_type times --symbols wasd123
python3 asciimage.py --mode from_ascii --file /home/alejandro/Pictures/lena.png --pixel_size 1
Please refer to the program help:
python3 asciimage.py --help
- GeeksforGeeks: Converting Image to ASCII Image in Python
- ASCII Art Generator
- GitHub: Image to ASCII by ajratnam
- Improve the resolution of the image formed from the text, with
scale=1
. - If an
int
argument is at the last of the command, EOF may corrupt the arg parsing. Protect this.