SRL Archive - Bugs

CTS 2 bug


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.


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

DeSnob

2011-12-30 19:31:09

This needs to be fixed. I've had many times when this issue affected my scripts, without even knowing why. Not fixing it is like having terrible eyesight and not buying glasses.

Wizzup?

2011-12-30 19:53:47

We have to consider (if possible) what would break. If a lot of scripts break (I don't believe they will), then we could add a new CTS, but I think we should just ``fix it''.

Gu3st...

2011-12-30 20:03:22

Imo, it's a lot more logical to fix the bugs that appears, even though if there are scripts that rely on the bugged version, than not fixing it

Home

2011-12-30 20:11:39

Fix it. I'v been having some problems too :P


~Home

Flight

2011-12-30 20:56:26

I don't think it will matter what will break if it's fixed. We can quickly update what needs to be. No reason just to keep sweeping it under the rug.

Wizzup?

2012-01-02 10:29:58

This will be fixed in Simba 981.

Ref: http://git.villavu.com/simba.git/commit/?id=d8dccc04e9f2af2dcdc9a8137bcfc412752021e5
Ref 2: http://git.villavu.com/simba.git/commit/?id=ba4d1e7a27d67cb70e737604bf216654e6fb8681

Wizzup?

2012-01-03 09:18:53

Seems to work in my local build:


Compiled successfully in 22 ms.
CTS 2, Tol 10: True
CTS 2, Tol 400: True
CTS 2, Tol 500: True
Successfully executed.