color index / color map

I am having problems getting an image that I have read in from a file to display using the correct colors. I am trying to set the color index using glPixelTransfer and glPixelMap. I cannot get either to work. Is anyone familiar with this operation and if so, where can I get an example of applying a colormap to images read in from main memory?