Applying a Curve

-apply_curve bears a parametric resemblance to -function1d in that the two parameter sets behave the same way, and a functional resemblance to Gimp's curve tool, in that it remaps a range of intensities to new values. If you start with a linear ramp, such as 256,256,1,1,'x' and follow it with -apply_curve with a particular set of parameters, the results are the same as if you had started with -function1d and those same parameters, extending with -expand_y. With -apply_curve, you are not restricted in your mathematical expressions. You may orient a linear ramp at 27° and then remap with -apply curve.



# Angle a beam of light 27 deg. off vertical.\
gmic ang='{pi*27/180}' \
  256,256,1,1,'x*cos($ang)+y*sin($ang)' \
  -apply_curve 1,0,0,63,32,127,255,191,32,255,0

One Dimensional Functions Remapping Space