Page 1 of 1

De-alpha blending

Posted: 2013-08-23T03:56:26-07:00
by thefcpk
Hi all,

I have found that a couple of my pictures I usually put a watermark on... well I only have the watermarked version now.(but in quite high quality so noise won't be a huge issue)
I have the overlay that went on them, and I know the alpha blending value.
Since alpha blending is quite simple mathematically: result=alpha*overlay+(1-alpha)*original
This means to precision/rounding/errors, you can still get original = result * 1/(1-alpha) + overlay * alpha / (1 - alpha)
This is especially true in my case since the alpha value is fairly low, so there won't be huge errors.

I can not find any way to do any custom formula/use existing ones to do that.
Any ideas?

Re: De-alpha blending

Posted: 2013-08-23T04:34:41-07:00
by thefcpk
and since I found a solution:
convert source.png logo.png -fx "(u-v*0.25)/(1-0.25)" original.png
(alpha=0.25 here)

:)