View Full Version : pixelpushing: how to alphablend two alpha channels?

10 October 2003, 02:29 PM
Hey folks,

I'm just fiddling around, creating a 2D graphics lib under Windows based on 32-Bit DIBs.
I'll make it short - I want to alpha blend a new pixel with an underlying pixel.

I've actually already written that routine, but there's following problem. The underlying pixel already has it's own alpha value and there's another "Master-Alpha" value, which is supposed to generally determine the transparency of all drawing functions.

I guess I need to adjust the "new pixel's" alpha value according to the master alpha value and then blend this result together with the alpha value of the underlying pixel... but how?

I'm braindead when it comes to maths and the invaluable google groups search is currently down :annoyed:

I'd appreciate any kind of help and hints,

Thanks in advance :)

10 October 2003, 04:19 AM
This really depends on what blend mode you're trying to do but typically alpha channels aren't alpha blended they are simply additive.

CGTalk Moderation
01 January 2006, 10:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.