Code Monkey home page Code Monkey logo

ascii_art's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.