Then I started to think whether RGB is indeed the right way to describe color for what I am doing, so the next thing I tried is to useThat seems like a way to calculate the graylevel of a color, as being used in color TV transmission (at least for PAL), and which is responsible for the fact that a B&W TV can show a color TV signal rather well (that as an aside, for the curious). I'm not exactly sure on the weights, I thought the value for blue was closer to 0.11. And indeed, looking at 3.3.3. Color Models in Video - YUV Color Model, I see:as the "color", and calculate the difference.my $ll = 0.212671 * $r + 0.715160 * $g + 0.072169 * $b;
Y = 0.299R + 0.587G + 0.114B
But why are you throwing away the other 2 values? You could use the whole of YUV, where Y is your above gray value, and U and V are the two other color components. Surely, a change in color tint is as important as a change in brightness.
And then there is HSV, another somewhat similar color value triplet.
In reply to Re: the difference between two colors, and how to describe a color
by bart
in thread the difference between two colors, and how to describe a color
by pg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |