G'MIC has a built in spline-based plotting command, -function1d, which furnishes a basis for ramps of arbitrary character. In isolation, the command generates images only one pixel high, which seems disappointing, until one reaches into the toolkit again and fetches out -expand_y, so we may grow the ramp readily in the transverse direction.
The command's first parameter is a 'stiffness' value, ranging from zero to one. When zero, G'MIC makes no attempt to transition values. When one, the transitions will be continuous to a high degree. The remaining parameter list may be arbitrarily long but divisible by two. These are abscissa (x) ordinate (y) pairs. The abscissa are non-negative and form a strictly ascending sequence, but need not be uniformly spaced. The ordinates may assume zero, positive or negative values of any magnitude. The difference between the first and last abscissa establishes the width of the image; the height is one pixel. -expand_y h/2
sets the desired height, h
. Observe the division by two. This curious step arises from -expand_y growing the image from the middle to both ends. From the command's viewpoint, it is expanding out a top and bottom edge.
#First parameter sets smoothness; zero \ |
General Ramps | Applying a Curve |