Transparency in Save Surface Images

W

whale_cancer

Guest
Edit: Note, I can get the exact images I want by layering these images on top of the appropriate color in Photoshop, but I'd rather not have to do this extra step for obvious time reasons.

Hello!

I am generating images programmatically to create game aids for a pen and paper RPG. I have found that when I generate images to a surface and save them to an external .png file, the surface doesn't layer the components as I would expect. Instead, transparent elements of any given component override instead of layer onto the background. For example...



Top left is the output I get if I draw the scorpion at less than alpha 1. The entire scorpion is translucent rather than what I would expect to happen (the scorpion's translucent sprite added over the image background).

Top right is a solid scorpion with alpha 1. But you can see the anti-aliased parts of the scorpion are translucent.

The bottom two are just the top two images with a magenta background so you can see the transparent parts pop out.

What is with this behavior? Can I change this?

Let me know if you need code, but it is just a lot of boring drawing to the surface.
 
Top