I am playing with computer graphics programming for the first time. I want to convert RGB (24-bit) images to indexed-palette (8-bit) images (like GIF). My initial thought is
This might be a little late to answer, but try this:
Each time you supress a color, you will have to add into a hash_map the colors and it's destination.