Variant 1: Pure LC Script, use it best with LC 6 (slow with LC 8/9).
Variant 2: Uses JS in a (hidden) browser widget for use with LC 8/9.
Variant 1 runs on Mac/ Win 7+10/ linux 32bit with LC 6/7/8/9 and Raspi 6/7.
Variant 2 runs on Mac/ Win 7+10/ Ubuntu 64bit with (latest) LC 8/9.
A tone curve has to map each of the color values 0-255 of your image to a
value in range 0-255. Some well known image processing apps use internally
for setting saturation, brightness or gamma also such curves.
You can set the tone curve
= by an editable formula or
= by 2 up to 9 handles (control points) that determine either,
... a polygon chain (linear pieces between the control points),
... a bezier curve of order 1=linear, 2= square ... up to order 8
(usually most control points are not on the curve),
... a natural spline curve (control points are on the curve),
... a clamped spline curve (control points are on the curve).