Great article… I had the same approach to image color search in my mind searching for class’es which could do the trick, when i stumpled upon this great article!
If you’re willing to expose some of your code in some way, that would be really great! Perhaps it could help a lot others struggling with image color search among huge amounts of images and even better you would get qualified feedback.
Thanks again for sharing your thoughts!
Regards
Jesper HorsMark
Developer, Denmark
NB: If you’re ok with sharing feel free to mail me )
]]>Thanks for the article, came upon it by random chance. I’ve had a go at implementing your algorithm in Rails with some tweaks as mentioned below
1) Use a palette of #xyz where each of x,y,z are in 0..F – this means I can make finding the closest root mean square faster as I know I only have to check the closest matching values.
2) I chose not to have multiple tables for the colors, but instead to have a table called color tokens whose field name was the color (e.g. F00 for red)
3) Instead of multiplying values directly, I used logarithms – log (AB) = log (A) + log(B). This keeps the numbers much smaller and reduces the risk of overflow – it also means I could effectively multiply tens of columns together.
As a working example see https://www.tripodtravel.co.nz/palette/similar-to/4430610943/10 – there are only 17000 images there but it is enough I think to see that the algorithm is basically working
Cheers, and thanks for the motivation
Gordon
]]>