15th July 2020
How to Implement Search By Color When All You Have is A Good Coffee - Mike
The only information we have about colors are the picture themselves. So we must infer it from there.
We need to tell if a picture is green or not.
For example for the following two images, the first one would be green and the second one would not.
In a recent project, I had to extract the main colours from an image and used functions from imagmagick to get there.
I scaled the image right down, then looped over the "pixels" and used imagecolorat to find the main colours of the image. Then used some maths to group similar colours together.
Knowing the main colours of an image means you can automatically style a web page around a cover photo which can be visually pleasing.