Kjetil's Information Center: A Blog About My Projects

ASCII-fication Filter

I made a filter program to convert normal images into random colored ASCII characters. It is similar to aalib, but aalib does not use random characters, and uses only a few colors, (in order to comply with text terminals I think).

It operates on plain PGM (Portable Greymap) image files only, since this is easy to parse. You can involve the convert tool from ImageMagick to use any kind of image file, like this:

convert foo.jpg -compress none pgm:- | ./pgm-asciify | convert pgm:- foo.png

Please note that you will get the best results by using big images with high contrast.

The code is released under a MIT licence, and can be fetched here.

Here is an example:

Keyboard asciified.

Filtered from this image:

Keyboard in normal appearance.

Topic: Open Source, by Kjetil @ 19/04-2009, Article Link