8

I am trying to create a gradient that when flipped and overlayed on itself will show a solid color.

I thought I would make it with a regular solid-to-transparent gradient on Photoshop, and save it as PNG, but when superimposed on one another, it still shows some transparency.

I tried to do it inside Photoshop and the same experiment with regular layers that had 50% opacity does not show the solid color (i.e. it does not "kill" the transparency).

What am I missing?

osadezu
  • 85
  • 1
  • 6

2 Answers2

5

The opacity is a multiplier. Assume:

  • Layer 1 opacity = 50%
  • Layer 2 opacity = 50%
  • Layer 3 opacity = 50%

Net opacity = Layer1 + (Layer2 * Layer1) + (Layer3 * Layer2 * Layer1)

Or, 50% + 25% + 12.5%. You would mathematically never get to 100%.

Andrew Vit
  • 1,050
  • 3
  • 10
  • 20
  • The related function is `f(x) = 2^-x`. As `x` approaches infinity, `y` approaches `0`. So, in our case, the transparency would never cancel out (be zero). – iglvzx Dec 01 '11 at 08:35
4

The way I look at it, each layer lets 50% of the light through... you don't get 100% with it.

It's like the weatherman saying there's a 50% chance of rain on Saturday and on Sunday, and concluding that it must rain sometime during the weekend. Obviously it doesn't mean that. :-)

user541686
  • 23,663
  • 46
  • 140
  • 214
  • 3
    That sounds right. The first layer lets through 50% of the light. The second layer lets through 50% of remaining light. Result: 25% of the light gets through. (I'm not a Photoshop user, but if its layers emulate real-world physics, that's how I'd expect them to behave.) – Keith Thompson Dec 01 '11 at 05:10
  • Hey thanks, I think that's it. "50% of 50% is not 0". So, any ideas how I might be able to create that gradient that flipped makes the solid color? – osadezu Dec 01 '11 at 05:19
  • @Ozkar: I think I figured it out: Check out the *Subtract* "Mode" above the *Layers* tab. Make the upper layer subtract from the lower layer (which is normal), and you should be able to get something working after playing around with it. – user541686 Dec 01 '11 at 05:24
  • Mmmh... I'm on CS3, I can't find 'Subtract', I tried 'Difference' and 'Exclusion' and none seem to get me near there. :S (I want a pixel-perfect solution, because if I try to make it aprox, by looking at it I will mess it up hehe. – osadezu Dec 01 '11 at 05:41
  • 1
    Your weather example is misguided. If the two days were independent, the probability of rain for the weekend would be `25%`. – iglvzx Dec 01 '11 at 08:13
  • 1
    @iglvzx: Wait, what? I think you misunderstood. I meant that he can't conclude it must rain *sometime* during the weekend, not the *entire* weekend. I'll clarify it. – user541686 Dec 01 '11 at 08:56