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.
Tetris Printer Algorithm
(via Hacker News)
Zachary Zmith writes, “A Kickstarter is funding beautifully-designed and illustrated editions of classic stories, with illustrations from Paul Pope, Yuko Shimizu and Bill Sienkiewicz. They have already met their initial goal to fund a version of Algernon Blackwood’s ‘The Willows’ with art by Paul Pope. If they reach $100k, Bill Sienkiewicz will illustrate H.G. Wells’ […]
Asaf Hanuka is a celebrated Israeli cartoonist whose astonishing, surreal illustrations serve as counterpoint to sweet (sometimes too-sweet) depictions of his family life, his complicated existence as a member of a visible minority in Israel, the fear he and his family live with, and his own pleasures and secret shames — a heady, confessional, autobiographical brew that has just been collected into The Realist: Plug and Play, the second volume of Hanuka’s comics.
SOG’s $60 Sync II “wearable belt buckle” multitool isn’t the only multitool/buckle on the market, but it does add a couple very sensible innovations, like a clip-on/clip-off base that lets you use your tool without taking off your belt, and a squared-off form factor (like a pair of folding travel sewing scissors) that adapts the […]
If you don’t want to get stuck footing the bill for a hit and run, this dashboard-mounted camera offers up to 2K resolution to make sure you always have a reliable witness, and it’s available in the Boing Boing Store for 30% off it’s usual price.The PapaGo mounts unobtrusively to your windshield to see everything […]
While some people still maintain that everything in Apple’s walled garden “just works” and is immune to the rampant malware of the Windows world, the reality is different. The Mac’s growing market share has made it a much more viable target for malicious actors, and its built-in tools aren’t always enough to fix things. Drive […]
Boasting an IPX6 waterproof rating, the Trakk Bullet Ultra Compact Waterproof Bluetooth Speaker resists dust and heavy rainfall. It’s currently available in the Boing Boing Store.The Trakk Bullet offers the same wireless convenience as other portable speakers, but few are built as tough as this one. Its utilitarian construction is designed to be a totally low-maintenance […]