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

Re: [pygame] Blitting to alpha channel or using another image's alpha channel



Lenard Lindstrom wrote:

You can use the BLEND_RGBA_MIN flag with a surface blit. Make sure the mask is all black and that all the target surface pixels have an alpha of 255. Before that was available (Python 1.8.1?) there was the surfarray module. surfarray.pixels_alpha lets one get at the alpha plane of a surface and manipulate it with array operations. See the shadowed effects in the Pygame cookbook for an example:

http://www.pygame.org/wiki/ShadowEffects?parent=CookBook

But you need either NumPy or Numeric for this to work.

The advice with the black mask is wrong. It needs to be white.

--
Lenard Lindstrom
<len-l@xxxxxxxxx>