Pygame set_colorkey transparency issues
- by Nathan Chowning
I'm having a strange issue that I cannot seem to remedy. I am doing some prototyping with Pygame on a desktop running windows and a laptop running OS X. Both are running python v2.7.3 (installed via homebrew for the Macbook) and pygame v1.9.1.
For transparency, I have been using set_colorkey with a transparency color of (255, 0, 255). Here is the applicable code:
transColor = pygame.Color(255, 0, 255)
image = pygame.image.load(playerPath + "idle.png").convert()
image.set_colorkey(transColor)
This works flawlessly on my windows machine. On my laptop, it does not work. It just shows the hideous magenta color. Here's the strange part. If I change the transColor to (0, 0, 0), all black pixels in my images are transparent. Has anyone run into this issue before?