Reputation: 6147
How to measure difference between RGB colors taking into account human perception, the goal is to build distance function which will tell that red and green are totally different, and light green and green are pretty similar, co distance should measure hue/shade between similar colours if the colors are the same.
Upvotes: 1
Views: 645
Reputation: 4070
You should look at CIE DeltaE 2000 or colour differences in perceptually-uniform colourspaces such as CAM16-UCS or JzAzBz where applying simple Euclidean distance is fine within reason.
We have implementations of all of them in colour if you need numerical references. Importantly though, most of the metrics are valid for small colour differences, usually less than 10 CIE L*a*b* units, for large colour differences, you would probably need something like HyAB.
Upvotes: 1