TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Legofy – Python program to make an image to look as if it was created with Legos

131 pointsby jaxonduover 9 years ago

14 comments

sabujpover 9 years ago
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.
评论 #10469708 未加载
评论 #10470491 未加载
评论 #10469594 未加载
评论 #10470209 未加载
bhaakover 9 years ago
Now pull <a href="https:&#x2F;&#x2F;github.com&#x2F;JuanPotato&#x2F;Legofy&#x2F;pull&#x2F;19" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;JuanPotato&#x2F;Legofy&#x2F;pull&#x2F;19</a> 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 :-)
评论 #10470667 未加载
评论 #10472265 未加载
asimjalisover 9 years ago
Neat.<p>I wish there was a demo available on the web so I did not have to install it to try it out.
评论 #10469350 未加载
jkldotioover 9 years ago
Seeing &quot;Legos&quot; 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&#x27;t want them called &quot;Legos&quot; either.[0]<p>[0]<a href="https:&#x2F;&#x2F;twitter.com&#x2F;LEGO_Group&#x2F;status&#x2F;502086477652959232" rel="nofollow">https:&#x2F;&#x2F;twitter.com&#x2F;LEGO_Group&#x2F;status&#x2F;502086477652959232</a><p>Edit, further interesting discussion <a href="http:&#x2F;&#x2F;english.stackexchange.com&#x2F;questions&#x2F;10839&#x2F;legos-not-lego" rel="nofollow">http:&#x2F;&#x2F;english.stackexchange.com&#x2F;questions&#x2F;10839&#x2F;legos-not-l...</a>
评论 #10469729 未加载
评论 #10470557 未加载
评论 #10469576 未加载
评论 #10470137 未加载
omegoteover 9 years ago
It may be a good moment to introduce you to Hexagonator (<a href="http:&#x2F;&#x2F;josetomastocino.github.io&#x2F;hexagonator&#x2F;" rel="nofollow">http:&#x2F;&#x2F;josetomastocino.github.io&#x2F;hexagonator&#x2F;</a>), a simple experiment to turn images to hexagon-tiled compositions, within your browser!
yannisover 9 years ago
The README is really short, one or two more lines can make the life of those just learning python a bit better.
评论 #10471245 未加载
ctdonathover 9 years ago
Kudos to writing the converter - good exercise.<p>FYI, there are numerous such tools available on the web: <a href="https:&#x2F;&#x2F;www.google.com&#x2F;search?q=picture+to+lego+converter" rel="nofollow">https:&#x2F;&#x2F;www.google.com&#x2F;search?q=picture+to+lego+converter</a>
leni536over 9 years ago
Does PIL use a linear colorspace for downscaling? I coudn&#x27;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.<p>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&#x27;t do it by default.<p><a href="http:&#x2F;&#x2F;entropymine.com&#x2F;imageworsener&#x2F;" rel="nofollow">http:&#x2F;&#x2F;entropymine.com&#x2F;imageworsener&#x2F;</a>
edentover 9 years ago
Nifty! There&#x27;s an Android App which does much the same thing - <a href="https:&#x2F;&#x2F;play.google.com&#x2F;store&#x2F;apps&#x2F;details?id=com.pixel.camera" rel="nofollow">https:&#x2F;&#x2F;play.google.com&#x2F;store&#x2F;apps&#x2F;details?id=com.pixel.came...</a> - also also you to convert GIFs.
shivenover 9 years ago
Needs an option for &quot;lego resolution&#x2F;scaling&quot;, 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.
dheeraover 9 years ago
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.
donquichotteover 9 years ago
Pretty cool that it also works with animated gifs!
评论 #10469788 未加载
yonaxover 9 years ago
made js clone: <a href="http:&#x2F;&#x2F;codepen.io&#x2F;yonax&#x2F;full&#x2F;MaXwqo" rel="nofollow">http:&#x2F;&#x2F;codepen.io&#x2F;yonax&#x2F;full&#x2F;MaXwqo</a>
qnaalover 9 years ago
if a line of blocks are all close to the same color, should erase the divisions (draw 1*X blocks)<p>like this it just seems like a simple imagemagick script