# Combining transparency

A 50% opaque white object put on top of another 50% opaque white object is not anywhere near as white as a 100% opaque white object (blending mode normal). I tried this in Illustrator and Inkscape, and the results seem to be similar, so my question is: how are overlapping transparencies calculated? Is there a way to force either to use simple addition (30% opaque on top of 20% opaque = 50% opaque)?

• There is the additive blend mode. May 8 '17 at 14:07
• Oh, wonderful! Thank you very much. I don't seem to be able to find it in AI but it is there in PS and gives almost the result I want. Many thanks! May 9 '17 at 17:35
• About alpha blending I'm afraid it is not possible to change the behaviour, but if you want a blending mode where `#777777` + `#888888` = `#ffffff`, in Gimp 2.10 you can achieve that using the legacy "addition" blend mode documented here: docs.gimp.org/en/gimp-concepts-layer-modes.html Dec 12 '18 at 16:35

Let the 2 otherwise identical layers have opacities 80% and 40%.

Represent the opacities as decimal numbers ie. 0,8 for 80% and 0,4 for 40%

The combined opacity as decimal number is 1 - (1-0,8)*(1- 0,4) = 1 - 0,2 * 0,6 = 1 - 0,12 = 0,88

As percentage that is 88%

The general formula for combining opacities A and B as decimal numbers:

Opacity = 1 - (1 -A)*(1 - B)

This is easy, if one thinks 1-A and 1-B as "transparencies". The combined transparency is calculated by multiplying the single layer transparencies. The opacity is = 1 - the transparency.

Your example: A=0,3 and B=0,2. The transparencies are 0,7 and 0,8

The combined opacity is 1 - 0,7 * 0,8 = 1 - 0,56 = 0,44 = 44%

ADDENDUM: The questioner wanted a way to force the combined opacity to be the sum of single layer opacities. This unfortunately is impossible. Let the layer opacities be 60% and 70%. We have no way to make something to have 130% opacity. 100% is the maximum. Nothing can be less transparent than the absolutely non-transparent.

If one has the single layer opacity = A (decimal) and wants to pile these layers to get the combined opacity = C, he needs log(1-C)/log(1-A) layers.

• Many thanks for this explanation! Do you happen to know the answer to my second question: is there a way to enforce simple addition? Alternately, how can I count the number of overlapping objects at each point? May 7 '17 at 22:15