JuanPotato / Legofy

Make images look as if they are made out of 1x1 LEGO blocks
MIT License
3.15k stars 186 forks source link

Add 2010 LEGO color palette support #72

Closed armel closed 8 years ago

armel commented 8 years ago

Travis CI is green now (my bad...)

It seems that there are 3 palettes: solid (33 colors), transparent (14 colors) and effects (4 colors). You can use one of them or all the 3.

$ legofy --palette solid image.jpg $ legofy --palette transparent image.jpg $ legofy --palette effects image.jpg $ legofy --palette all image.jpg

There is another one palette, mono, with only 2 colors (black and white...). It's just for test and fun...

christoga commented 8 years ago

πŸ‘πŸ‘πŸ‘πŸ‘πŸ‘πŸ‘

JuanPotato commented 8 years ago

The only thing that is holding me back from merging this, is that there should be a better way to restrict the colors on the image. I found this but in my testing it always gave white in the palette and other grayscale. It just seems better to use the built-in method of Pillow, but it is really annoying

armel commented 8 years ago

Agree with you. There should be a better way. But it could be improved in a future release :)

armel commented 8 years ago

Juan, I take a look at your link on stackoverflow. Note that I’m precisely using the Image.quantize method (Do not reinvent the wheel). Check my make_lego_palette(image, palette) function. It’s the same approach :)

JuanPotato commented 8 years ago

oh no this is awkward, I haven't had time to go through all your additions, so I assumed it was like the other merges. I'll merge this very soon ;)