RSS

What Google Engineers do for Fun: Computerized LEGO Art Project

Fri, Oct 10, 2008    (Rating: 4.38 stars, Click to rate this article!) Loading ... Loading ...

Life & World, Technology


What happens when you are really smart… like Google-lead-engineer smart, you move into a new place that has a big blank living room wall and you end up being bored one weekend? Well, I’ll tell you what I would do… I would order pizza, probably watch a movie, stare at the wall for a good 45mins until I decided it wasn’t going to change on its own, then play some video games.

But that’s not what Justin Voskuhl did.

What you see above isn’t a horribly pixelated image in 8-bit or something that like… it’s actually a picture of a flower done completely with LEGO pieces; yes these:

What Justin did is write a computer program that, taking a source picture, would establish the most optimized colors, Lego brick sizes and orientations in order to reproduce the source image completely in LEGO.

To do this justice, I’ll just paste his explanation here:

I moved into a new place about ten months ago, and had a huge
blank wall in the main room.  So I decided to make some funky
LEGO art
for the walls.

I started with some square nature images, and wrote some Java code to
use a simulated annealing technique to figure out a layout for
LEGO
bricks that when stacked on each other look like the image (but also
try to minimize cost of the parts, and also try to ensure the result
has some structure rigidity - these images are held together only by
gravity and the
LEGO bricks themselves - no glue.

So the Java program runs for about ten hours for each image, spits out
a preview and parts list and some HTML that you can print out to use
as a diagram to assemble the whole thing.  The assembly time took
about fifteen hours for each image.  I enslaved some graduate student
friends of mine and traded free dinner for time in my
LEGO sweatshop.

Check out the results.  Each image is pretty different, but all with a
nature theme.  For scale purposes each one is a 34×34 inch square.
The
LEGOs are stacked 250 rows high, and 100 “lego nubs” wide.  The
maple leaves are on a background that dithered a LOT but I thought it
was a feature since it really shows off the fact that these are just
stacks of
LEGO bricks.

More or less what I would have done had I had an empty white wall… either writing annealing algorithms to reproduce pictures with LEGOs, or draw on it with washable Crayon; something my wife let’s me do every Saturday if I’m good.

Justin has plans to release the source code soon, so stay posted!

Check out the gallery while we wait:

Share This on Your Favorite Social Network:
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Fark
  • Furl
  • Propeller
  • Reddit
  • Technorati
  • StumbleUpon
  • description
  • MisterWong
  • TwitThis
  • Slashdot
  • SphereIt
, , , , , , ,

This post was written by:

Riyad Kalla - who has written 1597 posts on The “Break it Down” Blog.

Bringing you summarized technical news, announcement and reviews quickly and to the point.

31 Comments For This Post

  1. slashdotter Says:

    Are you aware that you’ve just been slashdotted? As in front page?

  2. Anonymous Coward Says:

    I tried doing something similar about a year ago by trying to reduce the number of available colors in a pallete to just those available in legos. Unfortunately I don’t know photoshop well enough to figure it out. But now I don’t have to. :)

  3. TheSpatulaOfLove Says:

    That is fantastic! I’m sure Lego would be very interested in seeing this application.

  4. simoncpu Says:

    Is it possible to make the code publicly available? Thanks!

  5. Mike Says:

    It’s a shame that (a) a lead Google engineer can’t afford a decent camera and (b) you need to install some decent gallery plug-in please! ;-)

  6. Eugene Says:

    If _I_ were “like Google-lead-engineer smart”, I would use “it’s” when I meant “its”. Because I would be _way_ too smart to know about grammar and stuff.

  7. rahn Says:

    Todd Osborn AKA Soundmurderer did this same thing a few years ago.
    http://www.youtube.com/watch?v=7404tZehlos

    he makes tremendous jungle music as well!

  8. Mitch Says:

    Why the intellectual fellatio at the start of the article? Some friends and I did stuff like this back in the early 1980s when we were just teenagers, except we used little ceramic tiles and an old Apple II computer. Sorry, but no rocket science here.

  9. Flo Says:

    Nerd! There are no tits on that wall…

  10. Jimbobuay Says:

    One word: Awesome!

  11. Justin Says:

    I know that there were a few projects similar to this in the past. I think for a while Lego.com even offered a mosaic program that would do something similar to your photos. However, I seem to be having a hard time finding any of the applications and Lego’s application is long gone. Any chance you want to throw the code up on github.com? That would provide a great way to share the application and let others help improve it. At any rate very cool pictures.

  12. Editor Says:

    I’ve pinged Justin for the source code, he mentioned some basic cleanups and then we’ll get it linked up here for you guys.

    As a commenter on Slashdot pointed out, at the onset this project might not *seem* like the most amazing thing ever, but when you consider it also balances the cost of Legos to build the pictures and the most optimized build materials to do it, it’s pretty dang slick.

  13. Christian Treczoks Says:

    There is already a very interesting software around called PicToBrick, written by Tobias Reichling and Adrian Schütz. Have a look at the tool and some creations made with it:

    http://www.pictobrick.de/de/pictobrick.shtml

  14. A lego fan Says:

    And if you are a very smart microsoft engineer you do that, then you go on to write a program to generate 3D sculptures.

    http://flickr.com/photos/dunechaser/444038134/
    http://seattle.metblogs.com/2006/04/21/lego-sculpture-11th-avenue/
    http://www.brickwiki.org/index.php?title=Image:AngelSculpture.jpg

  15. Editor Says:

    A lego fan,

    That’s pretty cool, do you have an article link about how those were made?

  16. A lego fan Says:

    Editor,

    David Winkler (the sculptor whose work i mentioned above) has some information at this post.
    http://news.lugnet.com/build/sculpture/?n=925

    You may also be interested in Bram Lambrecht’s paper on 3D rendering and his LSculpt program.
    http://lego.bldesign.org/LSculpt/

  17. redditor Says:

    @slashdotter - slashdot is redundant.

    And… Ten fucking hours?

    What the Fuck isthis guy doing? Resampling the source image?

    Really what a moron

    Choose size of output
    Load image, resize to n lines
    First algorithm
    Set each color to nearest lego brick color
    RLE the bricks using known sizes as fits

    Would run in under three seconds for a one meter square mons lisa, would order the bricks using a rest service, print the schematic and make your coffee while doing it. Engineer my ass.

  18. jonathan Says:

    I like how the 1/8in x 5/16in part of the plate pieces is the smallest “pixel” (not sure what to call it) rather than the square 5/16in x 5/16in that most people use when doing mosaics. Its less obvious that its made from Legos but its definitely more interesting.

    I’m quite curious how deep these are. If its only one “nub” deep it throws another twist in there because 4 colors don’t come in 1×1 plates. Two deep would make converting the picture to lego pieces easier since you don’t have colors that must be 2 “pixels” wide but also makes it a bit more expensive. If it is 2 nubs deep and still takes advantage of the 1 nub wide pieces and back-fills with less expensive pieces I’m super impressed. I imagine google engineers, or anyone who would take on a novelty project like this, aren’t on as tight of a budget as I am though since I’m back to being a poor starving student.

    I’m planning on making a lego mosaic (1 x 1 nub squares rather than the way these are done) of eeyore for a Xmas present. I’m no purist though and will probably paint white plate pieces so I can get 1×1 plates in the greens and bright purple (then paint the larger green and purple pieces to make sure all the colors match).

    I’m anxiously awaiting this source code. Should I keep tabs on this thread, this blog, elsewhere?

  19. Editor Says:

    @redditor, the algorithm does quite a bit more than that, which is why it takes so long to run. Besides running the annealing algorithm it also tries to calculate the most structurally sound layout (e.g. trying to avoid long runs of Legos in horz or vert orientations which would create a “seam”) and also attempts to optimize for the cost of building materials to minimize the expense when you actually try and build the picture (Legos, surprisingly… are not cheap).

    So yes, I suppose *your* algorithm would run much faster, but I promise you the results would be quite a bit different.

  20. Editor Says:

    @A lego fan, thanks for the links, very cool stuff.

  21. James Pereira Says:

    Google engineer smart? Try seventh grade. Why is this a top story on slashdot??

  22. Editor Says:

    James,

    Awesome followup. Insulting, trite and misses the entire point of the writeup.

    I’m going to mail you a giant gold star that says “Internet Smarty Pants” on it. You wear it, right on your shirt and let everyone know.

  23. The9th Says:

    As an unimaginative soul who’s built lots of legos w/his kids over the years, I’d love to see some close-ups of these great-looking things.

    And to know how you approach Lego to get these huge lots of bricks.

    I had the same question about how Normal Mailer managed to get thousands of clear blocks from Lego so that he and his pals could build a coffee-table skyline of Manhattan (article in New Yorker mag way back when). If I recall, Mailer had one complaint–that Lego didn’t make clear “cap blocks”, so the skyline was “dimpled.”

  24. Shawn Says:

    10 hours per image?

  25. Nick Berg Says:

    The word you’re looking for is LEGO, there’s no such thing as “Legos”.

  26. Editor Says:

    Nick, thanks for the heads up. I originally wrote the entire article using “l3g0z”… so I guess that was even worse :)

  27. Karl Says:

    Justin,

    Many of us are sitting here waiting (as though for an original trilogy Star Wars movie) to get the source for this project. I am finishing up my vacation prior to starting a new job and my God would I be a Legoing fool (bet there’s no such word as Legoing, but then again I bet that guy is not Nick Berg [http://en.wikipedia.org/wiki/Nick_Berg])

    Hope you get to post it soon!

  28. Editor Says:

    Guys,

    Sorry for the delay, emailed Justin twice over the weekend, so hopefully will have a reply to you shortly with regard to the source code.

  29. Justin Says:

    Any word on how soon the software will be available?

  30. Riyad Kalla Says:

    No word back from Justin yet unfortunately, sorry guys.

  31. Tamer Says:

    Pretty cool stuff — I’d like to try this with some of my photos!

7 Trackbacks For This Post

  1. sp4ngle » Blog Archive » What Google Engineers do for Fun: Computerized Lego Art Project | The “Break it Down” Blog Says:

    [...] [...]

  2. Marginal Improvements Make People Happy Says:

    [...] saw a recent post on Slashdot that got my attention - What Google Engineers do for Fun: Computerized Lego Art Project. I have to admit I am a total Lego nut so whenever I see Lego in the headline I have to read the [...]

  3. 5 WordPress Tips for Surviving Slashdot, Digg or Reddit | The "Break it Down" Blog Says:

    [...] to on-the-fly setup directly cached pages. For example, as soon as we saw hits coming in for the Lego Algorithm story, we popped it into WP-Super-Cache and had it create a permanent cache of the page that it would [...]

  4. Arjan`s World » LINKBLOG for October 12, 2008 Says:

    [...] What Google Engineers do for Fun: Computerized Lego Art Project - “Break it Down” Blog [...]

  5. Go Miniman Go » Google + LEGO = Wall Art Says:

    [...] LEGO brick sizes, and orientation to produce the original image done completely in LEGO bricks! Click here to read how Justin came up with the idea and check out some more awesome LEGO works of [...]

  6. links for 2008-10-21 | Yostivanich.com Says:

    [...] What Google Engineers do for Fun: Computerized LEGO Art Project | The "Break it Down" Blog That's beyond cool. He used Java to look at photos and develop how to build the photo using Lego bricks. (tags: java lego google software programming technology diy art) [...]

  7. Bill Ward’s Brickpile » Blog Archive » What Google Engineers do for Fun: Computerized LEGO Art Project Says:

    [...] What Google Engineers do for Fun: Computerized LEGO Art Project [...]

Leave a Reply