When I change my display setting to 16-bit color, I also see the behavior that you describe. I am not an expert in this area, but I believe that it makes sense given the set of colors that you are using. With 16-bit color, 5 bits are for Red, 6 bits are for Green, and 5 bits are for Blue. Five bits yield 32 values and 6 bits yield 64 values. So, even though for the 128 color case you generate 64 shades of red, only 32 different shades actually render. I experimented with your program and saw that if I make the color map colors include red, green, and blue values instead of just red and green, I can see a difference in the number of bands between 64 values and 128 values, even when my display is 16-bit color.