Skip to content

A Python program to convert images into ASCII representations, and viceversa.

Notifications You must be signed in to change notification settings

agarnung/asciimage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

asciimage

A Python program that converts images into ASCII representations, and vice versa.

Demo

Original ASCIIfied,

along with its .txt colleague.

Original ASCIIfied,

along with its .txt colleague.

What about starting from the ASCII circle and creating a real image? This is the result:

Reconstructed

Now we have a symmetry. Not that bad.


Example of usage:

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

References:


Other consulted links:


TODO:

  • 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.

About

A Python program to convert images into ASCII representations, and viceversa.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages