• Stars
    star
    191
  • Rank 201,770 (Top 4 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 9 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Converts images to ASCII art

What is ascii_art?

ascii_art easily converts images into ascii artwork. ascii_art now supports colored ascii art as well as the ability to convert colored ascii to html.

Example script

For a full example script, see draw_a_cat.py.
For a full list of example output, see examples.
Working colored HTML of an ASCII kitten using the character set 'kitten'

Reads cat.jpg, upscales the quality by 5, saves an ASCII rendering to cat_scale5_draw_ascii.png, saves a colored ASCII rendering to cat_scale5_full_range_color.png, and saves a text file containing the raw ASCII.

from ascii_art import ASCIIArt, ASCIIPicture

picture = ASCIIArt('cat', 5).draw_ascii(curve=1)
ASCIIPicture(picture).save('cat_scale5_draw_ascii.png')

colored_picture = ASCIIArt('cat', 5).draw_color_ascii(ASCIIArt.FULL_RANGE, curve=1.5)
ASCIIPicture(colored_picture).save('cat_scale5_full_range_color.png')

with open('cat_scale5_draw.txt', 'w') as f:
    f.write(''.join(picture))

Before

Before

After ASCII

After

After ASCII Color

After

Setup

python3 setup.py install

Dependencies

Pillow==3.0.0