Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jontonsoup4/ascii_art
Converts images to ASCII art
https://github.com/jontonsoup4/ascii_art
Last synced: 13 days ago
JSON representation
Converts images to ASCII art
- Host: GitHub
- URL: https://github.com/jontonsoup4/ascii_art
- Owner: jontonsoup4
- License: mit
- Created: 2015-11-11T23:14:00.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2019-03-29T12:12:09.000Z (over 5 years ago)
- Last Synced: 2024-08-01T22:56:09.365Z (3 months ago)
- Language: Python
- Size: 17.2 MB
- Stars: 191
- Watchers: 11
- Forks: 33
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://github.com/jontonsoup4/ascii_art/blob/master/examples/draw_a_cat.py).
For a full list of example output, see [examples](https://github.com/jontonsoup4/ascii_art/tree/master/examples).
[Working colored HTML of an ASCII kitten using the character set 'kitten'](http://htmlpreview.github.com/?https://github.com/jontonsoup4/ascii_art/blob/master/examples/cat_scale2_html_kitten.html)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, ASCIIPicturepicture = 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](https://github.com/jontonsoup4/ascii_art/blob/master/examples/cat.jpg)
## After ASCII
![After](https://github.com/jontonsoup4/ascii_art/blob/master/examples/cat_scale5_draw_ascii.png)
## After ASCII Color
![After](https://github.com/jontonsoup4/ascii_art/blob/master/examples/cat_scale5_full_range_color.png)# Setup
`python3 setup.py install`# Dependencies
`Pillow==3.0.0`