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:



(Rating: 4.38 stars, Click to rate this article!)



























October 10th, 2008 at 5:38 pm
Are you aware that you’ve just been slashdotted? As in front page?
October 10th, 2008 at 9:17 pm
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.
October 10th, 2008 at 10:09 pm
That is fantastic! I’m sure Lego would be very interested in seeing this application.
October 11th, 2008 at 12:09 am
Is it possible to make the code publicly available? Thanks!
October 11th, 2008 at 1:17 am
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!
October 11th, 2008 at 1:47 am
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.
October 11th, 2008 at 6:24 am
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!
October 11th, 2008 at 7:03 am
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.
October 11th, 2008 at 7:44 am
Nerd! There are no tits on that wall…
October 11th, 2008 at 7:56 am
One word: Awesome!
October 11th, 2008 at 8:42 am
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.
October 11th, 2008 at 9:37 am
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.
October 11th, 2008 at 9:40 am
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
October 11th, 2008 at 4:26 pm
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
October 11th, 2008 at 4:38 pm
A lego fan,
That’s pretty cool, do you have an article link about how those were made?
October 11th, 2008 at 10:27 pm
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/
October 11th, 2008 at 11:20 pm
@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.
October 11th, 2008 at 11:32 pm
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?
October 11th, 2008 at 11:34 pm
@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.
October 11th, 2008 at 11:35 pm
@A lego fan, thanks for the links, very cool stuff.
October 12th, 2008 at 3:24 am
Google engineer smart? Try seventh grade. Why is this a top story on slashdot??
October 12th, 2008 at 9:28 am
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.
October 12th, 2008 at 12:49 pm
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.”
October 12th, 2008 at 2:59 pm
10 hours per image?
October 12th, 2008 at 9:47 pm
The word you’re looking for is LEGO, there’s no such thing as “Legos”.
October 13th, 2008 at 8:08 am
Nick, thanks for the heads up. I originally wrote the entire article using “l3g0z”… so I guess that was even worse
October 13th, 2008 at 8:36 am
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!
October 13th, 2008 at 8:38 am
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.
October 17th, 2008 at 6:57 pm
Any word on how soon the software will be available?
October 19th, 2008 at 8:05 pm
No word back from Justin yet unfortunately, sorry guys.
October 31st, 2008 at 8:07 am
Pretty cool stuff — I’d like to try this with some of my photos!