Does anyone have (or know of) a good algorithm for finding the closest color available in a palette? I am using a 256-color palette, with 8 bits each for the r,g, and b components. Allegro uses a weighted squares method, which works OK, but it does not seem to be as accurate as the CPalette::GetNearestColorIndex() function in VC++. I am writing an app for DOS, so I can't use the VC++ function. Any help would really be appreciated.
Thanks, that is a lot better than the standard weighted squares method (which I noticed you had commented out in your code). This is good enough for me to use, but STILL not quite as good as the CPalette::GetNearestPaletteIndex() function.
you computed color difference in this function .
Well this is actually color matching or similarity . but my question is that what the difference mean actually regarding matching .
I want to show color similarity image .do't want to compute the color differences.