Input and Fill

G'MIC can make ramps procedurally as a part of image specifications (<width>, <height>, <depth>, <channels>, <procedure>). These fall under the rubric of the -input command.

#horizontal ramp \
gmic 256,256,1,1,'x' -normalize 0,255
#vertical ramp
gmic 256,256,1,1,'y' -normalize 0,255
# ramp along any orientation (30 deg or \
# 0.5236 rads shown.) \
gmic \
 256,256,1,1,'x*cos(0.5236)+y*sin(0.5236)' \
 -normalize 0,255

In the preceding snippets, G'MIC evaluates the fifth parameter, <procedure>, as a G'MIC mathematical expression, described in Section 1.8 of The Handbook. These expressions run pixel-by-pixel, presets like 'x' and 'y' are set to the current column and row, and the pixel at 'x' and 'y' is assigned the results. For a simple expression like 'x', G'MIC assigns the value of the current column to the pixel's intensity and – voilà! – a horizontal ramp is born.

Ramps, a. k. a. “Gradients” Warp