Jennifer Murphy
Registered Senior Member
Suppose I have a shade of blue with these values for the RGB attributes: 143 179 221. And suppose I have several other shades of blue, each with their RGB settings. I would like a way to calculate how close they are to the target shade. Is there an accepted way to do that? The RGB values for the other shades are in the table below.
I tried two methods. One, Sum(Diff), was to simply add up the differences. That is a poor choice. If R & G are each off by +100 and B is off by -200, the Sum(Diff) will be zero.
My next method was to add up the square of the differences, Sum(Sqrs). This doesn't have the problem of Sum(Diff), but I'm not sure if it is a good metric.
Any suggestions?
Thanks
Code:
R G B Sum(Diff) Sum(Sqrs)
143 179 221 0 0
130 166 205 -42 24
167 188 214 +26 27
139 159 197 -48 31
172 186 245 +60 38
I tried two methods. One, Sum(Diff), was to simply add up the differences. That is a poor choice. If R & G are each off by +100 and B is off by -200, the Sum(Diff) will be zero.
My next method was to add up the square of the differences, Sum(Sqrs). This doesn't have the problem of Sum(Diff), but I'm not sure if it is a good metric.
Any suggestions?
Thanks