Conjuring Images out of the Aether and Other Generators
Typically, images arrive at the pipeline by way of the
input command or as an output of some transformative command. To this, one may also conjure images out of the aether, using specialized variations of the
input command.
Conjuring images from the aether is fairly straightforward. One writes a series of as many as four integer parameters, spatial dimensions, separated by commas, with no embedded white space. The four numbers represent the width, height, depth and spectral dimensions of an image, like so:
$ gmic 1036,850,1,3 print
[gmic]./ Start G'MIC interpreter (v.3.3.6).
[gmic]./ Input black image at position 0 (1 image 1036x850x1x3).
[gmic]./ Print image [0] = '[unnamed]'.
[0] = '[unnamed]':
size = (1036,850,1,3) [10.1 Mio of float32].
data = (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, ... ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0).
min = 0, max = 0, mean = 0, std = 0, coords_min = (0,0,0,0), coords_max = (0,0,0,0).
[gmic]./ End G'MIC interpreter.
which will produce an image 1036 pixels wide, 850 pixels high, one pixel deep, with a spectral dimension of three channels; it will be black unless one writes an optional fifth parameter, a mathematical script that defines image content procedurally. The tutorial on image ramps and the
input command itself have examples of procedural image definitions. The four dimensions will conjure an image out of the aether, ready to be transformed by some follow-on command, typically a generator like
plasma or
noise.
Not all dimensions need to be furnished; omitted dimensions default to one. So:
$ gmic 100 print
[gmic]./ Start G'MIC interpreter (v.3.3.6).
[gmic]./ Input black image at position 0 (1 image 100x1x1x1).
[gmic]./ Print image [0] = '[unnamed]'.
[0] = '[unnamed]':
size = (100,1,1,1) [400 b of float32].
data = (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0).
min = 0, max = 0, mean = 0, std = 0, coords_min = (0,0,0,0), coords_max = (0,0,0,0).
[gmic]./ End G'MIC interpreter.
produces a 100x1x1x1 image. The special form
$ gmic 0 print
[gmic]./ Start G'MIC interpreter (v.3.3.6).
[gmic]./ Input empty image at position 0 (1 image 0x0x0x0).
[gmic]./ Print image [0] = '[empty]'.
[0] = '[empty]':
size = (0,0,0,0) [0b of float32].
data = ().
[gmic]./ End G'MIC interpreter.
produces an empty image where all dimensions are zero. If output, the resulting file will have zero bytes. This special case primarily serves scripts that may be generating images dynamically; the zero dimensioned image serves as a boundary case that can trigger a loop exit.
Images may also be conjured up from other images by way of selections, image indices appearing within square braces. This is an implied copy command; it places the copied images at the end of the pipeline.
Updated: 07-May-2023 21:10 UTC Commit: 79f1223f76abc9d217cab05bf38ca89560b76ee6