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:













Are you aware that you’ve just been slashdotted? As in front page?
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.
Hi
If you want to do similar things, you can try http://www.mosaicsmaker.com .
You can upload a photo, the website transfroms it in a LEGO mosaic and you can download a documentation to assemble it yourself.
Ju that is seriously slick, thanks for the link!
That is fantastic! I’m sure Lego would be very interested in seeing this application.
Is it possible to make the code publicly available? Thanks!
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!
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.
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!
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.
Nerd! There are no tits on that wall…
One word: Awesome!
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.
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.
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
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
A lego fan,
That’s pretty cool, do you have an article link about how those were made?
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/
@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.
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?
@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.
@A lego fan, thanks for the links, very cool stuff.
Google engineer smart? Try seventh grade. Why is this a top story on slashdot??
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.
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.”
10 hours per image?
The word you’re looking for is LEGO, there’s no such thing as “Legos”.
Nick, thanks for the heads up. I originally wrote the entire article using “l3g0z”… so I guess that was even worse
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!
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.
Any word on how soon the software will be available?
No word back from Justin yet unfortunately, sorry guys.
Pretty cool stuff — I’d like to try this with some of my photos!
Was the source ever published? It would be a great tool to do create some very nice christmas presents.
Sorry guys, I never heard back from Justin on this… believe me, I’ve sent him just shy of 75 emails.
I have to imagine he’s buried in work though and I’ll just keep probing until he goes insane or forwards it along
All I want for Chrismas is the source code for this project.
Waiting for source code too…..
Editor,
I was wondering if you had any updates on the source code for this. Can we look forward to a link anytime soon?
LEGOgeek, sorry guys, never got a reply back from Justin — and I pestered the hell out of him for it… it’s very likely we aren’t even friends anymore
What happened with posting the code? I’d love to give this a try!
I was never able to get in touch with Justin about it unfortunately. Multiple death threats later and a puppy to say “I’m Sorry” and I’m pretty sure we aren’t friends anymore
what ever happened with this… even if its not totally finished, having access to this program should provide some fun on rainy days.
Kindly (re)consider posting the code/executable.
MosaicsMaker is a tool that transforms photos into LEGO mosaics. The LEGO mosaics creator permits you to upload a photo, crop it, change the colors and view online the result.
You can buy these LEGO paintings pre assembled by us or in a puzzle like mode. A documentation is then provided.
http://www.mosaicsmaker.com
nab, thanks for the link for folks interested in this service.
It is the best time to make some plans for the future and it is time to be happy. I’ve read this post and if I could I desire to suggest you some interesting things or tips. Maybe you could write next articles referring to this article. I want to read even more things about it!
Hi there, just became aware of your blog through Google, and found that it is really informative. I am gonna watch out for brussels. I will appreciate if you continue this in future. Many people will be benefited from your writing. Cheers!
LEGOland in Chicago has the Scream and another painting made of LEGOs.