Discuss digital image processing techniques and algorithms. We encourage its application to ImageMagick but you can discuss any software solutions here.

I'm working on a tool that needs to know how "different" or "close" two colors are to each other. This also includes brightness, saturation and such other properties. Ultimately I want to get this down to one single scalar telling me how different these colors are to the average human eye.

In my tool I want to perform this comparison several billion times, so I was thinking of transforming the source colors into a colorspace that would give me this difference directly using the euclidean distance in three dimensions. Most of my calculations only involves questions like is the difference between these two colors larger than the difference between these other two colors? so that the euclidean distance would not even require calculating the square root.

Does anyone know of any open-access papers about this, or if there is a good colorspace for this readily available? If it is not possible to perform such a transform (I actually don't think it is possible), what other methods could be used to compare colors that takes the human vision into consideration?

Thank you. I think I was mistaken about the L*a*b* colorspace, which seems to be what I'm looking for. Possibly with the addition of the CIEDE2000 algorithms.

I ran across a paper the other day that I believe did color distance in LAB. But when I tried to find it, I could not. Unfortunately, I did not bookmark it or did so in some folder I do not recall.