[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] Pygame blitting 8-bit surfaces doesn't ignore palettes?



Hi. I'm working with 8-bit surfaces in Python 2.7 with Pygame 1.9.2pre. Everything I've read says that if I blit an 8-bit surface to another 8-bit surface, Pygame will ignore both palettes and only copy each pixel's 8-bit integer value from the source surface to the destination surface.

My experience so far is that this is *not* what happens. Rather, I'm seeing that that when blitting, Pygame will use the source surface's palette to get the 24-bit entry for each pixel, then look for that 24-bit value in the destination surface's palette, and then write the 8-bit integer value from the destination surface's palette as the pixel value in the destination surface. If there are no matching 24-bit palette entries for the palettes for both surfaces, then the resulting pixel's integer value in the destination surface is 0.

I'm just curious as to whether this is this a bug, or is my understanding of how Pygame works with 8-bit surfaces not correct? (In my case I have multiple surfaces each with their own palettes, and if I blit a pixel value of "1" then I want it to be "1" on my destination surface regardless of what any of the palettes are! :)

Thanks everyone!
Brian

--
Brian Madden
Mission Pinball (blog | twitterMPF software framework | sample games)