# Drawing arbitrary 8-bit images by playing Tetris

Holy. Crap.

Michael Birken lays out, in detail, a method for teaching a computer to draw arbitrary 8-bit images by playing Tetris, strategically deploying blocks of various colors to cause exactly the picture you want to emerge. The method is (as you'd imagine), starkly terrifying in its complexity, but the video speaks for itself.

The algorithm converts pixels from a source image into squares in the Tetris playfield, one row at a time from the bottom up. To generate an individual square, the algorithm assembles a structure consisting of a rectangular region fully supported by a single square protruding from the bottom. When the rectangular region is completed, its rows are cleared, leaving behind the protruding square. Three examples of the process appear below.

The algorithm can also generate multiple squares with a single structure as shown below.

During construction of a row, all of the squares produced by this method must be supported. In the images above, the generated squares are supported by the floor of the playfield. However, if an arbitrary row contains holes, it may not provide the support necessary for the construction of the row above it. The algorithm solves this problem by constructing a flat platform on top of the row with holes. In the animation below, a platform is built above a row comprising of a single red square. The platform is a temporary structure and inserting the final piece removes it.

### 13

1. Antinous / Moderator says:

Eleven.

2. SomeGuyNamedMark says:

I predict drawing with Tetris will be the new rage

1. anon0mouse says:

Thank god, an algorithm.  I was about to jam my controller up my nose and into my brain in despair because, how the heck do you compete with that?

2. Jonathan Roberts says:

How does 2:23 happen? There’s a gap between the two sprites.

1. blindcc says:

Try finding the frame(s) with a score of 72200. Those pixels are supported by three almost-complete rows that will be eliminated with an elbow block on the right.

2. Logolepsy says:

Like blindcc said, see this frame.

1. SamSam says:

Oh weird, I guess I never noticed that individual pieces don’t continue to fall by gravity. Obvious in retrospect.

3. SomeGuyNamedMark says:

The pic is cute and all but look at that score!

4. chosen at random says:

this is the new unicorn chaser.

5. mandorim says:

the beauty of doing simple things the hard way

6. Boundegar says:

That’s the depest Tetris I’ve ever seen. I think. It’s been a long time. But it’s like 40 levels deep, is that normal?