nanogui: GdFindNearestColor
Subject:
Re: GdFindNearestColor
From:
"Greg Haerr" ####@####.####
Date:
23 Jan 2000 20:05:25 -0000
Message-Id: <02a401bf65db$bc783160$15320cd0@gregh>
: ¿Why the different weights to the three color components in the cuadratic
: mean error calculation? Has it something to do with the hardware? Have I
: missed that school day?
:
Manuel,
Those are included in attempt to convert based on luminescence, rather
than just color space. The formula to convert RGB to grayscale uses
those constants to convert to b/w luminescence, as they correspond
to the relative brightness of each of the colors.
Actually, I have seen other algorithms that are quite a bit faster; I've been
considering changing the line in GdFindColor() from
sq = (long)R*R*30*30 + (long)G*G*59*59 + (long)B*B*11*11;
to
sq = abs(R) + abs(G) + abs(B);
Perhaps you should try that and see how the color match algorithm
works with the std gray palette... Let me know.
Regards,
Greg