24.1.2009

Image to ASCII art with Python


Yes, it's very slow, but it's also quite cool, and a fun hack in a bit over an hour. I thought of adding error diffusion algorithm to smooth color slides, but because of so low "pixel" size, it doesn't seem worth it. Otherwise, I'm out of ideas how to match the characters better to pixels.

Script works also for variable width fonts. But they look awful compared to fixed width ones.

The actual script will be posted soon...

Update 1: Trying to use proper latin-1 character set in Pygame seems to be more difficult than previously anticipated. Full algorithm and funtionality: 1 hour, finetuning and debugging: 10 hours.

Update 2: Working script

Update 3: The whole thing grew a bit too large and complex for simple pasting. So I put it at Google Code. here

Now supports numpy, SMP and variable width fonts.

0 comments: