-
Alpha merged, Maths, and tricks
Hello all,
I’ve been trying to get afx to realize an idea i had a few days ago
basically, if you think about it, if you have 2 images linearly alpha mixed
and that you know one of the original images, you can find out the 2nd image(with a precision loss, since you miss some of the info(1channel+1/2channel < 2 channels). Mathematically it goes like that if x(i) is the original pic, and x'(i) the new pic and y(i) was the alpha merged pic with alpha=c then x'(i)=c*x(i)+(1-c)*y(i) and by consequence, y(i)=(x'(i)-c*x(i))*1/(1-c) All of this is pretty simple... now the thing is how to do it properly in afx.... the biggest problem is the - function, since afx only has(but maybe i missed something) an absolute difference operator(the difference mode)... As for multiplications, they can be handled by the contrast operator. Of course you get tons of clipping problems everywhere, and ideally one would need to do all calculations in a single function with more precision.... So far i've been getting result that look okay, but with really funky processes and lots of lost info... So, if someone has an idea, please let me know, thanks, Paul-Kenji Cahier