‘Smooth’ control points in curves aren't truly smooth
Environment/Versions
- GIMP version: 2.10.34
- Package: Any
- Operating System: All
This is a rather subtle problem but it might be important in some situations. Description of the bug
When using the Curves dialog in ‘Smooth’ mode, the curve may have discontinuities around smooth control points. In 8-bit mode this is usually not noticeable, but when editing images at higher bit depths, there can be noticeable peaks and gaps in the intensity histogram after applying the curve. These may become visible in the image as banding in smooth gradients.
Reproduction
Is the bug reproducible? Always
Reproduction steps:
- Open the attached 16-bit gradient image. Gradient16bit.xcf
- Open the Curves dialog and import one of the attached curves files. curves.tgz
- Apply the curve and re-open the Curves dialog, look at the histogram.
Expected result: the histogram is smooth.
Actual result: the histogram has peaks and dips at the locations of the control points.
Additional information
The peaks and gaps will vary as the control points are moved around. With a lot of trial-and-error, the discontinuities can be avoided.
I suspect that the root cause might be that part of the curves dialog implementation still assumes 256 intensity levels, which is why the curve can be seen jiggling up and down at one side of the nearest other control points while dragging around a control point in between those other points. Looks like some variables might need to be upgraded from chars to floats. But, this is just a hunch…