Skip to content

Commit

Permalink
finder-test -> Update LAB, LCH & DeltaE
Browse files Browse the repository at this point in the history
D65 correction caused this test to fail
  • Loading branch information
slackydev committed Jan 9, 2025
1 parent 8b7dd0c commit fe10e4a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Tests/finder_color.simba
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// Very simple CountColor "test"
// - in case of small optimizations, or corrections this test can fail
// - I've added some tolerance of 0.1% of total pixels
// - I've added some tolerance of 1% of total pixels

const
TESTS := [
Expand All @@ -20,24 +20,24 @@ const
24717,
24713,
22999,
23668,
39849,
53443
24204,
44815,
55037
];

var
Bitmap: TImage;
I: Integer;
begin
Bitmap := TImage.Create(500, 500);
Bitmap.DrawHSLCircle(Bitmap.Center, 200); // roughly 628300 pixels, so 0.1% error is 628
Bitmap.DrawHSLCircle(Bitmap.Center, 200); // roughly 628300 pixels, so 0.1% error is 628

Target.SetImage(Bitmap);

for I := 0 to High(TESTS) do
begin
WriteLn(Target.CountColor(TESTS[I]), ' vs ', TEST_RESULTS[i]);
Assert(Abs(Target.CountColor(TESTS[I]) - TEST_RESULTS[I]) < 629);
Assert(Abs(Target.CountColor(TESTS[I]) - TEST_RESULTS[I]) <= 6283);
end;

Bitmap.Free();
Expand Down

0 comments on commit fe10e4a

Please sign in to comment.