If I want to display one uniformly semi-transparent image, and then 'fade out' this image, gradually replacing it with another of the same transparency, while maintaining the combined transparency at a constant level during the transition, how do I determine what transparency to draw the images?
By trial and error - drawing transparent images of various alphas on top of each other - I've come up with the graph below, showing transparency of image A on one axis and transparency of image B on the other. The 'isoalpha' lines show combinations of alpha that result in the same alpha all the way along the line. Each line is for a different level of alpha, with fully transparent at the top-left.
You can see that the formula I'm looking for is not a straight linear transition with alphaA + alphaB == alphaTarget.
What's the mathematical formula I am looking for?
X axis - alpha of image B (0-255 l-r). Y axis - alpha of image A (0-255 downwards).