Original Post
Hi,
I''m trying to manually merge two images with alpha transparency, but I can''t come up with a formula that looks good.
I''ve got as far as
R = Rs*(1-An) + Rn*An
G = Gs*(1-An) + Gn*An
B = Bs*(1-An) + Bn*An
where Rs,Gs,Bs are the colurs of the bottom image and Rn,Gb,Bn are the colours of the top image. An is the alpha value (0..1) for the top image. This works fine, but I can''t get a formula to give me a final alpha for the combined image. What should the alpha value be for two pixels with 0.5 as their alpha value? What about 0.75 and 0.3?
Any help would be apprciated,
Andrew