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

Re: [pygame] Unexpect blit behavior when using BLEND_ADD



Marcus von Appen wrote:
On, Wed Apr 16, 2008, Lenard Lindstrom wrote:

I was trying out BLEND_ADD with blit to see if an alpha plane could be added to a surface with alpha's zero. Here is the trial session:
[...]

Both surfaces contain alpha, so only alpha blending will be applied. The
BLEND_* args only work for cases where alpha blending cannot be
applied.
Should we change this to take alpha into account for the BLEND_* args as
well and only apply the default alpha blending, if no BLEND_* args are
passed?

The documentation is vague on this. It just says that BLEND_ flags are optional. Nothing is mentioned about them being ignored. For alpha surfaces a blend may be useful for doing shadow effects. Such effects require extracting and altering the alpha plane. Want to make a shadow for antialiased text. Extract the alpha and apply to an all black surface. Right now surfarray must be used to do this in a practical way. Otherwise it would have to be done per-pixel with get_at/set_at.

--
Lenard Lindstrom
<len-l@xxxxxxxxx>