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

Re: [pygame] Blitting image with alpha channel on a transparent background



If there's no images being displayed behind the background image, then there isn't a need for it to have an alpha value at all, since you'd never see anything through it anyway.

As far as the alpha goes, my guess is that you're getting hung up because you've mixed two different alpha modes.  There's some caveats about using per-pixel alpha (like the .png file probably has) and the other modes (color key or single value alpha like you've got).

So i'd first try just eliminating the transparency on the background, if in fact there's nothing behind it anyway.

(also, I'm fairly new, so sorry if I'm making some mistakes here)

-Lee-

On Thu, Apr 22, 2010 at 7:59 AM, stas zytkiewicz <stas.zytkiewicz@xxxxxxxxx> wrote:
Hello, I hope that someone can point me in the right direction.
I have a semi transparent background surface created with set_alpha(100).
On this surface I want to blit an png image which has a alpha channel.
The problem is that when I blit the png image surface to the background
surface the png image surface is also set to the same alpha value as the
background, 100 in this example.
As a result the complete image is semi transparent.

Thanks,
Stas

--
Free-source educational programs for schools
http://www.schoolsplay.org  and http://wiki.laptop.org/go/Schoolsplay
http://gvr.sf.net and http://wiki.laptop.org/go/Guido_van_Robot