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

Re: [pygame] Changing the RGB of a full color surface?



On Mon, 2006-01-30 at 13:15 -0800, HandyGM wrote:
> Hi there. I have code to colorize a 256 color surface instantly... now I 
> need to create a routine that will colorize a full color surface.

It is also easy to create a new palette for your 8bit image. The arrays
are small enough they can be created in straight Python, no need for
Numeric

pic = pygame.image.load('Image256Colors.png')
palette = [(x,x,x for x in range(256)]
pic.set_palette(palette)