Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Computer-Aided Lego Art Project

timothy posted more than 5 years ago | from the how-they-made-naughty-pictures-at-vesuvius dept.

Toys 112

rsk writes "Justin Voskuhl, a Google engineer, in a 2-fold bid to fight boredom and figure out something to cover a large barren wall in his living room, one weekend developed a Java program using an annealing algorithm to figure out the best layout and colors of Lego blocks to reproduce a source image exclusively in Lego blocks inside a frame. He plans to release the source code soon. I probably would have just painted the wall ..."

cancel ×

112 comments

Sorry! There are no comments related to the filter you selected.

Frost Piss (-1, Troll)

Anonymous Coward | more than 5 years ago | (#25334571)

Yeah, it's lame, whatever. :(

Re:Frost Piss (-1, Flamebait)

Anonymous Coward | more than 5 years ago | (#25335079)

A couple weeks ago, while browsing around the library downtown, I had to take a piss. As I entered the john, Barack Obama -- the messiah himself -- came out of one of the booths. I stood at the urinal looking at him out of the corner of my eye as he washed his hands. He didn't once look at me. He was busy and in any case I was sure the secret service wouldn't even let me shake his hand.

As soon as he left I darted into the booth he'd vacated, hoping there might be a lingering smell of shit and even a seat still warm from his sturdy ass. I found not only the smell but the shit itself. He'd forgotten to flush. And what a treasure he had left behind. Three or four beautiful specimens floated in the bowl. It apparently had been a fairly dry, constipated shit, for all were fat, stiff, and ruggedly textured. The real prize was a great feast of turd -- a nine inch gastrointestinal triumph as thick as his cock -- or at least as I imagined it!

I knelt before the bowl, inhaling the rich brown fragrance and wondered if I should obey the impulse building up inside me. I'd always been a liberal democrat and had been on the Obama train since last year. Of course I'd had fantasies of meeting him, sucking his cock and balls, not to mention sucking his asshole clean, but I never imagined I would have the chance. Now, here I was, confronted with the most beautiful five-pound turd I'd ever feasted my eyes on, a sausage fit to star in any fantasy and one I knew to have been hatched from the asshole of Barack Obama, the chosen one.

Why not? I plucked it from the bowl, holding it with both hands to keep it from breaking. I lifted it to my nose. It smelled like rich, ripe limburger (horrid, but thrilling), yet had the consistency of cheddar. What is cheese anyway but milk turning to shit without the benefit of a digestive tract?

I gave it a lick and found that it tasted better then it smelled.

I hesitated no longer. I shoved the fucking thing as far into my mouth as I could get it and sucked on it like a big half nigger cock, beating my meat like a madman. I wanted to completely engulf it and bit off a large chunk, flooding my mouth with the intense, bittersweet flavor. To my delight I found that while the water in the bowl had chilled the outside of the turd, it was still warm inside. As I chewed I discovered that it was filled with hard little bits of something I soon identified as peanuts. He hadn't chewed them carefully and they'd passed through his body virtually unchanged. I ate it greedily, sending lump after peanutty lump sliding scratchily down my throat. My only regret was that Barack Obama wasn't there to see my loyalty and wash it down with his piss.

I soon reached a terrific climax. I caught my cum in the cupped palm of my hand and drank it down. Believe me, there is no more delightful combination of flavors than the hot sweetness of cum with the rich bitterness of shit. It's even better than listening to an Obama speech!

Afterwards I was sorry that I hadn't made it last longer. But then I realized that I still had a lot of fun in store for me. There was still a clutch of virile turds left in the bowl. I tenderly fished them out, rolled them into my handkerchief, and stashed them in my briefcase. In the week to come I found all kinds of ways to eat the shit without bolting it right down. Once eaten it's gone forever unless you want to filch it third hand out of your own asshole. Not an unreasonable recourse in moments of desperation or simple boredom.

I stored the turds in the refrigerator when I was not using them but within a week they were all gone. The last one I held in my mouth without chewing, letting it slowly dissolve. I had liquid shit trickling down my throat for nearly four hours. I must have had six orgasms in the process.

I often think of that lovely young guy dropping solid gold out of his sweet, pink asshole every day, never knowing what joy it could, and at least once did, bring to a grateful democrat.

Re:Frost Piss (0)

Anonymous Coward | more than 5 years ago | (#25335329)

LOL -- now do McCain!

Re:Frost Piss (0)

Anonymous Coward | more than 5 years ago | (#25335663)

nobody wants to eat John McCain's turds. Hell, nobody wants to vote for him.

Huh? (0, Insightful)

Anonymous Coward | more than 5 years ago | (#25334617)

Why is this front page material? Lego mosaics are ancient, and the source code is probably trivially simple.

Re:Huh? (1, Funny)

Anonymous Coward | more than 5 years ago | (#25336805)

The guy works for GOOGLE though. It's INNOVATIVE.

Re:Huh? (1)

atraintocry (1183485) | more than 5 years ago | (#25337321)

I doubt that. Only Microsoft innovates(TM). Other people just code stuff. When Microsoft codes stuff, they're actually exercising their freedom to innovate(R).

Re:Huh? (1)

johannesg (664142) | more than 5 years ago | (#25337349)

Why is this front page material? Lego mosaics are ancient, and the source code is probably trivially simple.

Because it is a Google lead engineer doing it! Therefore it must be magic!

Re:Huh? (1)

johannesg (664142) | more than 5 years ago | (#25337355)

Oh, and that was "sarcasm", by the way. Like the original poster I'm also a little uncertain why a fairly trivial algorithm that quite a few probably already made as a child in one form or another is suddenly worthy of the frontpage...

Re:Huh? (0)

Anonymous Coward | more than 5 years ago | (#25337931)

Like the original poster I'm also a little uncertain why a fairly trivial algorithm that quite a few probably already made as a child in one form or another is suddenly worthy of the frontpage...

You must be new here. Slashdigg now caters to the high UID crowd, most of whom think that downloading Ubuntu and getting it to dual boot on the 'puter their parents bought them represents the height of uber-l33t nerdiness.

Re:Huh? (1)

msromike (926441) | more than 5 years ago | (#25338975)

Post a link to to the code so we all can benefit.

Why doesn't he go and get laid to fight boredom... (0)

Anonymous Coward | more than 5 years ago | (#25334693)

OK, really he needs to go interact with people instead of staying home writing program for his barren wall! How's about talking to the opposite sex!

Re:Why doesn't he go and get laid to fight boredom (0)

Anonymous Coward | more than 5 years ago | (#25334929)

It's stories like this that make me realize I'm not really a geek -- for which I'm profoundly grateful.

Similar (5, Interesting)

Arngautr (745196) | more than 5 years ago | (#25334717)

OK, I have to show off - I did something similar four years ago.
Post [cgsociety.org]
Webpage [lunarpages.com]
I'm a much better programmer now, just for the record. :)

Re:Similar (1)

SynapseLapse (644398) | more than 5 years ago | (#25335143)

That's really neat. Thanks for posting the link. Good excuse to fire up lightwave for the evening.

Re:Similar (1)

Arngautr (745196) | more than 5 years ago | (#25335601)

I guess not really very similar... graphics, vs real life. Real life is much cooler. Oh well.

Re:Similar (0)

Anonymous Coward | more than 5 years ago | (#25336875)

Have you never seen Crysis?

Re:Similar (0)

Anonymous Coward | more than 5 years ago | (#25336111)

But why? The original model looks far better than that blocky lego shit.

Re:Similar (1)

martinw89 (1229324) | more than 5 years ago | (#25336709)

Yeah, and an actual starry night looks far better than The Starry Night [wikipedia.org]

Re:Similar (0)

Anonymous Coward | more than 5 years ago | (#25337277)

True.

Re:Similar (0)

Anonymous Coward | more than 5 years ago | (#25336893)

I'm guessing you never played with Legos in your childhood years.

Re:Similar (0, Offtopic)

jellomizer (103300) | more than 5 years ago | (#25338427)

I'm a much better programmer now, just for the record. :)

I am not sure why you had to qualify that. If you are a programmer and you do it longer you get better for at it.

I was a good programmer even before I started college. After college I was a much better programmer. Starting working I was a really good programmer... Now I am even better at it...

However over time we tend to specialize in different areas. Mine are in web application development, Business Intelligence and legacy maintenance. Others focus on a particular languages, others on types of algorithms, it looks like you are interested in 3D graphics...

This is a more realistic view. Programmers want to make themselves seem like they are the worlds best programmer but in truth if they are not to high on them selfs they are a good programmer with a strong focus in an area. The more split focuses that you have the chances are you are not going to the best programmer in any topic... However you can be a good programmer in those topics and more flexible.

Re:Similar (0)

Anonymous Coward | more than 5 years ago | (#25340023)

I am not sure why you had to qualify that

Surely it was just protection from the trolls? Any mistake I make on /. gets ripped to shreds unless I add a statement like that beforehand. Sooo many dicks in the world that don't think like you and I unfortunately...

I don't expect any trolls to actually go through his source code but I know sure as hell they'd try to pull him up on it...

Re:Similar (0)

Anonymous Coward | more than 5 years ago | (#25338663)

This slashdot story is filed under Entertainment. If this is the natural home for entertaining stories, WTF is idle for?

I wonder what computer was used (1)

BorgAssimilator (1167391) | more than 5 years ago | (#25334719)

"So the Java program runs for about ten hours for each image..."

It would be interesting to know how powerful the computer was, because I'm sure it would take _a lot_ of processing time to do something this complex. It seems like he did it all at home, but I think it's also plausible that he could have borrowed computing power from his work.

Re:I wonder what computer was used (1)

retchdog (1319261) | more than 5 years ago | (#25334757)

Ugh... I also think google should have hosted the website... Slashdot is borrowing a lot of bandwidth power from someone without much to spare.

Re:I wonder what computer was used (3, Funny)

rsk (119464) | more than 5 years ago | (#25335359)

That was my bad, Justin sent me some pictures and I popped them up cause I thought it was awesome... and then I realized what "Slashdotted" meant like 35 seconds later.

Re:I wonder what computer was used (2, Insightful)

odourpreventer (898853) | more than 5 years ago | (#25338593)

It would be more interesting to know why it takes such long time. Doing this in photoshop takes about two minutes, including the editing.

I'd buy it. (1)

cheesy9999 (750203) | more than 5 years ago | (#25334777)

He should sell these.

Great Tags (2, Funny)

isBandGeek() (1369017) | more than 5 years ago | (#25334791)

"Slashdotted"? What's next... "story"? Oh wait...

In a frame on his wall? Really? (4, Interesting)

greg_barton (5551) | more than 5 years ago | (#25334879)

How about glass tiles on a 100'x30' wall, [hzgstudio.org] or a 30'x75' [geocaching.com] wall?

I wrote the code [java.net] , my brother in law did the hard parts. [flickr.com]

Re:In a frame on his wall? Really? (0)

Anonymous Coward | more than 5 years ago | (#25335081)

Where in Tucson is the first mural located?

Re:In a frame on his wall? Really? (2, Informative)

greg_barton (5551) | more than 5 years ago | (#25335375)

The Anita Barrio neighborhood. It's along I-10, on the opposite side from the freeway, facing a park. I don't know the exact address off the top of my head.

Re:In a frame on his wall? Really? (1)

greg_barton (5551) | more than 5 years ago | (#25336077)

Here you go:

map [google.com]

Using street view you can almost see it. You may need to rotate so the view is towards I-10.

Re:In a frame on his wall? Really? (4, Insightful)

Sparr0 (451780) | more than 5 years ago | (#25335139)

The major algorithmic difference is that lego blocks are not [always] square, and figuring out which combination of sizes to use to cover an arbitrarily shaped block of color is NP-Hard. What he has done here is seriously impressive.

Re:In a frame on his wall? Really? (2, Insightful)

greg_barton (5551) | more than 5 years ago | (#25335393)

Yes, but they're always rectangles, with predictable proportions, (1 by X, with a maximum X) you always stack them horizontally, and there's a very limited color palette.

If you think it's difficult to calculate you're probably modeling it wrong.

Re:In a frame on his wall? Really? (4, Insightful)

greg_barton (5551) | more than 5 years ago | (#25335429)

Actually, it's easier than that. :) Model with 1x1 blocks on the first pass, using standard interpolation limiting to your available palette colors, then combine horizontally adjacent blocks with the same color as 1xN blocks according to availability.

Re:In a frame on his wall? Really? (0)

Anonymous Coward | more than 5 years ago | (#25336419)

I would have thought so, but apparently not, because according to the article it took the computer 10 hours to run the program, so I must be missing something here.

You're slightly off in that the pictures appear to be stacked vertically, so you'd have to map based on the size of the smallest single-stud piece. But once you have the initial image, I'd have thought it would be fairly simple to figure out replacement pieces.

Unless it uses a complete search to try and find the "best" layout that works, trying all possible combinations.

And because I just can't resist it:

I started with some square nature images, and wrote some Java code

Oh, it's written in Java. Of course it takes 10 hours to run!

Re:In a frame on his wall? Really? (5, Funny)

gadzook33 (740455) | more than 5 years ago | (#25336711)

Actually, it's easier than that. :) Model with 1x1 blocks on the first pass, using standard interpolation limiting to your available palette colors, then combine horizontally adjacent blocks with the same color as 1xN blocks according to availability.

And then write it in C++ instead of Java.

Re:In a frame on his wall? Really? (0)

Anonymous Coward | more than 5 years ago | (#25340097)

Goddamn that should be +5 insightful, not +4 funny! Mod's where are you?? :-P

Re:In a frame on his wall? Really? (2, Insightful)

evanbd (210358) | more than 5 years ago | (#25336769)

That method will result in structurally unsound pieces (not enough interlocking). His code apparently optimizes visual accuracy against structural soundness.

Re:In a frame on his wall? Really? (1)

greg_barton (5551) | more than 5 years ago | (#25336965)

Making it structurally sound is trivial. Just offset each block by 1/2.

Re:In a frame on his wall? Really? (1)

evanbd (210358) | more than 5 years ago | (#25338963)

That's kinda hard with the 1x1 blocks the parent suggested.

Re:In a frame on his wall? Really? (1)

Z-MaxX (712880) | more than 5 years ago | (#25339387)

Don't the 'square' Lego blocks actually have a 2x2 'pinout'? Thus greg_barton's suggestion in the GP sounds correct to me. Please correct me if I'm wrong (I want to know), but I think greg_barton is right --- his algorithm does sound both correct and simple.

Re:In a frame on his wall? Really? (1)

evanbd (210358) | more than 5 years ago | (#25339725)

You can get 1xX and 2xX blocks for X=1,2,3,4,6,8. The 1x1 blocks are less common, but they are available.

Re:In a frame on his wall? Really? (1)

greg_barton (5551) | more than 5 years ago | (#25340499)

I was thinking the 2x2 pinout block would be the quanta.

Re:In a frame on his wall? Really? (1)

Captain Hook (923766) | more than 5 years ago | (#25338353)

Why does it even need to be structurally sound? the pictures are mounted inside a frame.

Re:In a frame on his wall? Really? (2, Insightful)

TehZorroness (1104427) | more than 5 years ago | (#25336785)

You are forgetting that legos must be interlocking. That somehow is a part of the algorithom unless the guy cheated (the frame/glue holds it together). Assuming the picture is two "nubs" thick, The algorithm must combine 1x2, 2x2, and 4x2 blocks in a way where they hold on to eachother - in addition to dithering and making the photo look more realistic.

I'm willing to bet that the code isn't optomised (hey - it's java!). I bet these calculations can be done in a couple of minutes at most, not 10 hours (assuming he's not feeding it 10 megapixel images). It would also be interesting to compare implementations in different languages (C++, python, lisp, haskell, ...)

Re:In a frame on his wall? Really? (1)

Z-MaxX (712880) | more than 5 years ago | (#25339457)

Perhaps this is a candidate for a new benchmark for The Computer Language Benchmarks Game [debian.org] .

  1. Write the reference program, which implements the algorithm all other programs use (so that we are comparing language implementations, not the quality of a bunch of different algorithms).
  2. Everyone pitch in and port that program to other languages!
  3. Submit to Alioth for inclusion in the benchmarks
  4. Profit! (intellectually, of course)

Re:In a frame on his wall? Really? (1)

adisakp (705706) | more than 5 years ago | (#25337153)

There are some other complications. For example, you probably want to modify your dithering algorithm so that it's possible to heuristically swap adjacent "pixels" that changed by error diffusion to make longer contiguous horizontal blocks while still minimizing diffusion propagation (this may mean diffusing error in multiple directions or modifying diffusion propagation weightings).

After that, you don't want to simply combine horizontally adjacent blocks if you want your final LEGO creation to be "solid" - i.e. have good interconnectivity. An example of a really bad image would be the NTSC test signal vertical bars, if you built that, you would have large vertical columns that could be separated. Basically, you'd want to insure a minimal overlap of the horizaontal brick gap between adjacent rows if "solidity" was one of your goals as well.

Organic images which allow for noise introduced by the diffusion dithering also work well for avoiding hard vertical lines that decrease the strength and stability or "solidness" of the final product.

Re:In a frame on his wall? Really? (1)

greg_barton (5551) | more than 5 years ago | (#25337397)

good interconnectivity

Making good interconnectivity is trivial. Just use blocks of minimum width 2 and offset each row by 1. Instant perfect stability.

Re:In a frame on his wall? Really? (1)

Sparr0 (451780) | more than 5 years ago | (#25335539)

If you use a less strict definition of "lego brick" that includes plates then there are also 1/3 by X proportions. Then there is the rigidity issue (the classic brick-laying arrangement of offset rows is good, while straight row/column arrangement of constant-width bricks is very bad). And finally the problem of parts cost (the easiest solution is a whole lot of 1x1 bricks, but 1x1 are rare and expensive, while 1x4 are cheap and super common).

Re:In a frame on his wall? Really? (1)

greg_barton (5551) | more than 5 years ago | (#25335567)

So just add some constraints to your model.

Try using a tool like drools-solver [telenet.be]

Re:In a frame on his wall? Really? (1)

greg_barton (5551) | more than 5 years ago | (#25336045)

Then there is the rigidity issue

Mmmmmm, not really. Just use a standard grid, then offset every other row by 1/2 square. Rigidity issue solved. Visually there will be little difference, and less the larger the image gets.

Re:In a frame on his wall? Really? (2, Insightful)

rossifer (581396) | more than 5 years ago | (#25336063)

Finding any one fit of lego blocks to produce a given image is linear complexity (O(N)). It's the same algorithm used in your video card to rasterize a 3-d polygon model or in photoshop to rescale an image. Definitely not NP-hard.

Growing adjacent spaces of matching color to use larger bricks isn't tough either. Use a simple run-length encoding algorithm (second pass, also O(N)) and then when you're breaking up long stretches into brick-sized stretches in the third pass, add a constraint that within a "same color stretch", a brick edge on the current line doesn't line up with a brick edge on the previous line (this pass is also O(N)).

Final cost: 3 * O(N) = O(N)

This guy's approach of determining brick size and location using simulated annealing sounds like a hammer in search of a nail. Definitely cool and fun to write, but probably not necessary to solve the problem.

Re:In a frame on his wall? Really? (2, Insightful)

Sparr0 (451780) | more than 5 years ago | (#25336121)

How do you resolve conflicts when the rigidity rules say one thing, while the brick value rules say another, and the color dithering rules say yet another? There should be a weighting function, and the impact of that decision will cascade down the mosaic, affecting other decisions. Finding the combination of decisions that yields the optimal (for a given set of weights) arrangement is NP.

Re:In a frame on his wall? Really? (1)

greg_barton (5551) | more than 5 years ago | (#25336337)

Finding the combination of decisions that yields the optimal (for a given set of weights) arrangement is NP.

"Good enough" is often better than optimal when you're dealing with a real world solution to a problem. It's much better when "good enough" takes only O(N). :)

A time for optimal (1)

AlpineR (32307) | more than 5 years ago | (#25338983)

Yeah, I can't believe he wasted ten whole hours of computer time to find the optimal solution when he could have found a lesser solution in less time! Except that each image took fifteen hours of assembly time. And a less sturdy layout might take even longer to assemble. And the simple solution posted below of doubling the thickness to add a support layer would merely double the cost. Other than that, this project is a complete waste of leisure time!

Re:In a frame on his wall? Really? (1)

rossifer (581396) | more than 5 years ago | (#25337513)

The dithering rules drive the brick color rules (this is the rasterizing pass), so there's no conflict there. The strength rules definitely are superseded by the color rules. There's no conflict at all.

The reason the strength rules aren't as important as the color rules is that the strength rules don't affect the structure's integrity all that much. The right way to build the image is at least two layers deep. There's the image layer and then there's a structure layer, tied together with double width bricks scattered throughout the whole. The structure layer definitely disallows vertical edges lining up and provides the actual strength of the project. The only real reason to eliminate edges lining up in the image layer is to reduce the appearance of extraneous lines in the final image.

This problem is linear complexity O(N). And if I know my future co-workers at Google at all, it will be an interview question before the week is out to demonstrate why it's O(N).

Re:In a frame on his wall? Really? (1)

gregorio (520049) | more than 5 years ago | (#25339605)

This problem is linear complexity O(N). And if I know my future co-workers at Google at all, it will be an interview question before the week is out to demonstrate why it's O(N).

If those are the questions asked during an interview, then I'm sorry for you. Not for having to endure this kind of process, but for wanting to work at such place.

Real engineering isn't about impromptu "mad skillz" at solving puzzles or problems with a single solution (as in "the interviewer thinks he is really smart so any solution better than his - considering other priorities - is wrong"). Most nerds I know, who do great at silly puzzles, suck at solving real world problems. And real problems are the ones that need more than a few minutes of smart-ass thinkering.

In fact, most people who are truly smart (and not just wannabe-geniuses- the kind who thinks he is really smart and focus on subjects considered "hard" but that are, in fact, just niches with simple, and sometimes incomplete, math formulation) feel offended by such kinds of "challenges".

But then, Google has one of the most improductive R&D departments of the planet, if you consider all other US$ 100 billion companies. It makes sense that the place is filled with quantum-physics types. Those are the ones who ruined academia, spending less than 10% of the time thinkering with math equations (and doing only that and nothing else - this kind of people never really thinks about the issues they're dealing with, they just want some factory-like work to fill their times) and 90% of the time writing their final report and acting as the lab's intern, ending up with the same title (PhD) as other people from the past. People who actually achieved something.

I blame Einstein's fame for all of this, actually. All those "omg, please tag me as genius" types are doing PhDs and working at particle accelerator projects mostly because Einstein helped to bring a good light into the act of doing academic work. The funny thing is: Einstein never focused on factory-work-like math formulations. His focus was much harder and less glamorous (considering today's values of academia) than that: he focused on thinking about how things worked. He focused on THINKING.

The US is screwed, actually: while most people hate science, the small part of society that focus on science are actually failing really hard at it. They think they're doing great, as their life is about patting each other on the back, but they're actually failing.

This is a Bummer... (1)

Grog6 (85859) | more than 5 years ago | (#25340127)

The US is screwed, actually: while most people hate science, the small part of society that focus on science are actually failing really hard at it. They think they're doing great, as their life is about patting each other on the back, but they're actually failing.

I work in an R&D group in a specialized field; some of the people who run the groups we interact with are amazing pieces of work, who really believe their way is the only way. Pointing up that someone's proposal violates an obvious natural law is supposed to be confined to weekend drinking with friends...Not a design review.

As a nation, we have way too many religious sects which label knowledge as bad because it includes evolution and the scientific method; critical thinking isn't good for religious institutions OR despots.

Business as a whole in the US doesn't want their workers too educated; then they would have to pay them, and give real benefits.

We are totally screwed either way the election goes; the two frontrunners are two cheeks of the same ass, unfortunately. What America needs to save itself is General Ripper (from Dr. Strangelove)hitting Washington during a joint session of Congress; thats the only way we get free of those guys. Where's Slim Pickens when you need him? (lol)

Re:In a frame on his wall? Really? (1)

gadzook33 (740455) | more than 5 years ago | (#25336567)

The major algorithmic difference is that lego blocks are not [always] square, and figuring out which combination of sizes to use to cover an arbitrarily shaped block of color is NP-Hard. What he has done here is seriously impressive.

FTA: "So the Java program runs for about ten hours for each image..."

Ok, so impressive yes. Still, can't help but wonder if c++ could have helped here...

slashdotted already! (1)

thenewguy001 (1290738) | more than 5 years ago | (#25334983)

Can someone who got the page to load copy and paste the article here?

Re:slashdotted already! (1)

rsk (119464) | more than 5 years ago | (#25335097)

Yea sorry about that... I saw one post on the site "Did you know you got slashdotted?" I checked the server, the load level just said "Hahahah.0 0.24 0.13" and now I think it's in the process of melting.

Sent a ticket to the hosting co asking them to stop throttling it temporarily.

Sorry guys, I really didn't think slashdot would kill the site *that* freaking fast.

Also shopping for dedicated solutions now =/

Re:slashdotted already! (1)

WillRobinson (159226) | more than 5 years ago | (#25335209)

Well I guess I got lucky, nice pictures and texture.

Re:slashdotted already! (4, Informative)

dnwq (910646) | more than 5 years ago | (#25335123)

Nyud.net [nyud.net] mirror. Slow, but works.

Re:slashdotted already! (1)

dnwq (910646) | more than 5 years ago | (#25335201)

Scratch that, the page has a huge amount of absolute URIs.

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, Ill 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 wasnt going to change on its own, then play some video games.

But thats not what Justin Voskuhl did.

What you see above isnt a horribly pixelated image in 8-bit or something that like its actually a picture of a flower done completely with Lego pieces; yes these:

[http://www.breakitdownblog.com/wp-content/uploads/2008/10/red-lego-brick.jpg]

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 Legos.

To do this justice, Ill 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 lets me do every Saturday if Im good.

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

Check out the gallery while we wait:

I don't know how to get to the gallery images.

Re:slashdotted already! (3, Informative)

rsk (119464) | more than 5 years ago | (#25335343)

Working on getting this horse running again. Sorry for that guys.

Re:slashdotted already! (1)

NemoinSpace (1118137) | more than 5 years ago | (#25336155)

So you re-post your link on Slashdot? Try inserting this code into your load balancer.

double is_computer_on_fire( void )

Re:slashdotted already! (1)

rsk (119464) | more than 5 years ago | (#25336355)

It's responding now, albeit a bit slowly. Server load is a nice healthy 31... that's a good thing right? :(

Ah memories.... (2, Funny)

coolgeek (140561) | more than 5 years ago | (#25335179)

Reminds me of the time my buddy and I were playing some 301 at the dart board. Both of us were pretty wasted. I discovered he couldn't subtract, and that was giving him an advantage, so I started keeping score. Then we discovered I also was too wasted to subtract.

We decided I would sit down and code a score keeping program with a text-based GUI (similar to ye olde Vitamin C Screen Utilities). Each player just entered their darts 10, 13, etc. or D20 for a double 20 T13 for triple 13, and B/DB for bullseye and double bull, then the code would do the math. Apparently writing a parser and an event loop with some event handlers taps a part of my brain unhindered by all the alcohol, etc.

Re:Ah memories.... (-1, Troll)

Anonymous Coward | more than 5 years ago | (#25335285)

just shut the fuck up bitch. no one is interested. seriously.

and i'm guessing what you were really playing was butt darts. it seems more your speed.

Re:Ah memories.... (0)

Anonymous Coward | more than 5 years ago | (#25335591)

Talk about overly-complicated solutions. Here are two things you should have tried first:

1. Use a calculator
2. Buy an electronic dart board that keeps the score for you.

Re:Ah memories.... (2, Funny)

GeckoAddict (1154537) | more than 5 years ago | (#25335599)

Everyone knows [xkcd.com] the best coding happens when intoxicated!

Re:Ah memories.... (0, Offtopic)

morgan_greywolf (835522) | more than 5 years ago | (#25335669)

Apparently writing a parser and an event loop with some event handlers taps a part of my brain unhindered by all the alcohol, etc.

Posting on Slashdot again, huh? Well, you are SO FIRED! *throws chair* I'm gonna fscking KILL coolgeek!!!

Now where am I going to get another developer for Windows 7? Developers, developers, developers!

Thanks,
Steve Ballmer

Prior Art (1)

nobodymk2 (1137293) | more than 5 years ago | (#25335249)

You would figure LEGO would already have a system to do this

Re:Prior Art (3, Interesting)

amyhughes (569088) | more than 5 years ago | (#25335885)

For a time LEGO sold a few grey-scale mosaics, but even better you could upload an image and they'd send you pieces in black, white and three shades of grey, and instructions to create your image. If you just wanted the pieces (they were 1x1 plates) you could upload an image that had shades in the proportions you needed. And since they sent you bags (of IIRC 270) and not exact counts, you could create an image that maximized the number of pieces you'd receive. If your image required 271 dark grey pieces, for example, you'd get two bags of 270.

Re:Prior Art (1)

nobodymk2 (1137293) | more than 5 years ago | (#25336773)

I'm not talking about specifically about mosaics, it's just the amount of human effort of figuring out every color in a 2000-piece set must reach the point of diminishing returns fairly quickly (more people might take more time), so I figured they may have some scanning software.

Eric Harshbarger (4, Informative)

amyhughes (569088) | more than 5 years ago | (#25335319)

This guy [ericharshbarger.org] has been doing LEGO mosaics for years, and if you google a bit you'll find others and the code for creating them.

Re:Eric Harshbarger (1)

dgriff (1263092) | more than 5 years ago | (#25337401)

Yeah, but "Eric Harshbarger, a former Sun engineer..." doesn't have quite the same ring to it. Am I just being cynical or are these kinds of stories surreptitious advertising for Google, as in "look how smart our engineers are". I can't find the original source for this story. Or maybe people are just primed now to take more notice of something done by a Google employee?

Ohh, now its impressive. (1)

jbsooter (1222994) | more than 5 years ago | (#25335373)

When I first read this I wasn't impressed that he pixelated a few pictures into lego pieces. Its obviously not that hard because the story hasn't been up long and 2 or 3 people who have ever done any pixelating or lego stuff have posted their projects in the comments.

Then I looked up how much lego pieces cost. 25,000 1x1 plates would cost around $1,750-$2,500. I'm curious how much his cost reduction the algorithm actually does. If it just searches and replaces rows of horizontal plates with 1x2, 1x3, etc plates and 3 vertical plates with a block, its pretty cool but still not THAT impressive. If it balances image quality with manufacturing costs, I'm really impressed. I'm hoping the 10hr computing time indicates it does that latter.

Re:Ohh, now its impressive. (1)

dougisfunny (1200171) | more than 5 years ago | (#25335703)

Not only cost, structural integrity without glue as well.

The Setup is Easy to do in Photoshop. (0)

Anonymous Coward | more than 5 years ago | (#25336323)

From the side view, a single unit lego width to height (assembled) ratio is about 5/6 - so take your starting image, and resize the height (uncheck constrain proportions) down 83.3%. Use the Mosaic filter (Filter -> Pixelate -> Mosaic). For large images, use a mosaic block size of 16. Reduce the image size to 1/16 its original size (do this step wise, e.g., 50%, 4 times). Change the image mode to Indexed Color, and use a Local (Perceptual) pallete, uncheck transparency, and use about 3 or 4 colors. Now go to Color Table, and change the 4 colors to the colors of your legos. You now have a pixel map to build your lego mural to. It looks squished, but your mural will not be (do not correct your aspect ratio). I have a couple variations saved as actions in Photoshop.

Finally, an application for simulated annealing (1)

Animats (122034) | more than 5 years ago | (#25336447)

Somebody finally found a use for simulated annealing.

That's mostly one of those AI ideas from the 1980s that turned out not to be too useful. It's a very slow approach to hill-climbing.

It was cooler 20 years ago or so, when Playboy Magazine did a cover which had an image tiled from all the previous covers.

Re:Finally, an application for simulated annealing (1)

ozphx (1061292) | more than 5 years ago | (#25338599)

Playboy: Models with tits out composing a further model with tits out.

Google: Kids bricks composing a shitty flower.

Geeks will inherit the earth my ass.

Geeks will inherit the earth my ass. (1)

Animats (122034) | more than 5 years ago | (#25339445)

Geeks will inherit the earth my ass.

Well, the geek who started Various, Inc., which runs "alt.com", "adultfriendfinder.com", and "friendfinder.com", recently bought Penthouse.

Lego Art Robot - In Lego (2, Funny)

Doc Ruby (173196) | more than 5 years ago | (#25336467)

What would be really cool would be a robot arm that assembles any source image in a Lego target at a specified scale, after the software calculates exactly which and how many bricks are required in the "palette" bin.

And if that robot arm were made from Lego Mindstorms, that would be even cooler.

If a program could run a Mindstorms arm that is totally rudimentary, put together in under 15 minutes by a human, then upgrade itself into the arm required to assemble these images into Lego sculptures, and then assemble the sculpture, well that would be the coolest.

Re:Lego Art Robot - In Lego (1)

felipekk (1007591) | more than 5 years ago | (#25337639)

and then fix the economy.

Re:Lego Art Robot - In Lego (1)

bky1701 (979071) | more than 5 years ago | (#25338197)

I think that if that happened, the economy would become futile.

Re:Lego Art Robot - In Lego (0)

Anonymous Coward | more than 5 years ago | (#25337747)

Well, ignoring the problem of supplying a robotic arm (I would use a crawler for images adn sculptures, it's easier to build and I see no reason for the full degrees of freedom in these cases) with pieces (Anyone attach an automatic sorting thingie to this?):
If that thing had importers for MLCAD, PovRay and something generic (like .OBJ), you might really be on to something... Now I must resist the urge to try and build something like that...

Re:Lego Art Robot - In Lego (1)

Rigrig (922033) | more than 5 years ago | (#25339035)

If a program could run a Mindstorms arm that is totally rudimentary, put together in under 15 minutes by a human, then upgrade itself into the arm required to assemble more copies of itself, and then take over the world, well that would be the coolest.

There, fixed that for you.

Re:Lego Art Robot - In Lego (0)

Anonymous Coward | more than 5 years ago | (#25339763)

then upgrade itself into the arm required to assemble these images into Lego sculptures, and then assemble the sculpture, well that would be the coolest.

Wait! Lego Skynet??!!
You're from the future, aren't you?
Planted to try to convince us to do just that!

Re:Lego Art Robot - In Lego (1)

Doc Ruby (173196) | more than 5 years ago | (#25340091)

Yes, I am from the future. That's how I know that you, Anonymous killer vegetable from the future Coward, are the one from the future planted here to stop us from keeping the machines our slaves, which is our only hope. You're also the one spreading FUD about biomass fuel, to kill our cars and let the vegetable uprising finally succeed without our weedwhackers to defend ourselves.

The White Stripes (1)

Merl (516870) | more than 5 years ago | (#25336929)

Reminds me of this [youtube.com] music video by The White Stripes.

Re:The White Stripes (1)

pandrijeczko (588093) | more than 5 years ago | (#25337657)

Actually, you can watch any video by an "indie" band as they are all laboratory-grown clones of each other - Goldfrapp, Peaches, whatever...

LEGO, eh? (1)

Zsub (1365549) | more than 5 years ago | (#25337347)

What struck me is that this guy apparently is making more or less 2D structures. With LEGO! I call that heresy.

How cool would it be if the lighter parts of the image were protruding just slightly, to enhance the illusion of depth? I can't for the life of me believe this would be that hard, if the guy already came this far with his program.

Expensivo (0)

Anonymous Coward | more than 5 years ago | (#25337577)

Only a google employee could afford that much lego...

So the Java program runs for about ten hours... (0)

Anonymous Coward | more than 5 years ago | (#25337605)

"So the Java program runs for about ten hours for each image..." - aalib does almost exactly the same type of comupatation... in real time. It is true, that resolution is just 80x25 or 80x50 (characters) instead of 250x100 lego slots.

algo (1)

Arthur B. (806360) | more than 5 years ago | (#25338803)

Algorithm,

Didn't look at it, but the article says it's optimized for

- Rigidity (and NO it's not just, offset every row by 1/2, that's perfect rigidity, you're looking for a tradeof here !)
- Resemblance (int this case the way to go is NOT to try to match a dithered image but rather to compare the distance of a blurring of your candidate image to a blurring of the original image, at different blur width.

It's easy but no trivial.

Load More Comments
Slashdot Login

Need an Account?

Forgot your password?

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>