
Legofy – Python program to make an image to look as if it was created with Legos - jaxondu
https://github.com/JuanPotato/Legofy
======
sabujp
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.

~~~
bluetomcat
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.

~~~
matthewmacleod
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.

------
bhaak
Now pull
[https://github.com/JuanPotato/Legofy/pull/19](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 :-)

~~~
joezydeco
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.

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

------
asimjalis
Neat.

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

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

------
jkldotio
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]

[0][https://twitter.com/LEGO_Group/status/502086477652959232](https://twitter.com/LEGO_Group/status/502086477652959232)

Edit, further interesting discussion
[http://english.stackexchange.com/questions/10839/legos-
not-l...](http://english.stackexchange.com/questions/10839/legos-not-lego)

~~~
mc32
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.

~~~
unwind
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.

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

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

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

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

------
ctdonath
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](https://www.google.com/search?q=picture+to+lego+converter)

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

[http://entropymine.com/imageworsener/](http://entropymine.com/imageworsener/)

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

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

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

------
donquichotte
Pretty cool that it also works with animated gifs!

~~~
JupiterMoon
Surely these are just a set of images?

------
yonax
made js clone:
[http://codepen.io/yonax/full/MaXwqo](http://codepen.io/yonax/full/MaXwqo)

------
qnaal
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

