I\'m looking for a formula to convert them.
I know to convert a general transparency it is
alpha * new + ( 1 - alpha ) * old
I have:
It appears that your formula is precisely the formula used in your examples, calculated per component, and rounded up.
R_c := ceiling(R_a * alpha) + ceiling (R_b * (1 - alpha))
G_c := ceiling(G_a * alpha) + ceiling (G_b * (1 - alpha))
B_c := ceiling(B_a * alpha) + ceiling (B_b * (1 - alpha))
Strange, though, the R component doesn't appear to follow the rules. I'm inclined to wonder why.