2

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. – joojaa 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! – Kamil S. 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 – etuardu Dec 12 '18 at 16:35
2

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? – Kamil S. May 7 '17 at 22:15
  • @KamilS. added the 2nd answer – user287001 May 7 '17 at 22:28
  • Thank you. Of course, >100% makes no sense. What I want is for fifty 1% layers to have the combined opacity of 50% so as to count the number of layers by just looking at the resulting opacity. Too bad this isn't possible. – Kamil S. May 8 '17 at 7:01
1

Think of transparency as light shining through.

The first layer absorbs 50% of the light, 50% comes through. So now from the remaining light, 50% will pass through the second layer, which is 25% from the original amount.

(While the formulars of user287001 are fine, I think the explanation is too complicated.)

  • Thank you, this is indeed much easier to wrap one's head around! – Kamil S. May 9 '17 at 17:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.