Photoshop: Invert curves - Why doesn't it work?

  • 1
  • Question
  • Updated 6 years ago
  • (Edited)
It's easy, I add a curve adjustment layer and add a knot with input 120 output 150.
Now the values at 120 will be 150 and values around adapted to it

Now I do the reverse, add on top another curve adjustment layer, input 150 output 120. This should undo the aforementioned process yet result is very different from original, and I'm not talking about quantization, the actual algorithm differs (knots tension)

Please check both images:


Photo of pedro picapiedra

pedro picapiedra

  • 26 Posts
  • 0 Reply Likes
  • frustrated

Posted 6 years ago

  • 1
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 813 Reply Likes
First, those curves don't look remotely like the inverse of one another.

Second, you're dealing with spline interpolation of the points, and it won't be exact except for the points you set.

Third, yeah, quantization is going to make it impossible to get an exact inverse.
Photo of pedro picapiedra

pedro picapiedra

  • 26 Posts
  • 0 Reply Likes
First, those curves don't look remotely like the inverse of one another.

Yes I know, that's what I'm asking.

I can accept small deviations due to in-range clipping or quantization, but not a random interpretation of an algorithm.

It's easy please test yourself, do a process.

Curve layer input:195 output:245 you get a nice curve
Curve layer input:245 output:195 totally different (straight down), despite the knot placement is exactly the same as above, just in another axis.

That's the concept right?
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 813 Reply Likes
No, the curves you show do not look like inverses, due to the points you entered.

There is nothing random, just spline interpolation of the points you enter.

Yes, entering a few points may result in different curves because it is interpolated as splines -- the splines do not necessarily invert. To behave as you seem to be requesting, Photoshop would have to calculate the inverse itself, or use linear interpolation to avoid the splines.
Photo of pedro picapiedra

pedro picapiedra

  • 26 Posts
  • 0 Reply Likes
And what's the point of using splines?
What logical thinking should I take to make inverting a curve more predictable?

Just an example, what's the inverse of the curve described by the point x: 100 y:150?
In this case is there a one knot solution to inverse the curve using a function (for the calculation) or something?
Photo of christoph pfaffenbichler

christoph pfaffenbichler, Champion

  • 1208 Posts
  • 166 Reply Likes
»What logical thinking should I take to make inverting a curve more predictable?«
May I ask why you need to invert the Curve in the first place?
Photo of pedro picapiedra

pedro picapiedra

  • 26 Posts
  • 0 Reply Likes
Many reasons, the proper answer should be "why not?"
In this case I just had a mistake cloning out dust on a layer over an underexposed curve adjustment layer (to see artifacts better), where it should have been below the adjustment layer, or with the "ignore adj layers" option turn on.
Normally I'd like to invert curves as a manual profile substitution.
Photo of christoph pfaffenbichler

christoph pfaffenbichler, Champion

  • 1208 Posts
  • 166 Reply Likes
I can certainly see how such touch up Layer mix ups can happen; I guess somebody with better math-skills than me might be able to use the »Draw to modify the curve«-mode to create a »point-by-point«-inverted version of a Curve via a Script.

In any case I guess your original assumption was identical directional behaviour of x- and y-axis changes (basically the 45 ̊ angle working like a mirror axis) – an assumption that you have disproved with your example.

For many of us Photoshop-users Curves have been a useful tool for our whole (or at least considerable parts of our) professional careers – so I guess we are accustomed to their behaviour and don’t expect it to be different.
Photo of pedro picapiedra

pedro picapiedra

  • 26 Posts
  • 0 Reply Likes
Please, can someone explain me why doesn't it work?
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 813 Reply Likes
We already did that.
Photo of pedro picapiedra

pedro picapiedra

  • 26 Posts
  • 0 Reply Likes
Yes, from a technical point of view ("we used splines")
but not from a power user point of view.

Please explain us what is so good about using splines that it's better than switching to linear or cubic interpolation and do all the stuff we imagine.

No complaining, just trying to take something positive from the discussion and not a plain "NO".
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 813 Reply Likes
The splines don't reflect, and won't give a mathematically inverted curve (especially with only 2 points specified).

Splines are cubic interpolation, and give smooth curves based on a few control points.

Linear interpolation of the points would give you invertible lines, but would not be smooth (not useful for most imaging).

To get a perfectly inverted curve you'd probably have to write code to create the curves, or use the freehand (pencil) mode and draw lines yourself.
Photo of pedro picapiedra

pedro picapiedra

  • 26 Posts
  • 0 Reply Likes
I see so indeed is for smooth transfers, I was a bit lost because in another application I use, cubic interpolation is being used and it's 100% reversible as you see in the images. Probably this is a no spline cubic, right?

Well thanks for the answers and consider something to get around this in future versions.



Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 813 Reply Likes
That looks like they used a different spline function. But I'm still not sure how they got a good inverse even with a different spline basis (because normally they won't give a good inverse).
Photo of pedro picapiedra

pedro picapiedra

  • 26 Posts
  • 0 Reply Likes
Yes, overlaying them I can see they are not 100% exact, either the first one is 100% the same as photoshop's, but well...