nielsie95
2011-12-30 17:41:54
Hello there,
I think our CTS 2 comparison, using HSL, may be considered bugged. In the HSL model, the hue values are in the range of 0 to 360 degrees because it is a circle. This means colours with hue 0 are actually close to colours with hue 360. In our case, where values are scaled down to 0..100, this is not true. In fact, colours with hue 0 and hue 100 are considered to be as far apart as possible.
It mainly occurs with red colours. The script above demonstrates that two, to the eye very similar colours, have a tolerance of over 400. This should be fixed, but it may change behaviour of a lot of scripts. So what would be a good solution? Just fix it? Give the fixed a CTS a new number? Perhaps not fix it?
Nielsie95
I think our CTS 2 comparison, using HSL, may be considered bugged. In the HSL model, the hue values are in the range of 0 to 360 degrees because it is a circle. This means colours with hue 0 are actually close to colours with hue 360. In our case, where values are scaled down to 0..100, this is not true. In fact, colours with hue 0 and hue 100 are considered to be as far apart as possible.
program new;
var
c1, c2: Integer;
begin
c1 := HSLToColor(0, 50, 50);
c2 := HSLToColor(99, 50, 50);
DisplayDebugImgWindow(100, 100);
with TMufasaBitmap.Create do
try
SetSize(100, 100);
Rectangle(IntToBox(0, 0, 50, 99), c1);
Rectangle(IntToBox(50, 0, 99, 99), c2);
Rectangle(IntToBox(50, 0, 50, 99), clBlack);
DrawBitmapDebugImg(Index);
finally
Free;
end;
SetColorToleranceSpeed(1);
WriteLn('CTS 1, Tol 10: ' + BoolToStr(SimilarColors(c1, c2, 10)));
SetColorToleranceSpeed(2);
WriteLn('CTS 2, Tol 400: ' + BoolToStr(SimilarColors(c1, c2, 400)));
WriteLn('CTS 2, Tol 500: ' + BoolToStr(SimilarColors(c1, c2, 500)));
end.
It mainly occurs with red colours. The script above demonstrates that two, to the eye very similar colours, have a tolerance of over 400. This should be fixed, but it may change behaviour of a lot of scripts. So what would be a good solution? Just fix it? Give the fixed a CTS a new number? Perhaps not fix it?
Nielsie95