Hacker News new | comments | show | ask | jobs | submit login
Legofy – Python program to make an image to look as if it was created with Legos (github.com)
131 points by jaxondu on Oct 29, 2015 | hide | past | web | favorite | 39 comments

That is not at all what I was expecting. I was thinking conversion of actual objects in the picture into blocks, i.e. like minecraft but with lego style blocks. Instead it looks like a bad impressionist style painting done on one of those flat lego pieces you use as the "ground" when making something with legos.

This is exactly what I was expecting. The full-size image makes the seams clearer; it's meant to be constructed from 1x1 blocks. It's inspired by a Lego ad campaign from last year: http://www.adweek.com/adfreak/designers-brilliantly-minimali...

I also was expecting what you were, but I still think it's neat, or at least I think my kids will.

I guess we were a little too hopeful here.

It's absolutely baffling how such a trivial little program is able to attract so much stars and attention. Seems like GitHub is turning into a kindergarten these days.

Come one, don't be that person. People love to bookmark things that are fun or interesting, regardless of whether they are 'trivial'. This is fun and/or interesting. Absolutely nothing wrong with that.

Now pull https://github.com/JuanPotato/Legofy/pull/19 and write code to automatically put an order in for the needed bricks on lego.com to recreate the digital images as real life lego pictures :-)

When I was younger (about 10-15yrs ago) my parents got me a birthday present that was a grayscale LEGO picture of me that I had to put together. They didn't tell me what it was, I just got a big LEGO square base and a ton of different of colors of 1x1 nubs to "paint by numbers" from the diagram included. Pretty neat to see a color version of essentially what I did so long ago.

I think the colors would need to be posterized a bit more (which would be a nice addition - make the actual colors match all known official Lego brick colors). 32 shades of green looks nice in the demo image, but it's probably not buildable.

That's exactly what's in the linked PR...


I wish there was a demo available on the web so I did not have to install it to try it out.

Agreed. And more example images. But neato none the less!

Seeing "Legos" on the Internet has always annoyed me, even though it must be a decade and a half since I last even touched any LEGO bricks. Apparently the company doesn't want them called "Legos" either.[0]


Edit, further interesting discussion http://english.stackexchange.com/questions/10839/legos-not-l...

I for one don't care what the creators say. To me it's like the "GIF" thing: as a creator, especially when it's years after it's something that's part of the public consciousness, you don't have any say as to how people should pronounce the name of your product. Language is what people use, not what some people dictate.

I really don't care for the problems with our USPTO related law(s), but if you're going to go full-internet-trade-mark-pedant or whatever shouldn't you make use of the unicode glyphs ® or ™ when referring to LEGO^® bricks?

I do like the top comment at SE though, that was a pleasant surprise. excerpt from SE comment follows:

>Owners of trademarks are free to make whatever pronouncements they like regarding how people should use their trademarks. Users of the English language, however, have the final say of how the English language works.

>Just as watches made by Rolex are “Rolexes”, Apple computers are “Macs”, shoes made by Puma are “Pumas”, cars made by Audi are “Audis”, portable video games made by Nintendo are “Game Boys”, by the same process toys made by Lego are “Legos”.

No, the toys are "Lego sets", the individual pieces are "Lego bricks". What is "a Lego"? That's why you can't pluralise it.

Also, it's not an English language-wide thing, it's - as far as I'm aware - limited the US; certainly not practised in the UK.

Most people I know call tem Legos, with a few calling them Lego (as if mass uncountable object nouns --which seems weird) but yeah, I don't care much for their trademark protection technique (though I concede they may protect it), so I don't see the need to perpetuate their trademark crusade on their behalf and happily call them Legos.

To me it's not at all about trademark protection (I wouldn't write it in all-caps), it's just about how weird it sounds to make it a plural.

In Swedish (Lego is from Denmark, but our languages are pretty similar) it's exactly that, a mass uncountable object.

A bit like saying "this castle is made out of sands" when talking about a sand castle. It's grains of sands vs sand; pieces of Lego vs just Lego to me.

Of course this is all natural language and there is no right or wrong and so on, I just wanted to provide a perspective since it seemed like you interpreted the parent comment differently from how I did.

We'll see what the sands of time have to say about this :)

In danish you usually something is made from "Lego klodser", or simply "Lego", so either the plural is on the bricks part, or not there at all.

Lego, or Lego bricks is what would say as a native English speaker, but I guess its really up to the Danes.

Seems like a US thing to call it Legos, never heard anyone in the UK refer to it as anything but Lego.

I live in the UK too and have never heard anyone refer to Lego as Legos. The latter sounds extremely odd (in the same way that 'sheeps' does).

I wish North Americans would use the correct pronunciation.

US person here. I grew up calling them Legos. I don't know why. I even spent a Summer in Sweden (and visited Denmark several times) when I was a child; yet I still wound up calling them Legos. I don't refer to sheep (plural) as sheeps, though. I'm just happy that my neighbors aren't including an errant apostrophe ie: Lego's

It's not dissimilar from walking up to the counter at a coffee shop and ordering two large coffees. Everyone knows it's two large cups of coffee.

So Lego bricks become Legos. Nothing fancy.

I call the individual articles "bricks" or "pieces" and the collective "lego". UK born and bred.

I'm in the middle. "Legos" annoys me in the same way "sheeps" does, but at the same time, "LEGO" also annoys me. It's "Lego". It's a contraction, not an acronym - and stuff any company that demands we futz with our language just to write their name :)

It may be a good moment to introduce you to Hexagonator (http://josetomastocino.github.io/hexagonator/), a simple experiment to turn images to hexagon-tiled compositions, within your browser!

The README is really short, one or two more lines can make the life of those just learning python a bit better.

It's on GitHub. Don't complain, make a pull request! Or at least submit an issue.

Kudos to writing the converter - good exercise.

FYI, there are numerous such tools available on the web: https://www.google.com/search?q=picture+to+lego+converter

Does PIL use a linear colorspace for downscaling? I coudn't find it in their documentation. My intuition says that your sample image would look much better if it was downscaled in a linear colorspace, especially because of the thin bright lines disappear in the legofied image.

I recommend imageworsener for downscaling, its homepage links to many good articles about this topic too. AFAIK imagemagick can be tamed to use linear colorspace for downscaling, but it doesn't do it by default.


Nifty! There's an Android App which does much the same thing - https://play.google.com/store/apps/details?id=com.pixel.came... - also also you to convert GIFs.

Needs an option for "lego resolution/scaling", i.e. 1x1 vs 2x2 vs 4x4 blocks per output pixel. For times when I want to make a more detailed (hence physically bigger) Legopic from, well, a pic.

I would like to create a similar program that uses simultaneous photograph and depth sensor data (e.g. from a Tango device, or Google Camera app) to make a 3D version.

Pretty cool that it also works with animated gifs!

Surely these are just a set of images?

if a line of blocks are all close to the same color, should erase the divisions (draw 1*X blocks)

like this it just seems like a simple imagemagick script

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact