GithubHelp home page GithubHelp logo

png2ascii's Introduction

png2ascii: A lightning fast PNG to ASCII image generator

png2ascii is an ASCII image generator written in C. It was made to be the fastest way to make ASCII versions of your favorite images.

Why?

Good question. It's not like tools like this are hard to find, but it is hard to find one that doesn't make a mess of requiring external libraries, or one that actually performs quickly. png2ascii is lightweight and does only what it needs to do.

Examples

Features and Notes

  • Super fast PNG to ASCII conversion, tuned with KCachegrind for performance.
  • The LodePNG library is required for use and is included here. There are no external dependencies.
  • Size and image format conversion easily done with another command line utility. See "Usage" below for details.

Performance

png2ascii was designed for speed, which is a large reason why it was written in C. KCachegrind was used to squeeze as much performance out of the tool as possible. png2ascii is fast, converting a 10MP, 10.6MB PNG into ASCII in just over 1 second on an Intel Core M processor. Compare that to 45 seconds for a comparable conversion with a Python utility. Though there's little reason you'd ever need to produce a single image that large, png2ascii can be used to batch convert frames to produce cool ASCII GIFs.

Usage

  • Run make at the command line to build the project with GCC.
  • png2ascii expects a PNG file as its only argument and outputs the ASCII image to stdout.
  • Images with a width greater than 100 pixels or so will be very large. It's easy to resize any image to the perfect size with ImageMagick's convert: convert img.png -resize 80x80 out.png ; ./png2ascii out.png > out.txt. True | piping isn't yet supported, because I'm not certain that LodePNG supports reading a PNG from stdin. I'm working on it.

Version History

1.0.1 (1/7/16)

  • Refactored source
  • Updated readme

1.0.0 (8/16/15)

  • Added alpha channel support

0.9.0 (8/16/15)

  • Initial release

png2ascii's People

Watchers

 avatar  avatar

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.