[PD] Gem: alpha blending without loss of brightness

Georg Holzmann grh at mur.at
Wed Jan 23 17:33:58 CET 2008


Hallo!

I have again a basic alpha blending problem, where I don't find a solution:

For example I have two images (A + B), which are overlapping at a small 
part (C):

----------------
| image A      |
|              |
|          |------------------
|          | C |             |
-----------|----             |
            |                 |
            |  image B        |
            -------------------

Now I want that image A and image B looks normal (unchanged) and in the 
overlapping part the two images are added so that one sees both - and 
all this with openGL commands (not pix_add or similar, because I have 
lots of such regions).

OK, I gave all images an alpha value of 0.5, but then the whole image 
losses brightness.

So my question: is there a way to get this alpha blending and without a 
loss of brightness in the images ? or can I "renormalize" this effect 
somehow (re-increase the brightness) ?
(see attached patch where I illustruted this problem with 2 colored 
rectangles)

Thanks for any hint,
LG
Georg
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: alphablend.pd
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20080123/9b6e6b45/attachment.asc>


More information about the Pd-list mailing list