Turning photographs into text
The butterfly in my text-picture experiments is a photograph. There is no image on the page at all, only letters.
From pixels to characters
The photo is shrunk until each pixel is about the size of one character. Then every pixel is asked one question: how dark are you? Darker pixels get heavier characters, @ and #, and lighter ones get : and ;. Pixels that are nearly white get nothing, so the paper shows through.
A few things make the difference between a muddy picture and a readable one:
- Cut the subject out first. A busy background turns into noise. A clean cutout turns into paper.
- Boost local contrast. Push each character away from the average of its neighbours, so edges and veins survive the shrinking.
- Match the cell shape. Characters are taller than they are wide, so the picture is sampled on a grid of the same shape.
Springs
Each character is its own little object with a resting place. A spring pulls it home, the pointer pushes it away, and friction settles it again. Hold the pointer down and they scramble between characters of the same weight.
Once in a while one lets go and falls like a petal.
That's all of it. The rest is choosing a good photograph.