Steph David
November 2nd, 2004, 05:13 AM
I have a true color bitmap, and I need to build a 256 colors palette that I can use to turn my true color bitmap into a 256 color bitmap.
The palette already contains some predefined colors, and I have 160 colors that I can use freely.
First question:
How can I tell two colors are close? Apparently, the best seems to use HSB values, but with different coefficients to weight their difference.
What is the exact formula and coefficients that I should use?
Second question:
What is the best way to reduce a list of N colors to a list of 160 colors, knowing that when I will apply the new palette to the original image, the image should visually change as little as possible?
The palette already contains some predefined colors, and I have 160 colors that I can use freely.
First question:
How can I tell two colors are close? Apparently, the best seems to use HSB values, but with different coefficients to weight their difference.
What is the exact formula and coefficients that I should use?
Second question:
What is the best way to reduce a list of N colors to a list of 160 colors, knowing that when I will apply the new palette to the original image, the image should visually change as little as possible?