0

I have made a game using PyGame. After trying to make one of the pictures transparent (using an online editor to change the picture) the colors didn't work anymore.

I'm using p = pygame.image.load("filename.png") to load and gameDisplay.blit(p ,(pos,pos)) to blit. Black became green and the transparent part red. I have drawn other transparent pictures and they work fine.

Desired Appearance

What it's supposed to look like

Actual Appearance

What is looks like

Come with questions for what code I have and don't have as pasting a 455-line script here is probably not going to happen. I have tried using .convert_alpha as some said that would work, but it didn't.

Tagc
  • 8,736
  • 7
  • 61
  • 114
sommervold
  • 301
  • 2
  • 8
  • Sounds like the problem is with the online editor maybe? If you have drawn other transparent pictures and this one doesn't work then it basically boils down to the editor giving unexpected results. It doesn't sound like a problem with pygame based on the information you've written. But if all you want to do is making one color transparent you could just use a [colorkey](http://stackoverflow.com/documentation/pygame/7079/drawing-on-the-screen/23788/transparency#t=201701102013493651592) on your original image instead – Ted Klein Bergman Jan 10 '17 at 20:14
  • I have used the same editor for all of my pictures. So i can't see why that would be a problem. Will try what you suggested when I get home.(currently at school) – sommervold Jan 11 '17 at 10:29

0 Answers0