Converting colors... 8bit index -> 24 bit.
Posted on 1998-05-23
here is what i need to do -
I have a palette that I have loaded from a PCX file.
Now, I want to plot pixels on the screen using Windows pixel plotting functions, but to do this, I need to convert from the indexed color to RGB values.
Now, when I just take the index, and apply the various color settings to an RGB structure and pass that, my colors appear to dark, which means that the info is too light. i have tried doubling the values (ie: palette[index].red*2, etc.) but that doesn't seem to have worked.
I have loaded a pcx file into another program, but it looks "normal" there - ie: the colors are all correct, but when I load them in my little program, and convert them to 24 bit for use with pixel plotting they are all wrong.
Anyone that can help, I would be most appreciative.
This shouldn't be too hard of a question, I'm sure it's just a simple formula for converting from the 262K color possibilites of 256 color indexed to 24 bit color. I just don't know it.