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

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



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.

Can anyone tell me why this won't work?

        pic    = pygame.image.load('MyFullColorPic.png')
        adj    = (50, 50, 50)
        array  = pygame.surfarray.array3d(pic)
        array  = array * (255+adj[0], 255+adj[1], 255+adj[2])
        array /= 255
        Numeric.clip(array, [0, 0, 0], [255, 255, 255])
        pygame.surfarray.blit_array(pic, array)