0

I'm using PyGame to manipulate and draw images.

For example, this is an image I create using draw.rect:

normal image

I need to run my code on AWS, so I followed the instructions to let pygame run on a headless server, and added os.environ["SDL_VIDEODRIVER"] = "dummy" to my code. However now, the images that are produce interpret the same RGB values differently (especially the blue channel).

messed-up image

For example, the off-white in the original image is (254, 252, 213), but in the second image its produces as a (255,255,255).

Why does this happen?

  • There are a few links that might help you, as I'm unable to recreate your problem : http://www.pygame.org/docs/ref/display.html#pygame.display.init http://www.pygame.org/docs/ref/display.html#pygame.display.get_driver – underscoreC Feb 21 '17 at 16:34

1 Answers1

0

The solution was to enable the alpha channel in PyGame's display.

This can be done by setting self.screen = pygame.display.set_mode((WIDTH, HEIGHT), 0, 32) after display is initialized.