GithubHelp home page GithubHelp logo

vsego / pyteart Goto Github PK

View Code? Open in Web Editor NEW
6.0 0.0 1.0 908 KB

Generators of ASCII art with overlapping characters

License: GNU General Public License v2.0

Python 32.45% Max 5.91% Visual Basic 61.64%

pyteart's Introduction

PyteArt

PyteArt is a collection of generators of ASCII art with overlapping characters, written in Python 3.

The project was created as a result of Nick Higham's challenge to make a port of his typeart program to a more modern setting. His original motivation and source code are available here.

The main difference from the usual ASCII art is that we allow overlapping characters. While that impairs with display options (usually, ASCII art can be viewed as an ordinary text file, or - at least - in a console, if colouring is required), this approach allows better representation of the image's pixels.

Programs included

  • patgen.py -- A helper script that generates patterns, used for converting shades of gray to characters;

  • img2dat.py -- Converter of images (JPEG, PNG,... anything readable by PIL) to sequences of characters, as described in Nick Higham's original blog post and BASIC program;

  • pyteart.py -- port of Nick Higham's TypeArt, used for converting DAT data to a HTML file (overlapping of characters is achieved with overlapping DIV blocks).

Programs patgen.py and img2dat.py require Python 3 Pillow library. In Fedora repositories, this is package python3-pillow.x86_64.

Typical use

To convert an image to a DAT file:

./img2dat.py "Nick Higham.png"

This will produce a farily low quality image, so one may want to darken it a bit (set brightness to 0.9) and increase the contrast (by a factor 2):

./img2dat.py "Nick Higham.png" .9 2

Similarly, good settings to convert the image of Manchester's Numerical Analysis group are

./img2dat.py "NA Manchester group.jpg" 1.1 1.5

To convert DAT to HTML files, just run

./pyteart.py "Nick Higham.dat"
./pyteart.py "NA Manchester group.dat"

pyteart's People

Contributors

vsego avatar

Stargazers

Stewart Russell avatar Erik avatar Malte Schmitz avatar  avatar  avatar Raymond Phillips avatar

Forkers

vb6hobbyst7

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.