G'MIC - GREYC's Magic for Image Computing: A Full-Featured Open-Source Framework for Image Processing
GREYC CNRS ENSICAEN UNICAEN

A Full-Featured Open-Source Framework for Image Processing



Latest stable version: 3.4.3 (2024/10/11)

Reference

Table of Contents  ▸  Input Data◀  Items of a Processing Pipeline    |    Command Items and Selections  ▶

Input Data

If a specified G'MIC item appears to be an existing filename, the corresponding image data are loaded and inserted at the end of the image list (which is equivalent to the use of input filename).
Special filenames - and -.ext stand for the standard input/output streams, optionally forced to be in a specific ext file format (e.g. -.jpg or -.png).
The following special input strings may be used as G'MIC items to create and insert new images with prescribed values, at the end of the image list:
[selection] or [selection]xN: Insert 1 or N copies of already existing images. selection may represent one or several images (see section Command Items and Selections to learn more about selections).
width[%],_height[%],_depth[%],_spectrum[%],_values[xN]: Insert one or N images with specified size and values (adding % to a dimension means "percentage of the size along the same axis", taken from the last image [-1]). Any specified dimension can be also written as [image], and is then set to the size (along the same axis) of the existing specified image [image]. values can be either a sequence of numbers separated by commas ,, or a mathematical expression, as e.g. in input item 256,256,1,3,[x,y,128] which creates a 256x256 RGB color image with a spatial shading on the red and green channels. (see section Mathematical Expressions to learn more about mathematical expressions).
(v1,v2,..[:delimiter | axis_order])[xN]: Insert one or N new images from specified prescribed values. Value separator inside parentheses can be , (column separator), ; (row separator), / (slice separator) or ^ (channel separator). For instance, expression (1,2,3;4,5,6;7,8,9) creates a 3x3 matrix (scalar image), with values running from 1 to 9.
('string'[:delimiter])[xN]: Insert one or N new images from specified string, by filling the images with the character codes composing the string. When specified, delimiter tells about the main orientation of the image. Delimiter can be x (eq. to , which is the default), y (eq. to ;), z (eq. to /) or c (eq. to ^). When specified delimiter is ,, ;, / or ^, the expression is actually equivalent to ({'string'[:delimiter]})[xN] (see section Substitution Rules for more information on the syntax).
0[xN]: Insert one or N new empty images, containing no pixel data. Empty images are used only in rare occasions.

Input item name=value declares a new variable name, or assign a new string value to an existing variable. Variable names must use the character set [a-zA-Z0-9_] and cannot start with a number.
A variable definition is always local to the current command except :
When it starts by the underscore character _. In that case, it becomes also accessible by any command invoked outside the current command scope (global variable).
When defined in a subcommand of the current command, a variable becomes also accessible in the parent command. A subcommand of a command foo is a command whose name starts with __foo_ (e.g. __foo_sub) and that is called from foo.
If a variable name starts with two underscores __, the global variable is also shared among different threads and can be read/set by commands running in parallel (see command parallel for this purpose). Otherwise, it remains local to the thread that defined it.
Numerical variables can be updated with the use of these special operators: += (addition), -= (subtraction), *= (multiplication), /= (division), %= (modulo), &= (bitwise and), |= (bitwise or), ^= (power), <<= and >> (bitwise left and right shifts). For instance, foo=1 foo+=3.
Input item name.=string appends specified string at the end of variable name.
Input item name..=string prepends specified string at the beginning of variable name.
Multiple variable assignments and updates are allowed, with expressions: name1,name2,...,nameN=value or name1,name2,...,nameN=value1,value2,...,valueN where assignment operator = can be replaced by one of the allowed operators (e.g. +=).
Variables usually store numbers or strings. Use command store to assign variables from image data (and syntax input $variable to bring them back on the image list afterwards).

◀  Items of a Processing Pipeline    |    Command Items and Selections  ▶
G'MIC - GREYC's Magic for Image Computing: A Full-Featured Open-Source Framework for Image Processing

G'MIC is an open-source software distributed under the CeCILL free software licenses (LGPL-like and/or
GPL-compatible). Copyrights (C) Since July 2008, David Tschumperlé - GREYC UMR CNRS 6072, Image Team.