What is the most accurate algorithm to calculate the difference between 2 RGBA colors?
By accurate I mean close to human perception.
What is the most accurate algorithm to calculate the difference between 2 RGBA colors?
By accurate I mean close to human perception.
The most practical way is usually to convert the colors to the CIEUVW or CIELAB color space, and then take the normal Euclidean distance to be the color distance.
Both of these color spaces were designed to approximate "perceptual uniformity", so that this distance is good approximation of human-perceived color difference for colors that are "reasonably close".
See: https://en.wikipedia.org/wiki/CIE_1964_color_space https://en.wikipedia.org/wiki/Lab_color_space