5.5-rc1 curve behaviour

It seems the new curve algorithm can behave in unexpected ways:
Screenshot%20from%202018-12-05%2018-41-05
By setting just a single point, it is possible to create the step behaviour shown.
Somehow I like the idea of the new curves - but this version needs more control points to create a simple smooth round curve. (Even if the control point is in the middle it tends more towards two straight lines meeting in the middle.)

conflicting
It does let me add points to where I think the curve is supposed to be!

Looks like a bug when more than one curve point is at y = 0.
Ping @agriggio

Sounds like a bug in the GUI though, given what @HIRAM demonstrated (i.e. the curve seems to be computed correctly).

Anyway:

I hope this will make people happy.

3 Likes

And hereā€™s the same thing with the old cubic splines:
52

2 Likes

@agriggio Imho no need to fix it for 5.5 release!

2 Likes

If you are talking about the GUI bug, I definitely agree (I had no intention of fixing it, in fact :slight_smile:

However, restoring the old curve behaviour is now or never IMHO. It doesnā€™t make sense to remove it for 5.5 and add it back for 5.6.

1 Like

Does restoring the old behaviour mean we will not have the new curve behaviour?

No, weā€™ll have both (just try the PR mentioned above):
24

1 Like

Iā€™m happy, thanks.
All, a note about the old methodā€¦ There have been several comments about adding/changing a point having a ā€œglobalā€ effect which means other parts of the curve change. There is a simple workaround if you donā€™t want that. Simply have two points fairly close together and this acts as a clamp. That is, moving the curve on one side of the clamp has negligible effect on the curve thatā€™s on the other side of the clamp. A second point can be easily added close to an existing one by placing it with CTRL + mouse click - it will jump exactly onto the curve. So the old curve can be nice and smooth if you want that. Or by placing more points, you can imitate the more ā€œlocalā€ behaviour of the new curve.

1 Like

Question: Which curve is used by the Auto-Matched Tone Curve, new or old?

new

Which means that you have to move two points when you want to change the curve in that region. Makes it more difficult to immediately see the result. Also you can easily delete a node if you drag one node over the other.

This is true. But once youā€™ve dragged one away, then you immediately see the result as you move the remaining one. It takes me a while to do a curve so having to do this removing thing once or twice isnā€™t much of an overhead for me.

Sorry for the late input, just got back from the woodsā€¦

Iā€™ve considered this in my software, and Iā€™ve come to the conclusion that Iā€™m wedded to Tino Kludgeā€™s spline algorithm until the heat death of the universe. The spline algorithm that forms the foundation of a curve tool really becomes the basis of the image manipulation with respect to determining input->transform->output, and changing it renders a good many curves as defined by a set of control points based on the previous spline as plain wrong.

I explored a more ā€˜localā€™ spline algorithm, but abandoned the effort when i realized 1) the legacy of control point lists I already had, and 2) I can make my Tino Kludge spline be local, but I canā€™t make a local algorithm easily provide the sweeping curves that distort my image tones less than, say, a lift in one area that then produces a relatively flat slope that really distorts the tones of a particular band.

I do a good bit of what Andrew describes, using two close points to anchor the remaining slope. Works for meā€¦

1 Like

Hmm, those zeros are from rtengine::DiagonalCurve::getVal() which is not GUI specific as far as I can tell.

1 Like

Youā€™re right, I was a bit too quick in dismissing this. Iā€™ll take a look when time permits :+1:

@agriggio Alberto, I think I found the culprit: Itā€™s the special case for 0 and 1. Though I donā€™t know how to fix thatā€¦

1 Like

yes, Iā€™m working on itā€¦ thanks for the hint!

Hereā€™s the patch. Iā€™ll push later today

diff --git a/rtengine/diagonalcurves.cc b/rtengine/diagonalcurves.cc
--- a/rtengine/diagonalcurves.cc
+++ b/rtengine/diagonalcurves.cc
@@ -326,6 +326,9 @@
     if (p1_y == p2_y && (p1_y == 0 || p1_y == 1)) {
         for (i = 1; i < n_points-1; ++i) {
             t = p1_x + space * i;
+            if (t >= p2_x) {
+                break;
+            }
             res_x.push_back(t);
             res_y.push_back(p1_y);
         }
2 Likes