JuanPotato / Legofy

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

enhance the Legofy to only use Lego colors #64

Closed WendellLiu closed 8 years ago

WendellLiu commented 9 years ago

i just add a function "getNearestColor" in legofy

BTW, tests/nearestColor.py was made for me to test the function and you don't have to merge this on main project

ewjoachim commented 8 years ago

I think you'd have quite better result if you implemented getNearestColor with HSV or HSL (which can be done easily with colorsys from the standard lib (#BatteriesIncluded). Then it might be interesting to multiply either component with a scalar constant to change their relative importance.

Worth noting that Wikipedia has an article on color difference which point to rather using L*a*b and Python-colormap has specific functions for computing visually correct color distances.

Main point is : computing distance by doing an euclidean distance over RGB coordinates does not result with the visually closest color.

christoga commented 8 years ago

I think you better modified your colors again and change it with material design color The list of the hex is here And because the color of the site is hex, Try to use HEX to RGB Converter, check it here

This pull request also have a conflict with the branch, try to fix it 😉

WendellLiu commented 8 years ago

thanks all! I will fix my problem as soon as possible

WendellLiu commented 8 years ago

@christoga I'm confused why i should change the colors with material design color. what's advantage in this way?

thanks for your suggestion

ewjoachim commented 8 years ago

I think @christoga wanted to say that Material Design offers a palette of colors that should look better. That could be interesting as an option, if we could choose our palette, but given the goal of this pull request, using the official LEGO colors should be the main feature we add ... we can still add the option to chose a better palette in a subsequent PR based on what this one offers, though.

JuanPotato commented 8 years ago

I'm still trying to find a fix for something before I merge this, and I'll probably be implementing the nearest color in a different way. Great stuff though

JuanPotato commented 8 years ago

better merge has been merged