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
#N canvas 545 0 684 281 10;
#X obj 27 140 gemwin;
#X msg 44 71 create \, 1;
#X msg 47 102 destroy;
#X obj 161 205 rectangle 2 1;
#X obj 162 71 gemhead;
#X obj 163 107 colorRGB 1 0 0 0.5;
#X floatatom 267 61 5 0 0 0 - - -;
#X obj 466 204 rectangle 2 1;
#X obj 467 74 gemhead;
#X floatatom 574 70 5 0 0 0 - - -;
#X obj 163 178 alpha;
#X obj 467 176 alpha;
#X obj 161 141 translateXYZ -1 0 0;
#X obj 469 136 translateXYZ 1 0.2 0;
#X obj 469 104 colorRGB 0 1 0 0.5;
#X text 260 26 when you change these alpha values here \, also the
colors of the non-overlapping region change:;
#X connect 1 0 0 0;
#X connect 2 0 0 0;
#X connect 4 0 5 0;
#X connect 5 0 12 0;
#X connect 6 0 5 4;
#X connect 8 0 14 0;
#X connect 9 0 14 4;
#X connect 10 0 3 0;
#X connect 11 0 7 0;
#X connect 12 0 10 0;
#X connect 13 0 11 0;
#X connect 14 0 13 0;
_______________________________________________
[email protected] mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list

Reply via email to