1G'MIC(1)                    General Commands Manual                   G'MIC(1)
2
3
4

NAME

6       gmic - Perform image processing operations using the G'MIC framework.
7
8

HELP

10         gmic: GREYC's Magic for Image Computing: command-line interface
11               Version 2.9.4
12               (https://gmic.eu)
13
14               Copyright (c) 2008-2020, David Tschumperlé / GREYC / CNRS.
15               (https://www.greyc.fr)
16
17         1. Usage
18            -----
19
20           gmic [command1 [arg1_1,arg1_2,..]] .. [commandN [argN_1,argN_2,..]]
21
22         gmic  is the open-source interpreter of the G'MIC language, a script-
23       based programming language
24         dedicated to the design of possibly complex  image  processing  pipe‐
25       lines and operators.
26         It  can  be  used  to convert, manipulate, filter and visualize image
27       datasets made of one or several
28         1D/2D or 3D multi-spectral images.
29         This reference documentation describes all the technical  aspects  of
30       the G'MIC framework, in its
31         current version 2.9.4.
32         As  a  starting  point,  you  may want to visit our detailed tutorial
33       pages, at:
34         https://gmic.eu/tutorial/
35
36         2. Overall Context
37            ---------------
38
39         * At any time, G'MIC manages one list  of  numbered  (and  optionally
40       named) pixel-based images,
41         entirely stored in computer memory (uncompressed).
42
43         *  The first image of the list has index '0' and is denoted by '[0]'.
44       The second image of the list
45         is denoted by '[1]', the third by '[2]' and so on.
46
47         * Negative indices are treated in a periodic way:  '[-1]'  refers  to
48       the last image of the list,
49         '[-2]'  to  the penultimate one, etc. Thus, if the list has 4 images,
50       '[1]' and '[-3]' both designate
51         the second image of the list.
52
53         * A named image may be also indicated by '[name]', if 'name' uses the
54       character set [a-zA-Z0-9_]
55         and  does  not  start  with a number. Image names can be set or reas‐
56       signed at any moment during the
57         processing pipeline (see command name for this purpose).
58
59         * G'MIC defines a set of various commands and substitution mechanisms
60       to allow the design of
61         complex  pipelines  and  operators managing this list of images, in a
62       very flexible way: You can
63         insert or remove images in the list, rearrange image  order,  process
64       images (individually or
65         grouped),  merge image data together, display and output image files,
66       etc.
67
68         * Such a pipeline can define a new custom G'MIC command (stored in  a
69       user command file), and
70         re-used afterwards as a regular command, in a larger pipeline if nec‐
71       essary.
72
73         3. Image Definition and Terminology
74            --------------------------------
75
76         * In G'MIC, each image is modeled as a 1D, 2D,  3D  or  4D  array  of
77       scalar values, uniformly
78         discretized on a rectangular/parallelepipedic domain.
79
80         * The four dimensions of this array are respectively denoted by:
81
82           - width, the number of image columns (size along the x-axis).
83           - height, the number of image rows (size along the y-axis).
84           -  depth,  the  number of image slices (size along the z-axis). The
85       depth is equal to '1' for
86         usual color or grayscale 2D images.
87           - spectrum, the number of image channels (size along  the  c-axis).
88       The spectrum is
89         respectively  equal  to  '3'  and  '4'  for  usual RGB and RGBA color
90       images.
91         * There are no hard limitations on the size of the image  along  each
92       dimension. For instance, the
93         number  of  image  slices or channels can be of arbitrary size within
94       the limits of the available
95         memory.
96
97         * The width, height and depth of an image are considered  as  spatial
98       dimensions, while the
99         spectrum  has  a  multi-spectral  meaning.  Thus, a 4D image in G'MIC
100       should be most often regarded as
101         a 3D dataset of multi-spectral voxels. Most  of  the  G'MIC  commands
102       will stick with this idea (e.g.
103         command blur blurs images only along the spatial xyz-axes).
104
105         *  G'MIC  stores  all  the  image data as buffers of float values (32
106       bits, value range
107         '[-3.4E38,+3.4E38]'. It performs all its image processing  operations
108       with floating point numbers.
109         Each  image  pixel takes then 32bits/channel (except if double-preci‐
110       sion buffers have been enabled
111         during the compilation of the software, in which case  64bits/channel
112       can be the default).
113
114         * Considering float-valued pixels ensure to keep the numerical preci‐
115       sion when executing image
116         processing pipelines. For image input/output operations, you may want
117       to prescribe the image
118         datatype  to  be  different  than float (like bool, char, int, etc.).
119       This is possible by
120         specifying it as a file option when using I/O commands. (see  section
121       Input/Output Properties to
122         learn more about file options).
123
124         4. Items of a Processing Pipeline
125            ------------------------------
126
127         *  In  G'MIC, an image processing pipeline is described as a sequence
128       of items separated by the space
129         character. Such items are interpreted and executed from the  left  to
130       the right. For instance, the
131         expression:
132
133           filename.jpg   blur   3,0   sharpen   10  resize  200%,200%  output
134       file_out.jpg
135
136         defines a valid pipeline composed of nine G'MIC items.
137         * Each G'MIC item is a string that is either a  command,  a  list  of
138       command arguments, a
139         filename or a special input string.
140
141         * Escape characters '\fR' and double quotes '"' can be used to define
142       items containing spaces or
143         other special characters. For instance, the two  strings  single item
144       and "single item" both
145         define the same single item, with a space in it.
146
147         5. Input Data Items
148            ----------------
149
150         *  If  a specified G'MIC item appears to be an existing filename, the
151       corresponding image data are
152         loaded and inserted at the end of the image list (which is equivalent
153       to the use of `input
154         filename`).
155
156         *  Special  filenames - and -.ext stand for the standard input/output
157       streams, optionally forced
158         to be in a specific 'ext' file format (e.g. -.jpg or -.png).
159
160         * The following special input strings may be used as G'MIC  items  to
161       create and insert new images
162         with prescribed values, at the end of the image list:
163
164           - '[selection]' or '[selection]xN': Insert 1 or N copies of already
165       existing images. 'selection'
166         may represent one or several images (see section  Command  Items  and
167       Selections to learn more
168         about selections).
169           -  'width[%],_height[%],_depth[%],_spectrum[%],_values[xN]': Insert
170       one or N images with specified
171         size and values (adding '%' to a dimension means "percentage  of  the
172       size along the same axis",
173         taken  from  the  last  image '[-1]'). Any specified dimension can be
174       also written as '[image]', and is
175         then set to the size (along the same axis) of the existing  specified
176       image '[image]'. 'values' can
177         be  either a sequence of numbers separated by commas ',', or a mathe‐
178       matical expression, as e.g. in
179         input item '256,256,1,3,[x,y,128]' which creates a 256x256 RGB  color
180       image with a spatial shading
181         on  the red and green channels. (see section Mathematical Expressions
182       to learn more about
183         mathematical expressions).
184           - '(v1,v2,..)[xN]': Insert one or N new images from specified  pre‐
185       scribed values. Value
186         separator  inside parentheses can be ',' (column separator), ';' (row
187       separator), '/' (slice
188         separator) or  '^'  (channel  separator).  For  instance,  expression
189       '(1,2,3;4,5,6;7,8,9)' creates a 3x3
190         matrix (scalar image), with values running from 1 to 9.
191           -  '('string'[:delimiter])[xN]':  Insert  one  or N new images from
192       specified string, by filling the
193         images with the character codes composing the string. When specified,
194       'delimiter' tells about the
195         main orientation of the image. Delimiter can be 'x' (eq. to ',' which
196       is the default), 'y' (eq. to
197         ';'), 'z' (eq. to '/') or 'c' (eq. to '^'). When specified  delimiter
198       is ',', ';', '/' or '^', the
199         expression  is  actually equivalent to '({'string'[:delimiter]})[xN]'
200       (see section ''Substitution
201         Rules'' for more information on the syntax).
202           - '0[xN]': Insert one or N new empty images,  containing  no  pixel
203       data. Empty images are used
204         only in rare occasions.
205         * Input item 'name=value' declares a new variable 'name', or assign a
206       new string value to an
207         existing variable. Variable names must use the character  set  [a-zA-
208       Z0-9_] and cannot start with a
209         number.
210
211         * A variable definition is always local to the current command except
212       when it starts by the
213         underscore character '_'. In that case, it becomes also accessible by
214       any command invoked outside
215         the current command scope (global variable).
216
217         * If a variable name starts with two underscores __, the global vari‐
218       able is also shared among
219         different threads and can be read/set by commands running in parallel
220       (see command parallel for
221         this purpose). Otherwise, it remains local to the thread that defined
222       it.
223
224         * Numerical variables can be updated with the use  of  these  special
225       operators: '+=' (addition), '-='
226         (subtraction), '*=' (multiplication), '/=' (division), '%=' (modulo),
227       '&=' (bitwise and), '|='
228         (bitwise or), '^=' (power), '<<=' and '>>' (bitwise  left  and  right
229       shifts). For instance, 'foo=1'
230         'foo+=3'.
231
232         *  Input item 'name.=string' concatenates specified string to the end
233       of variable 'name'.
234
235         * Multiple variable assignments and updates are allowed, with expres‐
236       sions:
237         'name1,name2,...,nameN=value'                                      or
238       'name1,name2,...,nameN=value1,value2,...,valueN' where assignment
239         operator '=' can be replaced by one of the  allowed  operators  (e.g.
240       '+=').
241
242         *  Variables usually store numbers or strings. Use command 'store' to
243       assign variables from image
244         data (and syntax input $variable to bring them back on the image list
245       afterwards).
246
247         6. Command Items and Selections
248            ----------------------------
249
250         * A G'MIC item that is not a filename nor a special input string des‐
251       ignates a 'command' most of the
252         time. Generally, commands perform image processing operations on  one
253       or several available images of
254         the list.
255
256         *  Reccurent  commands  have  two  equivalent  names  ('regular'  and
257       'short'). For instance, command names
258         'resize' and 'r' refer to the same image resizing action.
259
260         * A G'MIC command may have mandatory or optional  arguments.  Command
261       arguments must be specified
262         in the next item on the command line. Commas ',' are used to separate
263       multiple arguments of a
264         single command, when required.
265
266         * The execution of a G'MIC command may be restricted only to a subset
267       of the image list, by
268         appending  '[selection]'  to the command name. Examples of valid syn‐
269       taxes for 'selection' are:
270
271           - 'command[-2]': Apply command only on the penultimate image '[-2]'
272       of the list.
273           -  'command[0,1,3]':  Apply command only on images '[0]', '[1]' and
274       '[3]'.
275           - 'command[3-6]': Apply command only on images '[3]' to '[6]' (i.e,
276       '[3]', '[4]', '[5]' and
277         '[6]').
278           - 'command[50%-100%]': Apply command only on the second half of the
279       image list.
280           - 'command[0,-4--1]': Apply command only on the first image and the
281       last four images.
282           -  'command[0-9:3]':  Apply  command only on images '[0]' to '[9]',
283       with a step of 3 (i.e. on images
284         '[0]', '[3]', '[6]' and '[9]').
285           - 'command[0-9:25%]': Apply command only on images '[0]' to  '[9]',
286       with a step of 25% (i.e. on
287         images '[0]', '[3]', '[6]' and '[9]').
288           -  'command[0--1:2]': Apply command only on images of the list with
289       even indices.
290           - 'command[0,2-4,50%--1]': Apply command on  images  '[0]',  '[2]',
291       '[3]', '[4]' and on the second
292         half of the image list.
293           -  'command[^0,1]':  Apply  command  on all images except the first
294       two.
295           - 'command[name1,name2]': Apply command on named images 'name1' and
296       'name2'.
297         *  Indices  in  selections are always sorted in increasing order, and
298       duplicate indices are discarded.
299         For instance,  selections  '[3-1,1-3]'  and  '[1,1,1,3,2]'  are  both
300       equivalent to '[1-3]'. If you want
301         to  repeat  a  single  command  multiple  times  on  an  image, use a
302       'repeat..done' loop instead. Inverting
303         the order of images for a command is achieved by explicitly inverting
304       the order of the images in
305         the list, with command 'reverse[selection]'.
306
307         * Command selections '[-1]', '[-2]' and '[-3]' are so often used they
308       have their own shortcuts,
309         respectively '.', '..' and '...'. For instance, command  'blur..'  is
310       equivalent to 'blur[-2]'. These
311         shortcuts work also when specifying command arguments.
312
313         *  G'MIC  commands  invoked  without '[selection]' are applied on all
314       images of the list, i.e. the
315         default selection is  '[0--1]'  (except  for  command  'input'  whose
316       default selection is '[-1]'').
317
318         *  Prepending a single hyphen '-' to a G'MIC command is allowed. This
319       may be useful to recognize
320         command items more easily in a one-liner pipeline (typically  invoked
321       from a shell).
322
323         *  A  G'MIC  command  prepended with a plus sign '+' does not act in-
324       place but inserts its result
325         as one or several new images at the end of the image list.
326
327         * There are two different types of commands that can be  run  by  the
328       G'MIC interpreter:
329
330           -  Built-in  commands  are  the  hard-coded  functionalities in the
331       interpreter core. They are thus
332         compiled as binary code and run fast, most of the time.  Omitting  an
333       argument when invoking a
334         built-in  command is not permitted, except if all following arguments
335       are also omitted. For
336         instance, invoking 'plasma 10,,5' is invalid but 'plasma 10' is  cor‐
337       rect.
338           -  Custom  commands,  are defined as G'MIC pipelines of built-in or
339       other custom commands. They
340         are parsed by the G'MIC interpreter, and thus run a bit  slower  than
341       built-in commands. Omitting
342         arguments  when invoking a custom command is permitted. For instance,
343       expressions flower ,,,100,,2
344         or flower , are correct.
345         * Most of the existing commands in G'MIC are actually defined as cus‐
346       tom commands.
347
348         *  A  user can easily add its own custom commands to the G'MIC inter‐
349       preter (see section  ''Adding
350         Custom Commands'' for more details). New built-in commands cannot  be
351       added (unless you modify the
352         G'MIC interpreter source code and recompile it).
353
354         7. Input/Output Properties
355            -----------------------
356
357         *  G'MIC  is able to read/write most of the classical image file for‐
358       mats, including:
359
360           - 2D grayscale/color files: .png, .jpeg, .gif,  .pnm,  .tif,  .bmp,
361       ...
362           - 3D volumetric files: .dcm, .hdr, .nii, .pan, .inr, .pnk, ...
363           - Video files: .mpeg, .avi, .mov, .ogg, .flv, ...
364           -  Generic  text  or  binary data files: .gmz, .cimg, .cimgz, .dlm,
365       .asc, .pfm, .raw,
366         .txt, .h.
367           - 3D object files: .off
368         * When dealing with color images, G'MIC generally reads,  writes  and
369       displays data using the usual
370         sRGB color space.
371
372         *  G'MIC  is able to manage 3D objects that may be read from files or
373       generated by G'MIC
374         commands. A 3D object is stored as a one-column scalar image contain‐
375       ing the object data, in the
376         following order: { magic_number; sizes; vertices; primitives; colors;
377       opacities }. These 3D
378         representations can be then processed as regular images (see  command
379       split3d for accessing each
380         of these 3D object data separately).
381
382         *  Be  aware  that usual file formats may be sometimes not adapted to
383       store all the available image
384         data, since G'MIC uses float-valued image buffers. For instance, sav‐
385       ing an image that was initially
386         loaded  as  a  16bits/channel  image, as a .jpg file will result in a
387       loss of information. Use the
388         G'MIC-specific file extension .gmz to ensure that all data  precision
389       is preserved when saving
390         images.
391
392         * Sometimes, file options may/must be set for file formats:
393
394           -  Video files: Only sub-frames of an image sequence may be loaded,
395       using the input expression
396         'filename.ext,[first_frame[,last_frame[,step]]]'.                 Set
397       'last_frame==-1' to tell it must be the last
398         frame  of  the video. Set 'step' to '0' to force an opened video file
399       to be opened/closed. Output
400         framerate and codec can be also set by using the output expression
401         'filename.avi,_fps,_codec,_keep_open' where 'keep_open' can be { 0  |
402       1 }. 'codec' is a 4-char
403         string (see http://www.fourcc.org/codecs.php ) or '0' for the default
404       codec. 'keep_open' tells if
405         the output video file must be kept  open  for  appending  new  frames
406       afterwards.
407           -  .cimg[z]  files: Only crops and sub-images of .cimg files can be
408       loaded, using the input
409         expressions    'filename.cimg,N0,N1',    'filename.cimg,N0,N1,x0,x1',
410       'filename.cimg,N0,N1,x0,y0,x1,y1',
411         'filename.cimg,N0,N1,x0,y0,z0,x1,y1,z1'           or           'file‐
412       name.cimg,N0,N1,x0,y0,z0,c0,x1,y1,z1,c1'.
413         Specifying '-1' for one coordinates stands for the  maximum  possible
414       value. Output expression
415         'filename.cimg[z][,datatype]'  can  be used to force the output pixel
416       type. 'datatype' can be { auto
417         | uchar | char | ushort | short | uint | int | uint64 | int64 | float
418       | double }.
419           -  .raw  binary files: Image dimensions and input pixel type may be
420       specified when loading
421         .raw       files       with       input       expression       'file‐
422       name.raw[,datatype][,width][,height[,depth[,dim[,offset]]]]]
423         '.  If no dimensions are specified, the resulting image is a one-col‐
424       umn vector with maximum possible
425         height. Pixel type can also be specified with the  output  expression
426       'filename.raw[,datatype]'.
427         'datatype' can be the same as for .cimg[z] files.
428           -  .yuv files: Image dimensions must be specified when loading, and
429       only sub-frames of an
430         image sequence may be  loaded,  using  the  input  expression  'file‐
431       name.yuv,width,height[,chroma_subsampl
432         ing[,first_frame[,last_frame[,step]]]'. 'chroma_subsampling' can be {
433       420 | 422 | 444 }. When
434         saving, chroma subsampling mode can be specified with output  expres‐
435       sion
436         'filename.yuv[,chroma_subsampling]'.
437           -  .tiff  files:  Only  sub-images of multi-pages tiff files can be
438       loaded, using the input
439         expression   'filename.tif,_first_frame,_last_frame,_step'.    Output
440       expression
441         'filename.tiff,_datatype,_compression,_force_multipage,_use_bigtiff'
442       can be used to specify the
443         output pixel type, as well as the compression method. 'datatype'  can
444       be the same as for .cimg[z]
445         files.  'compression'  can  be   {  none  (default)  |  lzw | jpeg }.
446       'force_multipage' can be { 0=no
447         (default) | 1=yes }. 'use_bigtiff' can be { 0=no | 1=yes (default) }.
448           - .gif files: Animated gif files can  be  saved,  using  the  input
449       expression
450         'filename.gif,fps>0,nb_loops'.  Specify  'nb_loops=0' to get an infi‐
451       nite number of animation loops
452         (this is the default behavior).
453           - .jpeg files: The output quality may be specified  (in  %),  using
454       the output expression
455         'filename.jpg,30'  (here,  to get a 30% quality output). '100' is the
456       default.
457           - .mnc files: The output header can set from  another  file,  using
458       the output expression
459         'filename.mnc,header_template.mnc'.
460           -  .pan,  .cpp,  .hpp,  .c and .h files: The output datatype can be
461       selected with
462         output expression 'filename[,datatype]'. 'datatype' can be  the  same
463       as for .cimg[z] files.
464           -  .gmic files: These filenames are assumed to be G'MIC custom com‐
465       mands files. Loading such
466         a file will add the commands it defines  to  the  interpreter.  Debug
467       information can be
468         enabled/disabled      by      the     input     expression     'file‐
469       name.gmic[,add_debug_info' where 'debug_info' can be
470         { 0=false | 1=true }.
471           - Inserting 'ext:' on the beginning of a filename (e.g.  'jpg:file‐
472       name') forces G'MIC to
473         read/write  the  file as it would have been done if it had the speci‐
474       fied extension .ext.
475         * Some input/output formats and options may not be supported, depend‐
476       ing on the configuration flags
477         that have been set during the build of the G'MIC software.
478
479         8. Substitution Rules
480            ------------------
481
482         *  G'MIC  items  containing  '$' or '{}' are substituted before being
483       interpreted. Use these
484         substituting expressions to access various data from the  interpreter
485       environment.
486
487         *  '$name'  and  '${name}'  are  both substituted by the value of the
488       specified named variable (set
489         previously by the item 'name=value'). If this variable has  not  been
490       already set, the expression is
491         substituted  by  the  highest  positive  index  of  the  named  image
492       '[name]'. If no image has this name,
493         the expression is substituted by the  value  of  the  OS  environment
494       variable with same name (it may be
495         thus an empty string if it is not defined).
496
497         * The following reserved variables are predefined by the G'MIC inter‐
498       preter:
499
500           - '$!': The current number of images in the list.
501           - '$>' and '$<': The  increasing/decreasing  index  of  the  latest
502       (currently running)
503         'repeat...done'  loop.  '$>'  goes  from  0 (first loop iteration) to
504       nb_iterations - 1 (last
505         iteration). '$<' does the opposite.
506           - '$/': The current  call  stack.  Stack  items  are  separated  by
507       slashes '/'.
508           -  '$|':  The current value (expressed in seconds) of a millisecond
509       precision timer.
510           - '$^': The current verbosity level.
511           - '$_cpus': The number  of  computation  cores  available  on  your
512       machine.
513           - '$_pid': The current process identifier, as an integer.
514           -  '$_prerelease': For pre-releases, the date of the pre-release as
515       yymmdd. For stable releases,
516         this variable is set to 0.
517           - '$_version': A 3-digits number telling about the current  version
518       of the G'MIC interpreter
519         (e.g. '294').
520           -  '$_host':  A  string  telling  about  the host running the G'MIC
521       interpreter (e.g. cli or gimp).
522           - '$_vt100': Set to 1 if colored text output is allowed on the con‐
523       sole. Otherwise, set to 0.
524           -  '$_path_rc': The path to the G'MIC folder used to store configu‐
525       ration files (its value is
526         OS-dependent).
527           - '$_path_user': The path to the G'MIC user file .gmic or user.gmic
528       (its value is
529         OS-dependent).
530           -  '$_path_commands':  A list of all imported command files (stored
531       as a list-valued variable).
532         * '$$name' and '$${name}' are both substituted by  the  G'MIC  script
533       code of the specified named
534         custom command, or by an empty string if no custom command with spec‐
535       ified name exists.
536
537         * '${"-pipeline"}' is substituted by the status value after the  exe‐
538       cution of the specified
539         G'MIC pipeline (see command status). Expression '${}' thus stands for
540       the current status value.
541
542         * '{``string}' (starting with two backquotes)  is  substituted  by  a
543       double-quoted version of the
544         specified string.
545
546         *  '{/string}' is substituted by the escaped version of the specified
547       string.
548
549         * '{'string'[:delimiter]}' (between single quotes) is substituted  by
550       the sequence of character
551         codes  that  composes  the  specified  string, separated by specified
552       delimiter. Possible delimiters are
553         ',' (default), ';', '/', '^' or ' '. For instance, item '{'foo'}'  is
554       substituted by '102,111,111'
555         and '{'foo':;}' by '102;111;111'.
556
557         *  '{image,feature[:delimiter]}' is substituted by a specific feature
558       of the image '[image]'.
559         'image' can be either an image number or an image  name.  It  can  be
560       also eluded, in which case, the
561         last  image  '[-1]'  of the list is considered for the requested fea‐
562       ture. Specified 'feature' can be
563         one of:
564
565           - 'b': The image basename (i.e. filename without  the  folder  path
566       nor extension).
567           - 'f': The image folder name.
568           -  'n': The image name or filename (if the image has been read from
569       a file).
570           - 't': The text string from the image values regarded as  character
571       codes.
572           -  'x': The image extension (i.e the characters after the last . in
573       the image name).
574           - '^': The sequence of all image values, separated by commas ,.
575           - '@subset': The sequence of  image  values  corresponding  to  the
576       specified subset, and separated by
577         commas ,.
578           -  Any  other  'feature' is considered as a mathematical expression
579       associated to the image
580         '[image]' and is substituted by the result of its  evaluation  (float
581       value). For instance,
582         expression  '{0,w+h}'  is  substituted  by  the  sum of the width and
583       height of the first image (see
584         section Mathematical Expressions for more details). If a mathematical
585       expression starts with an
586         underscore  _, the resulting value is truncated to a readable format.
587       For instance, item '{_pi}'
588         is  substituted  by  '3.14159'  (while  '{pi}'  is   substituted   by
589       '3.141592653589793').
590           - A 'feature' delimited by backquotes is replaced by a string whose
591       character codes correspond to
592         the list of values resulting from the  evaluation  of  the  specified
593       mathematical expression. For
594         instance,  item  '{[102,111,111]}'  is  substituted by 'foo' and item
595       '{vector8(65)}' by 'AAAAAAAA'.
596         * '{*}' is substituted by the visibility state of the instant display
597       window '#0]' (can be {
598         0=closed | 1=visible }.
599
600         *  '{*[index],feature1,...,featureN[:delimiter]}' is substituted by a
601       specific set of features of
602         the  instant  display  window  '#0'  (or  '#index',  if   specified).
603       Requested 'features' can be:
604
605           - 'w': display width (i.e. width of the display area managed by the
606       window).
607           - 'h': display height (i.e. height of the display area  managed  by
608       the window).
609           - 'wh': display width x display height.
610           - 'd': window width (i.e. width of the window widget).
611           - 'e': window height (i.e. height of the window widget).
612           - 'de': window width x window height.
613           - 'u': screen width (actually independent on the window size).
614           - 'v': screen height (actually independent on the window size).
615           - 'uv': screen width x screen height.
616           - 'n': current normalization type of the instant display.
617           - 't': window title of the instant display.
618           -  'x':  X-coordinate  of the mouse position (or -1, if outside the
619       display area).
620           - 'y': Y-coordinate of the mouse position (or -1,  if  outside  the
621       display area).
622           -  'b':  state  of the mouse buttons { 1=left-but. | 2=right-but. |
623       4=middle-but. }.
624           - 'o': state of the mouse wheel.
625           - 'k': decimal code of the pressed key if any, 0 otherwise.
626           - 'c': boolean (0 or 1) telling if the  instant  display  has  been
627       closed recently.
628           -  'r':  boolean  telling  if  the instant display has been resized
629       recently.
630           - 'm': boolean telling  if  the  instant  display  has  been  moved
631       recently.
632           -  Any  other  'feature' stands for a keycode name (in capital let‐
633       ters), and is substituted by a
634         boolean describing the current key state { 0=pressed | 1=released }.
635           - You can also prepend a hyphen '-' to a 'feature'  (that  supports
636       it) to flush the corresponding
637         event  immediately after reading its state (works for keys, mouse and
638       window events).
639         * Item substitution  is  never  performed  in  items  between  double
640       quotes. One must break the
641         quotes  to  enable  substitution  if needed, as in '"3+8 kg = "{3+8}"
642       kg"'. Using double quotes is then
643         a convenient way to disable the  substitutions  mechanism  in  items,
644       when necessary.
645
646         *  One  can  also disable the substitution mechanism on items outside
647       double quotes, by escaping the
648         {, } or $ characters, as in 3+4 doesn't evaluate.
649
650         9. Mathematical Expressions
651            ------------------------
652
653         * G'MIC has an embedded mathematical parser, used to evaluate (possi‐
654       bly complex) math
655         expressions  specified  inside  braces  '{}', or formulas in commands
656       that may take one as an argument
657         (e.g. 'fill').
658
659         * When the context allows it, a formula is evaluated for  each  pixel
660       of the selected images
661         (e.g. 'fill').
662
663         *  A  math  expression  may return a scalar or a vector-valued result
664       (with a fixed number of
665         components).
666
667         The mathematical parser understands the following set  of  functions,
668       operators and variables:
669
670         # Usual operators:
671
672         '||' (logical or), '&&' (logical and), '|' (bitwise or), '&' (bitwise
673       and), '!=', '==', '<=', '>=',
674         '<', '>', '<<' (left bitwise shift), '>>' (right bitwise shift), '-',
675       '+', '*', '/', '%' (modulo),
676         '^'  (power), '!' (logical not), '~' (bitwise not), '++', '--', '+=',
677       '-=', '*=', '/=', '%=', '&=',
678         '|=', '^=', '>>', '<<=' (in-place operators).
679
680         # Usual math functions:
681
682         'abs()',  'acos()',   'acosh()',   'arg()',   'arg0()',   'argkth()',
683       'argmax()', 'argmaxabs()', 'argmin()',
684         'argminabs()',  'asin()',  'asinh()', 'atan()', 'atan2()', 'atanh()',
685       'avg()', 'bool()', 'cbrt()',
686         'ceil()', 'cos()', 'cosh()', 'cut()',  'exp()',  'fact()',  'fibo()',
687       'floor()', 'gauss()', 'gcd()',
688         'int()',  'isnan()',  'isnum()',  'isinf()',  'isint()',  'isbool()',
689       'isexpr()', 'isfile()', 'isdir()',
690         'isin()', 'kth()', 'log()', 'log2()', 'log10()', 'max()', 'maxabs()',
691       'med()', 'min()', 'minabs()',
692         'narg()',  'prod()',  'rol()' (left bit rotation), 'ror()' (right bit
693       rotation), 'round()', 'sign()',
694         'sin()',  'sinc()',  'sinh()',  'sqrt()',  'std()',   'srand(_seed)',
695       'sum()', 'tan()', 'tanh()',
696         'var()', 'xor()'.
697         *  'atan2(y,x)' is the version of 'atan()' with two arguments 'y' and
698       'x' (as in C/C++).
699
700         * 'permut(k,n,with_order)' computes the number of permutations of 'k'
701       objects from a set of 'n'
702         objects.
703
704         * 'gauss(x,_sigma,_is_normalized)' returns exp(-x^2/(2*s^2))/(is_nor‐
705       malized?sqrt(2*pi*sigma^2):1).
706
707         * 'cut(value,min,max)' returns 'value' if it is in range '[min,max]',
708       or 'min' or 'max' otherwise.
709
710         *  'narg(a_1,...,a_N)'  returns  the  number  of  specified arguments
711       (here, 'N').
712
713         * 'arg(i,a_1,..,a_N)' returns the i-th argument 'a_i'.
714
715         * 'isnum()', 'isnan()', 'isinf()',  'isint()',  'isbool()'  test  the
716       type of the given number or
717         expression, and return '0' (false) or '1' (true).
718
719         * 'isfile('path')' (resp. 'isdir('path')') returns '0' (false) or '1'
720       (true) whether its string
721         argument is a path to an existing file (resp. to a directory) or not.
722
723         * 'isin(v,a_1,...,a_n)' returns '0' (false) or '1' (true) whether the
724       first value 'v' appears in
725         the set of other values 'a_i'.
726
727         * 'inrange(value,m,M,include_m,include_M)' returns '0' (false) or '1'
728       (true) whether the specified
729         value lies in range '[m,M]' or not ('include_m' and 'includeM'  tells
730       how boundaries 'm' and 'M' are
731         considered).
732
733         *  'argkth()', 'argmin()', 'argmax()', 'argminabs()', 'argmaxabs()'',
734       'avg()', 'kth()', 'min()',
735         'max()', 'minabs()', 'maxabs()', 'med()', 'prod()', 'std()',  'sum()'
736       and 'var()' can be called with
737         an arbitrary number of scalar/vector arguments.
738
739         *  'vargkth()',  'vargmin()',  'vargmax()', 'vargminabs()', 'vargmax‐
740       abs()', 'vavg()', 'vkth()',
741         'vmin()', 'vmax()', 'vminabs()',  'vmaxabs()',  'vmed()',  'vprod()',
742       'vstd()', 'vsum()' and 'vvar()'
743         are  the  versions  of the previous function with vector-valued argu‐
744       ments.
745
746         * 'round(value,rounding_value,direction)' returns  a  rounded  value.
747       'direction' can be {
748         -1=to-lowest | 0=to-nearest | 1=to-highest }.
749
750         * 'lerp(a,b,t)' returns 'a*(1-t) + b*t'.
751
752         * 'swap(a,b)' swaps the values of the given arguments.
753
754         # Variable names:
755
756         Variable names below are pre-defined. They can be overridden.
757         * 'l': length of the associated list of images.
758
759         * 'k': index of the associated image, in '[0,l-1]'.
760
761         * 'w': width of the associated image, if any ('0' otherwise).
762
763         * 'h': height of the associated image, if any ('0' otherwise).
764
765         * 'd': depth of the associated image, if any ('0' otherwise).
766
767         * 's': spectrum of the associated image, if any ('0' otherwise).
768
769         * 'r': shared state of the associated image, if any ('0' otherwise).
770
771         * 'wh': shortcut for width x height.
772
773         * 'whd': shortcut for width x height x depth.
774
775         * 'whds': shortcut for width x height x depth x spectrum (i.e. number
776       of image values).
777
778         * 'im', 'iM', 'ia', 'iv', 'is', 'ip', 'ic',  'in':  Respectively  the
779       minimum, maximum, average,
780         variance,  sum,  product,  median value and L2-norm of the associated
781       image, if any ('0' otherwise).
782
783         * 'xm', 'ym', 'zm', 'cm': The pixel coordinates of the minimum  value
784       in the associated image, if
785         any ('0' otherwise).
786
787         *  'xM', 'yM', 'zM', 'cM': The pixel coordinates of the maximum value
788       in the associated image, if
789         any ('0' otherwise).
790
791         * All these variables are considered as constant values by  the  math
792       parser (for optimization
793         purposes)  which  is  indeed  the case most of the time. Anyway, this
794       might not be the case, if
795         function 'resize(#ind,..)' is used in the math expression. If so,  it
796       is safer to invoke functions
797         'l()', 'w(_#ind)', 'h(_#ind)', ... 's(_#ind)' and 'in(_#ind)' instead
798       of the corresponding named
799         variables.
800
801         *  'i':  current  processed  pixel  value  (i.e.  value  located   at
802       (x,y,z,c)) in the associated image,
803         if any ('0' otherwise).
804
805         *  'iN':  N-th  channel  value of current processed pixel (i.e. value
806       located at (x,y,z,N) in the
807         associated image, if any ('0' otherwise). 'N' must be an  integer  in
808       range '[0,9]'.
809
810         *  'R',  'G', 'B' and 'A' are equivalent to 'i0', 'i1', 'i2' and 'i3'
811       respectively.
812
813         * 'I': current vector-valued processed pixel in the associated image,
814       if any ('0' otherwise). The
815         number  of vector components is equal to the number of image channels
816       (e.g. 'I' = [ R,G,B ] for a
817         RGB image).
818
819         * You may add '#ind' to any of the variable name  above  to  retrieve
820       the information for any numbered
821         image  '[ind]'  of  the  list  (when  this makes sense). For instance
822       'ia#0' denotes the average value of
823         the first image of the list).
824
825         * 'x': current processed column of the associated image, if any  ('0'
826       otherwise).
827
828         *  'y':  current  processed  row of the associated image, if any ('0'
829       otherwise).
830
831         * 'z': current processed slice of the associated image, if  any  ('0'
832       otherwise).
833
834         * 'c': current processed channel of the associated image, if any ('0'
835       otherwise).
836
837         * 't': thread id  when  an  expression  is  evaluated  with  multiple
838       threads ('0' means __master
839         thread__).
840
841         * 'e': value of e, i.e. 2.71828....
842
843         * 'pi': value of pi, i.e. 3.1415926....
844
845         *  'u': a random value between '[0,1]', following a uniform distribu‐
846       tion.
847
848         * 'g': a random value, following a gaussian distribution of  variance
849       1 (roughly in '[-6,6]').
850
851         *  'interpolation': value of the default interpolation mode used when
852       reading pixel values with the
853         pixel access operators (i.e. when the interpolation argument  is  not
854       explicitly specified, see below
855         for  more  details  on  pixel  access operators). Its initial default
856       value is '0'.
857
858         * 'boundary': value of the  default  boundary  conditions  used  when
859       reading pixel values with the
860         pixel  access operators (i.e. when the boundary condition argument is
861       not explicitly specified, see
862         below for more  details  on  pixel  access  operators).  Its  initial
863       default value is '0'.
864
865         # Vector calculus:
866
867         Most operators are also able to work with vector-valued elements.
868         *  '[a0,a1,...,aN-1]'  defines  a  'N'-dimensional vector with scalar
869       coefficients 'ak'.
870
871         * 'vectorN(a0,a1,,...,aN-1)' does  the  same,  with  the  'ak'  being
872       repeated periodically if only a few
873         are specified.
874
875         * 'vector(#N,a0,a1,,...,aN-1)' does the same, and can be used for any
876       constant expression 'N'.
877
878         * In previous expressions, the 'ak' can be vectors themselves, to  be
879       concatenated into a single
880         vector.
881
882         * The scalar element 'ak' of a vector 'X' is retrieved by 'X[k]'.
883
884         *  The  sub-vector  '[X[p],X[p+s]...X[p+s*(q-1)]]' (of size 'q') of a
885       vector 'X' is retrieved by
886         'X[p,q,s]'.
887
888         * 'expr('formula',_w,_h,_d,_s)' outputs a vector  of  size  'w*h*d*s'
889       with values generated from the
890         specified  formula,  as  if one were filling an image with dimensions
891       '(w,h,d,s)'.
892
893         * Equality/inequality comparisons between two vectors  is  done  with
894       operators '==' and '!='.
895
896         *  Some  vector-specific  functions  can  be  used  on vector values:
897       'cross(X,Y)' (cross product),
898         'dot(X,Y)'   (dot    product),    'size(X)'    (vector    dimension),
899       'sort(X,_is_increasing,_nb_elts,_size_elt)'
900         (sorted values), 'reverse(A)' (reverse order of components),
901         'shift(A,_length,_boundary_conditions)'                           and
902       'same(A,B,_nb_vals,_is_case_sensitive)' (vector
903         equality test).
904
905         * Function 'normP(u1,...,un)' computes the LP-norm of  the  specified
906       vector ('P' being an `unsigned
907         integer` constant or 'inf'). If 'P' is omitted, the L2 norm is calcu‐
908       lated.
909
910         *    Function    'resize(A,size,_interpolation,_boundary_conditions)'
911       returns a resized version of a
912         vector  'A' with specified interpolation mode. 'interpolation' can be
913       { -1=none (memory content) |
914         0=none | 1=nearest | 2=average | 3=linear  |  4=grid  |  5=bicubic  |
915       6=lanczos }, and
916         'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic |
917       3=mirror }.
918
919         * Function 'find(A,B,_starting_index,_search_step)' returns the index
920       where sub-vector 'B' appears
921         in vector 'A', (or '-1' if 'B' is not contained in 'A'). Argument 'A'
922       can be also replaced by an
923         image index '#ind'.
924
925         * A 2-dimensional vector may be seen as a complex number and used  in
926       those particular
927         functions/operators:  '**'  (complex  multiplication),  '//' (complex
928       division), '^^' (complex
929         exponentiation), '**=' (complex self-multiplication), '//='  (complex
930       self-division), '^^=' (complex
931         self-exponentiation),  'cabs()'  (complex modulus), 'carg()' (complex
932       argument), 'cconj()' (complex
933         conjugate), 'cexp()' (complex exponential), 'clog()'  (complex  loga‐
934       rithm),  'ccos()' (complex
935         cosine),   'csin()'   (complex  sine),  'ctan()'  (complex  tangent),
936       'ccosh()' (complex hyperpolic
937         cosine), 'csinh()' (complex hyperbolic sine) and  'ctanh()'  (complex
938       hyperbolic tangent).
939
940         *  A  MN-dimensional vector may be seen as a M x N matrix and used in
941       those particular
942         functions/operators:  '*'  (matrix-vector  multiplication),  'det(A)'
943       (determinant), 'diag(V)'
944         (diagonal matrix from a vector), 'eig(A)' (eigenvalues/eigenvectors),
945       'eye(n)' (n x n identity
946         matrix), 'invert(A,_solver)' (matrix  inverse),  'mul(A,B,_nb_colsB)'
947       (matrix-matrix multiplication),
948         'pseudoinvert(A,_nb_colsA,_solver)',  'rot(u,v,w,angle)' (3D rotation
949       matrix), 'rot(angle)' (2D
950         rotation matrix), 'solve(A,B,_nb_colsB)' (solver of linear system A.X
951       = B), 'svd(A,_nb_colsA)'
952         (singular value decomposition), 'trace(A)' (matrix trace) and 'trans‐
953       pose(A,nb_colsA)' (matrix
954         transpose). Argument 'nb_colsB' may be omitted if it is equal to 1.
955
956         *         'mproj(S,nb_colsS,D,nb_colsD,method,max_iter,max_residual)'
957       projects a matrix 'S' onto a
958         dictionary  (matrix)  'D'. Equivalent to command mproj but inside the
959       math evaluator.
960
961         * Specifying a vector-valued math expression as an argument of a com‐
962       mand that operates on image
963         values  (e.g.  'fill')  modifies the whole spectrum range of the pro‐
964       cessed image(s), for each spatial
965         coordinates (x,y,z). The command does not loop  over  the  c-axis  in
966       this case.
967
968         # String manipulation:
969
970         Character  strings  are defined and managed as vectors objects. Dedi‐
971       cated functions and initializers
972         to manage strings are:
973         * ['string'] and 'string' define a vector whose values are the  char‐
974       acter codes of the specified
975         character string (e.g. 'foo' is equal to [ 102,111,111 ]).
976
977         *  _'character' returns the (scalar) byte code of the specified char‐
978       acter (e.g. _'A' is equal to
979         '65').
980
981         * A special case happens for empty strings: Values  of  both  expres‐
982       sions [''] and '' are '0'.
983
984         *  Functions  'lowercase()'  and 'uppercase()' return string with all
985       string characters lowercased or
986         uppercased.
987
988         * Function  'stov(str,_starting_index,_is_strict)'  parses  specified
989       string 'str' and returns the
990         value contained in it.
991
992         *  Function  'vtos(expr,_nb_digits,_siz)'  returns  a  vector of size
993       'siz' which contains the character
994         representation of values described by expression 'expr'.  'nb_digits'
995       can be { -1=auto-reduced |
996         0=all | >0=max number of digits }.
997
998         *  Function  'echo(str1,str2,...,strN)'  prints  the concatenation of
999       given string arguments on the
1000         console.
1001
1002         * Function 'string(_#siz,str1,str2,...,strN)' generates a vector cor‐
1003       responding to the concatenation
1004         of given string/number arguments.
1005
1006         # Special operators:
1007
1008         *  ';':  expression  separator. The returned value is always the last
1009       encountered expression. For
1010         instance expression '1;2;pi' is evaluated as 'pi'.
1011
1012         * '=': variable assignment. Variables in mathematical parser can only
1013       refer to numerical values
1014         (vectors  or  scalars).  Variable  names are case-sensitive. Use this
1015       operator in conjunction with ';'
1016         to define more complex evaluable expressions, such as
1017
1018           t = cos(x); 3*t^2 + 2*t + 1
1019
1020         These variables remain local to the mathematical parser and cannot be
1021       accessed outside the
1022         evaluated expression.
1023
1024         *  Variables  defined in math parser may have a constant property, by
1025       specifying keyword 'const'
1026         before the variable name (e.g. 'const foo = pi/4;'). The value set to
1027       such a variable must be
1028         indeed  a constant scalar. Constant variables allows certain types of
1029       optimizations in the math
1030         JIT compiler.
1031
1032         # Specific functions:
1033
1034         * 'u(max)' or 'u(min,max)': return a random value  between  '[0,max]'
1035       or '[min,max]', following a
1036         uniform distribution.
1037
1038         *  'f2ui(value)'  and 'ui2f(value)': Convert a large unsigned integer
1039       as a negative floating point
1040         value (and vice-versa), so that 32bits floats can be  used  to  store
1041       large integers while keeping a
1042         unitary precision.
1043
1044         *  'i(_a,_b,_c,_d,_interpolation_type,_boundary_conditions)':  return
1045       the value of the pixel located
1046         at position (a,b,c,d) in the associated image,  if  any  ('0'  other‐
1047       wise). 'interpolation_type' can
1048         be { 0=nearest neighbor | 1=linear | 2=cubic }. 'boundary_conditions'
1049       can be { 0=dirichlet |
1050         1=neumann | 2=periodic | 3=mirror }. Omitted coordinates are replaced
1051       by their default values which
1052         are  respectively 'x', 'y', 'z', 'c', 'interpolation' and 'boundary'.
1053       For instance command
1054
1055           fill 0.5*(i(x+1)-i(x-1))
1056
1057          will estimate the X-derivative of an image with a  classical  finite
1058       difference scheme.
1059
1060         *  'j(_dx,_dy,_dz,_dc,_interpolation_type,_boundary_conditions)' does
1061       the same for the pixel located
1062         at position (x+dx,y+dy,z+dz,c+dc) (pixel access relative to the  cur‐
1063       rent coordinates).
1064
1065         *  'i[offset,_boundary_conditions]'  returns  the  value of the pixel
1066       located at specified 'offset' in
1067         the associated image buffer (or '0' if offset is out-of-bounds).
1068
1069         * 'j[offset,_boundary_conditions]' does the same for an offset  rela‐
1070       tive to the current pixel
1071         coordinates (x,y,z,c).
1072
1073         * 'i(#ind,_x,_y,_z,_c,_interpolation,_boundary_conditions)',
1074         'j(#ind,_dx,_dy,_dz,_dc,_interpolation,_boundary_conditions)',
1075         'i[#ind,offset,_boundary_conditions]'  and 'i[offset,_boundary_condi‐
1076       tions]' are similar expressions
1077         used to access pixel values for any numbered  image  '[ind]'  of  the
1078       list.
1079
1080         * 'I/J[offset,_boundary_conditions]' and 'I/J(#ind,_x,_y,_z,_interpo‐
1081       lation,_boundary_conditions)'
1082         do    the    same    as    'i/j[offset,_boundary_conditions]'     and
1083       'i/j(#ind,_x,_y,_z,_c,_interpolation,_boundary
1084         _conditions)'  but return a vector instead of a scalar (e.g. a vector
1085       [ R,G,B ] for a pixel at
1086         (a,b,c) in a color image).
1087
1088         *      'crop(_#ind,_x,_y,_z,_c,_dx,_dy,_dz,_dc,_boundary_conditions)'
1089       returns a vector whose values come
1090         from  the  cropped  region  of  image  '[ind]' (or from default image
1091       selected if 'ind' is not
1092         specified). Cropped region starts from point (x,y,z,c) and has a size
1093       of dx x dy x dz x dc.
1094         Arguments  for  coordinates  and sizes can be omitted if they are not
1095       ambiguous (e.g.
1096         'crop(#ind,x,y,dx,dy)' is a valid invocation of this function).
1097
1098         * 'draw(_#ind,S,x,y,z,c,dx,_dy,_dz,_dc,_opacity,_M,_max_M)'  draws  a
1099       sprite 'S' in image '[ind]' (or
1100         in  default  image selected if 'ind' is not specified) at coordinates
1101       (x,y,z,c). The size of the
1102         sprite dx x dy x dz x dc must be specified. You can  also  specify  a
1103       corresponding opacity mask 'M'
1104         if its size matches 'S'.
1105
1106         *  'polygon(_#ind,nb_vertices,coords,_opacity,_color)' draws a filled
1107       polygon in image '[ind]' (or
1108         in default image selected if 'ind' is  not  specified)  at  specified
1109       coordinates. It draws a single
1110         line if 'nb_vertices' is set to 2.
1111
1112         * 'polygon(_#ind,-nb_vertices,coords,_opacity,_pattern,_color)' draws
1113       a outlined polygon in image
1114         '[ind]' (or in default image selected if 'ind' is not  specified)  at
1115       specified coordinates and with
1116         specified  line  pattern.  It draws a single line if 'nb_vertices' is
1117       set to 2.
1118
1119         *      'ellipse(_#ind,xc,yc,radius1,_radius2,_angle,_opacity,_color)'
1120       draws a filled ellipse in image
1121         '[ind]' (or in default image selected if 'ind' is not specified) with
1122       specified coordinates.
1123
1124         *       'ellipse(_#ind,xc,yc,-radius1,-_radius2,_angle,_opacity,_pat‐
1125       tern,_color)' draws an outlined
1126         ellipse  in  image  '[ind]' (or in default image selected if 'ind' is
1127       not specified).
1128
1129         *                    'resize(#ind,w,_h,_d,_s,_interp,_boundary_condi‐
1130       tions,_cx,_cy,_cz,_cc)' resizes an image of the
1131         associated  list  with  specified dimension and interpolation method.
1132       When using this function, you
1133         should consider retrieving the (non-constant) image dimensions  using
1134       the dynamic functions
1135         'w(_#ind)',    'h(_#ind)',   'd(_#ind)',   's(_#ind)',   'wh(_#ind)',
1136       'whd(_#ind)' and 'whds(_#ind)' instead
1137         of the corresponding constant variables.
1138
1139         * 'if(condition,expr_then,_expr_else)': return value  of  'expr_then'
1140       or 'expr_else', depending on
1141         the value of 'condition' { 0=false | other=true }. 'expr_else' can be
1142       omitted in which case '0' is
1143         returned if the condition does not hold. Using the ternary operator
1144         'condition?expr_then[:expr_else]' gives an equivalent expression. For
1145       instance, G'MIC commands
1146
1147           fill if(x%10==0,255,i)
1148
1149          and
1150
1151           fill x%10?i:255
1152
1153          both draw blank vertical lines on every 10th column of an image.
1154
1155         *  'do(expression,_condition)' repeats the evaluation of 'expression'
1156       until 'condition' vanishes (or
1157         until 'expression' vanishes if  no  'condition'  is  specified).  For
1158       instance, the expression:
1159
1160           if(N<2,N,n=N-1;F0=0;F1=1;do(F2=F0+F1;F0=F1;F1=F2,n=n-1))
1161
1162          returns  the N-th value of the Fibonacci sequence, for 'N>=0' (e.g.,
1163       '46368' for 'N=24').
1164         'do(expression,condition)' always evaluates the specified  expression
1165       at least once, then check for
1166         the  loop condition. When done, it returns the last value of 'expres‐
1167       sion'.
1168
1169         * 'for(init,condition,_procedure,body)' first evaluates  the  expres‐
1170       sion 'init', then iteratively
1171         evaluates 'body' (followed by 'procedure' if specified) while 'condi‐
1172       tion' holds (i.e. not zero). It
1173         may happen that no iterations are done, in which  case  the  function
1174       returns 'nan'. Otherwise, it
1175         returns the last value of 'body'. For instance, the expression:
1176
1177           if(N<2,N,for(n=N;F0=0;F1=1,n=n-1,F2=F0+F1;F0=F1;F1=F2))
1178
1179          returns  the  'N'-th  value  of  the  Fibonacci sequence, for 'N>=0'
1180       (e.g., '46368' for 'N=24').
1181
1182         * 'while(condition,expression)' is exactly the same as 'for(init,con‐
1183       dition,expression)' without the
1184         specification of an initializing expression.
1185
1186         *  'break()'  and  'continue()' respectively breaks and continues the
1187       current running bloc (loop, init
1188         or main environment).
1189
1190         * 'fsize('filename')' returns the size of  the  specified  'filename'
1191       (or '-1' if file does not exist).
1192
1193         * 'date(attr,'path')' returns the date attribute for the given 'path'
1194       (file or directory), with
1195         'attr' being { 0=year | 1=month | 2=day | 3=day of week  |  4=hour  |
1196       5=minute | 6=second }, or a
1197         vector of those values.
1198
1199         *  'date(_attr)'  returns  the  specified  attribute  for the current
1200       (locale) date (attributes being {
1201         0...6=same meaning as above | 7=milliseconds }).
1202
1203         * 'print(expr1,expr2,...)' or 'print(#ind)' prints the value  of  the
1204       specified expressions (or image
1205         information)  on  the  console,  and  returns  the  value of the last
1206       expression (or 'nan' in case of an
1207         image). Function 'prints(expr)' also prints the  string  composed  of
1208       the character codes defined by
1209         the vector-valued expression (e.g. 'prints('Hello')').
1210
1211         *  'debug(expression)'  prints detailed debug info about the sequence
1212       of operations done by the math
1213         parser to evaluate the expression (and returns its value).
1214
1215         * 'display(_X,_w,_h,_d,_s)' or 'display(#ind)' display  the  contents
1216       of the vector 'X' (or specified
1217         image) and wait for user events. if no arguments are provided, a mem‐
1218       ory snapshot of the math parser
1219         environment is displayed instead.
1220
1221         * 'begin(expression)' and 'end(expression)' evaluates  the  specified
1222       expressions only once,
1223         respectively  at  the  beginning and end of the evaluation procedure,
1224       and this, even when multiple
1225         evaluations are required (e.g. in 'fill ">begin(foo = 0); ++foo"').
1226
1227         * 'copy(dest,src,_nb_elts,_inc_d,_inc_s,_opacity)' copies  an  entire
1228       memory block of 'nb_elts'
1229         elements  starting  from a source value 'src' to a specified destina‐
1230       tion 'dest', with increments
1231         defined by 'inc_d' and 'inc_s' respectively for the  destination  and
1232       source pointers.
1233
1234         *  'stats(_#ind)'  returns the statistics vector of the running image
1235       '[ind]', i.e the vector `[
1236         im,iM,ia,iv,xm,ym,zm,cm,xM,yM,zM,cM,is,ip ]` (14 values).
1237
1238         * 'ref(expr,a)' references specified expression  'expr'  as  variable
1239       name 'a'.
1240
1241         * 'unref(a,b,...)' destroys references to the named variable given as
1242       arguments.
1243
1244         * 'breakpoint()' inserts a possible computation  breakpoint  (useless
1245       with the cli interface).
1246
1247         *  '_(expr)'  just ignores its arguments (useful for inserting inline
1248       comments in math expressions).
1249
1250         * 'run('pipeline')' executes the specified G'MIC pipeline  as  if  it
1251       was called outside the currently
1252         evaluated expression.
1253
1254         *  'store(A,'varname',_w,_h,_d,_s,_is_compressed)' transfers the data
1255       of vector 'A' as a `w x h x d
1256         x s` image to the G'MIC variable '$varname'. Thus, the  data  becomes
1257       available outside the math
1258         expression  (that is equivalent to using the regular command 'store',
1259       but directly in the math
1260         expression).
1261
1262         * 'get('variable_name',_size,_to_numbers)' returns the value  of  the
1263       specified variable, as a vector
1264         of  'size'  values,  or  as a scalar (if 'size' is zero or not speci‐
1265       fied).
1266
1267         * 'name(_#ind,size)' returns a vector of size  'size',  whose  values
1268       are the characters codes of the
1269         name  of  image  '[ind]'  (or  default image selected if 'ind' is not
1270       specified).
1271
1272         *             'correlate(I,wI,hI,dI,sI,K,wK,hK,dK,sK,_boundary_condi‐
1273       tions,_is_normalized,_channel_mode,_xcenter,
1274         _ycenter,_zcen‐
1275       ter,_xstart,_ystart,_zstart,_xend,_yend,_zend,_xstride,_ystride,_zstride,_xdi‐
1276       lation,_y
1277         dilation,_zdilation)'  returns the correlation, unrolled as a vector,
1278       of the `wI x hI x dI x
1279         sI-sized image 'I' with the wK x hK x dK x sK`-sized kernel 'K'  (the
1280       meaning of the other
1281         arguments  are  the same as in command 'correlate'). Similar function
1282       'convolve(...)' is also defined
1283         for computing the convolution between 'I' and 'K'.
1284
1285         # User-defined macros:
1286
1287         * Custom macro functions can be defined in a math  expression,  using
1288       the assignment operator '=',
1289         e.g.
1290
1291           foo(x,y) = cos(x + y); result = foo(1,2) + foo(2,3)
1292
1293         *  Trying  to  override  a  built-in  function  (e.g. 'abs()') has no
1294       effect.
1295
1296         * Overloading macros with different number of arguments is  possible.
1297       Re-defining a previously
1298         defined macro with the same number of arguments discards its previous
1299       definition.
1300
1301         * Macro functions are indeed processed as macros by the  mathematical
1302       evaluator. You should
1303         avoid  invoking  them  with  arguments that are themselves results of
1304       assignments or self-operations.
1305         For instance,
1306
1307           foo(x) = x + x; z = 0; foo(++z)
1308
1309          returns '4' rather than expected value '2'.
1310
1311         * When substituted, macro arguments are  placed  inside  parentheses,
1312       except if a number sign '#' is
1313         located just before or after the argument name. For instance, expres‐
1314       sion
1315
1316           foo(x,y) = x*y; foo(1+2,3)
1317
1318          returns '9' (being substituted as '(1+2)*(3)'), while expression
1319
1320           foo(x,y) = x#*y#; foo(1+2,3)
1321
1322          returns '7' (being substituted as '1+2*3').
1323
1324         * Number signs appearing between macro  arguments  function  actually
1325       count for empty separators.
1326         They  may  be  used  to  force the substitution of macro arguments in
1327       unusual places, e.g. as in
1328
1329           str(N) = ['I like N#'];
1330
1331         # Multi-threaded and in-place evaluation:
1332
1333         * If your image data are large  enough  and  you  have  several  CPUs
1334       available, it is likely that the
1335         math  expression  passed  to  a 'fill', 'eval' or 'input' commands is
1336       evaluated in parallel, using
1337         multiple computation threads.
1338
1339         * Starting an expression with  ':'  or  '*'  forces  the  evaluations
1340       required for an image to be run in
1341         parallel,  even if the amount of data to process is small (beware, it
1342       may be slower to evaluate in
1343         this case!). Specify ':' (rather than '*') to  avoid  possible  image
1344       copy done before evaluating the
1345         expression  (this saves memory, but do this only if you are sure this
1346       step is not required!)
1347
1348         * If the specified expression starts  with  '>'  or  '<',  the  pixel
1349       access operators 'i()', 'i[]',
1350         'j()'  and 'j[]' return values of the image being currently modified,
1351       in forward ('>') or backward
1352         ('<') order. The multi-threading evaluation of the expression is dis‐
1353       abled in this case.
1354
1355         * Function 'critical(expr)' forces the execution of the given expres‐
1356       sion in a single thread at a
1357         time.
1358
1359         * 'begin_t(expr)' and 'end_t(expr)' evaluates the  specified  expres‐
1360       sion once for each running thread
1361         (so possibly several times) at the beginning and the end of the eval‐
1362       uation procedure.
1363
1364         * 'merge(variable,operator)' tells to merge the local variable  value
1365       computed by threads, with the
1366         specified operator, when all threads have finished computing.
1367
1368         *               Expressions              'i(_#ind,x,_y,_z,_c)=value',
1369       'j(_#ind,x,_y,_z,_c)=value', 'i[_#ind,offset]=value' and
1370         'j[_#ind,offset]=value' set a pixel value  at  a  different  location
1371       than the running one in the image
1372         '[ind]'  (or  in the associated image if argument '#ind' is omitted),
1373       either with global
1374         coordinates/offsets (with 'i(...)' and 'i[...]'),  or  relatively  to
1375       the current position (x,y,z,c)
1376         (with   'j(...)'  and  'j[...]').  These  expressions  always  return
1377       'value'.
1378
1379         * The last image of the list is always associated to the  evaluations
1380       of 'expressions', e.g. G'MIC
1381         sequence
1382
1383           256,128 fill {w}
1384
1385          will create a 256x128 image filled with value 256.
1386
1387         10. Image and Data Viewers
1388             ----------------------
1389
1390         *  G'MIC  has  some very handy embedded visualization modules, for 1D
1391       signals (command 'plot'),
1392         1D/2D/3D images (command 'display') and 3D  vector  objects  (command
1393       'display3d'). It manages
1394         interactive views of the selected image data.
1395
1396         * The following actions are available in the interactive viewers:
1397
1398           - (mousewheel): Zoom in/out.
1399           - ESC: Close window.
1400           - CTRL+D: Increase window size.
1401           - CTRL+C: Decrease window size.
1402           - CTRL+R: Reset window size.
1403           - CTRL+F: Toggle fullscreen mode.
1404           - CTRL+S: Save current view as a numbered file 'gmic_xxxx.ext'.
1405           -  CTRL+O:  Save  copy  of  the  viewed  data,  as  a numbered file
1406       'gmic_xxxx.ext'.
1407         * Actions specific to the 1D/2D image viewer (command 'display') are:
1408
1409           - Left mouse button: Create an image selection and zoom into it.
1410           - Middle mouse button, or CTRL+left mouse button: Move image.
1411           - Mouse wheel or PADD+/-: Zoom in/out.
1412           - Arrow keys: Move image left/right/up/down.
1413           - CTRL+A: Enable/disable transparency (show alpha channel).
1414           - CTRL+N: Change normalization mode (can be { none | normal | chan‐
1415       nel-by-channel }).
1416           - CTRL+SPACE: Reset view.
1417           - CTRL+X: Show/hide axes.
1418           - CTRL+Z: Hold/release aspect ratio.
1419         *  Actions  specific to the 3D volumetric image viewer (command 'dis‐
1420       play') are:
1421
1422           - CTRL+P: Play z-stack of frames as a movie.
1423           - CTRL+V: Show/hide 3D view on bottom right zone.
1424           - CTRL+X: Show/hide axes.
1425           - CTRL+(mousewheel): Go up/down.
1426           - SHIFT+(mousewheel): Go left/right.
1427           - Numeric PAD: Zoom in/out (+/-)  and  move  through  zoomed  image
1428       (digits).
1429           - BACKSPACE: Reset zoom scale.
1430         * Actions specific to the 3D object viewer (command 'display3d') are:
1431
1432           - (mouse)+(left mouse button): Rotate 3D object.
1433           - (mouse)+(right mouse button): Zoom 3D object.
1434           - (mouse)+(middle mouse button): Shift 3D object.
1435           - F1 ... F6: Toggle between different 3D rendering modes.
1436           - F7/F8: Decrease/increase focale.
1437           - F9: Select animation mode.
1438           - F10: Select animation speed.
1439           - SPACE: Start/stop animation.
1440           - CTRL+A: Show/hide 3D axes.
1441           - CTRL+B: Switch between available background.
1442           - CTRL+G: Save 3D object, as numbered file 'gmic_xxxx.off'.
1443           - CTRL+L: Show/hide outline.
1444           - CTRL+P: Print current 3D pose on stderr.
1445           - CTRL+T: Switch between single/double-sided 3D modes.
1446           - CTRL+V: Start animation with video output.
1447           - CTRL+X: Show/hide 3D bounding box.
1448           - CTRL+Z: Enable/disable z-buffered rendering.
1449
1450         11. Adding Custom Commands
1451             ----------------------
1452
1453         *  New  custom  commands can be added by the user, through the use of
1454       G'MIC custom commands files.
1455
1456         * A command file is a simple text file, where each line starts either
1457       by
1458
1459           command_name: command_definition
1460
1461          or
1462
1463           command_definition (continuation)
1464
1465         *  At  startup,  G'MIC  automatically  includes  user's  command file
1466       '$HOME/.gmic' (on Unix) or
1467         '%APPDATA%/user.gmic' (on Windows). The CLI tool 'gmic' automatically
1468       runs the command
1469         'cli_start' if defined.
1470
1471         * Custom command names must use character set [a-zA-Z0-9_] and cannot
1472       start with a number.
1473
1474         * Any '# comment' expression found in a custom commands file is  dis‐
1475       carded by the G'MIC parser,
1476         wherever it is located in a line.
1477
1478         *  In  a custom command, the following '$-expressions' are recognized
1479       and substituted:
1480
1481           - '$*' is substituted by a copy of the specified  string  of  argu‐
1482       ments.
1483           -  '$"*"' is substituted by a copy of the specified string of argu‐
1484       ments, each being double-quoted.
1485           - '$#' is substituted by  the  maximum  index  of  known  arguments
1486       (either specified by the user or
1487         set to a default value in the custom command).
1488           -  '$[]'  is substituted by the list of selected image indices that
1489       have been specified in the
1490         command invocation.
1491           - '$?' is substituted by a printable version of '$[]' to be used in
1492       command descriptions.
1493           -  '$i' and '${i}' are both substituted by the i-th specified argu‐
1494       ment. Negative indices such as
1495         '${-j}' are allowed and refer to the j-th latest  argument.  '$0'  is
1496       substituted by the custom
1497         command name.
1498           -  '${i=default}'  is substituted by the value of '$i' (if defined)
1499       or by its new value set to
1500         'default' otherwise ('default' may be a $-expression as well).
1501           - '${subset}' is substituted by the argument values  (separated  by
1502       commas ',') of a specified
1503         argument  subset. For instance expression '${2--2}' is substituted by
1504       all specified command
1505         arguments except the first and the last one.  Expression  '${^0}'  is
1506       then substituted by all
1507         arguments  of  the invoked command (eq. to '$*' if all arguments have
1508       been indeed specified).
1509           - '$=var' is substituted by  the  set  of  instructions  that  will
1510       assign each argument '$i' to the
1511         named  variable  'var$i'  (for  i in '[0...$#]'. This is particularly
1512       useful when a custom command want
1513         to manage variable numbers of arguments.  Variables  names  must  use
1514       character set [a-zA-Z0-9_] and
1515         cannot start with a number.
1516         *  These particular $-expressions for custom commands are always sub‐
1517       stituted, even in
1518         double-quoted items or when the dollar sign '$'  is  escaped  with  a
1519       backslash 'fR'. To avoid
1520         substitution,  place an empty double quoted string just after the '$'
1521       (as in '$""1').
1522
1523         * Specifying arguments may be skipped when invoking a custom command,
1524       by replacing them by commas
1525         ',' as in expression
1526
1527           flower ,,3
1528
1529          Omitted  arguments  are  set  to their default values, which must be
1530       thus explicitly defined in the
1531         code of the corresponding  custom  command  (using  default  argument
1532       expressions as '${1=default}').
1533
1534         *  If  one  numbered  argument  required by a custom command misses a
1535       value, an error is thrown by the
1536         G'MIC interpreter.
1537
1538         12. List of Commands
1539             ----------------
1540
1541         All available G'MIC commands are  listed  below,  by  categories.  An
1542       argument specified between '[]' or
1543         starting  by  '_'  is  optional  except when standing for an existing
1544       image '[image]', where 'image' can
1545         be either an index number or an image name. In this  case,  the  '[]'
1546       characters are mandatory when
1547         writing the item. Note that all images that serve as illustrations in
1548       this reference documentation
1549         are normalized in range [0,255] before being displayed. You may  need
1550       to do this explicitly
1551         (command  'normalize 0,255') if you want to save and view images with
1552       the same aspect than those
1553         illustrated in the example codes.
1554
1555         12.1. Global Options
1556               --------------
1557
1558         debug (+):
1559
1560           Activate debug mode.
1561           When activated, the G'MIC interpreter becomes very verbose and out‐
1562       puts additional log
1563           messages about its internal state on the standard output (stdout).
1564           This  option is useful for developers or to report possible bugs of
1565       the interpreter.
1566
1567         h:
1568             Shortcut for command 'help'.
1569
1570         help:
1571             command |
1572             (no arg)
1573
1574           Display help (optionally for specified command only) and exit.
1575           (equivalent to shortcut command 'h').
1576
1577         version:
1578
1579           Display current version number on stdout.
1580
1581         12.2. Input / Output
1582               --------------
1583
1584         camera (+):
1585             _camera_index>=0,_nb_frames>0,_skip_frames>=0,_cap‐
1586       ture_width>=0,_capture_height>=0
1587
1588           Insert one or several frames from specified camera.
1589           When  'nb_frames==0', the camera stream is released instead of cap‐
1590       turing new images.
1591
1592           Default values: 'camera_index=0' (default  camera),  'nb_frames=1',
1593       'skip_frames=0' and
1594             'capture_width=capture_height=0' (default size).
1595
1596         clut:
1597             "clut_name",_resolution>0,_cut_and_round={ 0=no | 1=yes }
1598
1599           Insert  one  of  the  862 pre-defined CLUTs at the end of the image
1600       list.
1601           'clut_name'  can  be  {  2-strip-process  |  60s  |   60s_faded   |
1602       60s_faded_alt | action_magenta_01 |
1603           action_red_01  |  adventure_1453  |  agfa_apx_100  |  agfa_apx_25 |
1604       agfa_precisa_100 |
1605           agfa_ultra_color_100    |    agfa_vista_200    |    agressive_high‐
1606       ligjtes_recovery_5 | alberto_street |
1607           alien_green | amstragram | amstragram+ | analogfx_anno_1870_color |
1608       analogfx_old_style_i |
1609           analogfx_old_style_ii       |       analogfx_old_style_iii        |
1610       analogfx_sepia_color | analogfx_soft_sepia_i |
1611           analogfx_soft_sepia_ii | anime | apocalypse_this_very_moment | aqua
1612       | aqua_and_orange_dark |
1613           arabica_12 | autumn | ava_614 | avalanche | azrael_93 |  bboyz_2  |
1614       berlin_sky | black_and_white |
1615           black_star  |  blade_runner  |  bleach_bypass  |  bleachbypass_1  |
1616       bleachbypass_2 | bleachbypass_3 |
1617           bleachbypass_4 | bleech_bypass_green  |  bleech_bypass_yellow_01  |
1618       blue_cold_fade | blue_dark |
1619           blue_house  |  blue_ice  |  blue_mono  |  blue_shadows_01 | blues |
1620       bob_ford | bourbon_64 |
1621           bright_green_01 | bright_teal_orange | bright_warm | brightgreen  |
1622       brownish | bw_1 | bw_10 | bw_2 |
1623           bw_3 | bw_4 | bw_5 | bw_6 | bw_7 | bw_8 | bw_9 | byers_11 | candle‐
1624       light | caribe | chemical_168 |
1625           chrome_01 | cinema | cinema_2 | cinema_3 | cinema_4  |  cinema_5  |
1626       cinema_noir | cinematic-1 |
1627           cinematic-10  |  cinematic-2  |  cinematic-3  | cinematic-4 | cine‐
1628       matic-5 | cinematic-6 | cinematic-7 |
1629           cinematic-8 | cinematic-9 | cinematic_01  |  cinematic_02  |  cine‐
1630       matic_03 | cinematic_for_flog |
1631           cinematic_lady_bird   |   cinematic_mexico   |   city_7   |   clas‐
1632       sic_teal_and_orange | clayton_33 |
1633           clear_teal_fade   |   clouseau_54   |   cobi_3   |   coffee_44    |
1634       cold_clear_blue | cold_clear_blue_1 |
1635           cold_simplicity_2  |  color_rich  | colorful_0209 | colornegative |
1636       conflict_01 | contrail_35 |
1637           contrast_with_highlights_protection |  contrasty_afternoon  |  con‐
1638       trasty_green | crispromance |
1639           crispwarm     |     crispwinter     |     cross_process_cp_130    |
1640       cross_process_cp_14 | cross_process_cp_15 |
1641           cross_process_cp_16 | cross_process_cp_18  |  cross_process_cp_3  |
1642       cross_process_cp_4 |
1643           cross_process_cp_6    |    crushin   |   cubicle_99   |   d_o_1   |
1644       dark_blues_in_sunlight | dark_green_02 |
1645           dark_green_1 | dark_place_01 | date_39 | day_4nite |  day_for_night
1646       | deep | deep_blue |
1647           deep_dark_warm    |    deep_high_contrast    |   deep_teal_fade   |
1648       deep_warm_fade | delicatessen |
1649           denoiser_simple_40 | desert_gold_37 | dimension |  directions_23  |
1650       django_25 | domingo_145 | dream_1
1651           |  dream_85  |  drop_green_tint_14 | dropblues | earth_tone_boost |
1652       edgyember | elegance_38 |
1653           enchanted  |  eterna_for_flog  |  expired_69   |   expired_fade   |
1654       expired_polaroid | extreme | fade |
1655           fade_to_green  |  faded  |  faded_47  |  faded_alt | faded_analog |
1656       faded_extreme | faded_green |
1657           faded_print | faded_retro_01 | faded_retro_02 | faded_vivid |  fad‐
1658       edlook | fallcolors |
1659           faux_infrared  |  faux_infrared_bw_1  |  faux_infrared_color_p_2  |
1660       faux_infrared_color_p_3 |
1661           faux_infrared_color_r_0a     |      faux_infrared_color_r_0b      |
1662       faux_infrared_color_yp_1 | fgcinebasic |
1663           fgcinebright  |  fgcinecold  |  fgcinedrama  | fgcinetealorange_1 |
1664       fgcinetealorange_2 | fgcinevibrant |
1665           fgcinewarm  |  film_0987  |  film_9879   |   film_high_contrast   |
1666       film_print_01 | film_print_02 | filmic |
1667           flat_30 | flavin | foggynight | folger_50 | french_comedy | frosted
1668       | frostedbeachpicnic |
1669           fuji_160c  |   fuji_160c_+   |   fuji_160c_++   |   fuji_160c_-   |
1670       fuji_3510_constlclip | fuji_3510_constlmap |
1671           fuji_3510_cuspclip  |  fuji_3513_constlclip | fuji_3513_constlmap |
1672       fuji_3513_cuspclip | fuji_400h |
1673           fuji_400h_+ | fuji_400h_++ | fuji_400h_- | fuji_800z |  fuji_800z_+
1674       | fuji_800z_++ | fuji_800z_- |
1675           fuji_astia_100_generic   |   fuji_astia_100f   |   fuji_fp-100c   |
1676       fuji_fp-100c_+ | fuji_fp-100c_++ |
1677           fuji_fp-100c_+++   |   fuji_fp-100c_++_alt   |   fuji_fp-100c_-   |
1678       fuji_fp-100c_-- | fuji_fp-100c_alt |
1679           fuji_fp-100c_cool  |  fuji_fp-100c_cool_+  | fuji_fp-100c_cool_++ |
1680       fuji_fp-100c_cool_- |
1681           fuji_fp-100c_cool_-- | fuji_fp-100c_negative  |  fuji_fp-100c_nega‐
1682       tive_+ | fuji_fp-100c_negative_++ |
1683           fuji_fp-100c_negative_+++    |    fuji_fp-100c_negative_++_alt    |
1684       fuji_fp-100c_negative_- |
1685           fuji_fp-100c_negative_--  |  fuji_fp-3000b  |   fuji_fp-3000b_+   |
1686       fuji_fp-3000b_++ | fuji_fp-3000b_+++ |
1687           fuji_fp-3000b_-    |    fuji_fp-3000b_--   |   fuji_fp-3000b_hc   |
1688       fuji_fp-3000b_negative |
1689           fuji_fp-3000b_negative_+     |     fuji_fp-3000b_negative_++      |
1690       fuji_fp-3000b_negative_+++ |
1691           fuji_fp-3000b_negative_-      |     fuji_fp-3000b_negative_--     |
1692       fuji_fp-3000b_negative_early | fuji_fp_100c
1693           |   fuji_hdr   |   fuji_neopan_1600    |    fuji_neopan_1600_+    |
1694       fuji_neopan_1600_++ | fuji_neopan_1600_- |
1695           fuji_neopan_acros_100  | fuji_provia_100_generic | fuji_provia_100f
1696       | fuji_provia_400f |
1697           fuji_provia_400x | fuji_sensia_100 | fuji_superia_100 |  fuji_supe‐
1698       ria_100_+ | fuji_superia_100_++ |
1699           fuji_superia_100_-  |  fuji_superia_1600  |  fuji_superia_1600_+  |
1700       fuji_superia_1600_++ |
1701           fuji_superia_1600_- | fuji_superia_200  |  fuji_superia_200_xpro  |
1702       fuji_superia_400 |
1703           fuji_superia_400_+  |  fuji_superia_400_++  |  fuji_superia_400_- |
1704       fuji_superia_800 |
1705           fuji_superia_800_+ |  fuji_superia_800_++  |  fuji_superia_800_-  |
1706       fuji_superia_hg_1600 |
1707           fuji_superia_reala_100       |       fuji_superia_x-tra_800       |
1708       fuji_velvia_100_generic | fuji_velvia_50 |
1709           fuji_xtrans_iii_acros       |       fuji_xtrans_iii_acros+g       |
1710       fuji_xtrans_iii_acros+r |
1711           fuji_xtrans_iii_acros+ye       |       fuji_xtrans_iii_astia      |
1712       fuji_xtrans_iii_classic_chrome |
1713           fuji_xtrans_iii_mono       |        fuji_xtrans_iii_mono+g        |
1714       fuji_xtrans_iii_mono+r | fuji_xtrans_iii_mono+ye |
1715           fuji_xtrans_iii_pro_neg_hi    |    fuji_xtrans_iii_pro_neg_std    |
1716       fuji_xtrans_iii_provia |
1717           fuji_xtrans_iii_sepia | fuji_xtrans_iii_velvia | fusion_88 | futur‐
1718       isticbleak_1 | futuristicbleak_2
1719           | futuristicbleak_3 | futuristicbleak_4 | going_for_a_walk | golden
1720       | golden_bright | golden_fade |
1721           golden_mono   |   golden_night_softner_43   |   golden_sony_37    |
1722       golden_vibrant | goldengate |
1723           goldfx_bright_spring_breeze     |    goldfx_bright_summer_heat    |
1724       goldfx_hot_summer_heat |
1725           goldfx_perfect_sunset_01min   |    goldfx_perfect_sunset_05min    |
1726       goldfx_perfect_sunset_10min |
1727           goldfx_spring_breeze | goldfx_summer_heat | good_morning | green_15
1728       | green_2025 | green_action |
1729           green_afternoon | green_blues |  green_conflict  |  green_day_01  |
1730       green_day_02 | green_g_09 |
1731           green_indoor  |  green_light  |  green_mono | green_yellow | green‐
1732       ish_contrasty | greenish_fade |
1733           greenish_fade_1 | hackmanite | happyness_133 |  hard_teal_orange  |
1734       harsh_day | harsh_sunset | helios
1735           |  herderite  |  heulandite  |  hiddenite | highlights_protection |
1736       hilutite | hlg_1_1 | hong_kong |
1737           horrorblue | howlite | hydracore | hyla_68 | hypersthene | hypnosis
1738       | hypressen | ilford_delta_100
1739           |  ilford_delta_3200 | ilford_delta_3200_+ | ilford_delta_3200_++ |
1740       ilford_delta_3200_- |
1741           ilford_delta_400   |   ilford_fp_4_plus_125   |    ilford_hp_5    |
1742       ilford_hp_5_+ | ilford_hp_5_++ |
1743           ilford_hp_5_-    |    ilford_hp_5_plus_400   |   ilford_hps_800   |
1744       ilford_pan_f_plus_50 | ilford_xp_2 |
1745           indoor_blue | industrial_33 | instantc | justpeachy  |  k_tone_vin‐
1746       tage_kodachrome | kh_1 | kh_10 |
1747           kh_2  | kh_3 | kh_4 | kh_5 | kh_6 | kh_7 | kh_8 | kh_9 | killstreak
1748       | kodak_2383_constlclip |
1749           kodak_2383_constlmap | kodak_2383_cuspclip |  kodak_2393_constlclip
1750       | kodak_2393_constlmap |
1751           kodak_2393_cuspclip           |          kodak_bw_400_cn          |
1752       kodak_e-100_gx_ektachrome_100 | kodak_ektachrome_100_vs |
1753           kodak_ektachrome_100_vs_generic      |      kodak_ektar_100       |
1754       kodak_elite_100_xpro | kodak_elite_chrome_200 |
1755           kodak_elite_chrome_400        |       kodak_elite_color_200       |
1756       kodak_elite_color_400 | kodak_elite_extracolor_100
1757           | kodak_hie_hs_infra | kodak_kodachrome_200 | kodak_kodachrome_25 |
1758       kodak_kodachrome_64 |
1759           kodak_kodachrome_64_generic | kodak_portra_160 | kodak_portra_160_+
1760       | kodak_portra_160_++ |
1761           kodak_portra_160_- | kodak_portra_160_nc | kodak_portra_160_nc_+  |
1762       kodak_portra_160_nc_++ |
1763           kodak_portra_160_nc_- | kodak_portra_160_vc | kodak_portra_160_vc_+
1764       | kodak_portra_160_vc_++ |
1765           kodak_portra_160_vc_- |  kodak_portra_400  |  kodak_portra_400_+  |
1766       kodak_portra_400_++ |
1767           kodak_portra_400_-  | kodak_portra_400_nc | kodak_portra_400_nc_+ |
1768       kodak_portra_400_nc_++ |
1769           kodak_portra_400_nc_- | kodak_portra_400_uc | kodak_portra_400_uc_+
1770       | kodak_portra_400_uc_++ |
1771           kodak_portra_400_uc_- | kodak_portra_400_vc | kodak_portra_400_vc_+
1772       | kodak_portra_400_vc_++ |
1773           kodak_portra_400_vc_- |  kodak_portra_800  |  kodak_portra_800_+  |
1774       kodak_portra_800_++ |
1775           kodak_portra_800_-   |   kodak_portra_800_hc  |  kodak_t-max_100  |
1776       kodak_t-max_3200 | kodak_t-max_400 |
1777           kodak_tmax_3200  |   kodak_tmax_3200_+   |   kodak_tmax_3200_++   |
1778       kodak_tmax_3200_- | kodak_tmax_3200_alt
1779           |   kodak_tri-x_400  |  kodak_tri-x_400_+  |  kodak_tri-x_400_++  |
1780       kodak_tri-x_400_- |
1781           kodak_tri-x_400_alt | korben_214 |  landscape_1  |  landscape_10  |
1782       landscape_2 | landscape_3 |
1783           landscape_4 | landscape_5 | landscape_6 | landscape_7 | landscape_8
1784       | landscape_9 |
1785           lateafternoonwanderlust | latesunset | lc_1 | lc_10 | lc_2 | lc_3 |
1786       lc_4 | lc_5 | lc_6 | lc_7 |
1787           lc_8  |  lc_9 | lenox_340 | life_giving_tree | light_blown | lomo |
1788       lomography_redscale_100 |
1789           lomography_x-pro_slide_200  |  low_contrast_blue  |  low_key_01   |
1790       lucky_64 | lushgreensummer |
1791           magenta_day  |  magenta_day_01  |  magenta_dream | magenta_yellow |
1792       magentacoffee | matrix |
1793           mckinnon_75 | memories | metropolis | milo_5 |  minimalistcaffeina‐
1794       tion | modern_film | mono_tinted |
1795           monochrome_1  |  monochrome_2  |  moody_1  |  moody_10  | moody_2 |
1796       moody_3 | moody_4 | moody_5 | moody_6
1797           | moody_7 | moody_8 | moody_9 | moonlight | moonlight_01 | moonrise
1798       | morning_6 | morroco_16 |
1799           mostly_blue | moviz_1 | moviz_10 | moviz_11 | moviz_12 | moviz_13 |
1800       moviz_14 | moviz_15 | moviz_16
1801           | moviz_17 | moviz_18 | moviz_19 | moviz_2 | moviz_20 | moviz_21  |
1802       moviz_22 | moviz_23 | moviz_24 |
1803           moviz_25  |  moviz_26  | moviz_27 | moviz_28 | moviz_29 | moviz_3 |
1804       moviz_30 | moviz_31 | moviz_32 |
1805           moviz_33 | moviz_34 | moviz_35 | moviz_36 | moviz_37 |  moviz_38  |
1806       moviz_39 | moviz_4 | moviz_40 |
1807           moviz_41  |  moviz_42 | moviz_43 | moviz_44 | moviz_45 | moviz_46 |
1808       moviz_47 | moviz_48 | moviz_5 |
1809           moviz_6 | moviz_7 | moviz_8 | moviz_9 |  mute_shift  |  muted_01  |
1810       muted_fade | mysticpurplesunset |
1811           nah  |  natural_vivid  | nemesis | neon_770 | neutral_teal_orange |
1812       neutral_warm_fade | newspaper |
1813           night_01 | night_blade_4 | night_king_141 | night_spy |  nightfrom‐
1814       day | nostalgiahoney | nostalgic |
1815           nw-1  |  nw-10  |  nw-2 | nw-3 | nw-4 | nw-5 | nw-6 | nw-7 | nw-8 |
1816       nw-9 | old_west | once_upon_a_time
1817           | only_red | only_red_and_blue | operation_yellow | orange_dark_4 |
1818       orange_dark_7 |
1819           orange_dark_look  |  orange_tone  | orange_underexposed | oranges |
1820       paladin | paladin_1875 |
1821           pasadena_21 | passing_by | pink_fade | pitaya_15 |  polaroid_664  |
1822       polaroid_665 | polaroid_665_+ |
1823           polaroid_665_++    |    polaroid_665_-    |    polaroid_665_--    |
1824       polaroid_665_negative |
1825           polaroid_665_negative_+      |      polaroid_665_negative_-       |
1826       polaroid_665_negative_hc | polaroid_667 |
1827           polaroid_669  | polaroid_669_+ | polaroid_669_++ | polaroid_669_+++
1828       | polaroid_669_- |
1829           polaroid_669_--  |  polaroid_669_cold   |   polaroid_669_cold_+   |
1830       polaroid_669_cold_- |
1831           polaroid_669_cold_-- | polaroid_672 | polaroid_690 | polaroid_690_+
1832       | polaroid_690_++ |
1833           polaroid_690_-   |   polaroid_690_--    |    polaroid_690_cold    |
1834       polaroid_690_cold_+ | polaroid_690_cold_++ |
1835           polaroid_690_cold_-  |  polaroid_690_cold_--  | polaroid_690_warm |
1836       polaroid_690_warm_+ |
1837           polaroid_690_warm_++ | polaroid_690_warm_- | polaroid_690_warm_-- |
1838       polaroid_polachrome |
1839           polaroid_px-100uv+_cold      |      polaroid_px-100uv+_cold_+     |
1840       polaroid_px-100uv+_cold_++ |
1841           polaroid_px-100uv+_cold_+++    |    polaroid_px-100uv+_cold_-     |
1842       polaroid_px-100uv+_cold_-- |
1843           polaroid_px-100uv+_warm      |      polaroid_px-100uv+_warm_+     |
1844       polaroid_px-100uv+_warm_++ |
1845           polaroid_px-100uv+_warm_+++    |    polaroid_px-100uv+_warm_-     |
1846       polaroid_px-100uv+_warm_-- |
1847           polaroid_px-680   |   polaroid_px-680_+   |   polaroid_px-680_++  |
1848       polaroid_px-680_- | polaroid_px-680_-- |
1849           polaroid_px-680_cold       |        polaroid_px-680_cold_+        |
1850       polaroid_px-680_cold_++ |
1851           polaroid_px-680_cold_++_alt      |     polaroid_px-680_cold_-     |
1852       polaroid_px-680_cold_-- |
1853           polaroid_px-680_warm       |        polaroid_px-680_warm_+        |
1854       polaroid_px-680_warm_++ | polaroid_px-680_warm_- |
1855           polaroid_px-680_warm_--   |  polaroid_px-70  |  polaroid_px-70_+  |
1856       polaroid_px-70_++ |
1857           polaroid_px-70_+++  |  polaroid_px-70_-   |   polaroid_px-70_--   |
1858       polaroid_px-70_cold |
1859           polaroid_px-70_cold_+        |       polaroid_px-70_cold_++       |
1860       polaroid_px-70_cold_- | polaroid_px-70_cold_-- |
1861           polaroid_px-70_warm        |        polaroid_px-70_warm_+         |
1862       polaroid_px-70_warm_++ | polaroid_px-70_warm_- |
1863           polaroid_px-70_warm_--      |      polaroid_time_zero_expired     |
1864       polaroid_time_zero_expired_+ |
1865           polaroid_time_zero_expired_++  |   polaroid_time_zero_expired_-   |
1866       polaroid_time_zero_expired_-- |
1867           polaroid_time_zero_expired_--- | polaroid_time_zero_expired_cold |
1868           polaroid_time_zero_expired_cold_-                                 |
1869       polaroid_time_zero_expired_cold_-- |
1870           polaroid_time_zero_expired_cold_--- | portrait_1  |  portrait_10  |
1871       portrait_2 | portrait_3 |
1872           portrait_4  |  portrait_5  | portrait_6 | portrait_7 | portrait_8 |
1873       portrait_9 | progressen |
1874           protect_highlights_01 | prussian_blue | pseudogrey | purple |  pur‐
1875       ple_2 | red_afternoon_01 |
1876           red_day_01    |    red_dream_01    |   redblueyellow   |   reds   |
1877       reds_oranges_yellows | reeve_38 | remy_24 |
1878           rest_33 | retro | retro_brown_01 |  retro_magenta_01  |  retro_sum‐
1879       mer_3 | retro_yellow_01 |
1880           rollei_ir_400   |   rollei_ortho_25   |   rollei_retro_100_tonal  |
1881       rollei_retro_80s | rotate_muted |
1882           rotate_vibrant | rotated | rotated_crush |  saturated_blue  |  sav‐
1883       ing_private_damon | science_fiction
1884           |   serenity   |   seringe_4   |  serpent  |  seventies_magazine  |
1885       shadow_king_39 | shine | skin_tones |
1886           smart_contrast  |  smokey  |  smooth_clear  |   smooth_cromeish   |
1887       smooth_fade | smooth_green_orange |
1888           smooth_sailing  |  smooth_teal_orange  |  soft_fade | softwarming |
1889       solarized_color | solarized_color_2
1890           |  springmorning  |  sprocket_231  |  spy_29  |   street   |   stu‐
1891       dio_skin_tone_shaper | subtle_blue |
1892           subtle_green  |  subtle_yellow  |  summer  |  summer_alt  | sunny |
1893       sunny_alt | sunny_rich | sunny_warm |
1894           super_warm  |  super_warm_rich  |  sutro_fx  |  sweet_bubblegum   |
1895       sweet_gelatto | taiga | tarraco |
1896           teal_fade | teal_moonlight | tealmagentagold | tealorange | tealor‐
1897       ange_1 | tealorange_2 |
1898           tealorange_3 | technicalfx_backlight_filter | teigen_28 |  tension‐
1899       green_1 | tensiongreen_2 |
1900           tensiongreen_3   |   tensiongreen_4  |  terra_4  |  the_matrices  |
1901       thriller_2 | toastedgarden | trent_18 |
1902           true_colors_8 | turkiest_42 | tweed_71 | ultra_water | undeniable |
1903       undeniable_2 | unknown |
1904           urban_cowboy  | uzbek_bukhara | uzbek_marriage | uzbek_samarcande |
1905       velvetia | very_warm_greenish |
1906           vibrant | vibrant_alien |  vibrant_contrast  |  vibrant_cromeish  |
1907       victory | vintage | vintage_163 |
1908           vintage_alt  | vintage_brighter | vintage_chrome | vintage_warmth_1
1909       | vireo_37 | warm |
1910           warm_dark_contrasty | warm_fade | warm_fade_1  |  warm_highlight  |
1911       warm_neutral | warm_sunset_red |
1912           warm_teal | warm_vintage | warm_yellow | well_see | whiter_whites |
1913       winterlighthouse | wipe |
1914           wooden_gold_20  |  yellow_55b  |  yellow_film_01  |  yellowstone  |
1915       you_can_do_it | zed_32 | zeke_39 |
1916           zilverfx_bw_solarization  | zilverfx_infrared | zilverfx_vintage_bw
1917       }
1918
1919           Default values: 'resolution=33' and 'cut_and_round=1'.
1920
1921           Example: [#1] clut summer clut alien_green,17 clut orange_dark4,48
1922
1923         m (+):
1924             Shortcut for command 'command'.
1925
1926         command (+):
1927             _add_debug_info={ 0 | 1 },{ filename | http[s]://URL | "string" }
1928
1929           Import G'MIC custom commands from specified file, URL or string.
1930           (equivalent to shortcut command 'm').
1931
1932           Imported commands are available directly after the 'command'  invo‐
1933       cation.
1934
1935           Default value: 'add_debug_info=1'.
1936
1937           Example:  [#1]  image.jpg  command  "foo  :  mirror  y deform $""1"
1938       +foo[0] 5 +foo[0] 15
1939
1940         cursor (+):
1941             _mode = { 0=hide | 1=show }
1942
1943           Show or hide mouse cursor for selected instant display windows.
1944           Command selection  (if  any)  stands  for  instant  display  window
1945       indices instead of image indices.
1946
1947           Default value: 'mode=1'.
1948
1949         d (+):
1950             Shortcut for command 'display'.
1951
1952         display (+):
1953             _X[%]>=0,_Y[%]>=0,_Z[%]>=0,_exit_on_anykey={ 0 | 1 }
1954
1955           Display  selected  images in an interactive viewer (use the instant
1956       display window [0] if opened).
1957           (equivalent to shortcut command 'd').
1958
1959           Arguments 'X','Y','Z' determine the initial selection view, for  3D
1960       volumetric images.
1961
1962           Default value: 'X=Y=Z=0' and 'exit_on_anykey=0'.
1963
1964           Tutorial: https://gmic.eu/tutorial/_display.shtml
1965
1966         d0:
1967             Shortcut for command 'display0'.
1968
1969         display0:
1970
1971           Display selected images without value normalization.
1972           (equivalent to shortcut command 'd0').
1973
1974         d2d:
1975             Shortcut for command 'display2d'.
1976
1977         display2d:
1978
1979           Display selected 2d images in an interactive window.
1980           (equivalent to shortcut command 'd2d').
1981
1982           This  command is used by default by command 'display' when display‐
1983       ing 2d images.
1984           If selected image is a volumetric image, each slice is displayed on
1985       a separate display
1986           window  (up to 10 images can be displayed simultaneously this way),
1987       with synchronized moves.
1988           When interactive window is opened, the following actions are possi‐
1989       ble:
1990           * Left mouse button: Create an image selection and zoom into it.
1991           * Middle mouse button, or CTRL+left mouse button: Move image.
1992           * Mouse wheel or PADD+/-: Zoom in/out.
1993           * Arrow keys: Move image left/right/up/down.
1994           * CTRL + A: Enable/disable transparency (show/hide alpha channel).
1995           * CTRL + C: Decrease window size.
1996           * CTRL + D: Increase window size.
1997           * CTRL + F: Toggle fullscreen mode.
1998           *  CTRL  +  N:  Change normalization mode (can be { none | normal |
1999       channel-by-channel }).
2000           * CTRL + O: Save a copy of the input  image,  as  a  numbered  file
2001       'gmic_xxxxxx.gmz'.
2002           * CTRL + R: Reset both window size and view.
2003           *  CTRL  +  S: Save a screenshot of the current view, as a numbered
2004       file 'gmic_xxxxxx.png'.
2005           * CTRL + SPACE: Reset view.
2006           * CTRL + X: Show/hide axes.
2007           * CTRL + Z: Hold/release aspect ratio.
2008
2009         d3d:
2010             Shortcut for command 'display3d'.
2011
2012         display3d:
2013             _[background_image],_exit_on_anykey={ 0 | 1 } |
2014             _exit_on_anykey={ 0 | 1 }
2015
2016           Display selected 3D objects  in  an  interactive  viewer  (use  the
2017       instant display window [0] if opened).
2018           (equivalent to shortcut command 'd3d').
2019
2020           Default       values:       '[background_image]=(default)'      and
2021       'exit_on_anykey=0'.
2022
2023         da:
2024             Shortcut for command 'display_array'.
2025
2026         display_array:
2027             _width>0,_height>0
2028
2029           Display images in interactive windows where pixel neighborhoods can
2030       be explored.
2031
2032           Default values: 'width=13' and 'height=width'.
2033
2034         dc:
2035             Shortcut for command 'display_camera'.
2036
2037         display_camera:
2038
2039           Open camera viewer.
2040
2041         dfft:
2042             Shortcut for command 'display_fft'.
2043
2044         display_fft:
2045
2046           Display  fourier  transform  of selected images, with centered log-
2047       module and argument.
2048           (equivalent to shortcut command 'dfft').
2049
2050           Example: [#1] image.jpg +display_fft
2051
2052         dg:
2053             Shortcut for command 'display_graph'.
2054
2055         display_graph:
2056             _width>=0,_height>=0,_plot_type,_ver‐
2057       tex_type,_xmin,_xmax,_ymin,_ymax,_xlabel,_ylabel
2058
2059           Render graph plot from selected image data.
2060           'plot_type' can be { 0=none | 1=lines | 2=splines | 3=bar }.
2061           'vertex_type'  can  be { 0=none | 1=points | 2,3=crosses | 4,5=cir‐
2062       cles | 6,7=squares }.
2063           'xmin','xmax','ymin','ymax' set the coordinates  of  the  displayed
2064       xy-axes.
2065           if  specified 'width' or 'height' is '0', then image size is set to
2066       half the screen size.
2067
2068           Default  values:  'width=0',   'height=0',   'plot_type=1',   'ver‐
2069       tex_type=1', 'xmin=xmax=ymin=ymax=0
2070             (auto)', 'xlabel="x-axis"' and 'ylabel="y-axis"'.
2071
2072           Example: [#1] 128,1,1,1,'cos(x/10+u)' +display_graph 400,300,3
2073
2074         dh:
2075             Shortcut for command 'display_histogram'.
2076
2077         display_histogram:
2078             _width>=0,_height>=0,_clus‐
2079       ters>0,_min_value[%],_max_value[%],_show_axes={ 0 | 1 },_expression.
2080
2081           Render a channel-by-channel histogram.
2082           If selected images have several slices, the rendering is  performed
2083       for all input slices.
2084           'expression'  is  a  mathematical  expression used to transform the
2085       histogram data for visualization
2086           purpose.
2087           (equivalent to shortcut command 'dh').
2088
2089           if specified 'width' or 'height' is '0', then image size is set  to
2090       half the screen size.
2091
2092           Default     values:    'width=0',    'height=0',    'clusters=256',
2093       'min_value=0%', 'max_value=100%',
2094             'show_axes=1' and 'expression=i'.
2095
2096           Example: [#1] image.jpg +display_histogram 512,300
2097
2098         display_parametric:
2099             _width>0,_height>0,_outline_opacity,_ver‐
2100       tex_radius>=0,_is_antialiased={  0  |  1 },_is_decorated={ 0 |        1
2101       },_xlabel,_ylabel
2102
2103           Render 2D or 3D parametric curve  or  point  clouds  from  selected
2104       image data.
2105           Curve points are defined as pixels of a 2 or 3-channel image.
2106           If  the point image contains more than 3 channels, additional chan‐
2107       nels define the (R,G,B) color for
2108           each vertex.
2109           If 'outline_opacity>1', the outline is  colored  according  to  the
2110       specified vertex colors and
2111           'outline_opacity-1' is used as the actual drawing opacity.
2112
2113           Default  values:  'width=512', 'height=width', 'outline_opacity=3',
2114       'vertex_radius=0',
2115             'is_antialiased=1','is_decorated=1', 'xlabel="x-axis"' and  'yla‐
2116       bel="y-axis"'.
2117
2118           Example:                                                       [#1]
2119       1024,1,1,2,'t=x/40;if(c==0,sin(t),cos(t))*(exp(cos(t))-2*cos(4*t)-sin(t/12)^5)'
2120       display_parametric 512,512
2121                    [#2] 1000,1,1,2,u(-100,100) quantize 4,1 noise 12 channels
2122       0,2 +normalize 0,255 append c       display_parametric 512,512,0.1,8
2123
2124         dp:
2125             Shortcut for command 'display_parallel'.
2126
2127         display_parallel:
2128
2129           Display each selected image in a separate interactive display  win‐
2130       dow.
2131           (equivalent to shortcut command 'dp').
2132
2133         dp0:
2134             Shortcut for command 'display_parallel0'.
2135
2136         display_parallel0:
2137
2138           Display  each selected image in a separate interactive display win‐
2139       dow, without value normalization.
2140           (equivalent to shortcut command 'dp0').
2141
2142         display_polar:
2143             _width>32,_height>32,_out‐
2144       line_type,_fill_R,_fill_G,_fill_B,_theta_start,_theta_end,_xlabel,_yla‐
2145       bel
2146
2147           Render polar curve from selected image data.
2148           'outline_type' can be { r<0=dots with radius -r |  0=no  outline  |
2149       r>0=lines+dots with radius r }.
2150           'fill_color'  can be { -1=no fill | R,G,B=fill with specified color
2151       }.
2152
2153           Default  values:  'width=500',  'height=width',   'outline_type=1',
2154       'fill_R=fill_G=fill_B=200',
2155             'theta_start=0',  'theta_end=360',  'xlabel="x-axis"'  and  'yla‐
2156       bel="y-axis"'.
2157
2158           Example:   [#1]   300,1,1,1,'0.3+abs(cos(10*pi*x/w))+u(0.4)'   dis‐
2159       play_polar 512,512,4,200,255,200
2160                    [#2]          3000,1,1,1,'x^3/1e10'          display_polar
2161       400,400,1,-1,,,0,{15*360}
2162
2163         dq:
2164             Shortcut for command 'display_quiver'.
2165
2166         display_quiver:
2167             _size_factor>0,_arrow_size>=0,_color_mode={    0=monochrome     |
2168       1=grayscale | 2=color }
2169
2170           Render selected images of 2D vectors as a field of 2D arrows.
2171           (equivalent to shortcut command 'dq').
2172
2173           Default     values:    'size_factor=16',    'arrow_size=1.5'    and
2174       'color_mode=1'.
2175
2176           Example: [#1] image.jpg +luminance gradient[-1] xy rv[-2,-1]  *[-2]
2177       -1 a[-2,-1] c crop 60,10,90,30       +display_quiver[1] ,
2178
2179         drgba:
2180             Shortcut for command 'display_rgba'.
2181
2182         display_rgba:
2183             _background_RGB_color
2184
2185           Render  selected  RGBA  images over a checkerboard or colored back‐
2186       ground.
2187           (equivalent to shortcut command 'drgba').
2188
2189           Default values: 'background_RGB_color=undefined' (checkerboard).
2190
2191           Example: [#1] image.jpg +norm threshold[-1] 40% blur[-1] 3  normal‐
2192       ize[-1] 0,255 append c display_rgba
2193
2194         dt:
2195             Shortcut for command 'display_tensors'.
2196
2197         display_tensors:
2198             _size_factor>0,_ellipse_size>=0,_color_mode={    0=monochrome   |
2199       1=grayscale | 2=color },_outline>=0
2200
2201           Render selected images of tensors as a field of 2D ellipses.
2202           (equivalent to shortcut command 'dt').
2203
2204           Default     values:      'size_factor=16',      'ellipse_size=1.5',
2205       'color_mode=2' and 'outline=2'.
2206
2207           Example:  [#1]  image.jpg  +diffusiontensors  0.1,0.9 resize2dx. 32
2208       +display_tensors. 64,2
2209
2210           Tutorial: https://gmic.eu/tutorial/_display_tensors.shtml
2211
2212         dw:
2213             Shortcut for command 'display_warp'.
2214
2215         display_warp:
2216             _cell_size>0
2217
2218           Render selected 2D warping fields.
2219           (equivalent to shortcut command 'dw').
2220
2221           Default value: 'cell_size=15'.
2222
2223           Example:               [#1]               400,400,1,2,'x=x-w/2;y=y-
2224       h/2;r=sqrt(x*x+y*y);a=atan2(y,x);5*sin(r/10)*[cos(a),sin(a)]'
2225       +display_warp 10
2226
2227         e (+):
2228             Shortcut for command 'echo'.
2229
2230         echo (+):
2231             message
2232
2233           Output specified message on the error output.
2234           (equivalent to shortcut command 'e').
2235
2236           Command selection (if any) stands for displayed call  stack  subset
2237       instead of image indices.
2238
2239         echo_file:
2240             filename,message
2241
2242           Output specified message, appending it to specified output file.
2243           (similar to 'echo' for specified output file stream).
2244
2245         echo_stdout:
2246             message
2247
2248           Output specified message, on the standard output (stdout).
2249           (similar  to  'echo' for output on standard output instead of stan‐
2250       dard error).
2251
2252         function1d:
2253             0<=smoothness<=1,x0>=0,y0,x1>=0,y1,...,xn>=0,yn
2254
2255           Insert continuous 1D function  from  specified  list  of  keypoints
2256       (xk,yk)
2257           in range [0,max(xk)] (xk are positive integers).
2258
2259           Default values: 'smoothness=1' and 'x0=y0=0'.
2260
2261           Example:   [#1]   function1d   1,0,0,10,30,40,20,70,30,80,0   +dis‐
2262       play_graph 400,300
2263
2264         funny_oneliners:
2265
2266           This commands shows examples of funny oneliners that  produce  cool
2267       results!
2268
2269           Example:   [#1]   729,729,1,3,"c(x,y,l)   =   (S   =  round(w/3^l);
2270       (int(x/S)%3)*(int(y/S)%3)==1?255:l<6?c(x,y,l +        1):0);  c(x,y,1)"
2271       nm "Sierpinski Carpet"
2272                    [#2] 1024,1024,1,1,">x>y?0:y<2?1:xor(j(0,-1),j(-1,-1))" f.
2273       "255*j(-w/2+y/2,0)" nm "Sierpinksi       Triangle"
2274                    [#3] 500,500 repeat 10 +noise_poissondisk[0]  {3+$>}  done
2275       rm[0]  a  z f "!z?(R=cut(norm(x-w/2,      y-h/2)/20,0,d-1);i(x,y,R)):0"
2276       slices 0 to_rgb f  "max(I)?u([255,255,255]):I"  blur_radial        0.6%
2277       equalize n 0,255 nm "Light Speed"
2278                    [#4]  100000,1,1,1,0.6180339887498948482*x round f i-j[-1]
2279       (1,-1)  *  cumulate  mod  4  +  1   +f   arg(i,        1,1,-1,-1)   f..
2280       arg(i,-1,1,1,-1)  cumulate -[0] {0,im} -[1] {1,im} a y pointcloud 0 b 1
2281       nm       "Fibonacci Word, by James Prichard"
2282                    [#5]
2283       1000,1000,1,1,f(x,y,l)=l?f(max(x,y)%3,abs(min(x,y))*3,l-1):x;f(x/w-.7,y/w,6)
2284       nm       "Recursive macro, by James Prichard"
2285
2286         i (+):
2287             Shortcut for command 'input'.
2288
2289         input (+):
2290             [type:]filename |
2291             [type:]http://URL |
2292             [selection]x_nb_copies>0 |
2293             {  width>0[%]  |  [image_w]  },{  _height>0[%]  |  [image_h]  },{
2294       _depth>0[%]  |  [image_d]  },{         _spectrum>0[%]  | [image_s] },_{
2295       value1,_value2,... | 'formula' } |
2296             (value1{,|;|/|^}value2{,|;|/|^}...[:{x|y|z|c|,|;|/|^}]) |
2297             0
2298
2299           Insert a new image taken from a filename  or  from  a  copy  of  an
2300       existing image [index],
2301           or  insert  new  image with specified dimensions and values. Single
2302       quotes may be omitted in
2303           'formula'. Specifying argument '0' inserts an 'empty' image.
2304           (equivalent to shortcut command 'i').
2305
2306           Default  values:   'nb_copies=1',   'height=depth=spectrum=1'   and
2307       'value1=0'.
2308
2309           Example: [#1] input image.jpg
2310                    [#2] input (1,2,3;4,5,6;7,8,9^9,8,7;6,5,4;3,2,1)
2311                    [#3]     image.jpg     (1,2,3;4,5,6;7,8,9)    (255^128^64)
2312       400,400,1,3,'if(x>w/2,x,y)*c'
2313
2314           Tutorial: https://gmic.eu/tutorial/_input.shtml
2315
2316         input_565:
2317             filename,width>0,height>0,reverse_endianness={ 0 | 1 }
2318
2319           Insert image data from a raw RGB-565 file, at the end of the list.
2320
2321           Default value: 'reverse_endianness=0'.
2322
2323         input_cube:
2324             "filename",_convert_1d_cluts_to_3d={ 0 | 1 }.
2325
2326           Insert CLUT data from a .cube filename (Adobe CLUT file format).
2327
2328           Default value: 'convert_1d_cluts_to_3d=1'.
2329
2330         input_flo:
2331             "filename"
2332
2333           Insert optical flow  data  from  a  .flo  filename  (vision.middle‐
2334       bury.edu file format).
2335
2336         ig:
2337             Shortcut for command 'input_glob'.
2338
2339         input_glob:
2340             pattern
2341
2342           Insert  new  images from several filenames that match the specified
2343       glob pattern.
2344           (equivalent to shortcut command 'ig').
2345
2346         input_gpl:
2347             filename
2348
2349           Input specified filename as a .gpl palette data file.
2350
2351         it:
2352             Shortcut for command 'input_text'.
2353
2354         input_text:
2355             filename
2356
2357           Input specified text-data filename as a new image.
2358           (equivalent to shortcut command 'it').
2359
2360         network (+):
2361             mode={ -1=disabled | 0=enabled w/o timeout | >0=enabled w/ speci‐
2362       fied timeout in seconds }
2363
2364           Enable/disable load-from-network and set corresponding timeout.
2365           (Default mode is 'enabled w/o timeout').
2366
2367         o (+):
2368             Shortcut for command 'output'.
2369
2370         output (+):
2371             [type:]filename,_format_options
2372
2373           Output selected images as one or several numbered file(s).
2374           (equivalent to shortcut command 'o').
2375
2376           Default value: 'format_options'=(undefined).
2377
2378         output_565:
2379             "filename",reverse_endianness={ 0=false | 1=true }
2380
2381           Output selected images as raw RGB-565 files.
2382
2383           Default value: 'reverse_endianness=0'.
2384
2385         output_cube:
2386             "filename"
2387
2388           Output selected CLUTs as a .cube file (Adobe CLUT format).
2389
2390         output_flo:
2391             "filename"
2392
2393           Output  selected optical flow as a .flo file (vision.middlebury.edu
2394       file format).
2395
2396         output_ggr:
2397             filename,_gradient_name
2398
2399           Output selected images as .ggr gradient files (GIMP).
2400           If no gradient name is specified, it is deduced from the filename.
2401
2402         ot:
2403             Shortcut for command 'output_text'.
2404
2405         output_text:
2406             filename
2407
2408           Output selected images as text-data filenames.
2409           (equivalent to shortcut command 'ot').
2410
2411         on:
2412             Shortcut for command 'outputn'.
2413
2414         outputn:
2415             filename,_index
2416
2417           Output selected  images  as  automatically  numbered  filenames  in
2418       repeat...done loops.
2419           (equivalent to shortcut command 'on').
2420
2421         op:
2422             Shortcut for command 'outputp'.
2423
2424         outputp:
2425             prefix
2426
2427           Output selected images as prefixed versions of their original file‐
2428       names.
2429           (equivalent to shortcut command 'op').
2430
2431           Default value: 'prefix=_'.
2432
2433         ow:
2434             Shortcut for command 'outputw'.
2435
2436         outputw:
2437
2438           Output selected images by overwriting their original location.
2439           (equivalent to shortcut command 'ow').
2440
2441         ox:
2442             Shortcut for command 'outputx'.
2443
2444         outputx:
2445             extension1,_extension2,_...,_extensionN,_output_at_same_loca‐
2446       tion={ 0 | 1 }
2447
2448           Output selected images with same base filenames but for N different
2449       extensions.
2450           (equivalent to shortcut command 'ox').
2451
2452           Default value: 'output_at_same_location=0'.
2453
2454         parse_cli:
2455             _output_mode,_{ * | command_name }
2456
2457           Parse definition of ''-documented commands and  output  info  about
2458       them in specified output mode.
2459           'output_mode'  can  be  {  ascii | bashcompletion | html | images |
2460       print }.
2461
2462           Default values: 'output_mode=print' and 'command_name=*'.
2463
2464         parse_gui:
2465             _outputmode,_{ * | filter_name}
2466
2467           Parse selected filter definitions and generate info  about  filters
2468       in selected output mode.
2469           'outputmode' can be { json | list | print | strings | update | zart
2470       }.
2471           It is possible to define a custom output mode, by implementing  the
2472       following commands
2473           ('outputmode'  must be replaced by the name of the custom user out‐
2474       put mode):
2475           * 'parse_gui_outputmode' :  A  command  that  outputs  the  parsing
2476       information with a custom format.
2477           *  'parse_gui_parseparams_outputmode'  (optional): A simple command
2478       that returns 0 or 1. It tells the
2479           parser whether parameters  of  matching  filter  must  be  analyzed
2480       (slower) or not.
2481           *  'parse_gui_trigger_outputmode'  (optional):  A  command  that is
2482       called by the parser just before
2483           parsing the set of each matching filters.
2484           Here is the list of global variables set by the parser,  accessible
2485       in command
2486           'parse_gui_outputmode':
2487           '$_nbfilters': Number of matching filters.
2488           '$_nongui'  (stored as an image): All merged lines in the file that
2489       do not correspond to '#@gui'
2490           lines.
2491           For each filter     * '$_fF_name' : Filter name.
2492           * '$_fF_path' : Full path.
2493           * '$_fF_locale' : Filter locale (empty, if not specified).
2494           * '$_fF_command' : Filter command.
2495           * '$_fF_commandpreview' : Filter preview  command  (empty,  if  not
2496       specified).
2497           *  '$_fF_zoomfactor'  :  Default  zoom factor (empty, if not speci‐
2498       fied).
2499           * '$_fF_zoomaccurate' : Is preview accurate  when  zoom  changes  ?
2500       (can be { 0=false | 1=true }).
2501           *  '$_fF_inputmode'  :  Default preferred input mode (empty, if not
2502       specified).
2503           * '$_fF_hide' : Path of filter hid by current filter (for localized
2504       filters, empty if not
2505           specified).
2506           * '$_fF_nbparams' : Number of parameters.
2507           For each parameter     * '$_fF_pP_name' : Parameter name.
2508           * '$_fF_pP_type' : Parameter type.
2509           *  '$_fF_pP_responsivity'  : Parameter responsivity (can be { 0 | 1
2510       }).
2511           * '$_fF_pP_visibility' : Parameter visibility.
2512           * '$_fF_pP_propagation' : Propagation of the parameter visibility.
2513           * '$_fF_pP_nbargs' : Number of parameter arguments.
2514           For each argument     * '$_fF_pP_aA' : Argument value
2515           Default parameters: 'filter_name=*' and 'output_format=print'.
2516
2517         pass (+):
2518             _shared_state={ -1=status only | 0=non-shared (copy) | 1=shared |
2519       2=adaptive }
2520
2521           Insert  images  from  parent context of a custom command or a local
2522       environment.
2523           Command selection (if any) stands for a selection of images in  the
2524       parent context.
2525           By default (adaptive shared state), selected images are inserted in
2526       a shared state if they do not
2527           belong
2528           to the context (selection) of the current custom command  or  local
2529       environment as well.
2530           Typical  use  of  command 'pass' concerns the design of custom com‐
2531       mands that take images as arguments.
2532           This commands return the list of corresponding indices in the  sta‐
2533       tus.
2534
2535           Default value: 'shared_state=2'.
2536
2537           Example:  [#1] command "average : pass$""1 add[^-1] [-1] remove[-1]
2538       div 2" sample ? +mirror y       +average[0] [1]
2539
2540         plot (+):
2541             _plot_type,_vertex_type,_xmin,_xmax,_ymin,_ymax,_exit_on_anykey={
2542       0 | 1 } |
2543             'formula',_resolution>=0,_plot_type,_ver‐
2544       tex_type,_xmin,xmax,_ymin,_ymax,_exit_on_anykey={ 0 | 1 }
2545
2546           Display selected images or formula in an  interactive  viewer  (use
2547       the instant display window [0] if
2548           opened).
2549           'plot_type' can be { 0=none | 1=lines | 2=splines | 3=bar }.
2550           'vertex_type'  can  be { 0=none | 1=points | 2,3=crosses | 4,5=cir‐
2551       cles | 6,7=squares }.
2552           'xmin', 'xmax', 'ymin', 'ymax' set the coordinates of the displayed
2553       xy-axes.
2554
2555           Default        values:        'plot_type=1',       'vertex_type=1',
2556       'xmin=xmax=ymin=ymax=0 (auto)' and
2557             'exit_on_anykey=0'.
2558
2559         p (+):
2560             Shortcut for command 'print'.
2561
2562         print (+):
2563
2564           Output information  on  selected  images,  on  the  standard  error
2565       (stderr).
2566           (equivalent to shortcut command 'p').
2567
2568         random_pattern:
2569             _width>0,_height>0,_min_detail_level>=0
2570
2571           Insert  a  new  RGB image of specified size at the end of the image
2572       list, rendered with a random
2573           pattern.
2574
2575           Default values: 'width=height=512' and 'min_detail_level=2'.
2576
2577           Example: [#1] repeat 6 random_pattern 256 done
2578
2579         screen (+):
2580             _x0[%],_y0[%],_x1[%],_y1[%]
2581
2582           Take screenshot, optionally grabbed with specified coordinates, and
2583       insert it
2584           at the end of the image list.
2585
2586         select (+):
2587             feature_type,_X[%]>=0,_Y[%]>=0,_Z[%]>=0,_exit_on_anykey={  0  | 1
2588       },_is_deep_selection={ 0 | 1 }
2589
2590           Interactively select  a  feature  from  selected  images  (use  the
2591       instant display window [0] if opened).
2592           'feature_type'  can  be  {  0=point  |  1=segment  |  2=rectangle |
2593       3=ellipse }.
2594           Arguments 'X','Y','Z' determine the initial selection view, for  3D
2595       volumetric images.
2596           The  retrieved  feature  is  returned  as  a  3D  vector  (if 'fea‐
2597       ture_type==0') or as a 6d vector
2598           (if 'feature_type!=0') containing the feature coordinates.
2599
2600           Default   values:   'X=Y=Z=(undefined)',   'exit_on_anykey=0'   and
2601       'is_deep_selection=0'.
2602
2603         serialize (+):
2604             _datatype,_is_compressed={ 0 | 1 },_store_names={ 0 | 1 }
2605
2606           Serialize  selected list of images into a single image, optionnally
2607       in a compressed form.
2608           'datatype' can be { auto | uchar | char | ushort | short |  uint  |
2609       int | uint64 | int64 | float |
2610           double }.
2611           Specify  'datatype'  if  all selected images have a range of values
2612       constrained to a particular
2613           datatype,
2614           in order to minimize the memory footprint.
2615           The resulting image has only integers values  in  [0,255]  and  can
2616       then be saved as a raw image of
2617           unsigned  chars  (doing  so  will  output  a valid .cimg[z] or .gmz
2618       file).
2619           If 'store_names' is set to '1', serialization uses the .gmz  format
2620       to store data in memory
2621           (otherwise the .cimg[z] format).
2622
2623           Default     values:    'datatype=auto',    'is_compressed=1'    and
2624       'store_names=1'.
2625
2626           Example: [#1] image.jpg +serialize uchar +unserialize[-1]
2627
2628         shape_circle:
2629             _size>=0
2630
2631           Input a 2D circle binary shape with specified size.
2632
2633           Default value: 'size=512'.
2634
2635           Example: [#1] shape_circle ,
2636
2637         shape_cupid:
2638             _size>=0
2639
2640           Input a 2D cupid binary shape with specified size.
2641
2642           Default value: 'size=512'.
2643
2644           Example: [#1] shape_cupid ,
2645
2646         shape_diamond:
2647             _size>=0
2648
2649           Input a 2D diamond binary shape with specified size.
2650
2651           Default value: 'size=512'.
2652
2653           Example: [#1] shape_diamond ,
2654
2655         shape_dragon:
2656             _size>=0,_recursion_level>=0,_angle
2657
2658           Input a 2D Dragon curve with specified size.
2659
2660           Default value: 'size=512', 'recursion_level=18' and 'angle=0'.
2661
2662           Example: [#1] shape_dragon ,
2663
2664         shape_fern:
2665             _size>=0,_density[%]>=0,_angle,0<=_opacity<=1,_type={ 0=Asplenium
2666       adiantum-nigrum |        1=Thelypteridaceae }
2667
2668           Input a 2D Barnsley fern with specified size.
2669
2670           Default value: 'size=512', 'density=50%', 'angle=30', 'opacity=0.3'
2671       and 'type=0'.
2672
2673           Example: [#1] shape_fern ,
2674
2675         shape_gear:
2676             _size>=0,_nb_teeth>0,0<=_height_teeth<=100,0<=_off‐
2677       set_teeth<=100,0<=_inner_radius<=100
2678
2679           Input a 2D gear binary shape with specified size.
2680
2681           Default  value: 'size=512', 'nb_teeth=12', 'height_teeth=20', 'off‐
2682       set_teeth=0' and
2683             'inner_radius=40'.
2684
2685           Example: [#1] shape_gear ,
2686
2687         shape_heart:
2688             _size>=0
2689
2690           Input a 2D heart binary shape with specified size.
2691
2692           Default value: 'size=512'.
2693
2694           Example: [#1] shape_heart ,
2695
2696         shape_polygon:
2697             _size>=0,_nb_vertices>=3,_angle
2698
2699           Input a 2D polygonal binary shape with specified geometry.
2700
2701           Default value: 'size=512', 'nb_vertices=5' and 'angle=0'.
2702
2703           Example: [#1] repeat 6 shape_polygon 256,{3+$>} done
2704
2705         shape_snowflake:
2706             size>=0,0<=_nb_recursions<=6
2707
2708           Input a 2D snowflake binary shape with specified size.
2709
2710           Default values: 'size=512' and 'nb_recursions=5'.
2711
2712           Example: [#1] repeat 6 shape_snowflake 256,$> done
2713
2714         shape_star:
2715             _size>=0,_nb_branches>0,0<=_thickness<=1
2716
2717           Input a 2D star binary shape with specified size.
2718
2719           Default values: 'size=512', 'nb_branches=5' and 'thickness=0.38'.
2720
2721           Example: [#1] repeat 9 shape_star 256,{$>+2} done
2722
2723         sh (+):
2724             Shortcut for command 'shared'.
2725
2726         shared (+):
2727             x0[%],x1[%],y[%],z[%],c[%] |
2728             y0[%],y1[%],z[%],c[%] |
2729             z0[%],z1[%],c[%] |
2730             c0[%],c1[%] |
2731             c0[%] |
2732             (no arg)
2733
2734           Insert shared buffers from  (opt.  points/rows/planes/channels  of)
2735       selected images.
2736           Shared  buffers  cannot be returned by a command, nor a local envi‐
2737       ronment.
2738           (equivalent to shortcut command 'sh').
2739
2740           Example: [#1] image.jpg shared 1 blur[-1] 3 remove[-1]
2741                    [#2] image.jpg repeat s shared 25%,75%,0,$>  mirror[-1]  x
2742       remove[-1] done
2743
2744           Tutorial: https://gmic.eu/tutorial/_shared.shtml
2745
2746         sp:
2747             Shortcut for command 'sample'.
2748
2749         sample:
2750             _name1={ ? | apples | balloons | barbara | boats | bottles | but‐
2751       terfly | cameraman | car | cat |        cliff  |  chick  |  colorful  |
2752       david  |  dog  |  duck  |  eagle | elephant | earth | flower | fruits |
2753       gmicky        | gmicky_mahvin | gmicky_wilber | greece | gummy |  house
2754       |  inside  |  landscape | leaf | lena | leno        | lion | mandrill |
2755       monalisa | monkey | parrots | pencils | peppers | portrait0 | portrait1
2756       |         portrait2  |  portrait3 | portrait4 | portrait5 | portrait6 |
2757       portrait7 | portrait8 | portrait9 |        roddy |  rooster  |  rose  |
2758       square  |  swan  |  teddy  |  tiger | tulips | wall | waterfall | zelda
2759       },_name2,       ...,_nameN,_width={ >=0 | 0 (auto) },_height = { >=0  |
2760       0 (auto) } |
2761             (no arg)
2762
2763           Input a new sample RGB image (opt. with specified size).
2764           (equivalent to shortcut command 'sp').
2765
2766           Argument  'name'  can  be  replaced by an integer which serves as a
2767       sample index.
2768
2769           Example: [#1] repeat 6 sample done
2770
2771         srand (+):
2772             value |
2773             (no arg)
2774
2775           Set random generator seed.
2776           If no argument is specified, a random value is used as  the  random
2777       generator seed.
2778
2779         store (+):
2780             _is_compressed={ 0 | 1 },variable_name1,_variable_name2,...
2781
2782           Store selected images into one or several named variables.
2783           Selected  images  are  transferred  to  the  variables,  and are so
2784       removed from the image list.
2785           (except if the prepended variant of the command '+store[selection]'
2786       is used).
2787           If a single variable name is specified, all images of the selection
2788       are assigned
2789           to the named variable. Otherwise, there must be  as  many  variable
2790       names as images
2791           in the selection, and each selected image is assigned to each spec‐
2792       ified named variable.
2793           Use command 'input $variable' to bring the stored  images  back  in
2794       the list.
2795
2796           Default value: 'is_compressed=0'.
2797
2798           Example: [#1] sample eagle,earth store img1,img2 input $img2 $img1
2799
2800         testimage2d:
2801             _width>0,_height>0,_spectrum>0
2802
2803           Input a 2D synthetic image.
2804
2805           Default values: 'width=512', 'height=width' and 'spectrum=3'.
2806
2807           Example: [#1] testimage2d 512
2808
2809         um:
2810             Shortcut for command 'uncommand'.
2811
2812         uncommand (+):
2813             command_name[,_command_name2,...] |
2814             *
2815
2816           Discard definition of specified custom commands.
2817           Set argument to '*' for discarding all existing custom commands.
2818           (equivalent to shortcut command 'um').
2819
2820         uniform_distribution:
2821             nb_levels>=1,spectrum>=1
2822
2823           Input set of uniformly distributed spectrum-d points in [0,1]^spec‐
2824       trum.
2825
2826           Example: [#1] uniform_distribution 64,3 * 255 +distribution3d  cir‐
2827       cles3d[-1] 10
2828
2829         unserialize (+):
2830
2831           Recreate  lists  of  images from serialized image buffers, obtained
2832       with command 'serialize'.
2833
2834         up:
2835             Shortcut for command 'update'.
2836
2837         update:
2838
2839           Update commands from  the  latest  definition  file  on  the  G'MIC
2840       server.
2841           (equivalent to shortcut command 'up').
2842
2843         v (+):
2844             Shortcut for command 'verbose'.
2845
2846         verbose (+):
2847             level |
2848             { + | - }
2849
2850           Set or increment/decrement the verbosity level. Default level is 0.
2851           (equivalent to shortcut command 'v').
2852
2853           When  'level'>0,  G'MIC  log messages are displayed on the standard
2854       error (stderr).
2855
2856           Default value: 'level=1'.
2857
2858         wait (+):
2859             delay |
2860             (no arg)
2861
2862           Wait for a given delay (in ms), optionally since the last  call  to
2863       'wait'.
2864           or  wait for a user event occurring on the selected instant display
2865       windows.
2866           'delay' can be { <0=delay+flush events | 0=event | >0=delay }.
2867           Command selection  (if  any)  stands  for  instant  display  window
2868       indices instead of image indices.
2869           If  no window indices are specified and if 'delay' is positive, the
2870       command results
2871           in a 'hard' sleep during specified delay.
2872
2873           Default value: 'delay=0'.
2874
2875         warn (+):
2876             _force_visible={ 0 | 1 },_message
2877
2878           Print specified warning message, on the standard error (stderr).
2879           Command selection (if any) stands for displayed call  stack  subset
2880       instead of image indices.
2881
2882         w (+):
2883             Shortcut for command 'window'.
2884
2885         window (+):
2886             _width[%]>=-1,_height[%]>=-1,_normaliza‐
2887       tion,_fullscreen,_pos_x[%],_pos_y[%],_title
2888
2889           Display selected images into an instant display window with  speci‐
2890       fied size, normalization type,
2891           fullscreen mode and title.
2892           (equivalent to shortcut command 'w').
2893
2894           If 'width' or 'height' is set to -1, the corresponding dimension is
2895       adjusted to the window
2896           or image size.
2897           Specify 'pos_x' and 'pos_y' arguments only if the window has to  be
2898       moved to the specified
2899           coordinates. Otherwise, they can be avoided.
2900           'width'=0 or 'height'=0 closes the instant display window.
2901           'normalization'  can be { -1=keep same | 0=none | 1=always | 2=1st-
2902       time | 3=auto }.
2903           'fullscreen' can be { -1=keep same | 0=no | 1=yes }.
2904           You can manage up to 10 different instant display windows by  using
2905       the numbered variants
2906           'w0' (default, eq. to 'w'),'w1',...,'w9' of the command 'w'.
2907           Invoke 'window' with no selection to make the window visible, if is
2908       has been closed by the user.
2909
2910           Default  values:   'width=height=normalization=fullscreen=-1'   and
2911       'title=(undefined)'.
2912
2913         12.3. List Manipulation
2914               -----------------
2915
2916         k (+):
2917             Shortcut for command 'keep'.
2918
2919         keep (+):
2920
2921           Keep only selected images.
2922           (equivalent to shortcut command 'k').
2923
2924           Example: [#1] image.jpg split x keep[0-50%:2] append x
2925                    [#2] image.jpg split x keep[^30%-70%] append x
2926
2927         mv (+):
2928             Shortcut for command 'move'.
2929
2930         move (+):
2931             position[%]
2932
2933           Move selected images at specified position.
2934           (equivalent to shortcut command 'mv').
2935
2936           Example: [#1] image.jpg split x,3 move[1] 0
2937                    [#2] image.jpg split x move[50%--1:2] 0 append x
2938
2939         nm (+):
2940             Shortcut for command 'name'.
2941
2942         name (+):
2943             "name1","name2",...
2944
2945           Set names of selected images.
2946           *  If the selection contains a single image, then it is assumed the
2947       command has a single name
2948            argument (possibly containing multiple comas).
2949           * If the selection contains more than one image, each command argu‐
2950       ment defines a single image
2951            name for each image of the selection.
2952           (equivalent to shortcut command 'nm').
2953
2954           Example: [#1] image.jpg name image blur[image] 2
2955
2956           Tutorial: https://gmic.eu/tutorial/_name.shtml
2957
2958         rm (+):
2959             Shortcut for command 'remove'.
2960
2961         remove (+):
2962
2963           Remove selected images.
2964           (equivalent to shortcut command 'rm').
2965
2966           Example: [#1] image.jpg split x remove[30%-70%] append x
2967                    [#2] image.jpg split x remove[0-50%:2] append x
2968
2969         remove_duplicates:
2970
2971           Remove duplicates images in the selected images list.
2972
2973           Example:  [#1]  (1,2,3,4,2,4,3,1,3,4,2,1) split x remove_duplicates
2974       append x
2975
2976         remove_empty:
2977
2978           Remove empty images in the selected image list.
2979
2980         rmn:
2981             Shortcut for command 'remove_named'.
2982
2983         remove_named:
2984             "name1","name2",...
2985
2986           Remove all images with specified names from the list of images.
2987           Does nothing if no images with those names exist.
2988           (equivalent to shortcut command 'rmn').
2989
2990         rv (+):
2991             Shortcut for command 'reverse'.
2992
2993         reverse (+):
2994
2995           Reverse positions of selected images.
2996           (equivalent to shortcut command 'rv').
2997
2998           Example: [#1] image.jpg split x,3 reverse[-2,-1]
2999                    [#2] image.jpg split x,-16 reverse[50%-100%] append x
3000
3001         sort_list:
3002             _ordering={ + | - },_criterion
3003
3004           Sort list of selected images according to the specified image  cri‐
3005       terion.
3006
3007           Default values: 'ordering=+', 'criterion=i'.
3008
3009           Example:  [#1]  (1;4;7;3;9;2;4;7;6;3;9;1;0;3;3;2) split y sort_list
3010       +,i append y
3011
3012         12.4. Mathematical Operators
3013               ----------------------
3014
3015         abs (+):
3016
3017           Compute the pointwise absolute values of selected images.
3018
3019           Example: [#1] image.jpg +sub {ia} abs[-1]
3020                    [#2] 300,1,1,1,'cos(20*x/w)' +abs display_graph 400,300
3021
3022         acos (+):
3023
3024           Compute the pointwise arccosine of selected images.
3025
3026           Example: [#1] image.jpg +normalize -1,1 acos[-1]
3027                    [#2]  300,1,1,1,'cut(x/w+0.1*u,0,1)'  +acos  display_graph
3028       400,300
3029
3030           Tutorial:   https://gmic.eu/tutorial/trigometric-and-inverse-trigo
3031       metric-commands.shtml
3032
3033         acosh (+):
3034
3035           Compute the pointwise hyperbolic arccosine of selected images.
3036
3037         + (+):
3038             Shortcut for command 'add'.
3039
3040         add (+):
3041             value[%] |
3042             [image] |
3043             'formula' |
3044             (no arg)
3045
3046           Add specified value, image or mathematical expression  to  selected
3047       images, or compute the pointwise
3048           sum of selected images.
3049           (equivalent to shortcut command '+').
3050
3051           Example: [#1] image.jpg +add 30% cut 0,255
3052                    [#2] image.jpg +blur 5 normalize 0,255 add[1] [0]
3053                    [#3]  image.jpg add '80*cos(80*(x/w-0.5)*(y/w-0.5)+c)' cut
3054       0,255
3055                    [#4] image.jpg  repeat  9  +rotate[0]  {$>*36},1,0,50%,50%
3056       done add div 10
3057
3058         & (+):
3059             Shortcut for command 'and'.
3060
3061         and (+):
3062             value[%] |
3063             [image] |
3064             'formula' |
3065             (no arg)
3066
3067           Compute  the  bitwise  AND of selected images with specified value,
3068       image or mathematical expression,
3069           or compute the pointwise sequential bitwise AND of selected images.
3070           (equivalent to shortcut command '&').
3071
3072           Example: [#1] image.jpg and {128+64}
3073                    [#2] image.jpg +mirror x and
3074
3075         argmax:
3076
3077           Compute the argmax of selected images. Returns a single image
3078           with each pixel value being the index of the input image with maxi‐
3079       mal value.
3080
3081           Example: [#1] image.jpg sample lena,lion,square +argmax
3082
3083         argmaxabs:
3084
3085           Compute the argmaxabs of selected images. Returns a single image
3086           with  each pixel value being the index of the input image with max‐
3087       abs value.
3088
3089         argmin:
3090
3091           Compute the argmin of selected images. Returns a single image
3092           with each pixel value being the index of the input image with mini‐
3093       mal value.
3094
3095           Example: [#1] image.jpg sample lena,lion,square +argmin
3096
3097         argminabs:
3098
3099           Compute the argminabs of selected images. Returns a single image
3100           with  each  pixel  value  being  the  index of the input image with
3101       minabs value.
3102
3103         asin (+):
3104
3105           Compute the pointwise arcsine of selected images.
3106
3107           Example: [#1] image.jpg +normalize -1,1 asin[-1]
3108                    [#2]  300,1,1,1,'cut(x/w+0.1*u,0,1)'  +asin  display_graph
3109       400,300
3110
3111           Tutorial:   https://gmic.eu/tutorial/trigometric-and-inverse-trigo
3112       metric-commands.shtml
3113
3114         asinh (+):
3115
3116           Compute the pointwise hyperbolic arcsine of selected images.
3117
3118         atan (+):
3119
3120           Compute the pointwise arctangent of selected images.
3121
3122           Example: [#1] image.jpg +normalize 0,8 atan[-1]
3123                    [#2] 300,1,1,1,'4*x/w+u' +atan display_graph 400,300
3124
3125           Tutorial:   https://gmic.eu/tutorial/trigometric-and-inverse-trigo
3126       metric-commands.shtml
3127
3128         atan2 (+):
3129             [x_argument]
3130
3131           Compute the pointwise oriented arctangent of selected images.
3132           Each selected image is regarded as the y-argument of the arctangent
3133       function, while the
3134           specified image gives the corresponding x-argument.
3135
3136           Example: [#1]  (-1,1)  (-1;1)  resize  400,400,1,1,3  atan2[1]  [0]
3137       keep[1] mod {pi/8}
3138
3139           Tutorial:   https://gmic.eu/tutorial/trigometric-and-inverse-trigo
3140       metric-commands.shtml
3141
3142         atanh (+):
3143
3144           Compute the pointwise hyperbolic arctangent of selected images.
3145
3146         << (+):
3147             Shortcut for command 'bsl'.
3148
3149         bsl (+):
3150             value[%] |
3151             [image] |
3152             'formula' |
3153             (no arg)
3154
3155           Compute the bitwise left shift of selected  images  with  specified
3156       value, image or mathematical
3157           expression,  or compute the pointwise sequential bitwise left shift
3158       of selected images.
3159           (equivalent to shortcut command '<<').
3160
3161           Example: [#1] image.jpg bsl 'round(3*x/w,0)' cut 0,255
3162
3163         >> (+):
3164             Shortcut for command 'bsr'.
3165
3166         bsr (+):
3167             value[%] |
3168             [image] |
3169             'formula' |
3170             (no arg)
3171
3172           Compute the bitwise right shift of selected images  with  specified
3173       value, image or mathematical
3174           expression, or compute the pointwise sequential bitwise right shift
3175       of selected images.
3176           (equivalent to shortcut command '>>').
3177
3178           Example: [#1] image.jpg bsr 'round(3*x/w,0)' cut 0,255
3179
3180         cos (+):
3181
3182           Compute the pointwise cosine of selected images.
3183
3184           Example: [#1] image.jpg +normalize 0,{2*pi} cos[-1]
3185                    [#2] 300,1,1,1,'20*x/w+u' +cos display_graph 400,300
3186
3187           Tutorial:   https://gmic.eu/tutorial/trigometric-and-inverse-trigo
3188       metric-commands.shtml
3189
3190         cosh (+):
3191
3192           Compute the pointwise hyperbolic cosine of selected images.
3193
3194           Example: [#1] image.jpg +normalize -3,3 cosh[-1]
3195                    [#2] 300,1,1,1,'4*x/w+u' +cosh display_graph 400,300
3196
3197         / (+):
3198             Shortcut for command 'div'.
3199
3200         div (+):
3201             value[%] |
3202             [image] |
3203             'formula' |
3204             (no arg)
3205
3206           Divide  selected  images  by specified value, image or mathematical
3207       expression, or compute the
3208           pointwise quotient of selected images.
3209           (equivalent to shortcut command '/').
3210
3211           Example: [#1] image.jpg div '1+abs(cos(x/10)*sin(y/10))'
3212                    [#2] image.jpg +norm add[-1] 1 +div
3213
3214         div_complex:
3215             [divider_real,divider_imag],_epsilon>=0
3216
3217           Perform    division    of    the     selected     complex     pairs
3218       (real1,imag1,...,realN,imagN) of images by
3219           specified complex pair of images (divider_real,divider_imag).
3220           In  complex pairs, the real image must be always located before the
3221       imaginary image in the image
3222           list.
3223
3224           Default value: 'epsilon=1e-8'.
3225
3226         == (+):
3227             Shortcut for command 'eq'.
3228
3229         eq (+):
3230             value[%] |
3231             [image] |
3232             'formula' |
3233             (no arg)
3234
3235           Compute the boolean equality  of  selected  images  with  specified
3236       value, image or mathematical
3237           expression, or compute the boolean equality of selected images.
3238           (equivalent to shortcut command '==').
3239
3240           Example: [#1] image.jpg round 40 eq {round(ia,40)}
3241                    [#2] image.jpg +mirror x eq
3242
3243         exp (+):
3244
3245           Compute the pointwise exponential of selected images.
3246
3247           Example: [#1] image.jpg +normalize 0,2 exp[-1]
3248                    [#2] 300,1,1,1,'7*x/w+u' +exp display_graph 400,300
3249
3250         >= (+):
3251             Shortcut for command 'ge'.
3252
3253         ge (+):
3254             value[%] |
3255             [image] |
3256             'formula' |
3257             (no arg)
3258
3259           Compute the boolean 'greater or equal than' of selected images with
3260       specified value, image
3261           or mathematical expression, or  compute  the  boolean  'greater  or
3262       equal than' of selected images.
3263           (equivalent to shortcut command '>=').
3264
3265           Example: [#1] image.jpg ge {ia}
3266                    [#2] image.jpg +mirror x ge
3267
3268         > (+):
3269             Shortcut for command 'gt'.
3270
3271         gt (+):
3272             value[%] |
3273             [image] |
3274             'formula' |
3275             (no arg)
3276
3277           Compute  the  boolean 'greater than' of selected images with speci‐
3278       fied value, image or mathematical
3279           expression, or compute  the  boolean  'greater  than'  of  selected
3280       images.
3281           (equivalent to shortcut command '>').
3282
3283           Example: [#1] image.jpg gt {ia}
3284                    [#2] image.jpg +mirror x gt
3285
3286         <= (+):
3287             Shortcut for command 'le'.
3288
3289         le (+):
3290             value[%] |
3291             [image] |
3292             'formula' |
3293             (no arg)
3294
3295           Compute  the  boolean  'less or equal than' of selected images with
3296       specified value, image or
3297           mathematical expression, or compute  the  boolean  'less  or  equal
3298       than' of selected images.
3299           (equivalent to shortcut command '<=').
3300
3301           Example: [#1] image.jpg le {ia}
3302                    [#2] image.jpg +mirror x le
3303
3304         < (+):
3305             Shortcut for command 'lt'.
3306
3307         lt (+):
3308             value[%] |
3309             [image] |
3310             'formula' |
3311             (no arg)
3312
3313           Compute  the  boolean 'less than' of selected images with specified
3314       value, image or mathematical
3315           expression, or compute the boolean 'less than' of selected images.
3316           (equivalent to shortcut command '<').
3317
3318           Example: [#1] image.jpg lt {ia}
3319                    [#2] image.jpg +mirror x lt
3320
3321         log (+):
3322
3323           Compute the pointwise base-e logarithm of selected images.
3324
3325           Example: [#1] image.jpg +add 1 log[-1]
3326                    [#2] 300,1,1,1,'7*x/w+u' +log display_graph 400,300
3327
3328         log10 (+):
3329
3330           Compute the pointwise base-10 logarithm of selected images.
3331
3332           Example: [#1] image.jpg +add 1 log10[-1]
3333                    [#2] 300,1,1,1,'7*x/w+u' +log10 display_graph 400,300
3334
3335         log2 (+):
3336
3337           Compute the pointwise base-2 logarithm of selected images
3338
3339           Example: [#1] image.jpg +add 1 log2[-1]
3340                    [#2] 300,1,1,1,'7*x/w+u' +log2 display_graph 400,300
3341
3342         max (+):
3343             value[%] |
3344             [image] |
3345             'formula' |
3346             (no arg)
3347
3348           Compute the maximum between selected images  and  specified  value,
3349       image or mathematical expression,
3350           or compute the pointwise maxima between selected images.
3351
3352           Example: [#1] image.jpg +mirror x max
3353                    [#2] image.jpg max 'R=((x/w-0.5)^2+(y/h-0.5)^2)^0.5;255*R'
3354
3355         maxabs (+):
3356             value[%] |
3357             [image] |
3358             'formula' |
3359             (no arg)
3360
3361           Compute  the  maxabs  between  selected images and specified value,
3362       image or mathematical expression,
3363           or compute the pointwise maxabs between selected images.
3364
3365         m/ (+):
3366             Shortcut for command 'mdiv'.
3367
3368         mdiv (+):
3369             value[%] |
3370             [image] |
3371             'formula' |
3372             (no arg)
3373
3374           Compute the matrix division of selected matrices/vectors by  speci‐
3375       fied value, image or mathematical
3376           expression, or compute the matrix division of selected images.
3377           (equivalent to shortcut command 'm/').
3378
3379         med:
3380
3381           Compute the median of selected images.
3382
3383           Example: [#1] image.jpg sample lena,lion,square +med
3384
3385         min (+):
3386             value[%] |
3387             [image] |
3388             'formula' |
3389             (no arg)
3390
3391           Compute  the  minimum  between selected images and specified value,
3392       image or mathematical expression,
3393           or compute the pointwise minima between selected images.
3394
3395           Example: [#1] image.jpg +mirror x min
3396                    [#2] image.jpg min 'R=((x/w-0.5)^2+(y/h-0.5)^2)^0.5;255*R'
3397
3398         minabs (+):
3399             value[%] |
3400             [image] |
3401             'formula' |
3402             (no arg)
3403
3404           Compute the minabs between selected  images  and  specified  value,
3405       image or mathematical expression,
3406           or compute the pointwise minabs between selected images.
3407
3408         % (+):
3409             Shortcut for command 'mod'.
3410
3411         mod (+):
3412             value[%] |
3413             [image] |
3414             'formula' |
3415             (no arg)
3416
3417           Compute  the  modulo of selected images with specified value, image
3418       or mathematical expression, or
3419           compute the pointwise sequential modulo of selected images.
3420           (equivalent to shortcut command '%').
3421
3422           Example: [#1] image.jpg +mirror x mod
3423                    [#2] image.jpg mod 'R=((x/w-0.5)^2+(y/h-0.5)^2)^0.5;255*R'
3424
3425         m* (+):
3426             Shortcut for command 'mmul'.
3427
3428         mmul (+):
3429             value[%] |
3430             [image] |
3431             'formula' |
3432             (no arg)
3433
3434           Compute the matrix right multiplication of  selected  matrices/vec‐
3435       tors by specified value, image or
3436           mathematical expression, or compute the matrix right multiplication
3437       of selected images.
3438           (equivalent to shortcut command 'm*').
3439
3440           Example: [#1] (0,1,0;0,0,1;1,0,0) (1;2;3) +mmul
3441
3442         * (+):
3443             Shortcut for command 'mul'.
3444
3445         mul (+):
3446             value[%] |
3447             [image] |
3448             'formula' |
3449             (no arg)
3450
3451           Multiply selected images by specified value, image or  mathematical
3452       expression, or compute the
3453           pointwise product of selected images.
3454           (equivalent to shortcut command '*').
3455
3456           See also: add, sub, div.
3457
3458           Example: [#1] image.jpg +mul 2 cut 0,255
3459                    [#2] image.jpg (1,2,3,4,5,6,7,8) ri[-1] [0] mul[0] [-1]
3460                    [#3] image.jpg mul '1-3*abs(x/w-0.5)' cut 0,255
3461                    [#4] image.jpg +luminance negate[-1] +mul
3462
3463         mul_channels:
3464             value1,_value2,...,_valueN
3465
3466           Multiply  channels of selected images by specified sequence of val‐
3467       ues.
3468
3469           Example: [#1] image.jpg +mul_channels 1,0.5,0.8
3470
3471         mul_complex:
3472             [multiplier_real,multiplier_imag]
3473
3474           Perform   multiplication   of   the    selected    complex    pairs
3475       (real1,imag1,...,realN,imagN) of images by
3476           specified complex pair of images (multiplier_real,multiplier_imag).
3477           In  complex pairs, the real image must be always located before the
3478       imaginary image in the image
3479           list.
3480
3481         != (+):
3482             Shortcut for command 'neq'.
3483
3484         neq (+):
3485             value[%] |
3486             [image] |
3487             'formula' |
3488             (no arg)
3489
3490           Compute the boolean inequality of selected  images  with  specified
3491       value, image or mathematical
3492           expression, or compute the boolean inequality of selected images.
3493           (equivalent to shortcut command '!=').
3494
3495           Example: [#1] image.jpg round 40 neq {round(ia,40)}
3496
3497         | (+):
3498             Shortcut for command 'or'.
3499
3500         or (+):
3501             value[%] |
3502             [image] |
3503             'formula' |
3504             (no arg)
3505
3506           Compute  the  bitwise  OR  of selected images with specified value,
3507       image or mathematical expression,
3508           or compute the pointwise sequential bitwise OR of selected images.
3509           (equivalent to shortcut command '|').
3510
3511           Example: [#1] image.jpg or 128
3512                    [#2] image.jpg +mirror x or
3513
3514         ^ (+):
3515             Shortcut for command 'pow'.
3516
3517         pow (+):
3518             value[%] |
3519             [image] |
3520             'formula' |
3521             (no arg)
3522
3523           Raise selected images to the power of  specified  value,  image  or
3524       mathematical expression, or compute
3525           the pointwise sequential powers of selected images.
3526           (equivalent to shortcut command '^').
3527
3528           Example: [#1] image.jpg div 255 +pow 0.5 mul 255
3529                    [#2] image.jpg gradient pow 2 add pow 0.2
3530
3531         rol (+):
3532             value[%] |
3533             [image] |
3534             'formula' |
3535             (no arg)
3536
3537           Compute the bitwise left rotation of selected images with specified
3538       value, image or mathematical
3539           expression, or compute the pointwise sequential bitwise left  rota‐
3540       tion of selected images.
3541
3542           Example: [#1] image.jpg rol 'round(3*x/w,0)' cut 0,255
3543
3544         ror (+):
3545             value[%] |
3546             [image] |
3547             'formula' |
3548             (no arg)
3549
3550           Compute  the  bitwise right rotation of selected images with speci‐
3551       fied value, image or mathematical
3552           expression, or compute the pointwise sequential bitwise right rota‐
3553       tion of selected images.
3554
3555           Example: [#1] image.jpg ror 'round(3*x/w,0)' cut 0,255
3556
3557         sign (+):
3558
3559           Compute the pointwise sign of selected images.
3560
3561           Example: [#1] image.jpg +sub {ia} sign[-1]
3562                    [#2] 300,1,1,1,'cos(20*x/w+u)' +sign display_graph 400,300
3563
3564         sin (+):
3565
3566           Compute the pointwise sine of selected images.
3567
3568           Example: [#1] image.jpg +normalize 0,{2*pi} sin[-1]
3569                    [#2] 300,1,1,1,'20*x/w+u' +sin display_graph 400,300
3570
3571           Tutorial:   https://gmic.eu/tutorial/trigometric-and-inverse-trigo
3572       metric-commands.shtml
3573
3574         sinc (+):
3575
3576           Compute the pointwise sinc function of selected images.
3577
3578           Example: [#1] image.jpg +normalize {-2*pi},{2*pi} sinc[-1]
3579                    [#2] 300,1,1,1,'20*x/w+u' +sinc display_graph 400,300
3580
3581         sinh (+):
3582
3583           Compute the pointwise hyperbolic sine of selected images.
3584
3585           Example: [#1] image.jpg +normalize -3,3 sinh[-1]
3586                    [#2] 300,1,1,1,'4*x/w+u' +sinh display_graph 400,300
3587
3588         sqr (+):
3589
3590           Compute the pointwise square function of selected images.
3591
3592           Example: [#1] image.jpg +sqr
3593                    [#2] 300,1,1,1,'40*x/w+u' +sqr display_graph 400,300
3594
3595         sqrt (+):
3596
3597           Compute the pointwise square root of selected images.
3598
3599           Example: [#1] image.jpg +sqrt
3600                    [#2] 300,1,1,1,'40*x/w+u' +sqrt display_graph 400,300
3601
3602         - (+):
3603             Shortcut for command 'sub'.
3604
3605         sub (+):
3606             value[%] |
3607             [image] |
3608             'formula' |
3609             (no arg)
3610
3611           Subtract specified  value,  image  or  mathematical  expression  to
3612       selected images, or compute the
3613           pointwise difference of selected images.
3614           (equivalent to shortcut command '-').
3615
3616           Example: [#1] image.jpg +sub 30% cut 0,255
3617                    [#2] image.jpg +mirror x sub[-1] [0]
3618                    [#3] image.jpg sub 'i(w/2+0.9*(x-w/2),y)'
3619                    [#4] image.jpg +mirror x sub
3620
3621         tan (+):
3622
3623           Compute the pointwise tangent of selected images.
3624
3625           Example: [#1] image.jpg +normalize {-0.47*pi},{0.47*pi} tan[-1]
3626                    [#2] 300,1,1,1,'20*x/w+u' +tan display_graph 400,300
3627
3628           Tutorial:   https://gmic.eu/tutorial/trigometric-and-inverse-trigo
3629       metric-commands.shtml
3630
3631         tanh (+):
3632
3633           Compute the pointwise hyperbolic tangent of selected images.
3634
3635           Example: [#1] image.jpg +normalize -3,3 tanh[-1]
3636                    [#2] 300,1,1,1,'4*x/w+u' +tanh display_graph 400,300
3637
3638         xor (+):
3639             value[%] |
3640             [image] |
3641             'formula' |
3642             (no arg)
3643
3644           Compute the bitwise XOR of selected images  with  specified  value,
3645       image or mathematical expression,
3646           or compute the pointwise sequential bitwise XOR of selected images.
3647
3648           Example: [#1] image.jpg xor 128
3649                    [#2] image.jpg +mirror x xor
3650
3651         12.5. Values Manipulation
3652               -------------------
3653
3654         apply_curve:
3655             0<=smoothness<=1,x0,y0,x1,y1,x2,y2,...,xN,yN
3656
3657           Apply curve transformation to image values.
3658
3659           Default values: 'smoothness=1', 'x0=0', 'y0=100'.
3660
3661           Example: [#1] image.jpg +apply_curve 1,0,0,128,255,255,0
3662
3663         apply_gamma:
3664             gamma>=0
3665
3666           Apply gamma correction to selected images.
3667
3668           Example: [#1] image.jpg +apply_gamma 2
3669
3670         balance_gamma:
3671             _ref_color1,...
3672
3673           Compute  gamma-corrected  color  balance  of  selected  image, with
3674       respect to specified reference color.
3675
3676           Default value: 'ref_color1=128'.
3677
3678           Example: [#1] image.jpg +balance_gamma 128,64,64
3679
3680         cast:
3681             datatype_source,datatype_target
3682
3683           Cast datatype of image buffer from specified source type to  speci‐
3684       fied target type.
3685           'datatype_source'  and  'datatype_target'  can  be { uchar | char |
3686       ushort | short | uint | int |
3687           uint64 | int64 | float | double }.
3688
3689         complex2polar:
3690
3691           Compute complex to polar transforms of selected images.
3692
3693           Example: [#1] image.jpg +fft complex2polar[-2,-1] log[-2] shift[-2]
3694       50%,50%,0,0,2 remove[-1]
3695
3696         compress_clut:
3697             _max_error>0,_avg_error>0,_max_nbpoints>=8     |     0    (unlim‐
3698       ited),_error_metric={ 0=L2-norm |        1=deltaE_1976 |  2=deltaE_2000
3699       },_reconstruction_colorspace={    0=srgb    |    1=rgb   |   2=lab   },
3700       _try_rbf_first={ 0 | 1 }
3701
3702           Compress selected color LUTs as sequences of colored keypoints.
3703
3704           Default      values:       'max_error=1.5',       'avg_error=0.75',
3705       'max_nb_points=2048', 'error_metric=2',
3706             'reconstruction_colorspace=0' and 'try_rbf_first=1'.
3707
3708         compress_rle:
3709             _is_binary_data={ 0 | 1 },_maximum_sequence_length>=0
3710
3711           Compress selected images as 2xN data matrices, using RLE algorithm.
3712           Set  'maximum_sequence_length=0'  to  disable  maximum  length con‐
3713       straint.
3714
3715           Default values: 'is_binary_data=0' and 'maximum_sequence_length=0'.
3716
3717           Example: [#1]  image.jpg  resize2dy  100  quantize  4  round  +com‐
3718       press_rle , +decompress_rle[-1]
3719
3720         cumulate (+):
3721             { x | y | z | c }...{ x | y | z | c } |
3722             (no arg)
3723
3724           Compute the cumulative function of specified image data, optionally
3725       along the specified axes.
3726
3727           Example:   [#1]    image.jpg    +histogram    +cumulate[-1]    dis‐
3728       play_graph[-2,-1] 400,300,3
3729
3730         c (+):
3731             Shortcut for command 'cut'.
3732
3733         cut (+):
3734             { value0[%] | [image0] },{ value1[%] | [image1] } |
3735             [image]
3736
3737           Cut values of selected images in specified range.
3738           (equivalent to shortcut command 'c').
3739
3740           Example: [#1] image.jpg +add 30% cut[-1] 0,255
3741                    [#2] image.jpg +cut 25%,75%
3742
3743         decompress_clut:
3744             _width>0,_height>0,_depth>0,_reconstruction_colorspace={ 0=srgb |
3745       1=rgb | 2=lab }
3746
3747           Decompress selected colored keypoints into 3D CLUTs, using a  mixed
3748       RBF/PDE approach.
3749
3750           Default  values:  'width=height=depth=33'  and 'reconstruction_col‐
3751       orspace=0'.
3752
3753         decompress_clut_rbf:
3754             _width>0,_height>0,_depth>0,_reconstruction_colorspace={ 0=srgb |
3755       1=rgb | 2=lab }
3756
3757           Decompress selected colored keypoints into 3D CLUTs, using RBF thin
3758       plate spline interpolation.
3759
3760           Default  value:  'width=height=depth=33'  and  'reconstruction_col‐
3761       orspace=0'.
3762
3763         decompress_clut_pde:
3764             _width>0,_height>0,_depth>0,_reconstruction_colorspace={ 0=srgb |
3765       1=rgb | 2=lab }
3766
3767           Decompress selected colored keypoints into 3D CLUTs,  using  multi‐
3768       scale diffusion PDE's.
3769
3770           Default  values:  'width=height=depth=33'  and 'reconstruction_col‐
3771       orspace=0'.
3772
3773         decompress_rle:
3774
3775           Decompress selected data vectors, using RLE algorithm.
3776
3777         discard (+):
3778             _value1,_value2,... |
3779             { x | y | z | c}...{ x | y | z | c},_value1,_value2,... |
3780             (no arg)
3781
3782           Discard specified values in selected images or discard  neighboring
3783       duplicate values,
3784           optionally only for the values along the first of a specified axis.
3785           If  no  arguments  are  specified, neighboring duplicate values are
3786       discarded.
3787           If all pixels of a selected image are discarded, an empty image  is
3788       returned.
3789
3790           Example: [#1] (1;2;3;4;3;2;1) +discard 2
3791                    [#2] (1,2,2,3,3,3,4,4,4,4) +discard x
3792
3793         eigen2tensor:
3794
3795           Recompose  selected pairs of eigenvalues/eigenvectors as 2x2 or 3x3
3796       tensor fields.
3797
3798           Tutorial: https://gmic.eu/tutorial/_eigen2tensor.shtml
3799
3800         endian (+):
3801             _datatype
3802
3803           Reverse data endianness of selected images, eventually  considering
3804       the pixel being of the specified
3805           datatype.
3806           'datatype'  can  be  { uchar | char | ushort | short | uint | int |
3807       uint64 | int64 | float | double }.
3808
3809         equalize (+):
3810             _nb_levels>0[%],_value_min[%],_value_max[%]
3811
3812           Equalize histograms of selected images.
3813           If value range is specified, the equalization is done only for pix‐
3814       els in the specified
3815           value range.
3816
3817           Default     values:     'nb_levels=256',     'value_min=0%'     and
3818       'value_max=100%'.
3819
3820           Example: [#1] image.jpg +equalize
3821                    [#2] image.jpg +equalize 4,0,128
3822
3823         f (+):
3824             Shortcut for command 'fill'.
3825
3826         fill (+):
3827             value1,_value2,... |
3828             [image] |
3829             'formula'
3830
3831           Fill selected images with values  read  from  the  specified  value
3832       list, existing image
3833           or  mathematical  expression. Single quotes may be omitted in 'for‐
3834       mula'.
3835           (equivalent to shortcut command 'f').
3836
3837           Example: [#1] 4,4 fill 1,2,3,4,5,6,7
3838                    [#2] 4,4 (1,2,3,4,5,6,7) fill[-2] [-1]
3839                    [#3] 400,400,1,3 fill "X=x-w/2; Y=y-h/2;  R=sqrt(X^2+Y^2);
3840       a=atan2(Y,X);                                                if(R<=180,
3841       255*abs(cos(c+200*(x/w-0.5)*(y/h-0.5))),850*(a%(0.1*(c+1))))"
3842
3843           Tutorial: https://gmic.eu/tutorial/_fill.shtml
3844
3845         index (+):
3846             { [palette] | palette_name },0<=_dithering<=1,_map_palette={ 0  |
3847       1 }
3848
3849           Index selected vector-valued images by specified vector-valued pal‐
3850       ette.
3851           'palette_name' can be { default | hsv | lines | hot | cool | jet  |
3852       flag | cube | rainbow | algae |
3853           amp  |balance | curl | deep | delta | dense | diff | haline | ice |
3854       matter | oxy | phase | rain |
3855           solar | speed | tarn |tempo | thermal | topo | turbid  |  aurora  |
3856       hocuspocus | srb2 | uzebox }
3857
3858           Default values: 'dithering=0' and 'map_palette=0'.
3859
3860           Example: [#1] image.jpg +index 1,1,1
3861                    [#2]  image.jpg  (0;255;255^0;128;255^0;0;255)  +index[-2]
3862       [-1],1,1
3863
3864           Tutorial: https://gmic.eu/tutorial/_index.shtml
3865
3866         ir:
3867             Shortcut for command 'inrange'.
3868
3869         inrange:
3870             min[%],max[%],_include_min_boundary={      0=no      |      1=yes
3871       },_include_max_boundary={ 0=no | 1=yes }
3872
3873           Detect  pixels  whose  values  are in specified range [min,max], in
3874       selected images.
3875           (equivalent to shortcut command 'ir').
3876
3877           Default value: 'include_min_boundary=include_max_boundary=1'.
3878
3879           Example: [#1] image.jpg +inrange 25%,75%
3880
3881         map (+):
3882             [palette],_boundary_conditions |
3883             palette_name,_boundary_conditions
3884
3885           Map specified vector-valued  palette  to  selected  indexed  scalar
3886       images.
3887           'palette_name'  can be { default | hsv | lines | hot | cool | jet |
3888       flag | cube | rainbow | algae |
3889           amp | balance | curl | deep | delta | dense | diff | gray |  haline
3890       | ice | matter | oxy | phase |
3891           rain  |  solar  |  speed | tarn | tempo | thermal | topo | turbid |
3892       aurora | hocuspocus | srb2 | uzebox
3893           }
3894           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
3895       | 3=mirror }.
3896
3897           Default value: 'boundary_conditions=0'.
3898
3899           Example: [#1] image.jpg +luminance map[-1] 3
3900                    [#2] image.jpg +rgb2ycbcr split[-1] c (0,255,0) resize[-1]
3901       256,1,1,1,3 map[-4] [-1] remove[-1]       append[-3--1] c ycbcr2rgb[-1]
3902
3903           Tutorial: https://gmic.eu/tutorial/_map.shtml
3904
3905         mix_channels:
3906             (a00,...,aMN) |
3907             [matrix]
3908
3909           Apply specified matrix to channels of selected images.
3910
3911           Example: [#1] image.jpg +mix_channels (0,1,0;1,0,0;0,0,1)
3912
3913         negate:
3914             base_value |
3915             (no arg)
3916
3917           Negate image values.
3918
3919           Default value: 'base_value=(undefined)'.
3920
3921           Example: [#1] image.jpg +negate
3922
3923         noise (+):
3924             std_deviation>=0[%],_noise_type
3925
3926           Add random noise to selected images.
3927           'noise_type' can be { 0=gaussian  |  1=uniform  |  2=salt&pepper  |
3928       3=poisson | 4=rice }.
3929
3930           Default value: 'noise_type=0'.
3931
3932           Example:  [#1]  image.jpg  +noise[0]  50,0 +noise[0] 50,1 +noise[0]
3933       10,2 cut 0,255
3934                    [#2] 300,300,1,3 [0] noise[0]  20,0  noise[1]  20,1  +his‐
3935       togram 100 display_graph[-2,-1] 400,300,3
3936
3937         noise_perlin:
3938             _scale_x[%]>0,_scale_y[%]>0,_scale_z[%]>0,_seed_x,_seed_y,_seed_z
3939
3940           Render  2D  or  3D  Perlin noise on selected images, from specified
3941       coordinates.
3942           The Perlin noise is a specific type of smooth noise,
3943           described here : 'https://en.wikipedia.org/wiki/Perlin_noise'.
3944
3945           Default       values:       'scale_x=scale_y=scale_z=16'        and
3946       'seed_x=seed_y=seed_z=0'.
3947
3948           Example: [#1] 500,500,1,3 noise_perlin ,
3949
3950         noise_poissondisk:
3951             _radius[%]>0,_max_sample_attempts>0
3952
3953           Add poisson disk sampling noise to selected images.
3954           Implements  the  algorithm from the article "Fast Poisson Disk Sam‐
3955       pling in Arbitrary Dimensions",
3956           by Robert Bridson (SIGGRAPH'2007).
3957
3958           Default values: 'radius=8' and 'max_sample_attempts=30'.
3959
3960           Example: [#1] 300,300 noise_poissondisk 8
3961
3962         normp:
3963             p>=0
3964
3965           Compute the pointwise  Lp-norm  norm  of  vector-valued  pixels  in
3966       selected images.
3967
3968           Default value: 'p=2'.
3969
3970           Example:  [#1]  image.jpg  +normp[0]  0  +normp[0]  1  +normp[0]  2
3971       +normp[0] inf
3972
3973         norm:
3974
3975           Compute the pointwise euclidean norm  of  vector-valued  pixels  in
3976       selected images.
3977
3978           Example: [#1] image.jpg +norm
3979
3980           Tutorial: https://gmic.eu/tutorial/_norm.shtml
3981
3982         n (+):
3983             Shortcut for command 'normalize'.
3984
3985         normalize (+):
3986             {   value0[%]   |  [image0]  },{  value1[%]  |  [image1]  },_con‐
3987       stant_case_ratio |
3988             [image]
3989
3990           Linearly normalize values of selected images in specified range.
3991           (equivalent to shortcut command 'n').
3992
3993           Example: [#1] image.jpg split x,2 normalize[-1] 64,196 append x
3994
3995           Tutorial: https://gmic.eu/tutorial/_normalize.shtml
3996
3997         normalize_sum:
3998
3999           Normalize selected images with a unitary sum.
4000
4001           Example:   [#1]   image.jpg   +histogram   normalize_sum[-1]   dis‐
4002       play_graph[-1] 400,300
4003
4004         not:
4005
4006           Apply boolean not operation on selected images.
4007
4008           Example: [#1] image.jpg +ge 50% +not[-1]
4009
4010         orientation:
4011
4012           Compute  the  pointwise  orientation  of  vector-valued  pixels  in
4013       selected images.
4014
4015           Example: [#1] image.jpg +orientation +norm[-2]  negate[-1]  mul[-2]
4016       [-1] reverse[-2,-1]
4017
4018           Tutorial: https://gmic.eu/tutorial/_orientation.shtml
4019
4020         oneminus:
4021
4022           For each selected image, compute one minus image.
4023
4024           Example: [#1] image.jpg normalize 0,1 +oneminus
4025
4026         otsu:
4027             _nb_levels>0
4028
4029           Hard-threshold selected images using Otsu's method.
4030           The  computed  thresholds  are  returned as a list of values in the
4031       status.
4032
4033           Default value: 'nb_levels=256'.
4034
4035           Example: [#1] image.jpg luminance +otsu ,
4036
4037         polar2complex:
4038
4039           Compute polar to complex transforms of selected images.
4040
4041         quantize:
4042             nb_levels>=1,_keep_values={   0   |   1    },_quantization_type={
4043       -1=median-cut | 0=k-means | 1=uniform }
4044
4045           Quantize selected images.
4046
4047           Default value: 'keep_values=1' and 'quantization_type=0'.
4048
4049           Example: [#1] image.jpg luminance +quantize 3
4050                    [#2]   200,200,1,1,'cos(x/10)*sin(y/10)'   +quantize[0]  6
4051       +quantize[0] 4 +quantize[0] 3       +quantize[0] 2
4052
4053         quantize_area:
4054             _min_area>0
4055
4056           Quantize selected images such that each flat  region  has  an  area
4057       greater or equal to 'min_area'.
4058
4059           Default value: 'min_area=10'.
4060
4061           Example:  [#1]  image.jpg  quantize  3  +blur  1  round[-1]  +quan‐
4062       tize_area[-1] 2
4063
4064         rand (+):
4065             { value0[%] | [image0] },_{ value1[%] | [image1] } |
4066             [image]
4067
4068           Fill selected images with random values  uniformly  distributed  in
4069       the specified range.
4070
4071           Example: [#1] 400,400,1,3 rand -10,10 +blur 10 sign[-1]
4072
4073         replace:
4074             source,target
4075
4076           Replace pixel values in selected images.
4077
4078           Example: [#1] (1;2;3;4) +replace 2,3
4079
4080         replace_inf:
4081             _expression
4082
4083           Replace all infinite values in selected images by specified expres‐
4084       sion.
4085
4086           Example: [#1] (0;1;2) log +replace_inf 2
4087
4088         replace_nan:
4089             _expression
4090
4091           Replace all NaN values in selected images by specified expression.
4092
4093           Example: [#1] (-1;0;2) sqrt +replace_nan 2
4094
4095         replace_naninf:
4096             _expression
4097
4098           Replace all NaN and infinite values in selected images by specified
4099       expression.
4100
4101         replace_seq:
4102             "search_seq","replace_seq"
4103
4104           Search and replace a sequence of values in selected images.
4105
4106           Example: [#1] (1;2;3;4;5) +replace_seq "2,3,4","7,8"
4107
4108         replace_str:
4109             "search_str","replace_str"
4110
4111           Search  and replace a string in selected images (viewed as strings,
4112       i.e. sequences of character
4113           codes).
4114
4115           Example: [#1] ('"Hello there, how are you ?"') +replace_str  "Hello
4116       there","Hi David"
4117
4118         round (+):
4119             rounding_value>=0,_rounding_type |
4120             (no arg)
4121
4122           Round values of selected images.
4123           'rounding_type' can be { -1=backward | 0=nearest | 1=forward }.
4124
4125           Default value: 'rounding_type=0'.
4126
4127           Example: [#1] image.jpg +round 100
4128                    [#2] image.jpg mul {pi/180} sin +round
4129
4130         roundify:
4131             gamma>=0
4132
4133           Apply  roundify transformation on float-valued data, with specified
4134       gamma.
4135
4136           Default value: 'gamma=0'.
4137
4138           Example: [#1] 1000 fill '4*x/w' repeat 5 +roundify[0] {$>*0.2} done
4139       append c display_graph 400,300
4140
4141         = (+):
4142             Shortcut for command 'set'.
4143
4144         set (+):
4145             value,_x[%],_y[%],_z[%],_c[%]
4146
4147           Set pixel value in selected images, at specified coordinates.
4148           (equivalent to shortcut command '=').
4149
4150           If specified coordinates are outside the image bounds, no action is
4151       performed.
4152
4153           Default values: 'x=y=z=c=0'.
4154
4155           Example: [#1] 2,2 set 1,0,0 set 2,1,0 set 3,0,1 set 4,1,1
4156                    [#2]       image.jpg        repeat        10000        set
4157       255,{u(100)}%,{u(100)}%,0,{u(100)}% done
4158
4159         threshold:
4160             value[%],_is_soft={ 0 | 1 } :
4161
4162           Threshold values of selected images.
4163           'soft' can be { 0=hard-thresholding | 1=soft-thresholding }.
4164
4165           Default value: 'is_soft=0'.
4166
4167           Example: [#1] image.jpg +threshold[0] 50% +threshold[0] 50%,1
4168
4169           Tutorial: https://gmic.eu/tutorial/_threshold.shtml
4170
4171         vector2tensor:
4172
4173           Convert selected vector fields to corresponding tensor fields.
4174
4175         12.6. Colors
4176               ------
4177
4178         adjust_colors:
4179             -100<=_brightness<=100,-100<=_con‐
4180       trast<=100,-100<=_gamma<=100,-100<=_hue_shift<=100,        -100<=_satu‐
4181       ration<=100,_value_min,_value_max
4182
4183           Perform a global adjustment of colors on selected images.
4184           Range   of   correct   image   values   are  considered  to  be  in
4185       [value_min,value_max] (e.g. [0,255]).
4186           If 'value_min==value_max==0', value range is estimated from min/max
4187       values of selected images.
4188           Processed    images    have    pixel    values    constrained    in
4189       [value_min,value_max].
4190
4191           Default   values:    'brightness=0',    'contrast=0',    'gamma=0',
4192       'hue_shift=0', 'saturation=0',
4193             'value_min=value_max=0'.
4194
4195           Example: [#1] image.jpg +adjust_colors 0,30,0,0,30
4196
4197         ac:
4198             Shortcut for command 'apply_channels'.
4199
4200         apply_channels:
4201             "command",color_channels,_value_action={  0=none | 1=cut | 2=nor‐
4202       malize }
4203
4204           Apply specified command on the  chosen  color  channel(s)  of  each
4205       selected images.
4206           (equivalent to shortcut command 'ac').
4207
4208           Argument  'color_channels' refers to a colorspace, and can be basi‐
4209       cally one of
4210           { all | rgba | [s]rgb | ryb | lrgb | ycbcr | lab | lch | hsv |  hsi
4211       | hsl | cmy | cmyk | yiq }.
4212           You can also make the processing focus on a few particular channels
4213       of this colorspace,
4214           by setting 'color_channels' as 'colorspace_channel'  (e.g.  'hsv_h'
4215       for the hue).
4216           All  channel  values  are  considered to be provided in the [0,255]
4217       range.
4218
4219           Default value: 'value_action=0'.
4220
4221           Example:   [#1]   image.jpg    +apply_channels    "equalize    blur
4222       2",ycbcr_cbcr
4223
4224         autoindex:
4225             nb_colors>0,0<=_dithering<=1,_method={ 0=median-cut | 1=k-means }
4226
4227           Index selected vector-valued images by adapted colormaps.
4228
4229           Default values: 'dithering=0' and 'method=1'.
4230
4231           Example:  [#1]  image.jpg  +autoindex[0] 4 +autoindex[0] 8 +autoin‐
4232       dex[0] 16
4233
4234         bayer2rgb:
4235             _GM_smoothness,_RB_smoothness1,_RB_smoothness2
4236
4237           Transform selected RGB-Bayer sampled images to color images.
4238
4239           Default  values:  'GM_smoothness=RB_smoothness=1'  and  'RB_smooth‐
4240       ness2=0.5'.
4241
4242           Example: [#1] image.jpg rgb2bayer 0 +bayer2rgb 1,1,0.5
4243
4244         deltaE:
4245             [image],_metric={  0=deltaE_1976  | 1=deltaE_2000 },"_to_Lab_com‐
4246       mand"
4247
4248           Compute the CIE DeltaE color difference between selected images and
4249       specified [image].
4250           Argument  'to_Lab_command'  is  a command able to convert colors of
4251       [image] into a Lab representation.
4252
4253           Default values: 'metric=1' and 'to_Lab_command="srgb2lab"'.
4254
4255           Example: [#1] image.jpg +blur 2 +deltaE[0] [1],1,srgb2lab
4256
4257         cmy2rgb:
4258
4259           Convert color representation of selected images from CMY to RGB.
4260
4261         cmyk2rgb:
4262
4263           Convert color representation of selected images from CMYK to RGB.
4264
4265         colorblind:
4266             type={ 0=protanopia | 1=protanomaly | 2=deuteranopia | 3=deutera‐
4267       nomaly  |  4=tritanopia  |         5=tritanomaly  |  6=achromatopsia  |
4268       7=achromatomaly }
4269
4270           Simulate color blindness vision.
4271
4272           Example: [#1] image.jpg +colorblind 0
4273
4274         colormap:
4275             nb_levels>=0,_method={ 0=median-cut | 1=k-means },_sort_vectors
4276
4277           Estimate best-fitting colormap with 'nb_colors' entries,  to  index
4278       selected images.
4279           Set 'nb_levels==0' to extract all existing colors of an image.
4280           'sort_vectors'  can  be  { 0=unsorted | 1=by increasing norm | 2=by
4281       decreasing occurrence }.
4282
4283           Default value: 'method=1' and 'sort_vectors=1'.
4284
4285           Example: [#1] image.jpg +colormap[0] 4 +colormap[0] 8  +colormap[0]
4286       16
4287
4288           Tutorial: https://gmic.eu/tutorial/_colormap.shtml
4289
4290         compose_channels:
4291
4292           Compose all channels of each selected image, using specified arith‐
4293       metic operator (+,-,or,min,...).
4294
4295           Default value: '1=+'.
4296
4297           Example: [#1] image.jpg +compose_channels and
4298
4299           Tutorial: https://gmic.eu/tutorial/_compose_channels.shtml
4300
4301         direction2rgb:
4302
4303           Compute RGB representation of selected 2D direction fields.
4304
4305           Example: [#1] image.jpg luminance gradient append c blur 2 orienta‐
4306       tion +direction2rgb
4307
4308         ditheredbw:
4309
4310           Create dithered B&W version of selected images.
4311
4312           Example: [#1] image.jpg +equalize ditheredbw[-1]
4313
4314         fc:
4315             Shortcut for command 'fill_color'.
4316
4317         fill_color:
4318             col1,...,colN
4319
4320           Fill selected images with specified color.
4321           (equivalent to shortcut command 'fc').
4322
4323           Example: [#1] image.jpg +fill_color 255,0,255
4324
4325           Tutorial: https://gmic.eu/tutorial/_fill_color.shtml
4326
4327         gradient2rgb:
4328             _is_orientation={ 0 | 1 }
4329
4330           Compute RGB representation of 2D gradient of selected images.
4331
4332           Default value: 'is_orientation=0'.
4333
4334           Example: [#1] image.jpg +gradient2rgb 0 equalize[-1]
4335
4336         hcy2rgb:
4337
4338           Convert color representation of selected images from HCY to RGB.
4339
4340         hsi2rgb:
4341
4342           Convert color representation of selected images from HSI to RGB.
4343
4344         hsi82rgb:
4345
4346           Convert color representation of selected images from HSI8 to RGB.
4347
4348         hsl2rgb:
4349
4350           Convert color representation of selected images from HSL to RGB.
4351
4352         hsl82rgb:
4353
4354           Convert color representation of selected images from HSL8 to RGB.
4355
4356         hsv2rgb:
4357
4358           Convert color representation of selected images from HSV to RGB.
4359
4360           Example:  [#1]  (0,360;0,360^0,0;1,1^1,1;1,1)  resize 400,400,1,3,3
4361       hsv2rgb
4362
4363         hsv82rgb:
4364
4365           Convert color representation of selected images from HSV8 to RGB.
4366
4367         int2rgb:
4368
4369           Convert color representation of selected images from INT24 to RGB.
4370
4371         jzazbz2rgb:
4372             illuminant={ 0=D50 | 1=D65 | 2=E } |
4373             (no arg)
4374
4375           Convert color representation of selected images from RGB to Jzazbz.
4376
4377           Default value: 'illuminant=2'.
4378
4379         jzazbz2xyz:
4380
4381           Convert color representation of selected images from RGB to XYZ.
4382
4383         lab2lch:
4384
4385           Convert color representation of selected images from Lab to Lch.
4386
4387         lab2rgb:
4388             illuminant={ 0=D50 | 1=D65 | 2=E } |
4389             (no arg)
4390
4391           Convert color representation of selected images from Lab to RGB.
4392
4393           Default value: 'illuminant=2'.
4394
4395           Example:     [#1]     (50,50;50,50^-3,3;-3,3^-3,-3;3,3)      resize
4396       400,400,1,3,3 lab2rgb
4397
4398         lab2srgb:
4399             illuminant={ 0=D50 | 1=D65 | 2=E } |
4400             (no arg)
4401
4402           Convert color representation of selected images from Lab to sRGB.
4403
4404           Default value: 'illuminant=2'.
4405
4406           Example:      [#1]     (50,50;50,50^-3,3;-3,3^-3,-3;3,3)     resize
4407       400,400,1,3,3 lab2rgb
4408
4409         lab82srgb:
4410             illuminant={ 0=D50 | 1=D65 | 2=E } |
4411             (no arg)
4412
4413           Convert color representation of selected images from Lab8 to sRGB.
4414
4415           Default value: 'illuminant=2'.
4416
4417           Example:     [#1]     (50,50;50,50^-3,3;-3,3^-3,-3;3,3)      resize
4418       400,400,1,3,3 lab2rgb
4419
4420         lab2xyz:
4421             illuminant={ 0=D50 | 1=D65 | 2=E } |
4422             (no arg)
4423
4424           Convert color representation of selected images from Lab to XYZ.
4425
4426           Default value: 'illuminant=2'.
4427
4428         lab82rgb:
4429             illuminant={ 0=D50 | 1=D65 | 2=E } |
4430             (no arg)
4431
4432           Convert color representation of selected images from Lab8 to RGB.
4433
4434           Default value: 'illuminant=2'.
4435
4436         lch2lab:
4437
4438           Convert color representation of selected images from Lch to Lab.
4439
4440         lch2rgb:
4441             illuminant={ 0=D50 | 1=D65 | 2=E } |
4442             (no arg)
4443
4444           Convert color representation of selected images from Lch to RGB.
4445
4446           Default value: 'illuminant=2'.
4447
4448         lch82rgb:
4449             illuminant={ 0=D50 | 1=D65 | 2=E } |
4450             (no arg)
4451
4452           Convert color representation of selected images from Lch8 to RGB.
4453
4454           Default value: 'illuminant=2'.
4455
4456         luminance:
4457
4458           Compute luminance of selected sRGB images.
4459
4460           Example: [#1] image.jpg +luminance
4461
4462         lightness:
4463
4464           Compute lightness of selected sRGB images.
4465
4466           Example: [#1] image.jpg +lightness
4467
4468         lut_contrast:
4469             _nb_colors>1,_min_rgb_value
4470
4471           Generate  a  RGB  colormap  where consecutive colors have high con‐
4472       trast.
4473           This function performs a specific score  maximization  to  generate
4474       the result, so
4475           it may take some time when 'nb_colors' is high.
4476
4477           Default values: 'nb_colors=256' and 'min_rgb_value=64'.
4478
4479         map_clut:
4480             [clut] | "clut_name"
4481
4482           Map specified RGB color LUT to selected images.
4483
4484           Example:  [#1]  image.jpg uniform_distribution {2^6},3 mirror[-1] x
4485       +map_clut[0] [1]
4486
4487         mix_rgb:
4488             a11,a12,a13,a21,a22,a23,a31,a32,a33
4489
4490           Apply 3x3 specified matrix to RGB colors of selected images.
4491
4492           Default values: 'a11=1', 'a12=a13=a21=0', 'a22=1',  'a23=a31=a32=0'
4493       and 'a33=1'.
4494
4495           Example: [#1] image.jpg +mix_rgb 0,1,0,1,0,0,0,0,1
4496
4497           Tutorial: https://gmic.eu/tutorial/_mix_rgb.shtml
4498
4499         palette:
4500             palette_name | palette_number
4501
4502           Input specified color palette at the end of the image list.
4503           'palette_name'  can be { default | hsv | lines | hot | cool | jet |
4504       flag | cube | rainbow | parula |
4505           spring | summer | autumn | winter | bone | copper | pink  |  vga  |
4506       algae | amp | balance | curl |
4507           deep  | delta | dense | diff | gray | haline | ice | matter | oxy |
4508       phase | rain | solar | speed |
4509           tarn | tempo | thermal | topo | turbid | aurora | hocuspocus | srb2
4510       | uzebox | amiga7800 |
4511           amiga7800mess | fornaxvoid1 }
4512
4513           Example: [#1] palette hsv
4514
4515         pseudogray:
4516             _max_increment>=0,_JND_threshold>=0,_bits_depth>0
4517
4518           Generate  pseudogray  colormap with specified increment and percep‐
4519       tual threshold.
4520           If 'JND_threshold' is 0, no perceptual constraints are applied.
4521
4522           Default   values:   'max_increment=5',   'JND_threshold=2.3'    and
4523       'bits_depth=8'.
4524
4525           Example: [#1] pseudogray 5
4526
4527         replace_color:
4528             tolerance[%]>=0,smoothness[%]>=0,src1,src2,...,dest1,dest2,...
4529
4530           Replace pixels from/to specified colors in selected images.
4531
4532           Example: [#1] image.jpg +replace_color 40,3,204,153,110,255,0,0
4533
4534         retinex:
4535             _value_offset>0,_colorspace={  hsi  |  hsv  |  lab | lrgb | rgb |
4536       ycbcr                                               },0<=_min_cut<=100,
4537       0<=_max_cut<=100,_sigma_low>0,_sigma_mid>0,_sigma_high>0
4538
4539           Apply  multi-scale  retinex algorithm on selected images to improve
4540       color consistency.
4541           (as described in the page http://www.ipol.im/pub/art/2014/107/).
4542
4543           Default   values:   'offset=1',   'colorspace=hsv',    'min_cut=1',
4544       'max_cut=1', 'sigma_low=15',
4545             'sigma_mid=80' and 'sigma_high=250'.
4546
4547         rgb2bayer:
4548             _start_pattern=0,_color_grid=0
4549
4550           Transform selected color images to RGB-Bayer sampled images.
4551
4552           Default values: 'start_pattern=0' and 'color_grid=0'.
4553
4554           Example: [#1] image.jpg +rgb2bayer 0
4555
4556         rgb2cmy:
4557
4558           Convert color representation of selected images from RGB to CMY.
4559
4560           Example: [#1] image.jpg rgb2cmy split c
4561
4562         rgb2cmyk:
4563
4564           Convert color representation of selected images from RGB to CMYK.
4565
4566           Example: [#1] image.jpg rgb2cmyk split c
4567                    [#2]  image.jpg  rgb2cmyk  split  c  fill[3]  0  append  c
4568       cmyk2rgb
4569
4570         rgb2hcy:
4571
4572           Convert color representation of selected images from RGB to HCY.
4573
4574           Example: [#1] image.jpg rgb2hcy split c
4575
4576         rgb2hsi:
4577
4578           Convert color representation of selected images from RGB to HSI.
4579
4580           Example: [#1] image.jpg rgb2hsi split c
4581
4582         rgb2hsi8:
4583
4584           Convert color representation of selected images from RGB to HSI8.
4585
4586           Example: [#1] image.jpg rgb2hsi8 split c
4587
4588         rgb2hsl:
4589
4590           Convert color representation of selected images from RGB to HSL.
4591
4592           Example: [#1] image.jpg rgb2hsl split c
4593                    [#2] image.jpg rgb2hsl +split c add[-3]  100  mod[-3]  360
4594       append[-3--1] c hsl2rgb
4595
4596         rgb2hsl8:
4597
4598           Convert color representation of selected images from RGB to HSL8.
4599
4600           Example: [#1] image.jpg rgb2hsl8 split c
4601
4602         rgb2hsv:
4603
4604           Convert color representation of selected images from RGB to HSV.
4605
4606           Example: [#1] image.jpg rgb2hsv split c
4607                    [#2]  image.jpg  rgb2hsv  +split c add[-2] 0.3 cut[-2] 0,1
4608       append[-3--1] c hsv2rgb
4609
4610         rgb2hsv8:
4611
4612           Convert color representation of selected images from RGB to HSV8.
4613
4614           Example: [#1] image.jpg rgb2hsv8 split c
4615
4616         rgb2int:
4617
4618           Convert color representation of selected images from RGB  to  INT24
4619       scalars.
4620
4621           Example: [#1] image.jpg rgb2int
4622
4623         rgb2jzazbz:
4624             illuminant={ 0=D50 | 1=D65 | 2=E } |
4625             (no arg)
4626
4627           Convert color representation of selected images from RGB to Jzazbz.
4628
4629           Default value: 'illuminant=2'.
4630
4631         rgb2lab:
4632             illuminant={ 0=D50 | 1=D65 | 2=E } |
4633             (no arg)
4634
4635           Convert color representation of selected images from RGB to Lab.
4636
4637           Default value: 'illuminant=2'.
4638
4639         rgb2lab8:
4640             illuminant={ 0=D50 | 1=D65 | 2=E } |
4641             (no arg)
4642
4643           Convert color representation of selected images from RGB to Lab8.
4644
4645           Default value: 'illuminant=2'.
4646
4647           Example: [#1] image.jpg rgb2lab8 split c
4648
4649         rgb2lch:
4650             illuminant={ 0=D50 | 1=D65 | 2=E } |
4651             (no arg)
4652
4653           Convert color representation of selected images from RGB to Lch.
4654
4655           Default value: 'illuminant=2'.
4656
4657           Example: [#1] image.jpg rgb2lch split c
4658
4659         rgb2lch8:
4660             illuminant={ 0=D50 | 1=D65 | 2=E } |
4661             (no arg)
4662
4663           Convert color representation of selected images from RGB to Lch8.
4664
4665           Default value: 'illuminant=2'.
4666
4667           Example: [#1] image.jpg rgb2lch8 split c
4668
4669         rgb2luv:
4670
4671           Convert color representation of selected images from RGB to LUV.
4672
4673           Example: [#1] image.jpg rgb2luv split c
4674
4675         rgb2ryb:
4676
4677           Convert color representation of selected images from RGB to RYB.
4678
4679           Example: [#1] image.jpg rgb2ryb split c
4680
4681         rgb2srgb:
4682
4683           Convert  color representation of selected images from linear RGB to
4684       sRGB.
4685
4686         rgb2xyz:
4687             illuminant={ 0=D50 | 1=D65 | 2=E } |
4688             (no arg)
4689
4690           Convert color representation of selected images from RGB to XYZ.
4691
4692           Default value: 'illuminant=2'.
4693
4694           Example: [#1] image.jpg rgb2xyz split c
4695
4696         rgb2xyz8:
4697             illuminant={ 0=D50 | 1=D65 | 2=E } |
4698             (no arg)
4699
4700           Convert color representation of selected images from RGB to XYZ8.
4701
4702           Default value: 'illuminant=2'.
4703
4704           Example: [#1] image.jpg rgb2xyz8 split c
4705
4706         rgb2yiq:
4707
4708           Convert color representation of selected images from RGB to YIQ.
4709
4710           Example: [#1] image.jpg rgb2yiq split c
4711
4712         rgb2yiq8:
4713
4714           Convert color representation of selected images from RGB to YIQ8.
4715
4716           Example: [#1] image.jpg rgb2yiq8 split c
4717
4718         rgb2ycbcr:
4719
4720           Convert color representation of selected images from RGB to YCbCr.
4721
4722           Example: [#1] image.jpg rgb2ycbcr split c
4723
4724         rgb2yuv:
4725
4726           Convert color representation of selected images from RGB to YUV.
4727
4728           Example: [#1] image.jpg rgb2yuv split c
4729
4730         rgb2yuv8:
4731
4732           Convert color representation of selected images from RGB to YUV8.
4733
4734           Example: [#1] image.jpg rgb2yuv8 split c
4735
4736         remove_opacity:
4737
4738           Remove opacity channel of selected images.
4739
4740         ryb2rgb:
4741
4742           Convert color representation of selected images from RYB to RGB.
4743
4744         select_color:
4745             tolerance[%]>=0,col1,...,colN
4746
4747           Select pixels with specified color in selected images.
4748
4749           Example: [#1] image.jpg +select_color 40,204,153,110
4750
4751           Tutorial: https://gmic.eu/tutorial/_select_color.shtml
4752
4753         sepia:
4754
4755           Apply sepia tones effect on selected images.
4756
4757           Example: [#1] image.jpg sepia
4758
4759         solarize:
4760
4761           Solarize selected images.
4762
4763           Example: [#1] image.jpg solarize
4764
4765         split_colors:
4766             _tolerance>=0,_max_nb_outputs>0,_min_area>0
4767
4768           Split selected images as several image containing a single color.
4769           One selected image can be split as at most 'max_nb_outputs' images.
4770           Output images are sorted by  decreasing  area  of  extracted  color
4771       regions and have an additional
4772           alpha-channel.
4773
4774           Default    values:    'tolerance=0',    'max_nb_outputs=256'    and
4775       'min_area=8'.
4776
4777           Example: [#1] image.jpg quantize 5 +split_colors , display_rgba
4778
4779         split_opacity:
4780
4781           Split color and opacity parts of selected images.
4782
4783         srgb2lab:
4784             illuminant={ 0=D50 | 1=D65 | 2=E } |
4785             (no arg)
4786
4787           Convert color representation of selected images from sRGB to Lab.
4788
4789           Default value: 'illuminant=2'.
4790
4791           Example: [#1] image.jpg srgb2lab split c
4792                    [#2]  image.jpg   srgb2lab   +split   c   mul[-2,-1]   2.5
4793       append[-3--1] c lab2srgb
4794
4795         srgb2lab8:
4796             illuminant={ 0=D50 | 1=D65 | 2=E } |
4797             (no arg)
4798
4799           Convert color representation of selected images from sRGB to Lab8.
4800
4801           Default value: 'illuminant=2'.
4802
4803         srgb2rgb:
4804
4805           Convert color representation of selected images from sRGB to linear
4806       RGB.
4807
4808         to_a:
4809
4810           Force selected images to have an alpha channel.
4811
4812         to_color:
4813
4814           Force selected images to be in color mode (RGB or RGBA).
4815
4816         to_colormode:
4817             mode={ 0=adaptive | 1=G | 2=GA | 3=RGB | 4=RGBA }
4818
4819           Force selected images to be in a given color mode.
4820
4821           Default value: 'mode=0'.
4822
4823         to_gray:
4824
4825           Force selected images to be in GRAY mode.
4826
4827           Example: [#1] image.jpg +to_gray
4828
4829         to_graya:
4830
4831           Force selected images to be in GRAYA mode.
4832
4833         to_pseudogray:
4834             _max_step>=0,_is_perceptual_constraint={ 0 | 1 },_bits_depth>0
4835
4836           Convert selected  scalar  images  ([0-255]-valued)  to  pseudo-gray
4837       color images.
4838
4839           Default   values:  'max_step=5',  'is_perceptual_constraint=1'  and
4840       'bits_depth=8'.
4841           The original pseudo-gray technique  has  been  introduced  by  Rich
4842       Franzen
4843           [http://r0k.us/graphics/pseudoGrey.html].
4844           Extension of this technique to arbitrary increments for more tones,
4845       has been done by David
4846           Tschumperlé.
4847
4848         to_rgb:
4849
4850           Force selected images to be in RGB mode.
4851
4852         to_rgba:
4853
4854           Force selected images to be in RGBA mode.
4855
4856         transfer_histogram:
4857             [reference_image],_nb_levels>0,_color_channels
4858
4859           Transfer histogram of the specified  reference  image  to  selected
4860       images.
4861           Argument  'color channels' is the same as with command 'apply_chan‐
4862       nels'.
4863
4864           Default value: 'nb_levels=256' and 'color_channels=all'.
4865
4866           Example:  [#1]  image.jpg  100,100,1,3,"u([256,200,100])"   +trans‐
4867       fer_histogram[0] [1]
4868
4869         transfer_pca:
4870             [reference_image],_color_channels
4871
4872           Transfer mean and covariance matrix of specified vector-valued ref‐
4873       erence image to selected images.
4874           Argument 'color channels' is the same as with command  'apply_chan‐
4875       nels'.
4876
4877           Default value: 'color_channels=all'.
4878
4879           Example: [#1] sample lena,earth +transfer_pca[0] [1]
4880
4881         transfer_rgb:
4882             [target],_gamma>=0,_regularization>=0,_luminosity_con‐
4883       straints>=0,_rgb_resolution>=0,       _is_constraints={ 0 | 1 }
4884
4885           Transfer colors from selected source images to  selected  reference
4886       image (given as argument).
4887           'gamma'  determines  the  importance  of  color  occurrences in the
4888       matching process (0=none to 1=huge).
4889           'regularization' determines the number of guided filter  iterations
4890       to remove quantization effects.
4891           'luminosity_constraints'  tells  if  luminosity constraints must be
4892       applied on non-confident matched
4893           colors.
4894           'is_constraints' tells if additional hard color constraints must be
4895       set (opens an interactive
4896           window).
4897
4898           Default  values:  'gamma=0.3','regularization=8',  'luminosity_con‐
4899       straints=0.1',
4900             'rgb_resolution=64' and 'is_constraints=0'.
4901
4902           Example: [#1] sample pencils,wall +transfer_rgb[0] [1],0,0.01
4903
4904         xyz2jzazbz:
4905
4906           Convert color representation of selected images from XYZ to RGB.
4907
4908         xyz2lab:
4909             illuminant={ 0=D50 | 1=D65 | 2=E } |
4910             (no arg)
4911
4912           Convert color representation of selected images from XYZ to Lab.
4913
4914           Default value: 'illuminant=2'.
4915
4916         xyz2rgb:
4917             illuminant={ 0=D50 | 1=D65 | 2=E } |
4918             (no arg)
4919
4920           Convert color representation of selected images from XYZ to RGB.
4921
4922           Default value: 'illuminant=2'.
4923
4924         xyz82rgb:
4925             illuminant={ 0=D50 | 1=D65 | 2=E } |
4926             (no arg)
4927
4928           Convert color representation of selected images from XYZ8 to RGB.
4929
4930           Default value: 'illuminant=2'.
4931
4932         ycbcr2rgb:
4933
4934           Convert color representation of selected images from YCbCr to RGB.
4935
4936         yiq2rgb:
4937
4938           Convert color representation of selected images from YIQ to RGB.
4939
4940         yiq82rgb:
4941
4942           Convert color representation of selected images from YIQ8 to RGB.
4943
4944         yuv2rgb:
4945
4946           Convert color representation of selected images from YUV to RGB.
4947
4948         yuv82rgb:
4949
4950           Convert selected images from YUV8 to RGB color bases.
4951
4952         12.7. Geometry Manipulation
4953               ---------------------
4954
4955         a (+):
4956             Shortcut for command 'append'.
4957
4958         append (+):
4959             [image],axis,_centering |
4960             axis,_centering
4961
4962           Append specified image to selected images, or all  selected  images
4963       together, along specified axis.
4964           (equivalent to shortcut command 'a').
4965
4966           'axis' can be { x | y | z | c }.
4967           Usual  'centering'  values  are { 0=left-justified | 0.5=centered |
4968       1=right-justified }.
4969
4970           Default value: 'centering=0'.
4971
4972           Example: [#1] image.jpg split y,10 reverse append y
4973                    [#2]  image.jpg  repeat  5  +rows[0]  0,{10+18*$>}%   done
4974       remove[0] append x,0.5
4975                    [#3] image.jpg append[0] [0],y
4976
4977         append_tiles:
4978             _M>=0,_N>=0,0<=_centering_x<=1,0<=_centering_y<=1
4979
4980           Append MxN selected tiles as new images.
4981           If 'N' is set to 0, number of rows is estimated automatically.
4982           If 'M' is set to 0, number of columns is estimated automatically.
4983           If 'M' and 'N' are both set to '0', auto-mode is used.
4984           If 'M' or 'N' is set to 0, only a single image is produced.
4985           'centering_x'  and 'centering_y' tells about the centering of tiles
4986       when they have different sizes.
4987
4988           Default values: 'M=0', 'N=0', 'centering_x=centering_y=0.5'.
4989
4990           Example: [#1] image.jpg split xy,4 append_tiles ,
4991
4992         apply_scales:
4993             "command",num‐
4994       ber_of_scales>0,_min_scale[%]>=0,_max_scale[%]>=0,_scale_gamma>0,_inter‐
4995       polation
4996
4997           Apply specified command on different scales of selected images.
4998           'interpolation' can be { 0=none | 1=nearest | 2=average |  3=linear
4999       | 4=grid | 5=bicubic | 6=lanczos
5000           }.
5001
5002           Default  value:  'min_scale=25%',  'max_scale=100%' and 'interpola‐
5003       tion=3'.
5004
5005           Example: [#1] image.jpg apply_scales "blur 5 sharpen 1000",4
5006
5007         autocrop (+):
5008             value1,value2,... |
5009             (no arg)
5010
5011           Autocrop selected images by specified vector-valued intensity.
5012           If no arguments are provided, cropping value is guessed.
5013
5014           Example:   [#1]   400,400,1,3   fill_color    64,128,255    ellipse
5015       50%,50%,120,120,0,1,255 +autocrop
5016
5017         autocrop_components:
5018             _threshold[%],_min_area[%]>=0,_is_high_connectivity={   0   |   1
5019       },_output_type={ 0=crop |        1=segmentation | 2=coordinates }
5020
5021           Autocrop and  extract  connected  components  in  selected  images,
5022       according to a mask given as the last
5023           channel of
5024           each of the selected image (e.g. alpha-channel).
5025
5026           Default  values:  'threshold=0%', 'min_area=0.1%', 'is_high_connec‐
5027       tivity=0' and 'output_type=1'.
5028
5029           Example: [#1] 256,256 noise 0.1,2 eq 1 dilate_circ 20 label_fg  0,1
5030       normalize 0,255 +neq 0 *[-1] 255       append c +autocrop_components ,
5031
5032         autocrop_seq:
5033             value1,value2,... | auto
5034
5035           Autocrop selected images using the crop geometry of the last one by
5036       specified vector-valued
5037           intensity,
5038           or by automatic guessing the cropping value.
5039
5040           Default value: auto mode.
5041
5042           Example:     [#1]     image.jpg     +fill[-1]     0     ellipse[-1]
5043       50%,50%,30%,20%,0,1,1 autocrop_seq 0
5044
5045         channels (+):
5046             { [image0] | c0[%] },_{ [image1] | c1[%] }
5047
5048           Keep only specified channels of selected images.
5049           Dirichlet  boundary  is  used  when  specified  channels are out of
5050       range.
5051
5052           Example: [#1] image.jpg channels 0,1
5053                    [#2] image.jpg luminance channels 0,2
5054
5055         columns (+):
5056             { [image0] | x0[%] },_{ [image1] | x1[%] }
5057
5058           Keep only specified columns of selected images.
5059           Dirichlet boundary is used when specified columns are out of range.
5060
5061           Example: [#1] image.jpg columns -25%,50%
5062
5063         z (+):
5064             Shortcut for command 'crop'.
5065
5066         crop (+):
5067             x0[%],x1[%],_boundary_conditions |
5068             x0[%],y0[%],x1[%],y1[%],_boundary_conditions |
5069             x0[%],y0[%],z0[%],x1[%],y1[%],z1[%],_boundary_conditions |
5070             x0[%],y0[%],z0[%],c0[%],x1[%],y1[%],z1[%],c1[%],_boundary_condi‐
5071       tions
5072
5073           Crop selected images with specified region coordinates.
5074           (equivalent to shortcut command 'z').
5075
5076           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
5077       | 3=mirror }.
5078
5079           Default value: 'boundary_conditions=0'.
5080
5081           Example:   [#1]   image.jpg   +crop   -230,-230,280,280,1   crop[0]
5082       -230,-230,280,280,0
5083                    [#2] image.jpg crop 25%,25%,75%,75%
5084
5085         diagonal:
5086
5087           Transform selected vectors as diagonal matrices.
5088
5089           Example: [#1] 1,10,1,1,'y' +diagonal
5090
5091         elevate:
5092             _depth,_is_plain={ 0 | 1 },_is_colored={ 0 | 1 }
5093
5094           Elevate selected 2D images into 3D volumes.
5095
5096           Default values: 'depth=64', 'is_plain=1' and 'is_colored=1'.
5097
5098         expand_x:
5099             size_x>=0,_boundary_conditions={   0=dirichlet   |   1=neumann  |
5100       2=periodic | 3=mirror }
5101
5102           Expand selected images along the x-axis.
5103
5104           Default value: 'boundary_conditions=1'.
5105
5106           Example: [#1] image.jpg expand_x 30,0
5107
5108         expand_xy:
5109             size>=0,_boundary_conditions={ 0=dirichlet | 1=neumann |  2=peri‐
5110       odic | 3=mirror }
5111
5112           Expand selected images along the xy-axes.
5113
5114           Default value: 'boundary_conditions=1'.
5115
5116           Example: [#1] image.jpg expand_xy 30,0
5117
5118         expand_xyz:
5119             size>=0,_boundary_conditions={  0=dirichlet | 1=neumann | 2=peri‐
5120       odic | 3=mirror }
5121
5122           Expand selected images along the xyz-axes.
5123
5124           Default value: 'boundary_conditions=1'.
5125
5126         expand_y:
5127             size_y>=0,_boundary_conditions={  0=dirichlet   |   1=neumann   |
5128       2=periodic | 3=mirror }
5129
5130           Expand selected images along the y-axis.
5131
5132           Default value: 'boundary_conditions=1'.
5133
5134           Example: [#1] image.jpg expand_y 30,0
5135
5136         expand_z:
5137             size_z>=0,_boundary_conditions={   0=dirichlet   |   1=neumann  |
5138       2=periodic | 3=mirror }
5139
5140           Expand selected images along the z-axis.
5141
5142           Default value: 'boundary_conditions=1'.
5143
5144         extract:
5145             "condition",_output_type={ 0=xyzc-coordinates | 1=xyz-coordinates
5146       | 2=scalar-values |        3=vector-values }
5147
5148           Extract a list of coordinates or values from selected image, where
5149           specified mathematical condition holds.
5150           For N coordinates matching, result is a 1xNx1x4 image.
5151
5152           Default values: 'output_type=0'.
5153
5154           Example: [#1] sp lena +extract "norm(I)>128",3
5155
5156         extract_region:
5157             [label_image],_extract_xyz_coordinates={        0       |       1
5158       },_label_1,...,_label_M
5159
5160           Extract all pixels of selected images whose corresponding label  in
5161       '[label_image]' is equal to
5162           'label_m',
5163           and output them as M column images.
5164
5165           Default value: 'extract_xyz_coordinates=0'.
5166
5167           Example:  [#1]  image.jpg  +blur 3 quantize. 4,0 +extract_region[0]
5168       [1],0,1,3
5169
5170         montage:
5171             "_layout_code",_montage_mode={  0<=centering<=1  |  2<=scale+2<=3
5172       },_output_mode={ 0=single layer |        1=multiple layers },"_process‐
5173       ing_command"
5174
5175           Create a single image montage from selected  images,  according  to
5176       specified layout code :
5177           *  'X' to assemble all images using an automatically estimated lay‐
5178       out.
5179           * 'H' to assemble all images horizontally.
5180           * 'V' to assemble all images vertically.
5181           * 'A' to assemble all images as an horizontal array.
5182           * 'B' to assemble all images as a vertical array.
5183           * 'Ha:b' to assemble two blocks 'a' and 'b' horizontally.
5184           * 'Va:b' to assemble two blocks 'a' and 'b' vertically.
5185           * 'Ra' to rotate a block 'a' by 90 deg. ('RRa'  for  180  deg.  and
5186       'RRRa' for 270 deg.).
5187           *  'Ma'  to  mirror a block 'a' along the X-axis ('MRRa' for the Y-
5188       axis).
5189           A block 'a' can be an  image  index  (treated  periodically)  or  a
5190       nested layout expression
5191           'Hb:c','Vb:c','Rb' or
5192           'Mb' itself.
5193           For example, layout code 'H0:V1:2' creates an image where image [0]
5194       is on the left, and images [1]
5195           and [2]
5196           vertically packed on the right.
5197
5198           Default values: 'layout_code=X', 'montage_mode=2',  output_mode='0'
5199       and
5200             'processing_command=""'.
5201
5202           Example: [#1] image.jpg sample ? +plasma[0] shape_cupid 256 normal‐
5203       ize 0,255 frame 3,3,0 frame 10,10,255        to_rgb  +montage  A  +mon‐
5204       tage[^-1] H1:V0:VH2:1H0:3
5205
5206         mirror (+):
5207             { x | y | z }...{ x | y | z }
5208
5209           Mirror selected images along specified axes.
5210
5211           Example: [#1] image.jpg +mirror y +mirror[0] c
5212                    [#2] image.jpg +mirror x +mirror y append_tiles 2,2
5213
5214         permute (+):
5215             permutation_string
5216
5217           Permute selected image axes by specified permutation.
5218           'permutation' is a combination of the character set {x|y|z|c},
5219           e.g. 'xycz', 'cxyz', ...
5220
5221           Example: [#1] image.jpg permute yxzc
5222
5223         r (+):
5224             Shortcut for command 'resize'.
5225
5226         resize (+):
5227             {[image_w] | width>0[%]},_{[image_h] | height>0[%]},_{[image_d] |
5228       depth>0[%]},_{[image_s] |         spectrum>0[%]},_interpolation,_bound‐
5229       ary_conditions,_ax,_ay,_az,_ac
5230
5231           Resize selected images with specified geometry.
5232           (equivalent to shortcut command 'r').
5233
5234           'interpolation'  can  be  {  -1=none  (memory  content)  | 0=none |
5235       1=nearest | 2=average | 3=linear |
5236           4=grid | 5=bicubic | 6=lanczos }.
5237           'boundary_conditions' has different meanings, according to the cho‐
5238       sen 'interpolation' mode :
5239           *  When  'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions'
5240       is meaningless.
5241           * When 'interpolation==0', 'boundary_conditions' can be { 0=dirich‐
5242       let | 1=neumann | 2=periodic |
5243           3=mirror }.
5244           * When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be
5245       { 0=none | 1=neumann }.
5246           'ax,ay,az,ac' set the centering along each  axis  when  'interpola‐
5247       tion=0 or 4'
5248           (set to '0' by default, must be defined in range [0,1]).
5249
5250           Default   values:  'interpolation=1',  'boundary_conditions=0'  and
5251       'ax=ay=az=ac=0'.
5252
5253           Example:  [#1]  image.jpg  +resize[-1]  256,128,1,3,2   +resize[-1]
5254       120%,120%,1,3,0,1,0.5,0.5  +resize[-1]        120%,120%,1,3,0,0,0.2,0.2
5255       +resize[-1] [0],[0],1,3,4
5256
5257         ri:
5258             Shortcut for command 'resize_as_image'.
5259
5260         resize_as_image:
5261             [reference],_interpolation,_boundary_conditions,_ax,_ay,_az,_ac
5262
5263           Resize selected images to the  geometry  of  specified  [reference]
5264       image.
5265           (equivalent to shortcut command 'ri').
5266
5267           Default   values:  'interpolation=1',  'boundary_conditions=0'  and
5268       'ax=ay=az=ac=0'.
5269
5270           Example: [#1] image.jpg sample duck +resize_as_image[-1] [-2]
5271
5272         resize_mn:
5273             width[%]>=0,_height[%]>=0,_depth[%]>=0,_B_value,_C_value
5274
5275           Resize selected images with Mitchell-Netravali filter (cubic).
5276           For       details       about        the        method,        see:
5277       https://de.wikipedia.org/wiki/Mitchell-Netravali-Filter
5278
5279           Default   values:   'height=100%',   'depth=100%',  'B=0.3333'  and
5280       'C=0.3333'.
5281
5282           Example: [#1] image.jpg resize2dx 32 resize_mn 800%,800%
5283
5284         resize_pow2:
5285             _interpolation,_boundary_conditions,_ax,_ay,_az,_ac
5286
5287           Resize selected images so that each dimension is a power of 2.
5288           'interpolation' can be  {  -1=none  (memory  content)  |  0=none  |
5289       1=nearest | 2=average | 3=linear |
5290           4=grid | 5=bicubic | 6=lanczos }.
5291           'boundary_conditions' has different meanings, according to the cho‐
5292       sen 'interpolation' mode :
5293           * When 'interpolation=={ -1 | 1 | 2 | 4  }',  'boundary_conditions'
5294       is meaningless.
5295           * When 'interpolation==0', 'boundary_conditions' can be { 0=dirich‐
5296       let | 1=neumann | 2=periodic |
5297           3=mirror }.
5298           * When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be
5299       { 0=none | 1=neumann }.
5300           'ax,ay,az,ac'  set  the  centering along each axis when 'interpola‐
5301       tion=0'
5302           (set to '0' by default, must be defined in range [0,1]).
5303
5304           Default  values:  'interpolation=0',  'boundary_conditions=0'   and
5305       'ax=ay=az=ac=0'.
5306
5307           Example: [#1] image.jpg +resize_pow2[-1] 0
5308
5309         rr2d:
5310             Shortcut for command 'resize_ratio2d'.
5311
5312         resize_ratio2d:
5313             width>0,height>0,_mode={   0=inside   |   1=outside   |  2=padded
5314       },0=<_interpolation<=6
5315
5316           Resize selected images while preserving their aspect ratio.
5317           (equivalent to shortcut command 'rr2d').
5318
5319           Default values: 'mode=0' and 'interpolation=6'.
5320
5321         r2dx:
5322             Shortcut for command 'resize2dx'.
5323
5324         resize2dx:
5325             width[%]>0,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac
5326
5327           Resize selected images along the x-axis, preserving 2D ratio.
5328           (equivalent to shortcut command 'r2dx').
5329
5330           'interpolation' can be  {  -1=none  (memory  content)  |  0=none  |
5331       1=nearest | 2=average | 3=linear |
5332           4=grid | 5=bicubic | 6=lanczos }.
5333           'boundary_conditions' has different meanings, according to the cho‐
5334       sen 'interpolation' mode :
5335           * When 'interpolation=={ -1 | 1 | 2 | 4  }',  'boundary_conditions'
5336       is meaningless.
5337           * When 'interpolation==0', 'boundary_conditions' can be { 0=dirich‐
5338       let | 1=neumann | 2=periodic |
5339           3=mirror }.
5340           * When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be
5341       { 0=none | 1=neumann }.
5342           'ax,ay,az,ac'  set  the  centering along each axis when 'interpola‐
5343       tion=0'
5344           (set to '0' by default, must be defined in range [0,1]).
5345
5346           Default  values:  'interpolation=3',  'boundary_conditions=0'   and
5347       'ax=ay=az=ac=0'.
5348
5349           Example: [#1] image.jpg +resize2dx 100,2 append x
5350
5351         r2dy:
5352             Shortcut for command 'resize2dy'.
5353
5354         resize2dy:
5355             height[%]>=0,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac
5356
5357           Resize selected images along the y-axis, preserving 2D ratio.
5358           (equivalent to shortcut command 'r2dy').
5359
5360           'interpolation'  can  be  {  -1=none  (memory  content)  | 0=none |
5361       1=nearest | 2=average | 3=linear |
5362           4=grid | 5=bicubic | 6=lanczos }.
5363           'boundary_conditions' has different meanings, according to the cho‐
5364       sen 'interpolation' mode :
5365           *  When  'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions'
5366       is meaningless.
5367           * When 'interpolation==0', 'boundary_conditions' can be { 0=dirich‐
5368       let | 1=neumann | 2=periodic |
5369           3=mirror }.
5370           * When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be
5371       { 0=none | 1=neumann }.
5372           'ax,ay,az,ac' set the centering along each  axis  when  'interpola‐
5373       tion=0'
5374           (set to '0' by default, must be defined in range [0,1]).
5375
5376           Default   values:  'interpolation=3',  'boundary_conditions=0'  and
5377       'ax=ay=az=ac=0'.
5378
5379           Example: [#1] image.jpg +resize2dy 100,2 append x
5380
5381         r3dx:
5382             Shortcut for command 'resize3dx'.
5383
5384         resize3dx:
5385             width[%]>0,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac
5386
5387           Resize selected images along the x-axis, preserving 3D ratio.
5388           (equivalent to shortcut command 'r3dx').
5389
5390           'interpolation' can be  {  -1=none  (memory  content)  |  0=none  |
5391       1=nearest | 2=average | 3=linear |
5392           4=grid | 5=bicubic | 6=lanczos }.
5393           'boundary_conditions' has different meanings, according to the cho‐
5394       sen 'interpolation' mode :
5395           * When 'interpolation=={ -1 | 1 | 2 | 4  }',  'boundary_conditions'
5396       is meaningless.
5397           * When 'interpolation==0', 'boundary_conditions' can be { 0=dirich‐
5398       let | 1=neumann | 2=periodic |
5399           3=mirror }.
5400           * When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be
5401       { 0=none | 1=neumann }.
5402           'ax,ay,az,ac'  set  the  centering along each axis when 'interpola‐
5403       tion=0'
5404           (set to '0' by default, must be defined in range [0,1]).
5405
5406           Default  values:  'interpolation=3',  'boundary_conditions=0'   and
5407       'ax=ay=az=ac=0'.
5408
5409         r3dy:
5410             Shortcut for command 'resize3dy'.
5411
5412         resize3dy:
5413             height[%]>0,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac
5414
5415           Resize selected images along the y-axis, preserving 3D ratio.
5416           (equivalent to shortcut command 'r3dy').
5417
5418           'interpolation'  can  be  {  -1=none  (memory  content)  | 0=none |
5419       1=nearest | 2=average | 3=linear |
5420           4=grid | 5=bicubic | 6=lanczos }.
5421           'boundary_conditions' has different meanings, according to the cho‐
5422       sen 'interpolation' mode :
5423           *  When  'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions'
5424       is meaningless.
5425           * When 'interpolation==0', 'boundary_conditions' can be { 0=dirich‐
5426       let | 1=neumann | 2=periodic |
5427           3=mirror }.
5428           * When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be
5429       { 0=none | 1=neumann }.
5430           'ax,ay,az,ac' set the centering along each  axis  when  'interpola‐
5431       tion=0'
5432           (set to '0' by default, must be defined in range [0,1]).
5433
5434           Default   values:  'interpolation=3',  'boundary_conditions=0'  and
5435       'ax=ay=az=ac=0'.
5436
5437         r3dz:
5438             Shortcut for command 'resize3dz'.
5439
5440         resize3dz:
5441             depth[%]>0,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac
5442
5443           Resize selected images along the z-axis, preserving 3D ratio.
5444           (equivalent to shortcut command 'r3dz').
5445
5446           'interpolation' can be  {  -1=none  (memory  content)  |  0=none  |
5447       1=nearest | 2=average | 3=linear |
5448           4=grid | 5=bicubic | 6=lanczos }.
5449           'boundary_conditions' has different meanings, according to the cho‐
5450       sen 'interpolation' mode :
5451           * When 'interpolation=={ -1 | 1 | 2 | 4  }',  'boundary_conditions'
5452       is meaningless.
5453           * When 'interpolation==0', 'boundary_conditions' can be { 0=dirich‐
5454       let | 1=neumann | 2=periodic |
5455           3=mirror }.
5456           * When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be
5457       { 0=none | 1=neumann }.
5458           'ax,ay,az,ac'  set  the  centering along each axis when 'interpola‐
5459       tion=0'
5460           (set to '0' by default, must be defined in range [0,1]).
5461
5462           Default  values:  'interpolation=3',  'boundary_conditions=0'   and
5463       'ax=ay=az=ac=0'.
5464
5465         rotate (+):
5466             angle,_interpolation,_boundary_conditions,_center_x[%],_cen‐
5467       ter_y[%] |
5468             u,v,w,angle,interpolation,boundary_conditions,_center_x[%],_cen‐
5469       ter_y[%],_center_z[%]
5470
5471           Rotate  selected images with specified angle (in deg.), and option‐
5472       ally 3D axis (u,v,w).
5473           'interpolation' can be { 0=none | 1=linear | 2=bicubic }.
5474           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
5475       | 3=mirror }.
5476           When  a  rotation  center (cx,cy,_cz) is specified, the size of the
5477       image is preserved.
5478
5479           Default values: 'interpolation=1', 'boundary_conditions=0' and
5480             'center_x=center_y=(undefined)'.
5481
5482           Example: [#1] image.jpg +rotate -25,1,2,50%,50% rotate[0] 25
5483
5484         rotate_tileable:
5485             angle,_max_size_factor>=0
5486
5487           Rotate selected images by specified angle and make them tileable.
5488           If resulting size of an image is too big, the image is replaced  by
5489       a 1x1 image.
5490
5491           Default values: 'max_size_factor=8'.
5492
5493         rows (+):
5494             { [image0] | y0[%] },_{ [image1] | y1[%] }
5495
5496           Keep only specified rows of selected images.
5497           Dirichlet  boundary conditions are used when specified rows are out
5498       of range.
5499
5500           Example: [#1] image.jpg rows -25%,50%
5501
5502         scale2x:
5503
5504           Resize selected images using the Scale2x algorithm.
5505
5506           Example: [#1] image.jpg threshold 50% resize 50%,50% +scale2x
5507
5508         scale3x:
5509
5510           Resize selected images using the Scale3x algorithm.
5511
5512           Example: [#1] image.jpg threshold 50% resize 33%,33% +scale3x
5513
5514         scale_dcci2x:
5515             _edge_threshold>=0,_exponent>0,_extend_1px={ 0=false | 1=true }
5516
5517           Double image size using directional  cubic  convolution  interpola‐
5518       tion,
5519           as      described      in      https://en.wikipedia.org/wiki/Direc
5520       tional_Cubic_Convolution_Interpolation.
5521
5522           Default    values:    'edge_threshold=1.15',    'exponent=5'    and
5523       'extend_1px=0'.
5524
5525           Example: [#1] image.jpg +scale_dcci2x ,
5526
5527         seamcarve:
5528             _width[%]>=0,_height[%]>=0,_is_priority_channel={     0    |    1
5529       },_is_antialiasing={ 0 | 1 },       _maximum_seams[%]>=0
5530
5531           Resize selected images with specified 2D geometry, using the  seam-
5532       carving algorithm.
5533
5534           Default     values:     'height=100%',     'is_priority_channel=0',
5535       'is_antialiasing=1' and
5536             'maximum_seams=25%'.
5537
5538           Example: [#1] image.jpg seamcarve 60%
5539
5540         shift (+):
5541             vx[%],_vy[%],_vz[%],_vc[%],_boundary_conditions,_interpolation={
5542       0=nearest_neighbor | 1=linear }
5543
5544           Shift selected images by specified displacement vector.
5545           Displacement  vector can be non-integer in which case linear inter‐
5546       polation should be chosen.
5547           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
5548       | 3=mirror }.
5549
5550           Default value: 'boundary_conditions=0' and 'interpolation=0'.
5551
5552           Example:   [#1]   image.jpg   +shift[0]   50%,50%,0,0,0   +shift[0]
5553       50%,50%,0,0,1 +shift[0] 50%,50%,0,0,2
5554
5555         shrink_x:
5556             size_x>=0
5557
5558           Shrink selected images along the x-axis.
5559
5560           Example: [#1] image.jpg shrink_x 30
5561
5562         shrink_xy:
5563             size>=0
5564
5565           Shrink selected images along the xy-axes.
5566
5567           Example: [#1] image.jpg shrink_xy 30
5568
5569         shrink_xyz:
5570             size>=0
5571
5572           Shrink selected images along the xyz-axes.
5573
5574         shrink_y:
5575             size_y>=0
5576
5577           Shrink selected images along the y-axis.
5578
5579           Example: [#1] image.jpg shrink_y 30
5580
5581         shrink_z:
5582             size_z>=0
5583
5584           Shrink selected images along the z-axis.
5585
5586         slices (+):
5587             { [image0] | z0[%] },_{ [image1] | z1[%] }
5588
5589           Keep only specified slices of selected images.
5590           Dirichlet boundary conditions are used when  specified  slices  are
5591       out of range.
5592
5593         sort (+):
5594             _ordering={ + | - },_axis={ x | y | z | c }
5595
5596           Sort pixel values of selected images.
5597           If  'axis'  is specified, the sorting is done according to the data
5598       of the first
5599           column/row/slice/channel
5600           of selected images.
5601
5602           Default values: 'ordering=+' and 'axis=(undefined)'.
5603
5604           Example: [#1] 64 rand 0,100 +sort display_graph 400,300,3
5605
5606         s (+):
5607             Shortcut for command 'split'.
5608
5609         split (+):
5610             { x | y | z | c }...{ x | y | z | c },_split_mode |
5611             keep_splitting_values={ + | - },_{ x | y | z | c }...{ x | y |  z
5612       | c },value1,_value2,... |
5613             (no arg)
5614
5615           Split  selected  images  along  specified  axes,  or regarding to a
5616       sequence of scalar values
5617           (optionally along specified axes too).
5618           (equivalent to shortcut command 's').
5619
5620           'split_mode' can be  {  0=split  according  to  constant  values  |
5621       >0=split in N parts | <0=split in
5622           parts of size -N }.
5623
5624           Default value: 'split_mode=-1'.
5625
5626           Example: [#1] image.jpg split c
5627                    [#2] image.jpg split y,3
5628                    [#3] image.jpg split x,-128
5629                    [#4] 1,20,1,1,"1,2,3,4" +split -,2,3 append[1--1] y
5630                    [#5] (1,2,2,3,3,3,4,4,4,4) +split x,0 append[1--1] y
5631
5632         split_tiles:
5633             M!=0,_N!=0,_is_homogeneous={ 0 | 1 }
5634
5635           Split selected images as a MxN array of tiles.
5636           If M or N is negative, it stands for the tile size instead.
5637
5638           Default values: 'N=M' and 'is_homogeneous=0'.
5639
5640           Example: [#1] image.jpg +local split_tiles 5,4 blur 3,0 sharpen 700
5641       append_tiles 4,5 endlocal
5642
5643         undistort:
5644             -1<=_amplitude<=1,_aspect_ratio,_zoom,_center_x[%],_cen‐
5645       ter_y[%],_boundary_conditions
5646
5647           Correct  barrel/pincushion  distortions  occurring  with wide-angle
5648       lens.
5649           References:
5650           [1] Zhang Z. (1999). Flexible camera calibration by viewing a plane
5651       from unknown orientation.
5652           [2]  Andrew W. Fitzgibbon (2001). Simultaneous linear estimation of
5653       multiple view geometry and lens
5654           distortion.
5655           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
5656       | 3=mirror }.
5657
5658           Default values: 'amplitude=0.25', 'aspect_ratio=0', 'zoom=0', 'cen‐
5659       ter_x=center_y=50%' and
5660             'boundary_conditions=0'.
5661
5662         y (+):
5663             Shortcut for command 'unroll'.
5664
5665         unroll (+):
5666             _axis={ x | y | z | c }
5667
5668           Unroll selected images along specified axis.
5669           (equivalent to shortcut command 'y').
5670
5671           Default value: 'axis=y'.
5672
5673           Example: [#1] (1,2,3;4,5,6;7,8,9) +unroll y
5674
5675         upscale_smart:
5676             width[%],_height[%],_depth,_smoothness>=0,_anisot‐
5677       ropy=[0,1],sharpening>=0
5678
5679           Upscale selected images with an edge-preserving algorithm.
5680
5681           Default  values:  'height=100%', 'depth=100%', 'smoothness=2', 'an‐
5682       isotropy=0.4' and
5683             'sharpening=10'.
5684
5685           Example: [#1]  image.jpg  resize2dy  100  +upscale_smart  500%,500%
5686       append x
5687
5688         warp (+):
5689             [warping_field],_mode,_interpolation,_boundary_condi‐
5690       tions,_nb_frames>0
5691
5692           Warp selected images with specified displacement field.
5693           'mode' can be { 0=backward-absolute | 1=backward-relative |  2=for‐
5694       ward-absolute | 3=forward-relative
5695           }.
5696           'interpolation' can be { 0=nearest-neighbor | 1=linear | 2=cubic }.
5697           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
5698       | 3=mirror }.
5699
5700           Default  values:  'mode=0',   'interpolation=1',   'boundary_condi‐
5701       tions=1' and 'nb_frames=1'.
5702
5703           Example:                       [#1]                       image.jpg
5704       100%,100%,1,2,'X=x/w-0.5;Y=y/h-0.5;R=(X*X+Y*Y)^0.5;A=atan2(Y,X);130*R*if(c==0,
5705       cos(4*A),sin(8*A))' warp[-2] [-1],1,1,0 quiver[-1] [-1],10,1,1,1,100
5706
5707           Tutorial: https://gmic.eu/tutorial/_warp.shtml
5708
5709         warp_patch:
5710             [warp‐
5711       ing_field],patch_width>=1,_patch_height>=1,_patch_depth>=1,_std_fac‐
5712       tor>0,_boundary_conditions.
5713
5714           Patch-warp  selected  images,  with specified 2D or 3D displacement
5715       field (in backward-absolute mode).
5716           Argument 'std_factor' sets the std of the gaussian weights for  the
5717       patch overlap,
5718           equal to 'std = std_factor*patch_size'.
5719           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
5720       | 3=mirror }.
5721
5722           Default values: 'std_factor=0.3' and 'boundary_conditions=3'.
5723
5724         warp_rbf:
5725             xs0[%],ys0[%],xt0[%],yt0[%],...,xsN[%],ysN[%],xtN[%],ytN[%]
5726
5727           Warp selected images using RBF-based interpolation.
5728           Each argument (xsk,ysk)-(xtk,ytk) corresponds to the coordinates of
5729       a keypoint
5730           respectively  on  the source and target images. The set of all key‐
5731       points define the overall image
5732           deformation.
5733
5734           Example:            [#1]            image.jpg             +warp_rbf
5735       0,0,0,0,100%,0,100%,0,100%,100%,100%,100%,0,100%,0,100%,50%,50%,70%,
5736       50%,25%,25%,25%,75%
5737
5738         12.8. Filtering
5739               ---------
5740
5741         bandpass:
5742             _min_freq[%],_max_freq[%]
5743
5744           Apply bandpass filter to selected images.
5745
5746           Default values: 'min_freq=0' and 'max_freq=20%'.
5747
5748           Example: [#1] image.jpg bandpass 1%,3%
5749
5750           Tutorial: https://gmic.eu/tutorial/_bandpass.shtml
5751
5752         bilateral (+):
5753             [guide],std_deviation_s[%]>=0,std_deviation_r[%]>=0,_sam‐
5754       pling_s>=0,_sampling_r>=0 |
5755             std_deviation_s[%]>=0,std_deviation_r[%]>=0,_sampling_s>=0,_sam‐
5756       pling_r>=0
5757
5758           Blur selected images by anisotropic (eventually joint/cross) bilat‐
5759       eral filtering.
5760           If  a  guide  image is provided, it is used for drive the smoothing
5761       filter.
5762           A guide image must be of the same xyz-size as the selected images.
5763           Set 'sampling' arguments to '0' for automatic adjustment.
5764
5765           Example: [#1] image.jpg repeat 5 bilateral 10,10 done
5766
5767         b (+):
5768             Shortcut for command 'blur'.
5769
5770         blur (+):
5771             std_deviation>=0[%],_boundary_conditions,_kernel |
5772             axes,std_deviation>=0[%],_boundary_conditions,_kernel
5773
5774           Blur selected images by a quasi-gaussian or gaussian filter (recur‐
5775       sive implementation).
5776           (equivalent to shortcut command 'b').
5777
5778           'boundary_conditions' can be { 0=dirichlet | 1=neumann }.
5779           'kernel' can be { 0=quasi-gaussian (faster) | 1=gaussian }.
5780           When specified, argument 'axes' is a sequence of { x | y | z | c }.
5781           Specifying  one  axis  multiple  times apply also the blur multiple
5782       times.
5783
5784           Default values: 'boundary_conditions=1' and 'kernel=0'.
5785
5786           Example: [#1] image.jpg +blur 5,0 +blur[0] 5,1
5787                    [#2] image.jpg +blur y,10%
5788
5789           Tutorial: https://gmic.eu/tutorial/_blur.shtml
5790
5791         blur_angular:
5792             amplitude[%],_center_x[%],_center_y[%]
5793
5794           Apply angular blur on selected images.
5795
5796           Default values: 'center_x=center_y=50%'.
5797
5798           Example: [#1] image.jpg blur_angular 2%
5799
5800           Tutorial: https://gmic.eu/tutorial/_blur_angular.shtml
5801
5802         blur_bloom:
5803             _amplitude>=0,_ratio>=0,_nb_iter>=0,_blend_operator={ + |  max  |
5804       min },_kernel={ 0=quasi-gaussian        (faster) | 1=gaussian | 2=box |
5805       3=triangle | 4=quadratic },_normalize_scales={ 0 | 1 },_axes
5806
5807           Apply a bloom filter that blend multiple blur filters of  different
5808       radii,
5809           resulting in a larger but sharper glare than a simple blur.
5810           When specified, argument 'axes' is a sequence of { x | y | z | c }.
5811           Specifying  one  axis  multiple  times apply also the blur multiple
5812       times.
5813           Reference: Masaki Kawase, "Practical Implementation of High Dynamic
5814       Range Rendering", GDC 2004.
5815
5816           Default values: 'amplitude=1', 'ratio=2', 'nb_iter=5', 'blend_oper‐
5817       ator=+', 'kernel=0',
5818             'normalize_scales=0' and 'axes=(all)'
5819
5820           Example: [#1] image.jpg blur_bloom ,
5821
5822         blur_linear:
5823             amplitude1[%],_amplitude2[%],_angle,_boundary_conditions={
5824       0=dirichlet | 1=neumann }
5825
5826           Apply  linear  blur  on  selected  images, with specified angle and
5827       amplitudes.
5828
5829           Default  values:  'amplitude2=0',  'angle=0'  and  'boundary_condi‐
5830       tions=1'.
5831
5832           Example: [#1] image.jpg blur_linear 10,0,45
5833
5834           Tutorial: https://gmic.eu/tutorial/_blur_linear.shtml
5835
5836         blur_radial:
5837             amplitude[%],_center_x[%],_center_y[%]
5838
5839           Apply radial blur on selected images.
5840
5841           Default values: 'center_x=center_y=50%'.
5842
5843           Example: [#1] image.jpg blur_radial 2%
5844
5845           Tutorial: https://gmic.eu/tutorial/_blur_radial.shtml
5846
5847         blur_selective:
5848             sigma>=0,_edges>0,_nb_scales>0
5849
5850           Blur selected images using selective gaussian scales.
5851
5852           Default values: 'sigma=5', 'edges=0.5' and 'nb_scales=5'.
5853
5854           Example:  [#1]  image.jpg  noise  20  cut 0,255 +local[-1] repeat 4
5855       blur_selective , done endlocal
5856
5857           Tutorial: https://gmic.eu/tutorial/_blur_selective.shtml
5858
5859         blur_x:
5860             amplitude[%]>=0,_boundary_conditions={ 0=dirichlet | 1=neumann }
5861
5862           Blur selected images along the x-axis.
5863
5864           Default value: 'boundary_conditions=1'.
5865
5866           Example: [#1] image.jpg +blur_x 6
5867
5868           Tutorial: https://gmic.eu/tutorial/_blur_x.shtml
5869
5870         blur_xy:
5871             amplitude_x[%],amplitude_y[%],_boundary_conditions={  0=dirichlet
5872       | 1=neumann }
5873
5874           Blur selected images along the X and Y axes.
5875
5876           Default value: 'boundary_conditions=1'.
5877
5878           Example: [#1] image.jpg +blur_xy 6
5879
5880           Tutorial: https://gmic.eu/tutorial/_blur_xy.shtml
5881
5882         blur_xyz:
5883             amplitude_x[%],amplitude_y[%],amplitude_z,_boundary_conditions={
5884       0=dirichlet | 1=neumann }
5885
5886           Blur selected images along the X, Y and Z axes.
5887
5888           Default value: 'boundary_conditions=1'.
5889
5890           Tutorial: https://gmic.eu/tutorial/_blur_xyz.shtml
5891
5892         blur_y:
5893             amplitude[%]>=0,_boundary_conditions={ 0=dirichlet | 1=neumann }
5894
5895           Blur selected images along the y-axis.
5896
5897           Default value: 'boundary_conditions=1'.
5898
5899           Example: [#1] image.jpg +blur_y 6
5900
5901           Tutorial: https://gmic.eu/tutorial/_blur_y.shtml
5902
5903         blur_z:
5904             amplitude[%]>=0,_boundary_conditions={ 0=dirichlet | 1=neumann }
5905
5906           Blur selected images along the z-axis.
5907
5908           Default value: 'boundary_conditions=1'.
5909
5910           Tutorial: https://gmic.eu/tutorial/_blur_z.shtml
5911
5912         boxfilter (+):
5913             size>=0[%],_order,_boundary_conditions,_nb_iter>=0 |
5914             axes,size>=0[%],_order,_boundary_conditions,_nb_iter>=0
5915
5916           Blur selected images by a box filter of specified size (fast recur‐
5917       sive implementation).
5918           'order' can be { 0=smooth | 1=1st-derivative | 2=2nd-derivative }.
5919           'boundary_conditions' can be { 0=dirichlet | 1=neumann }.
5920           When specified, argument 'axes' is a sequence of { x | y | z | c }.
5921           Specifying  one  axis  multiple  times apply also the blur multiple
5922       times.
5923
5924           Default values: 'order=0', 'boundary_conditions=1' and 'nb_iter=1'.
5925
5926           Example: [#1] image.jpg +boxfilter 5%
5927                    [#2] image.jpg +boxfilter y,3,1
5928
5929         bump2normal:
5930
5931           Convert selected bumpmaps to normalmaps.
5932
5933           Example: [#1] 300,300 circle 50%,50%,128,1,1 blur 5% bump2normal
5934
5935         compose_freq:
5936
5937           Compose selected low and high frequency parts into new images.
5938
5939           Example: [#1] image.jpg split_freq 2% mirror[-1] x compose_freq
5940
5941         convolve (+):
5942             [mask],_boundary_conditions,_is_normalized={  0  |   1   },_chan‐
5943       nel_mode,_xcenter,_ycenter,_zcenter,
5944       _xstart,_ystart,_zstart,_xend,_yend,_zend,_xstride,_ystride,_zstride,_xdi‐
5945       lation,_ydilation,       _zdilation
5946
5947           Convolve selected images by specified mask.
5948           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
5949       | 3=mirror }.
5950           'channel_mode' can be { 0=sum  input  channels  |  1=one-for-one  |
5951       2=expand }.
5952
5953           Default  values: 'boundary_conditions=1', 'is_normalized=0', 'chan‐
5954       nel_mode=1',
5955             'xcenter=ycenter=zcenter=-1'                       (-1=centered),
5956       'xstart=ystart=zstart=0', 'xend=yend=zend=-1' (-1=max
5957             coordinates),  'xstride=ystride=zstride=1'  and 'xdilation=ydila‐
5958       tion=zdilation=1'.
5959
5960           Example:  [#1]  image.jpg  (0,1,0;1,-4,1;0,1,0)  convolve[-2]  [-1]
5961       keep[-2]
5962                    [#2] image.jpg (0,1,0) resize[-1] 130,1,1,1,3 +convolve[0]
5963       [1]
5964
5965           Tutorial: https://gmic.eu/tutorial/_convolve.shtml
5966
5967         convolve_fft:
5968             [mask],_boundary_conditions
5969
5970           Convolve selected  images  with  specified  mask,  in  the  fourier
5971       domain.
5972           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
5973       | 3=mirror }.
5974
5975           Example:  [#1]  image.jpg  100%,100%  gaussian[-1]  20,1,45   +con‐
5976       volve_fft[0] [1]
5977
5978         correlate (+):
5979             [mask],_boundary_conditions,_is_normalized={   0   |  1  },_chan‐
5980       nel_mode,_xcenter,_ycenter,_zcenter,
5981       _xstart,_ystart,_zstart,_xend,_yend,_zend,_xstride,_ystride,_zstride,_xdi‐
5982       lation,_ydilation,       _zdilation
5983
5984           Correlate selected images by specified mask.
5985           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
5986       | 3=mirror }.
5987           'channel_mode'  can  be  {  0=sum  input channels | 1=one-for-one |
5988       2=expand }.
5989
5990           Default values: 'boundary_conditions=1', 'is_normalized=0',  'chan‐
5991       nel_mode=1',
5992             'xcenter=ycenter=zcenter=-1'                       (-1=centered),
5993       'xstart=ystart=zstart=0', 'xend=yend=zend=-1' (-1=max
5994             coordinates), 'xstride=ystride=zstride=1'  and  'xdilation=ydila‐
5995       tion=zdilation=1'.
5996
5997           Example:  [#1]  image.jpg  (0,1,0;1,-4,1;0,1,0)  correlate[-2] [-1]
5998       keep[-2]
5999                    [#2]   image.jpg   +crop   40%,40%,60%,60%   +correlate[0]
6000       [-1],0,1
6001
6002         cross_correlation:
6003             [mask]
6004
6005           Compute cross-correlation of selected images with specified mask.
6006
6007           Example: [#1] image.jpg +shift -30,-20 +cross_correlation[0] [1]
6008
6009         curvature:
6010
6011           Compute isophote curvatures on selected images.
6012
6013           Example: [#1] image.jpg blur 10 curvature
6014
6015         dct:
6016             _{ x | y | z }...{ x | y | z } |
6017             (no arg)
6018
6019           Compute  the  discrete cosine transform of selected images, option‐
6020       ally along the specified axes only.
6021           Output images are always evenly sized, so this command  may  change
6022       the size of the selected images.
6023
6024           Default values: (no arg)
6025           See also: idct.
6026
6027           Example: [#1] image.jpg +dct +idct[-1] abs[-2] +[-2] 1 log[-2]
6028
6029           Tutorial: https://gmic.eu/tutorial/_dct-and-idct.shtml
6030
6031         deblur:
6032             amplitude[%]>=0,_nb_iter>=0,_dt>=0,_regul>=0,_regul_type={
6033       0=Tikhonov | 1=meancurv. | 2=TV }
6034
6035           Deblur image using a regularized Jansson-Van Cittert algorithm.
6036
6037           Default   values:   'nb_iter=10',    'dt=20',    'regul=0.7'    and
6038       'regul_type=1'.
6039
6040           Example: [#1] image.jpg blur 3 +deblur 3,40,20,0.01
6041
6042         deblur_goldmeinel:
6043             sigma>=0,_nb_iter>=0,_acceleration>=0,_kernel_type={     0=quasi-
6044       gaussian (faster) | 1=gaussian }.
6045
6046           Deblur selected images using Gold-Meinel algorithm
6047
6048           Default values: 'nb_iter=8', 'acceleration=1' and 'kernel_type=1'.
6049
6050           Example: [#1] image.jpg +blur 1 +deblur_goldmeinel[-1] 1
6051
6052         deblur_richardsonlucy:
6053             sigma>=0, nb_iter>=0, _kernel_type={ 0=quasi-gaussian (faster)  |
6054       1=gaussian }.
6055
6056           Deblur selected images using Richardson-Lucy algorithm.
6057
6058           Default values: 'nb_iter=50' and 'kernel_type=1'.
6059
6060           Example: [#1] image.jpg +blur 1 +deblur_richardsonlucy[-1] 1
6061
6062         deconvolve_fft:
6063             [kernel],_regularization>=0
6064
6065           Deconvolve selected images by specified mask in the fourier space.
6066
6067           Default value: 'regularization>=0'.
6068
6069           Example:  [#1]  image.jpg  +gaussian 5 +convolve_fft[0] [1] +decon‐
6070       volve_fft[-1] [1]
6071
6072         deinterlace:
6073             _method={ 0 | 1 }
6074
6075           Deinterlace selected  images  ('method'  can  be  {  0=standard  or
6076       1=motion-compensated }).
6077
6078           Default value: 'method=0'.
6079
6080           Example:  [#1]  image.jpg  +rotate  3,1,1,50%,50%  resize  100%,50%
6081       resize 100%,200%,1,3,4 shift[-1] 0,1 add       +deinterlace 1
6082
6083         denoise (+):
6084             [guide],std_deviation_s[%]>=0,_std_devia‐
6085       tion_r[%]>=0,_patch_size>0,_lookup_size>0,_smoothness,
6086       _fast_approx={ 0 | 1 } |
6087             std_deviation_s[%]>=0,_std_devia‐
6088       tion_r[%]>=0,_patch_size>0,_lookup_size>0,_smoothness,
6089       _fast_approx={ 0 | 1 }
6090
6091           Denoise selected images by non-local patch averaging.
6092
6093           Default     values:      'std_deviation_p=10',      'patch_size=5',
6094       'lookup_size=6' and 'smoothness=1'.
6095
6096           Example: [#1] image.jpg +denoise 5,5,8
6097
6098         denoise_haar:
6099             _threshold>=0,_nb_scales>=0,_cycle_spinning>0
6100
6101           Denoise  selected images using haar-wavelet thresholding with cycle
6102       spinning.
6103           Set 'nb_scales==0' to automatically determine the optimal number of
6104       scales.
6105
6106           Default  values:  'threshold=1.4',  'nb_scale=0'  and  'cycle_spin‐
6107       ning=10'.
6108
6109           Example: [#1] image.jpg noise 20 cut 0,255 +denoise_haar[-1] 0.8
6110
6111         denoise_patchpca:
6112             _strength>=0,_patch_size>0,_lookup_size>0,_spatial_sampling>0
6113
6114           Denoise selected images using the patch-pca algorithm.
6115
6116           Default values: 'patch_size=7', 'lookup_size=11', 'details=1.8' and
6117       'spatial_sampling=5'.
6118
6119           Example:  [#1]  image.jpg  +noise  20 cut[-1] 0,255 +denoise_patch‐
6120       pca[-1] ,
6121
6122         deriche (+):
6123             std_deviation>=0[%],order={ 0 | 1 | 2 },axis={ x |  y  |  z  |  c
6124       },_boundary_conditions
6125
6126           Apply  Deriche recursive filter on selected images, along specified
6127       axis and with
6128           specified standard deviation, order and boundary conditions.
6129           'boundary_conditions' can be { 0=dirichlet | 1=neumann }.
6130
6131           Default value: 'boundary_conditions=1'.
6132
6133           Example: [#1] image.jpg deriche 3,1,x
6134                    [#2] image.jpg +deriche 30,0,x deriche[-2] 30,0,y add
6135
6136           Tutorial: https://gmic.eu/tutorial/_deriche.shtml
6137
6138         dilate (+):
6139             size>=0 |
6140             size_x>=0,size_y>=0,size_z>=0 |
6141             [kernel],_boundary_conditions,_is_real={ 0=binary-mode |  1=real-
6142       mode }
6143
6144           Dilate  selected images by a rectangular or the specified structur‐
6145       ing element.
6146           'boundary_conditions' can be { 0=dirichlet | 1=neumann }.
6147
6148           Default    values:    'size_z=1',    'boundary_conditions=1'    and
6149       'is_real=0'.
6150
6151           Example: [#1] image.jpg +dilate 10
6152
6153         dilate_circ:
6154             _size>=0,_boundary_conditions,_is_normalized={ 0 | 1 }
6155
6156           Apply circular dilation of selected images by specified size.
6157
6158           Default values: 'boundary_conditions=1' and 'is_normalized=0'.
6159
6160           Example: [#1] image.jpg +dilate_circ 7
6161
6162         dilate_oct:
6163             _size>=0,_boundary_conditions,_is_normalized={ 0 | 1 }
6164
6165           Apply octagonal dilation of selected images by specified size.
6166
6167           Default values: 'boundary_conditions=1' and 'is_normalized=0'.
6168
6169           Example: [#1] image.jpg +dilate_oct 7
6170
6171         dilate_threshold:
6172             size_x>=1,size_y>=1,size_z>=1,_threshold>=0,_boundary_conditions
6173
6174           Dilate selected images in the (X,Y,Z,I) space.
6175           'boundary_conditions' can be { 0=dirichlet | 1=neumann }.
6176
6177           Default  values:  'size_y=size_x',  'size_z=1', 'threshold=255' and
6178       'boundary_conditions=1'.
6179
6180         divergence:
6181
6182           Compute divergence of selected vector fields.
6183
6184           Example: [#1] image.jpg luminance +gradient append[-2,-1] c  diver‐
6185       gence[-1]
6186
6187         dog:
6188             _sigma1>=0[%],_sigma2>=0[%]
6189
6190           Compute difference of gaussian on selected images.
6191
6192           Default values: 'sigma1=2%' and 'sigma2=3%'.
6193
6194           Example: [#1] image.jpg dog 2,3
6195
6196         diffusiontensors:
6197             _sharpness>=0,0<=_anisotropy<=1,_alpha[%],_sigma[%],is_sqrt={ 0 |
6198       1 }
6199
6200           Compute the diffusion tensors of selected images for  edge-preserv‐
6201       ing smoothing algorithms.
6202
6203           Default  values:  'sharpness=0.7',  'anisotropy=0.3',  'alpha=0.6',
6204       'sigma=1.1' and 'is_sqrt=0'.
6205
6206           Example: [#1] image.jpg diffusiontensors 0.8 abs pow 0.2
6207
6208           Tutorial: https://gmic.eu/tutorial/_diffusiontensors.shtml
6209
6210         edges:
6211             _threshold[%]>=0
6212
6213           Estimate contours of selected images.
6214
6215           Default value: 'edges=15%'
6216
6217           Example: [#1] image.jpg +edges 15%
6218
6219         erode (+):
6220             size>=0 |
6221             size_x>=0,size_y>=0,_size_z>=0 |
6222             [kernel],_boundary_conditions,_is_real={ 0=binary-mode |  1=real-
6223       mode }
6224
6225           Erode selected images by a rectangular or the specified structuring
6226       element.
6227           'boundary_conditions' can be { 0=dirichlet | 1=neumann }.
6228
6229           Default    values:    'size_z=1',    'boundary_conditions=1'    and
6230       'is_real=0'.
6231
6232           Example: [#1] image.jpg +erode 10
6233
6234         erode_circ:
6235             _size>=0,_boundary_conditions,_is_normalized={ 0 | 1 }
6236
6237           Apply circular erosion of selected images by specified size.
6238
6239           Default values: 'boundary_conditions=1' and 'is_normalized=0'.
6240
6241           Example: [#1] image.jpg +erode_circ 7
6242
6243         erode_oct:
6244             _size>=0,_boundary_conditions,_is_normalized={ 0 | 1 }
6245
6246           Apply octagonal erosion of selected images by specified size.
6247
6248           Default values: 'boundary_conditions=1' and 'is_normalized=0'.
6249
6250           Example: [#1] image.jpg +erode_oct 7
6251
6252         erode_threshold:
6253             size_x>=1,size_y>=1,size_z>=1,_threshold>=0,_boundary_conditions
6254
6255           Erode selected images in the (X,Y,Z,I) space.
6256           'boundary_conditions' can be { 0=dirichlet | 1=neumann }.
6257
6258           Default  values:  'size_y=size_x',  'size_z=1', 'threshold=255' and
6259       'boundary_conditions=1'.
6260
6261         fft (+):
6262             _{ x | y | z }...{ x | y | z }
6263
6264           Compute the direct fourier transform (real and imaginary parts)  of
6265       selected images,
6266           optionally along the specified axes only.
6267           See also: ifft.
6268
6269           Example:  [#1]  image.jpg  luminance  +fft append[-2,-1] c norm[-1]
6270       log[-1] shift[-1] 50%,50%,0,0,2
6271                    [#2]  image.jpg  w2={int(w/2)}  h2={int(h/2)}  fft   shift
6272       $w2,$h2,0,0,2  ellipse  $w2,$h2,30,30,0,1,0       shift -$w2,-$h2,0,0,2
6273       ifft remove[-1]
6274
6275           Tutorial: https://gmic.eu/tutorial/_fft.shtml
6276
6277         g (+):
6278             Shortcut for command 'gradient'.
6279
6280         gradient (+):
6281             { x | y | z }...{ x | y | z },_scheme |
6282             (no arg)
6283
6284           Compute the gradient components  (first  derivatives)  of  selected
6285       images.
6286           (equivalent to shortcut command 'g').
6287
6288           'scheme'  can be { -1=backward | 0=centered | 1=forward | 2=sobel |
6289       3=rotation-invariant (default) |
6290           4=deriche | 5=vanvliet }.
6291           (no arg) compute all significant components.
6292
6293           Default value: 'scheme=0'.
6294
6295           Example: [#1] image.jpg gradient
6296
6297           Tutorial: https://gmic.eu/tutorial/_gradient.shtml
6298
6299         gradient_norm:
6300
6301           Compute gradient norm of selected images.
6302
6303           Example: [#1] image.jpg gradient_norm equalize
6304
6305           Tutorial: https://gmic.eu/tutorial/_gradient_norm.shtml
6306
6307         gradient_orientation:
6308             _dimension={1,2,3}
6309
6310           Compute N-d gradient orientation of selected images.
6311
6312           Default value: 'dimension=3'.
6313
6314           Example: [#1] image.jpg +gradient_orientation 2
6315
6316         guided (+):
6317             [guide],radius[%]>=0,regularization[%]>=0 |
6318             radius[%]>=0,regularization[%]>=0
6319
6320           Blur selected images by guided image filtering.
6321           If a guide image is provided, it is used  to  drive  the  smoothing
6322       process.
6323           A guide image must be of the same xyz-size as the selected images.
6324           This command implements the filtering algorithm described in:
6325           He, Kaiming; Sun, Jian; Tang, Xiaoou, "Guided Image Filtering",
6326           IEEE  Transactions  on  Pattern  Analysis and Machine Intelligence,
6327       vol.35, no.6, pp.1397,1409, June
6328           2013
6329
6330           Example: [#1] image.jpg +guided 5,400
6331
6332         haar:
6333             scale>0
6334
6335           Compute the direct haar multiscale wavelet  transform  of  selected
6336       images.
6337           See also: ihaar.
6338
6339           Tutorial: https://gmic.eu/tutorial/_haar.shtml
6340
6341         heat_flow:
6342             _nb_iter>=0,_dt,_keep_sequence={ 0 | 1 }
6343
6344           Apply iterations of the heat flow on selected images.
6345
6346           Default values: 'nb_iter=10', 'dt=30' and 'keep_sequence=0'.
6347
6348           Example: [#1] image.jpg +heat_flow 20
6349
6350         hessian (+):
6351             { xx | xy | xz | yy | yz | zz }...{ xx | xy | xz | yy | yz | zz }
6352       |
6353             (no arg)
6354
6355           Compute the hessian components  (second  derivatives)  of  selected
6356       images.
6357           (no arg) compute all significant components.
6358
6359           Example: [#1] image.jpg hessian
6360
6361         idct:
6362             _{ x | y | z }...{ x | y | z } |
6363             (no arg)
6364
6365           Compute  the  inverse discrete cosine transform of selected images,
6366       optionally along the specified
6367           axes only.
6368           Output images are always evenly sized, so this command  may  change
6369       the size of the selected images.
6370           (dct  images  obtained with the 'dct' command are evenly sized any‐
6371       way).
6372
6373           Default values: (no arg)
6374           See also: dct.
6375
6376           Tutorial: https://gmic.eu/tutorial/_dct-and-idct.shtml
6377
6378         iee:
6379
6380           Compute gradient-orthogonal-directed 2nd derivative of image(s).
6381
6382           Example: [#1] image.jpg iee
6383
6384         ifft (+):
6385             _{ x | y | z }...{ x | y | z }
6386
6387           Compute the inverse fourier transform (real and imaginary parts) of
6388       selected images.
6389           optionally along the specified axes only.
6390           See also: fft.
6391
6392           Tutorial: https://gmic.eu/tutorial/_fft.shtml
6393
6394         ihaar:
6395             scale>0
6396
6397           Compute  the  inverse haar multiscale wavelet transform of selected
6398       images.
6399           See also: haar.
6400
6401         ilaplacian:
6402             { nb_iterations>0 | 0 },_time_step>0,_[initial_estimate]
6403
6404           Invert selected Laplacian images.
6405           If given 'nb_iterations' is '0', inversion is done in Fourier space
6406       (single iteration),
6407           otherwise, by applying 'nb_iterations' of a Laplacian-inversion PDE
6408       flow (with specified
6409           'time_step').
6410           Note that the resulting inversions are just  estimation  of  possi‐
6411       ble/approximated solutions.
6412
6413           Default   values:   'nb_iterations=0','time_step=10'   and   '[ini‐
6414       tial_estimated]=(undefined)'.
6415
6416           Example: [#1] image.jpg +laplacian +ilaplacian[-1] 0
6417
6418         inn:
6419
6420           Compute gradient-directed 2nd derivative of image(s).
6421
6422           Example: [#1] image.jpg inn
6423
6424         inpaint (+):
6425             [mask] |
6426             [mask],0,_fast_method |
6427             [mask],_patch_size>=1,_lookup_size>=1,_lookup_fac‐
6428       tor>=0,_lookup_increment!=0,_blend_size>=0,           0<=_blend_thresh‐
6429       old<=1,_blend_decay>=0,_blend_scales>=1,_is_blend_outer={ 0 | 1 }
6430
6431           Inpaint selected images by specified mask.
6432           If no patch size (or 0) is specified, inpainting is  done  using  a
6433       fast average or median algorithm.
6434           Otherwise, it used a patch-based reconstruction method, that can be
6435       very time consuming.
6436           'fast_method' can be { 0=low-connectivity average |  1=high-connec‐
6437       tivity average |
6438           2=low-connectivity median | 3=high-connectivity median }.
6439
6440           Default  values: 'patch_size=0', 'fast_method=1', 'lookup_size=22',
6441       'lookup_factor=0.5',
6442             'lookup_increment=1',    'blend_size=0',     'blend_threshold=0',
6443       'blend_decay=0.05', 'blend_scales=10'
6444             and 'is_blend_outer=1'.
6445
6446           Example:  [#1]  image.jpg  100%,100%  ellipse 50%,50%,30,30,0,1,255
6447       ellipse 20%,20%,30,10,0,1,255       +inpaint[-2] [-1] remove[-2]
6448                    [#2]  image.jpg  100%,100%  circle  30%,30%,30,1,255,0,255
6449       circle   70%,70%,50,1,255,0,255         +inpaint[0]  [1],5,15,0.5,1,9,0
6450       remove[1]
6451
6452         inpaint_pde:
6453             [mask],_nb_scales[%]>=0,_diffusion_type={ 0=isotropic |  1=delau‐
6454       nay-guided | 2=edge-guided |        3=mask-guided },_diffusion_iter>=0
6455
6456           Inpaint selected images by specified mask using a multiscale trans‐
6457       port-diffusion algorithm.
6458           If 'diffusion type==3', non-zero values of the mask  (e.g.  a  dis‐
6459       tance function) are used
6460           to guide the diffusion process.
6461
6462           Default  values:  'nb_scales=75%',  'diffusion_type=1'  and 'diffu‐
6463       sion_iter=20'.
6464
6465           Example: [#1] image.jpg 100%,100% ellipse[-1] 30%,30%,40,30,0,1,255
6466       +inpaint_pde[0] [1]
6467
6468         inpaint_flow:
6469             [mask],_nb_global_iter>=0,_nb_local_iter>=0,_dt>0,_alpha>=0,_sigma>=0
6470
6471           Apply iteration of the inpainting flow on selected images.
6472
6473           Default values: 'nb_global_iter=10',  'nb_local_iter=100',  'dt=5',
6474       'alpha=1' and 'sigma=3'.
6475
6476           Example: [#1] image.jpg 100%,100% ellipse[-1] 30%,30%,40,30,0,1,255
6477       inpaint_flow[0] [1]
6478
6479         inpaint_holes:
6480             maximal_area[%]>=0,_tolerance>=0,_is_high_connectivity={ 0 | 1 }
6481
6482           Inpaint all connected regions having an area  less  than  specified
6483       value.
6484
6485           Default  values:  'maximal_area=4', 'tolerance=0' and 'is_high_con‐
6486       nectivity=0'.
6487
6488           Example: [#1] image.jpg noise 5%,2 +inpaint_holes 8,40
6489
6490         inpaint_morpho:
6491             [mask]
6492
6493           Inpaint selected images by specified mask using morphological oper‐
6494       ators.
6495
6496           Example: [#1] image.jpg 100%,100% ellipse[-1] 30%,30%,40,30,0,1,255
6497       +inpaint_morpho[0] [1]
6498
6499         inpaint_matchpatch:
6500             [mask],_nb_scales={  0=auto   |   >0   },_patch_size>0,_nb_itera‐
6501       tions_per_scale>0,_blend_size>=0,        _allow_outer_blending={  0 | 1
6502       },_is_already_initialized={ 0 | 1 }
6503
6504           Inpaint selected images by specified binary mask,  using  a  multi-
6505       scale matchpatch algorithm.
6506
6507           Default    values:    'nb_scales=0',   'patch_size=9',   'nb_itera‐
6508       tions_per_scale=10', 'blend_size=5',
6509             'allow_outer_blending=1' and 'is_already_initialized=0'.
6510
6511           Example: [#1] image.jpg 100%,100% ellipse[-1] 30%,30%,40,30,0,1,255
6512       +inpaint_matchpatch[0] [1]
6513
6514         kuwahara:
6515             size>0
6516
6517           Apply Kuwahara filter of specified size on selected images.
6518
6519           Example: [#1] image.jpg kuwahara 9
6520
6521         laplacian:
6522
6523           Compute Laplacian of selected images.
6524
6525           Example: [#1] image.jpg laplacian
6526
6527         lic:
6528             _amplitude>0,_channels>0
6529
6530           Render LIC representation of selected vector fields.
6531
6532           Default values: 'amplitude=30' and 'channels=1'.
6533
6534           Example:   [#1]   400,400,1,2,'if(c==0,x-w/2,y-h/2)'   +lic   200,3
6535       quiver[-2] [-2],10,1,1,1,255
6536
6537         map_tones:
6538             _threshold>=0,_gamma>=0,_smoothness>=0,nb_iter>=0
6539
6540           Apply tone mapping operator on selected images,  based  on  Poisson
6541       equation.
6542
6543           Default  values: 'threshold=0.1', 'gamma=0.8', 'smoothness=0.5' and
6544       'nb_iter=30'.
6545
6546           Example: [#1] image.jpg +map_tones ,
6547
6548         map_tones_fast:
6549             _radius[%]>=0,_power>=0
6550
6551           Apply fast tone mapping operator on selected images.
6552
6553           Default values: 'radius=3%' and 'power=0.3'.
6554
6555           Example: [#1] image.jpg +map_tones_fast ,
6556
6557         meancurvature_flow:
6558             _nb_iter>=0,_dt,_keep_sequence={ 0 | 1 }
6559
6560           Apply iterations of the mean curvature flow on selected images.
6561
6562           Default values: 'nb_iter=10', 'dt=30' and 'keep_sequence=0'.
6563
6564           Example: [#1] image.jpg +meancurvature_flow 20
6565
6566         median (+):
6567             size>=0,_threshold>0
6568
6569           Apply (opt. thresholded) median  filter  on  selected  images  with
6570       structuring element size x size.
6571
6572           Example: [#1] image.jpg +median 5
6573
6574         nlmeans:
6575             [guide],_patch_radius>0,_spatial_bandwidth>0,_tonal_band‐
6576       width>0,_patch_measure_command |
6577             _patch_radius>0,_spatial_bandwidth>0,_tonal_band‐
6578       width>0,_patch_measure_command
6579
6580           Apply  non local means denoising of Buades et al, 2005. on selected
6581       images.
6582           The patch is a gaussian function of 'std_patch_radius'.
6583           The spatial kernel is a rectangle of radius 'spatial_bandwidth'.
6584           The tonal kernel is exponential (exp(-d^2/_tonal_bandwidth^2))
6585           with d the euclidean distance between image patches.
6586
6587           Default    values:     'patch_radius=4',     'spatial_bandwidth=4',
6588       'tonal_bandwidth=10' and
6589             'patch_measure_command=-norm'.
6590
6591           Example:      [#1]      image.jpg     +noise     10     nlmeans[-1]
6592       4,4,{0.6*${-std_noise}}
6593
6594         nlmeans_core:
6595             _reference_image,_scaling_map,_patch_radius>0,_spatial_band‐
6596       width>0
6597
6598           Apply  non local means denoising using a image for weight and a map
6599       for scaling
6600
6601         normalize_local:
6602             _amplitude>=0,_radius>0,_n_smooth>=0[%],_a_smooth>=0[%],_is_cut={
6603       0 | 1 },_min=0,_max=255
6604
6605           Normalize selected images locally.
6606
6607           Default    values:   'amplitude=3',   'radius=16',   'n_smooth=4%',
6608       'a_smooth=2%', 'is_cut=1', 'min=0'
6609             and 'max=255'.
6610
6611           Example: [#1] image.jpg normalize_local 8,10
6612
6613         normalized_cross_correlation:
6614             [mask]
6615
6616           Compute normalized cross-correlation of selected images with speci‐
6617       fied mask.
6618
6619           Example:  [#1]  image.jpg +shift -30,-20 +normalized_cross_correla‐
6620       tion[0] [1]
6621
6622         percentile:
6623             [mask],0<=_min_percentile[%]<=100,0<=_max_percentile[%]<=100.
6624
6625           Apply percentile averaging filter to selected images.
6626
6627           Default values: 'min_percentile=0' and 'max_percentile=100'.
6628
6629           Example: [#1] image.jpg shape_circle 11,11 +percentile[0] [1],25,75
6630
6631         peronamalik_flow:
6632             K_factor>0,_nb_iter>=0,_dt,_keep_sequence={ 0 | 1 }
6633
6634           Apply iterations of the Perona-Malik flow on selected images.
6635
6636           Default   values:   'K_factor=20',    'nb_iter=5',    'dt=5'    and
6637       'keep_sequence=0'.
6638
6639           Example: [#1] image.jpg +heat_flow 20
6640
6641         phase_correlation:
6642             [destination]
6643
6644           Estimate  translation  vector  between  selected  source images and
6645       specified destination.
6646
6647           Example: [#1] image.jpg +shift  -30,-20  +phase_correlation[0]  [1]
6648       unroll[-1] y
6649
6650         pde_flow:
6651             _nb_iter>=0,_dt,_velocity_command,_keep_sequence={ 0 | 1 }
6652
6653           Apply iterations of a generic PDE flow on selected images.
6654
6655           Default values: 'nb_iter=10', 'dt=30', 'velocity_command=laplacian'
6656       and 'keep_sequence=0'.
6657
6658           Example: [#1] image.jpg +pde_flow 20
6659
6660         periodize_poisson:
6661
6662           Periodize selected images using a Poisson solver in Fourier space.
6663
6664           Example: [#1] image.jpg +periodize_poisson array 2,2,2
6665
6666         rbf:
6667             dx,_x0,_x1,_phi(r) |
6668             dx,dy,_x0,_y0,_x1,_y1,_phi(r) |
6669             dx,dy,dz,x0,y0,z0,x1,y1,z1,phi(r)
6670
6671           Reconstruct 1D/2D or 3D image from selected sets of  keypoints,  by
6672       RBF-interpolation.
6673           A  set  of keypoints is represented by a vector-valued image, where
6674       each pixel represents a single
6675           keypoint.
6676           Vector components of a keypoint have the following meaning:
6677             - For 1D reconstruction: [ x_k, f1(k),...fN(k) ].
6678             - For 2D reconstruction: [ x_k,y_k, f1(k),...,fN(k) ].
6679             - For 3D reconstruction: [ x_k,y_k,z_k, f1(k),...,fN(k) ].
6680           Values 'x_k','y_k' and 'z_k' are the spatial  coordinates  of  key‐
6681       point 'k'.
6682           Values  'f1(k),..,fN(k)' are the 'N' components of the vector value
6683       of keypoint 'k'.
6684           The   command   reconstructs   an   image   with   specified   size
6685       'dx'x'dy'x'dz', with 'N' channels.
6686
6687           Default  values:  'x0=y0=z0=0',  'x1=dx-1',  'y1=dy-1',  'z1=dz-1',
6688       'phi(r)=r^2*log(1e-5+r)'.
6689
6690           Example: [#1] sp colorful r2dx 400 100%,100% noise_poissondisk.  10
6691       1,{is},1,5    eval[-2]          "begin(p=0);i?(I[#-1,p++]=[x,y,I(#0)])"
6692       to_rgb[1] mul[0,1] dilate_circ[0]  5  +rbf[-1]  {0,       [w,h]}  c[-1]
6693       0,255
6694                    [#2] 32,1,1,5,u([400,400,255,255,255]) rbf 400,400 c 0,255
6695
6696         red_eye:
6697             0<=_threshold<=100,_smoothness>=0,0<=attenuation<=1
6698
6699           Attenuate red-eye effect in selected images.
6700
6701           Default  values:  'threshold=75',  'smoothness=3.5'  and  'attenua‐
6702       tion=0.1'.
6703
6704           Example: [#1] image.jpg +red_eye ,
6705
6706         remove_hotpixels:
6707             _mask_size>0, _threshold[%]>0
6708
6709           Remove hot pixels in selected images.
6710
6711           Default values: 'mask_size=3' and 'threshold=10%'.
6712
6713           Example: [#1] image.jpg noise 10,2 +remove_hotpixels ,
6714
6715         remove_pixels:
6716             number_of_pixels[%]>=0
6717
6718           Remove specified number of pixels (i.e. set them to 0) from the set
6719       of non-zero pixels in selected
6720           images.
6721
6722           Example: [#1] image.jpg +remove_pixels 50%
6723
6724         rolling_guidance:
6725             std_deviation_s[%]>=0,std_deviation_r[%]>=0,_precision>=0
6726
6727           Apply the rolling guidance filter on selected image.
6728           Rolling  guidance  filter  is  a  fast  image  abstraction  filter,
6729       described in:
6730           "Rolling Guidance Filter", Qi Zhang Xiaoyong,  Shen  Li,  Xu  Jiaya
6731       Jia, ECCV'2014.
6732
6733           Default values: 'std_deviation_s=4', 'std_deviation_r=10' and 'pre‐
6734       cision=0.5'.
6735
6736           Example: [#1] image.jpg +rolling_guidance , +-
6737
6738         sharpen (+):
6739             amplitude>=0 |
6740             amplitude>=0,edge>=0,_alpha,_sigma
6741
6742           Sharpen selected images by inverse diffusion or shock filters meth‐
6743       ods.
6744           'edge' must be specified to enable shock-filter method.
6745
6746           Default values: 'alpha=0' and 'sigma=0'.
6747
6748           Example: [#1] image.jpg sharpen 300
6749                    [#2] image.jpg blur 5 sharpen 300,1
6750
6751         smooth (+):
6752             amplitude[%]>=0,_sharpness>=0,0<=_anisot‐
6753       ropy<=1,_alpha[%],_sigma[%],_dl>0,_da>0,_precision>0,       _interpola‐
6754       tion,_fast_approx={ 0 | 1 } |
6755             nb_iterations>=0,_sharpness>=0,_anisotropy,_alpha,_sigma,_dt>0,0
6756       |
6757             [tensor_field],_amplitude>=0,_dl>0,_da>0,_precision>0,_interpola‐
6758       tion,_fast_approx={ 0 | 1 } |
6759             [tensor_field],_nb_iters>=0,_dt>0,0
6760
6761           Smooth  selected images anisotropically using diffusion PDE's, with
6762       specified field of
6763           diffusion tensors.
6764           'interpolation' can be { 0=nearest | 1=linear | 2=runge-kutta }.
6765
6766           Default  values:  'sharpness=0.7',  'anisotropy=0.3',  'alpha=0.6',
6767       'sigma=1.1', 'dl=0.8',
6768             'da=30', 'precision=2', 'interpolation=0' and 'fast_approx=1'.
6769
6770           Example: [#1] image.jpg repeat 3 smooth 40,0,1,1,2 done
6771                    [#2]  image.jpg  100%,100%,1,2  rand[-1] -100,100 repeat 2
6772       smooth[-1] 100,0.2,1,4,4 done warp[0]       [-1],1,1
6773
6774           Tutorial: https://gmic.eu/tutorial/_smooth.shtml
6775
6776         split_freq:
6777             smoothness>0[%]
6778
6779           Split selected images into low and high frequency parts.
6780
6781           Example: [#1] image.jpg split_freq 2%
6782
6783         solve_poisson:
6784             "laplacian_command",_nb_iterations>=0,_time_step>0,_nb_scales>=0
6785
6786           Solve Poisson equation so that applying 'laplacian[n]' is close  to
6787       the result of
6788           'laplacian_command[n]'.
6789           Solving  is  performed  using  a multi-scale gradient descent algo‐
6790       rithm.
6791           If 'nb_scales=0', the number of scales is automatically determined.
6792
6793           Default values: 'nb_iterations=60', 'dt=5' and 'nb_scales=0'.
6794
6795           Example: [#1] image.jpg command "foo : gradient  x"  +solve_poisson
6796       foo +foo[0] +laplacian[1]
6797
6798         split_details:
6799             _nb_scales>0,_base_scale[%]>=0,_detail_scale[%]>=0
6800
6801           Split selected images into 'nb_scales' detail scales.
6802           If 'base_scale'=='detail_scale'==0, the image decomposition is done
6803       with 'a trous' wavelets.
6804           Otherwise, it uses laplacian pyramids with linear  standard  devia‐
6805       tions.
6806
6807           Default values: 'nb_scales=4', 'base_scale=0' and 'detail_scale=0'.
6808
6809           Example: [#1] image.jpg split_details ,
6810
6811         structuretensors (+):
6812             _scheme={ 0=centered | 1=forward/backward }
6813
6814           Compute the structure tensor field of selected images.
6815
6816           Default value: 'scheme=1'.
6817
6818           Example: [#1] image.jpg structuretensors abs pow 0.2
6819
6820           Tutorial: https://gmic.eu/tutorial/_structuretensors.shtml
6821
6822         solidify:
6823             _smoothness[%]>=0,_diffusion_type={ 0=isotropic | 1=delaunay-ori‐
6824       ented | 2=edge-oriented },       _diffusion_iter>=0
6825
6826           Solidify selected transparent images.
6827
6828           Default values: 'smoothness=75%',  'diffusion_type=1'  and  'diffu‐
6829       sion_iter=20'.
6830
6831           Example:  [#1]  image.jpg  100%,100%  circle[-1]  50%,50%,25%,1,255
6832       append c +solidify , display_rgba
6833
6834         syntexturize:
6835             _width[%]>0,_height[%]>0
6836
6837           Resynthetize 'width'x'height' versions of  selected  micro-textures
6838       by phase randomization.
6839           The texture synthesis algorithm is a straightforward implementation
6840       of the method described in :
6841           http://www.ipol.im/pub/art/2011/ggm_rpn/
6842
6843           Default values: 'width=height=100%'.
6844
6845           Example: [#1] image.jpg crop 2,282,50,328 +syntexturize 320,320
6846
6847         syntexturize_matchpatch:
6848             _width[%]>0,_height[%]>0,_nb_scales>=0,_patch_size>0,_blend‐
6849       ing_size>=0,_precision>=0
6850
6851           Resynthetize  'width'x'height'  versions of selected micro-textures
6852       using a patch-matching algorithm.
6853           If 'nbscales==0', the number of scales used is estimated  from  the
6854       image size.
6855
6856           Default values: 'width=height=100%', 'nb_scales=0', 'patch_size=7',
6857       'blending_size=5' and
6858             'precision=1'.
6859
6860           Example: [#1] image.jpg  crop  25%,25%,75%,75%  syntexturize_match‐
6861       patch 512,512
6862
6863         tv_flow:
6864             _nb_iter>=0,_dt,_keep_sequence={ 0 | 1 }
6865
6866           Apply iterations of the total variation flow on selected images.
6867
6868           Default values: 'nb_iter=10', 'dt=30' and 'keep_sequence=0'.
6869
6870           Example: [#1] image.jpg +tv_flow 40
6871
6872         unsharp:
6873             radius[%]>=0,_amount>=0,_threshold[%]>=0
6874
6875           Apply unsharp mask on selected images.
6876
6877           Default values: 'amount=2' and 'threshold=0'.
6878
6879           Example: [#1] image.jpg blur 3 +unsharp 1.5,15 cut 0,255
6880
6881         unsharp_octave:
6882             _nb_scales>0,_radius[%]>=0,_amount>=0,threshold[%]>=0
6883
6884           Apply octave sharpening on selected images.
6885
6886           Default  values: 'nb_scales=4', 'radius=1', 'amount=2' and 'thresh‐
6887       old=0'.
6888
6889           Example: [#1] image.jpg blur 3 +unsharp_octave 4,5,15 cut 0,255
6890
6891         vanvliet (+):
6892             std_deviation>=0[%],order={ 0 | 1 | 2 | 3 },axis={ x | y | z |  c
6893       },_boundary_conditions
6894
6895           Apply Vanvliet recursive filter on selected images, along specified
6896       axis and with
6897           specified standard deviation, order and boundary conditions.
6898           'boundary_conditions' can be { 0=dirichlet | 1=neumann }.
6899
6900           Default value: 'boundary_conditions=1'.
6901
6902           Example: [#1] image.jpg +vanvliet 3,1,x
6903                    [#2] image.jpg +vanvliet 30,0,x vanvliet[-2] 30,0,y add
6904
6905         voronoi:
6906
6907           Compute the discrete Voronoi diagram of non-zero pixels in selected
6908       images.
6909
6910           Example:  [#1]  400,400  noise  0.2,2  eq 1 +label_fg 0 voronoi[-1]
6911       +gradient[-1] xy,1 append[-2,-1] c       norm[-1] ==[-1] 0 map[-2]  2,2
6912       mul[-2,-1] normalize[-2] 0,255 dilate_circ[-2] 4 reverse max
6913
6914         watermark_fourier:
6915             text,_size>0
6916
6917           Add a textual watermark in the frequency domain of selected images.
6918
6919           Default value: 'size=33'.
6920
6921           Example:  [#1]  image.jpg  +watermark_fourier  "Watermarked!" +dis‐
6922       play_fft   remove[-3,-1]   normalize   0,255         append[-4,-2]    y
6923       append[-2,-1] y
6924
6925         watershed (+):
6926             [priority_image],_is_high_connectivity={ 0 | 1 }
6927
6928           Compute the watershed transform of selected images.
6929
6930           Default value: 'is_high_connectivity=1'.
6931
6932           Example:  [#1]  400,400  noise  0.2,2  eq  1 +distance 1 mul[-1] -1
6933       label[-2] watershed[-2] [-1] mod[-2] 256       map[-2] 0 reverse
6934
6935         12.9. Features Extraction
6936               -------------------
6937
6938         area:
6939             tolerance>=0,is_high_connectivity={ 0 | 1 }
6940
6941           Compute area of connected components in selected images.
6942
6943           Default values: 'is_high_connectivity=0'.
6944
6945           Example: [#1] image.jpg luminance stencil[-1] 1 +area 0
6946
6947           Tutorial: https://gmic.eu/tutorial/_area.shtml
6948
6949         area_fg:
6950             tolerance>=0,is_high_connectivity={ 0 | 1 }
6951
6952           Compute  area  of  connected  components  for  non-zero  values  in
6953       selected images.
6954           Similar to 'area' except that 0-valued pixels are not considered.
6955
6956           Default values: 'is_high_connectivity=0'.
6957
6958           Example: [#1] image.jpg luminance stencil[-1] 1 +area_fg 0
6959
6960         at_line:
6961             x0[%],y0[%],z0[%],x1[%],y1[%],z1[%]
6962
6963           Retrieve  pixels  of the selected images belonging to the specified
6964       line (x0,y0,z0)-(x1,y1,z1).
6965
6966           Example:  [#1]   image.jpg   +at_line   0,0,0,100%,100%,0   line[0]
6967       0,0,100%,100%,1,0xFF00FF00,255,0,0
6968
6969         at_quadrangle:
6970             x0[%],y0[%],x1[%],y1[%],x2[%],y2[%],x3[%],y3[%],_interpola‐
6971       tion,_boundary_conditions |
6972             x0[%],y0[%],z0[%],x1[%],y1[%],z1[%],x2[%],y2[%],z2[%],x3[%],y3[%],z3[%],_inter‐
6973       polation,       _boundary_conditions
6974
6975           Retrieve  pixels  of the selected images belonging to the specified
6976       2D or 3D quadrangle.
6977           'interpolation' can be { 0=nearest-neighbor | 1=linear | 2=cubic }.
6978           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
6979       | 3=mirror }.
6980
6981           Example:    [#1]    image.jpg   params=5%,5%,95%,5%,60%,95%,40%,95%
6982       +at_quadrangle $params polygon.. 4,$params,      0.5,255
6983
6984         barycenter:
6985
6986           Compute the barycenter vector of pixel values.
6987
6988           Example:  [#1]  256,256  ellipse  50%,50%,20%,20%,0,1,1  deform  20
6989       +barycenter +ellipse[-2] {@0,1},5,5,0,10
6990
6991         delaunay:
6992
6993           Generate  discrete  2D Delaunay triangulation of non-zero pixels in
6994       selected images.
6995           Input images must be scalar.
6996           Each pixel of the output image is a  triplet  (a,b,c)  meaning  the
6997       pixel belongs to
6998           the Delaunay triangle 'ABC' where 'a','b','c' are the labels of the
6999       pixels 'A','B','C'.
7000
7001           Example: [#1] 400,400 rand 32,255 100%,100% noise. 0.4,2 eq. 1  mul
7002       +delaunay
7003                    [#2]  image.jpg  b  1%  100%,100%  noise.  0.8,2 eq. 1 mul
7004       +delaunay channels 0,2
7005
7006         detect_skin:
7007             0<=tolerance<=1,_skin_x,_skin_y,_skin_radius>=0
7008
7009           Detect skin in selected color images  and  output  an  appartenance
7010       probability map.
7011           Detection is performed using CbCr chromaticity data of skin pixels.
7012           If  arguments  'skin_x',  'skin_y'  and 'skin_radius' are provided,
7013       skin pixels are learnt
7014           from   the   sample   pixels   inside   the   circle   located   at
7015       ('skin_x','skin_y') with radius 'skin_radius'.
7016
7017           Default value: 'tolerance=0.5' and 'skin_x=skiny=radius=-1'.
7018
7019         displacement (+):
7020             [source_image],_smoothness,_precision>=0,_nb_scales>=0,_itera‐
7021       tion_max>=0,is_backward={ 0 | 1 },       _[guide]
7022
7023           Estimate displacement field between specified source  and  selected
7024       target images.
7025           If  'smoothness>=0',  regularization type is set to isotropic, else
7026       to anisotropic.
7027           If 'nbscales==0', the number of scales used is estimated  from  the
7028       image size.
7029
7030           Default  values:  'smoothness=0.1',  'precision=5',  'nb_scales=0',
7031       'iteration_max=10000',
7032             'is_backward=1' and '[guide]=(unused)'.
7033
7034           Example: [#1]  image.jpg  +rotate  3,1,0,50%,50%  +displacement[-1]
7035       [-2] quiver[-1] [-1],15,1,1,1,{1.5*iM}
7036
7037         distance (+):
7038             isovalue[%],_metric |
7039             isovalue[%],[metric],_method
7040
7041           Compute  the unsigned distance function to specified isovalue, opt.
7042       according to a custom metric.
7043           'metric' can  be  {  0=chebyshev  |  1=manhattan  |  2=euclidean  |
7044       3=squared-euclidean }.
7045           'method'  can  be { 0=fast-marching | 1=low-connectivity dijkstra |
7046       2=high-connectivity dijkstra |
7047           3=1+return path | 4=2+return path }.
7048
7049           Default value: 'metric=2' and 'method=0'.
7050
7051           Example: [#1] image.jpg threshold 20% distance 0 pow 0.3
7052                    [#2] 400,400 set 1,50%,50% +distance[0]  1,2  +distance[0]
7053       1,1 distance[0] 1,0 mod 32 threshold       16 append c
7054
7055           Tutorial: https://gmic.eu/tutorial/_distance.shtml
7056
7057         fftpolar:
7058
7059           Compute  fourier  transform  of selected images, as centered magni‐
7060       tude/phase images.
7061
7062           Example: [#1] image.jpg fftpolar ellipse 50%,50%,10,10,0,1,0  ifft‐
7063       polar
7064
7065         histogram (+):
7066             _nb_levels>0[%],_value0[%],_value1[%]
7067
7068           Compute the histogram of selected images.
7069           If  value  range is set, the histogram is estimated only for pixels
7070       in the specified
7071           value range. Argument 'value1' must be  specified  if  'value0'  is
7072       set.
7073
7074           Default values: 'nb_levels=256', 'value0=0%' and 'value1=100%'.
7075
7076           Example: [#1] image.jpg +histogram 64 display_graph[-1] 400,300,3
7077
7078         histogram_nd:
7079             nb_levels>0[%],_value0[%],_value1[%]
7080
7081           Compute the 1D,2D or 3D histogram of selected multi-channels images
7082       (having 1,2 or 3 channels).
7083           If value range is set, the histogram is estimated only  for  pixels
7084       in the specified
7085           value range.
7086
7087           Default values: 'value0=0%' and 'value1=100%'.
7088
7089           Example: [#1] image.jpg channels 0,1 +histogram_nd 256
7090
7091         histogram_cumul:
7092             _nb_levels>0,_is_normalized={ 0 | 1 },_val0[%],_val1[%]
7093
7094           Compute cumulative histogram of selected images.
7095
7096           Default  values:  'nb_levels=256', 'is_normalized=0', 'val0=0%' and
7097       'val1=100%'.
7098
7099           Example: [#1] image.jpg +histogram_cumul 256 histogram[0] 256  dis‐
7100       play_graph 400,300,3
7101
7102         histogram_pointwise:
7103             nb_levels>0[%],_value0[%],_value1[%]
7104
7105           Compute  the  histogram  of  each  vector-valued  point of selected
7106       images.
7107           If value range is set, the histogram is estimated only  for  values
7108       in the specified
7109           value range.
7110
7111           Default values: 'value0=0%' and 'value1=100%'.
7112
7113         hough:
7114             _width>0,_height>0,gradient_norm_voting={ 0 | 1 }
7115
7116           Compute hough transform (theta,rho) of selected images.
7117
7118           Default values: 'width=512', 'height=width' and 'gradient_norm_vot‐
7119       ing=1'.
7120
7121           Example: [#1] image.jpg +blur 1.5 hough[-1]  400,400  blur[-1]  0.5
7122       add[-1] 1 log[-1]
7123
7124         ifftpolar:
7125
7126           Compute inverse fourier transform of selected images, from centered
7127       magnitude/phase images.
7128
7129         isophotes:
7130             _nb_levels>0
7131
7132           Render isophotes of selected images on a transparent background.
7133
7134           Default value: 'nb_levels=64'
7135
7136           Example: [#1] image.jpg blur  2  isophotes  6  dilate_circ  5  dis‐
7137       play_rgba
7138
7139         label (+):
7140             _tolerance>=0,is_high_connectivity={  0 | 1 },_is_L2_norm={ 0 | 1
7141       }
7142
7143           Label connected components in selected images.
7144
7145           Default   values:   'tolerance=0',   'is_high_connectivity=0'   and
7146       'is_L2_norm=1'.
7147
7148           Example:  [#1]  image.jpg  luminance  threshold 60% label normalize
7149       0,255 map 0
7150                    [#2] 400,400 set 1,50%,50% distance 1 mod 16  threshold  8
7151       label mod 255 map 2
7152
7153           Tutorial: https://gmic.eu/tutorial/_label.shtml
7154
7155         label_fg:
7156             tolerance>=0,is_high_connectivity={ 0 | 1 }
7157
7158           Label  connected  components  for  non-zero  values (foreground) in
7159       selected images.
7160           Similar to 'label' except that 0-valued pixels are not labeled.
7161
7162           Default value: 'is_high_connectivity=0'.
7163
7164         laar:
7165
7166           Extract the largest axis-aligned rectangle  in  non-zero  areas  of
7167       selected images.
7168           Rectangle coordinates are returned in status, as a sequence of num‐
7169       bers x0,y0,x1,y1.
7170
7171           Example:  [#1]  shape_cupid  256  coords=${-laar}  normalize  0,255
7172       to_rgb rectangle $coords,0.5,0,128,0
7173
7174         max_patch:
7175             _patch_size>=1
7176
7177           Return  locations  of maximal values in local patch-based neighbor‐
7178       hood of given size for selected
7179           images.
7180
7181           Default value: 'patch_size=16'.
7182
7183           Example: [#1] image.jpg norm +max_patch 16
7184
7185         min_patch:
7186             _patch_size>=1
7187
7188           Return locations of minimal values in local  patch-based  neighbor‐
7189       hood of given size for selected
7190           images.
7191
7192           Default value: 'patch_size=16'.
7193
7194           Example: [#1] image.jpg norm +min_patch 16
7195
7196         minimal_path:
7197             x0[%]>=0,y0[%]>=0,z0[%]>=0,x1[%]>=0,y1[%]>=0,z1[%]>=0,_is_high_con‐
7198       nectivity={ 0 | 1 }
7199
7200           Compute minimal path between two points on selected potential maps.
7201
7202           Default value: 'is_high_connectivity=0'.
7203
7204           Example:  [#1]  image.jpg  +gradient_norm  fill[-1]  1/(1+i)  mini‐
7205       mal_path[-1]   0,0,0,100%,100%,0         pointcloud[-1]   0  *[-1]  280
7206       to_rgb[-1] ri[-1] [-2],0 or
7207
7208         mse (+):
7209
7210           Compute MSE (Mean-Squared Error) matrix between selected images.
7211
7212           Example: [#1] image.jpg +noise 30 +noise[0] 35  +noise[0]  38  cut.
7213       0,255 mse
7214
7215         patches:
7216             patch_width>0,patch_height>0,patch_depth>0,x0,y0,z0,_x1,_y1,_z1,...,_xN,_yN,_zN
7217
7218           Extract N+1 patches from selected  images,  centered  at  specified
7219       locations.
7220
7221           Example:             [#1]             image.jpg            +patches
7222       64,64,1,153,124,0,184,240,0,217,126,0,275,38,0
7223
7224         matchpatch (+):
7225             [patch_image],patch_width>=1,_patch_height>=1,_patch_depth>=1,_nb_iter‐
7226       ations>=0,_nb_randoms>=0,       _patch_penalization,_output_score={ 0 |
7227       1 },_[guide]
7228
7229           Estimate correspondence map between selected images  and  specified
7230       patch image, using
7231           a patch-matching algorithm.
7232           Each  pixel  of  the returned correspondence map gives the location
7233       (p,q) of the closest patch in
7234           the specified patch image. If 'output_score=1', the  third  channel
7235       also gives the corresponding
7236           matching score for each patch as well.
7237           If  'patch_penalization' is >=0, SSD is penalized with patch occur‐
7238       rences.
7239           If 'patch_penalization' is <0, SSD is inf-penalized  when  distance
7240       between patches are less than
7241           '-patch_penalization'.
7242
7243           Default    values:   'patch_height=patch_width',   'patch_depth=1',
7244       'nb_iterations=5',
7245             'nb_randoms=5',  'patch_penalization=0',   'output_score=0'   and
7246       'guide=(undefined)'.
7247
7248           Example:   [#1]  image.jpg  sample  colorful  +matchpatch[0]  [1],3
7249       +warp[-2] [-1],0
7250
7251         plot2value:
7252
7253           Retrieve values from selected 2D graph plots.
7254
7255           Example:    [#1]     400,300,1,1,'if(y>300*abs(cos(x/10+2*u)),1,0)'
7256       +plot2value +display_graph[-1] 400,300
7257
7258         pointcloud:
7259             _type  =  {  -X=-X-opacity  | 0=binary | 1=cumulative | 2=label |
7260       3=retrieve coordinates },_width,       _height>0,_depth>0
7261
7262           Render a set of point coordinates, as a point cloud in a  1D/2D  or
7263       3D binary image
7264           (or  do  the  reverse, i.e. retrieve coordinates of non-zero points
7265       from a rendered point cloud).
7266           Input point coordinates can be a NxMx1x1, Nx1x1xM or 1xNx1xM image,
7267       where 'N' is the number of
7268           points,
7269           and M the point coordinates.
7270           If 'M'>3, the 3-to-M components sets the (M-3)-dimensional color at
7271       each point.
7272           Parameters 'width','height' and 'depth' are related to the size  of
7273       the final image :
7274             -  If set to 0, the size is automatically set along the specified
7275       axis.
7276             - If set to N>0, the size along the specified axis is N.
7277             - If set to N<0, the size along the specified axis is at most N.
7278           Points with coordinates that are negative or higher than  specified
7279       ('width','height','depth')
7280           are not plotted.
7281
7282           Default values: 'type=0' and 'max_width=max_height=max_depth=0'.
7283
7284           Example: [#1] 3000,2 rand 0,400 +pointcloud 0 dilate[-1] 3
7285                    [#2]  3000,2  rand 0,400 {w} {w},3 rand[-1] 0,255 append y
7286       +pointcloud 0 dilate[-1] 3
7287
7288         psnr:
7289             _max_value
7290
7291           Compute PSNR (Peak Signal-to-Noise Ratio) matrix  between  selected
7292       images.
7293
7294           Default value: 'max_value=255'.
7295
7296           Example: [#1] image.jpg +noise 30 +noise[0] 35 +noise[0] 38 cut[-1]
7297       0,255 psnr 255 replace_inf 0
7298
7299         segment_watershed:
7300             _threshold>=0
7301
7302           Apply watershed segmentation on selected images.
7303
7304           Default values: 'threshold=2'.
7305
7306           Example: [#1] image.jpg segment_watershed 2
7307
7308         shape2bump:
7309             _resolution>=0,0<=_weight_avg_max_avg<=1,_dilation,_smoothness>=0
7310
7311           Estimate bumpmap from binary shape in selected images.
7312
7313           Default  value:  'resolution=256',  'weight_avg_max=0.75',   'dila‐
7314       tion=0' and 'smoothness=100'.
7315
7316         skeleton:
7317             _boundary_conditions={ 0=dirichlet | 1=neumann }
7318
7319           Compute skeleton of binary shapes using distance transform and con‐
7320       strained thinning.
7321
7322           Default value: 'boundary_conditions=1'.
7323
7324           Example: [#1] shape_cupid 320 +skeleton 0
7325
7326         slic:
7327             size>0,_regularity>=0,_nb_iterations>0
7328
7329           Segment selected 2D images with superpixels, using the  SLIC  algo‐
7330       rithm (Simple Linear Iterative
7331           Clustering).
7332           Scalar images of increasingly labeled pixels are returned.
7333           Reference  paper:  Achanta,  R.,  Shaji, A., Smith, K., Lucchi, A.,
7334       Fua, P., & Susstrunk, S. (2010).
7335           SLIC Superpixels (No. EPFL-REPORT-149300).
7336
7337           Default values: 'size=16', 'regularity=10' and 'nb_iterations=10'.
7338
7339           Example: [#1] image.jpg +srgb2lab slic[-1] 16  +blend  shapeaverage
7340       f[-2] "j(1,0)==i && j(0,1)==i" *[-1]       [-2]
7341
7342         ssd_patch:
7343             [patch],_use_fourier={ 0 | 1 },_boundary_conditions={ 0=dirichlet
7344       | 1=neumann }
7345
7346           Compute fields of SSD between selected images and specified patch.
7347           Argument 'boundary_conditions' is valid only when 'use_fourier=0'.
7348
7349           Default value: 'use_fourier=0' and 'boundary_conditions=0'.
7350
7351           Example: [#1] image.jpg +crop 20%,20%,35%,35% +ssd_patch[0] [1],0,0
7352
7353         thinning:
7354             _boundary_conditions={ 0=dirichlet | 1=neumann }
7355
7356           Compute skeleton of binary shapes using morphological thinning
7357           (beware, this is a quite slow iterative process)
7358
7359           Default value: 'boundary_conditions=1'.
7360
7361           Example: [#1] shape_cupid 320 +thinning
7362
7363         tones:
7364             N>0
7365
7366           Get N tones masks from selected images.
7367
7368           Example: [#1] image.jpg +tones 3
7369
7370         topographic_map:
7371             _nb_levels>0,_smoothness
7372
7373           Render selected images as topographic maps.
7374
7375           Default values: 'nb_levels=16' and 'smoothness=2'.
7376
7377           Example: [#1] image.jpg topographic_map 10
7378
7379         tsp:
7380             _precision>=0
7381
7382           Try to solve the 'travelling salesman' problem, using a combination
7383       of greedy search and 2-opt
7384           algorithms.
7385           Selected  images must have dimensions Nx1x1xC to represent N cities
7386       each with C-dimensional
7387           coordinates.
7388           This command re-order the selected data along the  x-axis  so  that
7389       the point sequence becomes a
7390           shortest path.
7391
7392           Default values: 'precision=256'.
7393
7394           Example:  [#1]  256,1,1,2  rand  0,512 tsp , 512,512,1,3 repeat w#0
7395       circle[-1]    {0,I[$>]},2,1,255,255,255          line[-1]     {0,bound‐
7396       ary=2;[I[$>],I[$>+1]]},1,255,128,0 done keep[-1]
7397
7398         variance_patch:
7399             _patch_size>=1
7400
7401           Compute  variance  of  each  images  patch  centered  at  (x,y), in
7402       selected images.
7403
7404           Default value: 'patch_size=16'
7405
7406           Example: [#1] image.jpg +variance_patch
7407
7408         12.10. Image Drawing
7409                -------------
7410
7411         arrow:
7412             x0[%],y0[%],x1[%],y1[%],_thick‐
7413       ness[%]>=0,_head_length[%]>=0,_head_thickness[%]>=0,_opacity,_pattern,
7414       _color1,...
7415
7416           Draw specified arrow on selected images.
7417           'pattern' is an hexadecimal number starting with '0x' which can  be
7418       omitted
7419           even  if a color is specified. If a pattern is specified, the arrow
7420       is
7421           drawn outlined instead of filled.
7422
7423           Default  values:  'thickness=1%',  'head_length=10%',  'head_thick‐
7424       ness=3%', 'opacity=1',
7425             'pattern=(undefined)' and 'color1=0'.
7426
7427           Example:      [#1]      400,400,1,3      repeat      100      arrow
7428       50%,50%,{u(100)}%,{u(100)}%,3,20,10,0.3,${-rgb} done
7429
7430         axes:
7431             x0,x1,y0,y1,_font_height>=0,_opacity,_pattern,_color1,...
7432
7433           Draw xy-axes on selected images.
7434           'pattern' is an hexadecimal number starting with '0x' which can  be
7435       omitted
7436           even if a color is specified.
7437           To draw only one x-axis at row Y, set both 'y0' and 'y1' to Y.
7438           To draw only one y-axis at column X, set both 'x0' and 'x1' to X.
7439
7440           Default   values:  'font_height=14',  'opacity=1',  'pattern=(unde‐
7441       fined)' and 'color1=0'.
7442
7443           Example: [#1] 400,400,1,3,255 axes -1,1,1,-1
7444
7445         ball:
7446             _size>0,                _R,_G,_B,0<=_specular_light<=8,0<=_specu‐
7447       lar_size<=8,_shadow>=0
7448
7449           Input a 2D RGBA colored ball sprite.
7450
7451           Default   values:   'size=64',   'R=255',   'G=R',  'B=R',  'specu‐
7452       lar_light=0.8', 'specular_size=1' and
7453             'shading=1.5'.
7454
7455           Example: [#1] repeat 9 ball {1.5^($>+2)},${-rgb} done append x
7456
7457         chessboard:
7458             size1>0,_size2>0,_offset1,_offset2,_angle,_opac‐
7459       ity,_color1,...,_color2,...
7460
7461           Draw chessboard on selected images.
7462
7463           Default   values:  'size2=size1',  'offset1=offset2=0',  'angle=0',
7464       'opacity=1', 'color1=0' and
7465             'color2=255'.
7466
7467           Example:            [#1]            image.jpg            chessboard
7468       32,32,0,0,25,0.3,255,128,0,0,128,255
7469
7470         cie1931:
7471
7472           Draw CIE-1931 chromaticity diagram on selected images.
7473
7474           Example: [#1] 500,400,1,3 cie1931
7475
7476         circle:
7477             x[%],y[%],R[%],_opacity,_pattern,_color1,...
7478
7479           Draw specified colored circle on selected images.
7480           A radius of '100%' stands for 'sqrt(width^2+height^2)'.
7481           'pattern'  is an hexadecimal number starting with '0x' which can be
7482       omitted
7483           even if a color is specified. If a pattern is specified, the circle
7484       is
7485           drawn outlined instead of filled.
7486
7487           Default values: 'opacity=1', 'pattern=(undefined)' and 'color1=0'.
7488
7489           Example:       [#1]      image.jpg      repeat      300      circle
7490       {u(100)}%,{u(100)}%,{u(30)},0.3,${-rgb}    done     circle     50%,50%,
7491       100,0.7,255
7492
7493         close_binary:
7494             0<=_endpoint_rate<=100,_endpoint_connectivity>=0,_spline_dist‐
7495       max>=0,_segment_distmax>=0,                           0<=_spline_angle‐
7496       max<=180,_spline_roundness>=0,_area_min>=0,_allow_self_intersection={ 0
7497       | 1 }
7498
7499           Automatically close open shapes in binary  images  (defining  white
7500       strokes on black background).
7501
7502           Default   values:   'endpoint_rate=75',  'endpoint_connectivity=2',
7503       'spline_distmax=80',
7504             'segment_distmax=20',    'spline_anglemax=90',     'spline_round‐
7505       ness=1','area_min=100',
7506             'allow_self_intersection=1'.
7507
7508         ellipse (+):
7509             x[%],y[%],R[%],r[%],_angle,_opacity,_pattern,_color1,...
7510
7511           Draw specified colored ellipse on selected images.
7512           A radius of '100%' stands for 'sqrt(width^2+height^2)'.
7513           'pattern'  is an hexadecimal number starting with '0x' which can be
7514       omitted
7515           even if a color is  specified.  If  a  pattern  is  specified,  the
7516       ellipse is
7517           drawn outlined instead of filled.
7518
7519           Default values: 'opacity=1', 'pattern=(undefined)' and 'color1=0'.
7520
7521           Example:      [#1]      image.jpg      repeat      300      ellipse
7522       {u(100)}%,{u(100)}%,{u(30)},{u(30)},{u(180)},0.3,${-rgb}           done
7523       ellipse 50%,50%,100,100,0,0.7,255
7524
7525         flood (+):
7526             x[%],_y[%],_z[%],_tolerance>=0,_is_high_connectivity={   0   |  1
7527       },_opacity,_color1,...
7528
7529           Flood-fill selected images using specified value and tolerance.
7530
7531           Default values: 'y=z=0',  'tolerance=0',  'is_high_connectivity=0',
7532       'opacity=1' and 'color1=0'.
7533
7534           Example:       [#1]      image.jpg      repeat      1000      flood
7535       {u(100)}%,{u(100)}%,0,20,0,1,${-rgb} done
7536
7537         gaussian:
7538             _sigma1[%],_sigma2[%],_angle
7539
7540           Draw a centered gaussian on selected images, with  specified  stan‐
7541       dard deviations and orientation.
7542
7543           Default values: 'sigma1=3', 'sigma2=sigma1' and 'angle=0'.
7544
7545           Example: [#1] 400,400 gaussian 100,30,45
7546
7547           Tutorial: https://gmic.eu/tutorial/_gaussian.shtml
7548
7549         graph (+):
7550             [function_image],_plot_type,_vertex_type,_ymin,_ymax,_opac‐
7551       ity,_pattern,_color1,... |
7552             'formula',_resolution>=0,_plot_type,_ver‐
7553       tex_type,_xmin,xmax,_ymin,_ymax,_opacity,_pattern,_color1,       ...
7554
7555           Draw specified function graph on selected images.
7556           'plot_type' can be { 0=none | 1=lines | 2=splines | 3=bar }.
7557           'vertex_type'  can  be { 0=none | 1=points | 2,3=crosses | 4,5=cir‐
7558       cles | 6,7=squares }.
7559           'pattern' is an hexadecimal number starting with '0x' which can  be
7560       omitted
7561           even if a color is specified.
7562
7563           Default   values:   'plot_type=1',   'vertex_type=1',  'ymin=ymax=0
7564       (auto)', 'opacity=1',
7565             'pattern=(undefined)'
7566           and 'color1=0'.
7567
7568           Example: [#1] image.jpg +rows 50% blur[-1] 3 split[-1] c div[0] 1.5
7569       graph[0]   [1],2,0,0,0,1,255,0,0        graph[0]  [2],2,0,0,0,1,0,255,0
7570       graph[0] [3],2,0,0,0,1,0,0,255 keep[0]
7571
7572         grid:
7573             size_x[%]>=0,size_y[%]>=0,_offset_x[%],_offset_y[%],_opac‐
7574       ity,_pattern,_color1,...
7575
7576           Draw xy-grid on selected images.
7577           'pattern'  is an hexadecimal number starting with '0x' which can be
7578       omitted
7579           even if a color is specified.
7580
7581           Default values: 'offset_x=offset_y=0', 'opacity=1', 'pattern=(unde‐
7582       fined)' and 'color1=0'.
7583
7584           Example: [#1] image.jpg grid 10%,10%,0,0,0.5,255
7585                    [#2]    400,400,1,3,255    grid   10%,10%,0,0,0.3,0xCCCCC‐
7586       CCC,128,32,16
7587
7588         j (+):
7589             Shortcut for command 'image'.
7590
7591         image (+):
7592             [sprite],_x[%|~],_y[%|~],_z[%|~],_c[%|~],_opacity,_[opac‐
7593       ity_mask],_max_opacity_mask
7594
7595           Draw specified sprite image on selected images.
7596           (equivalent to shortcut command 'j').
7597
7598           If  one  of  the  x,y,z or c argument ends with a '~', its value is
7599       expected to be
7600           a centering ratio (in [0,1]) rather than a position.
7601           Usual centering ratio  are  {  0=left-justified  |  0.5=centered  |
7602       1=right-justified }.
7603
7604           Default   values:  'x=y=z=c=0',  'opacity=1',  'opacity_mask=(unde‐
7605       fined)' and 'max_opacity_mask=1'.
7606
7607           Example:   [#1]   image.jpg   +crop   40%,40%,60%,60%    resize[-1]
7608       200%,200%,1,3,5 frame[-1] 2,2,0 image[0] [-1],      30%,30% keep[0]
7609
7610         line (+):
7611             x0[%],y0[%],x1[%],y1[%],_opacity,_pattern,_color1,...
7612
7613           Draw specified colored line on selected images.
7614           'pattern'  is an hexadecimal number starting with '0x' which can be
7615       omitted
7616           even if a color is specified.
7617
7618           Default values: 'opacity=1', 'pattern=(undefined)' and 'color1=0'.
7619
7620           Example:      [#1]      image.jpg       repeat       500       line
7621       50%,50%,{u(w)},{u(h)},0.5,${-rgb} done line 0,0,100%,100%,1,      0xCC‐
7622       CCCCCC,255 line 100%,0,0,100%,1,0xCCCCCCCC,255
7623
7624         linethick:
7625             x0[%],y0[%],x1[%],y1[%],_thickness,_opacity,_color1
7626
7627           Draw specified colored thick line on selected images.
7628
7629           Default values: 'thickness=2', 'opacity=1' and 'color1=0'.
7630
7631           Example:     [#1]     400,400,1,3     repeat     100      linethick
7632       {u([w,h,w,h,5])},0.5,${-rgb} done
7633
7634         mandelbrot (+):
7635             z0r,z0i,z1r,z1i,_iteration_max>=0,_is_julia={      0      |     1
7636       },_c0r,_c0i,_opacity
7637
7638           Draw mandelbrot/julia fractal on selected images.
7639
7640           Default values: 'iteration_max=100', 'is_julia=0', 'c0r=c0i=0'  and
7641       'opacity=1'.
7642
7643           Example:  [#1]  400,400  mandelbrot  -2.5,-2,2,2,1024 map 0 +blur 2
7644       elevation3d[-1] -0.2
7645
7646         marble:
7647             _image_weight,_pattern_weight,_angle,_amplitude,_sharp‐
7648       ness>=0,_anisotropy>=0,_alpha,_sigma,       _cut_low>=0,_cut_high>=0
7649
7650           Render marble like pattern on selected images.
7651
7652           Default     values:    'image_weight=0.2',    'pattern_weight=0.1',
7653       'angle=45', 'amplitude=0',
7654             'sharpness=0.4' and 'anisotropy=0.8',
7655           'alpha=0.6', 'sigma=1.1' and 'cut_low=cut_high=0'.
7656
7657           Example: [#1] image.jpg +marble ,
7658
7659         maze:
7660             _width>0,_height>0,_cell_size>0
7661
7662           Input maze with specified size.
7663
7664           Example: [#1] maze 30,20 negate normalize 0,255
7665
7666         maze_mask:
7667             _cellsize>0
7668
7669           Input maze according to size and shape of selected mask images.
7670           Mask may contain disconnected shapes.
7671
7672           Example: [#1] 0 text "G'MIC",0,0,53,1,1 dilate 3 autocrop  0  frame
7673       1,1,0 maze_mask 8 dilate 3 negate mul       255
7674
7675         newton_fractal:
7676             z0r,z0i,z1r,z1i,_angle,0<=_descent_method<=2,_itera‐
7677       tion_max>=0,_convergence_precision>0,_expr_p(z),
7678       _expr_dp(z),_expr_d2p(z)
7679
7680           Draw  newton  fractal  on  selected  images, for complex numbers in
7681       range (z0r,z0i) - (z1r,z1i).
7682           Resulting images have  3  channels  whose  meaning  is  [  last_zr,
7683       last_zi, nb_iter_used_for_convergence
7684           ].
7685           'descent_method' can be { 0=secant | 1=newton | 2=householder }.
7686
7687           Default values: 'angle=0', 'descent_method=1', 'iteration_max=200',
7688             'convergence_precision=0.01',                 'expr_p(z)=z^^3-1',
7689       'expr_dp(z)=3*z^^2' and 'expr_d2z(z)=6*z'.
7690
7691           Example:           [#1]           400,400            newton_fractal
7692       -1.5,-1.5,1.5,1.5,0,2,200,0.01,"z^^6  +  z^^3  -  1","6*z^^5 + 3*z^^2",
7693       "30*z^^4 + 6*z" f "[ atan2(i1,i0)*90+20,1,cut(i2/30,0.2,0.7) ]" hsl2rgb
7694
7695         j3d (+):
7696             Shortcut for command 'object3d'.
7697
7698         object3d (+):
7699             [object3d],_x[%],_y[%],_z,_opacity,_rendering_mode,_is_dou‐
7700       ble_sided={     0     |     1     },_is_zbuffer={     0    |    1    },
7701       _focale,_light_x,_light_y,_light_z,_specular_lightness,_specular_shini‐
7702       ness
7703
7704           Draw specified 3D object on selected images.
7705           (equivalent to shortcut command 'j3d').
7706
7707           'rendering_mode'  can  be { 0=dots | 1=wireframe | 2=flat | 3=flat-
7708       shaded | 4=gouraud-shaded |
7709           5=phong-shaded }.
7710
7711           Default values:  'x=y=z=0',  'opacity=1'  and  'is_zbuffer=1'.  All
7712       other arguments take their
7713             default values
7714           from the 3D environment variables.
7715
7716           Example:  [#1] image.jpg torus3d 100,10 cone3d 30,-120 add3d[-2,-1]
7717       rotate3d. 1,1,0,60 object3d[0] [-1],      50%,50% keep[0]
7718
7719         pack_sprites:
7720             _nb_scales>=0,0<=_min_scale<=100,_allow_rotation={  0=0  deg.   |
7721       1=180   deg.   |   2=90   deg.   |   3=any   },        _spacing,_preci‐
7722       sion>=0,max_iterations>=0
7723
7724           Try to randomly pack as many sprites as possible onto  the  'empty'
7725       areas of an image.
7726           Sprites  can  be  eventually  rotated and scaled during the packing
7727       process.
7728           First selected image is the canvas that will  be  filled  with  the
7729       sprites.
7730           Its  last channel must be a binary mask whose zero values represent
7731       potential locations for drawing
7732           the sprites.
7733           All other selected images  represent  the  sprites  considered  for
7734       packing.
7735           Their last channel must be a binary mask that represents the sprite
7736       shape (i.e. a 8-connected
7737           component).
7738           The order of sprite packing follows the order of specified  sprites
7739       in the image list.
7740           Sprite  packing  is  done  on random locations and iteratively with
7741       decreasing scales.
7742           'nb_scales' sets the number of decreasing scales considered for all
7743       specified sprites to be packed.
7744           'min_scale'  (in  %)  sets  the minimal size considered for packing
7745       (specified as a percentage of the
7746           original sprite size).
7747           'spacing' can be positive or negative.
7748           'precision' tells about the desired number of failed trials  before
7749       ending the filling process.
7750
7751           Default  values: 'nb_scales=5', 'min_scale=25', 'allow_rotation=3',
7752       'spacing=1', 'precision=7'
7753             and 'max_iterations=256'.
7754
7755           Example:   [#1]   512,512,1,3,"min(255,y*c/2)"   100%,100%   circle
7756       50%,50%,100,1,255  append  c  image.jpg        resize2dy[-1] 24 to_rgba
7757       pack_sprites 3,25
7758
7759         piechart:
7760             label_height>=0,label_R,label_G,label_B,"label1",value1,R1,G1,B1,...,"labelN",val‐
7761       ueN,RN,GN,BN
7762
7763           Draw pie chart on selected (RGB) images.
7764
7765           Example:             [#1]             image.jpg            piechart
7766       25,0,0,0,"Red",55,255,0,0,"Green",40,0,255,0,"Blue",30,128,128,255,
7767       "Other",5,128,128,128
7768
7769         plasma (+):
7770             _alpha,_beta,_scale>=0
7771
7772           Draw a random colored plasma fractal on selected images.
7773           This command implements the so-called 'Diamond-Square' algorithm.
7774
7775           Default values: 'alpha=1', 'beta=1' and 'scale=8'.
7776
7777           Example: [#1] 400,400,1,3 plasma
7778
7779           Tutorial: https://gmic.eu/tutorial/_plasma.shtml
7780
7781         point (+):
7782             x[%],y[%],_z[%],_opacity,_color1,...
7783
7784           Set specified colored pixel on selected images.
7785
7786           Default values: 'z=0', 'opacity=1' and 'color1=0'.
7787
7788           Example:      [#1]      image.jpg      repeat      10000      point
7789       {u(100)}%,{u(100)}%,0,1,${-rgb} done
7790
7791         polka_dots:
7792             diameter>=0,_density,_offset1,_offset2,_angle,_aliasing,_shad‐
7793       ing,_opacity,_color,...
7794
7795           Draw dots pattern on selected images.
7796
7797           Default   values:  'density=20',  'offset1=offset2=50',  'angle=0',
7798       'aliasing=10', 'shading=1',
7799             'opacity=1' and 'color=255'.
7800
7801           Example: [#1] image.jpg polka_dots 10,15,0,0,20,10,1,0.5,0,128,255
7802
7803         polygon (+):
7804             N>=1,x1[%],y1[%],...,xN[%],yN[%],_opacity,_pattern,_color1,...
7805
7806           Draw specified colored N-vertices polygon on selected images.
7807           'pattern' is an hexadecimal number starting with '0x' which can  be
7808       omitted
7809           even  if a color is specified. If a pattern is specified, the poly‐
7810       gon is
7811           drawn outlined instead of filled.
7812
7813           Default values: 'opacity=1', 'pattern=(undefined)' and 'color1=0'.
7814
7815           Example:             [#1]             image.jpg             polygon
7816       4,20%,20%,80%,30%,80%,70%,20%,80%,0.3,0,255,0                   polygon
7817       4,20%,20%,80%,30%,      80%,70%,20%,80%,1,0xCCCCCCCC,255
7818                    [#2]  image.jpg  2,16,1,1,'u(if(x,{h},{w}))'   polygon[-2]
7819       {h},{^},0.6,255,0,255 remove[-1]
7820
7821         quiver:
7822             [function_image],_sampling[%]>0,_factor>=0,_is_arrow={   0   |  1
7823       },_opacity,_color1,...
7824
7825           Draw specified 2D vector/orientation field on selected images.
7826
7827           Default values:  'sampling=5%',  'factor=1',  'is_arrow=1',  'opac‐
7828       ity=1', 'pattern=(undefined)'
7829           and 'color1=0'.
7830
7831           Example:  [#1]  100,100,1,2,'if(c==0,x-w/2,y-h/2)'  500,500,1,3,255
7832       quiver[-1] [-2],10
7833                    [#2] image.jpg  +resize2dy  600  luminance[0]  gradient[0]
7834       mul[1]  -1  reverse[0,1]  append[0,1]  c       blur[0] 8 orientation[0]
7835       quiver[1] [0],20,1,1,0.8,255
7836
7837         rectangle:
7838             x0[%],y0[%],x1[%],y1[%],_opacity,_pattern,_color1,...
7839
7840           Draw specified colored rectangle on selected images.
7841           'pattern' is an hexadecimal number starting with '0x' which can  be
7842       omitted
7843           even  if  a color is specified. If a pattern is specified, the rec‐
7844       tangle is
7845           drawn outlined instead of filled.
7846
7847           Default values: 'opacity=1', 'pattern=(undefined)' and 'color1=0'.
7848
7849           Example:     [#1]      image.jpg      repeat      30      rectangle
7850       {u(100)}%,{u(100)}%,{u(100)}%,{u(100)}%,0.3,${-rgb} done
7851
7852         rorschach:
7853             'smoothness[%]>=0','mirroring={ 0=none | 1=x | 2=y | 3=xy }
7854
7855           Render rorschach-like inkblots on selected images.
7856
7857           Default values: 'smoothness=5%' and 'mirroring=1'.
7858
7859           Example: [#1] 400,400 rorschach 3%
7860
7861         sierpinski:
7862             recursion_level>=0
7863
7864           Draw Sierpinski triangle on selected images.
7865
7866           Default value: 'recursion_level=7'.
7867
7868           Example: [#1] image.jpg sierpinski 7
7869
7870         spiralbw:
7871             width>0,_height>0,_is_2dcoords={ 0 | 1 }
7872
7873           Input a 2D rectangular spiral image with specified size.
7874
7875           Default values: 'height=width' and 'is_2dcoords=0'.
7876
7877           Example: [#1] spiralbw 16
7878                    [#2]  image.jpg spiralbw {[w,h]},1 +warp[0] [1],0 +warp[2]
7879       [1],2
7880
7881         spline:
7882             x0[%],y0[%],u0[%],v0[%],x1[%],y1[%],u1[%],v1[%],_opac‐
7883       ity,_color1,...
7884
7885           Draw  specified colored spline curve on selected images (cubic her‐
7886       mite spline).
7887
7888           Default values: 'opacity=1' and 'color1=0'.
7889
7890           Example:      [#1]      image.jpg      repeat       30       spline
7891       {u(100)}%,{u(100)}%,{u(-600,600)},{u(-600,600)},{u(100)}%,
7892       {u(100)}%,{u(-600,600)},{u(-600,600)},0.6,255 done
7893
7894         tetraedron_shade:
7895             x0,y0,z0,x1,y1,z1,x2,y2,z2,x3,y3,z3,R0,G0,B0,...,R1,G1,B1,...,R2,G2,B2,...,R3,G3,B3,...
7896
7897           Draw  tetraedron  with interpolated colors on selected (volumetric)
7898       images.
7899
7900         t (+):
7901             Shortcut for command 'text'.
7902
7903         text (+):
7904             text,_x[%|~],_y[%|~],_font_height[%]>=0,_opacity,_color1,...
7905
7906           Draw specified colored text string on selected images.
7907           (equivalent to shortcut command 't').
7908
7909           If one of the x or y  argument  ends  with  a  '~',  its  value  is
7910       expected to be
7911           a centering ratio (in [0,1]) rather than a position.
7912           Usual  centering  ratio  are  {  0=left-justified  | 0.5=centered |
7913       1=right-justified }.
7914           Sizes '13' and '128' are special and  correspond  to  binary  fonts
7915       (no-antialiasing).
7916           Any other font size is rendered with anti-aliasing.
7917           Specifying  an empty target image resizes it to new dimensions such
7918       that the image contains
7919           the entire text string.
7920
7921           Default  values:  'x=y=0.01~',  'font_height=16',  'opacity=1'  and
7922       'color1=0'.
7923
7924           Example:  [#1] image.jpg resize2dy 600 y=0 repeat 30 text {2*$>}" :
7925       This is a nice text, isn't it ?",10,       $y,{2*$>},0.9,255  y+={2*$>}
7926       done
7927                    [#2] 0 text "G'MIC",0,0,23,1,255
7928
7929         to:
7930             Shortcut for command 'text_outline'.
7931
7932         text_outline:
7933             text,_x[%|~],_y[%|~],_font_height[%]>0,_outline>=0,_opac‐
7934       ity,_color1,...
7935
7936           Draw specified colored and outlined text string on selected images.
7937           If one of the x or y  argument  ends  with  a  '~',  its  value  is
7938       expected to be
7939           a centering ratio (in [0,1]) rather than a position.
7940           Usual  centering  ratio  are  {  0=left-justified  | 0.5=centered |
7941       1=right-justified }.
7942
7943           Default  values:  'x=y=0.01~',   'font_height=7.5%',   'outline=2',
7944       'opacity=1',
7945             'color1=color2=color3=255' and 'color4=255'.
7946
7947           Example: [#1] image.jpg text_outline "Hi there!",10,10,63,3
7948
7949         triangle_shade:
7950             x0,y0,x1,y1,x2,y2,R0,G0,B0,...,R1,G1,B1,...,R2,G2,B2,...
7951
7952           Draw triangle with interpolated colors on selected images.
7953
7954           Example:           [#1]           image.jpg          triangle_shade
7955       20,20,400,100,120,200,255,0,0,0,255,0,0,0,255
7956
7957         truchet:
7958             _scale>0,_radius>=0,_pattern_type={ 0=straight | 1=curved }
7959
7960           Fill selected images with random truchet patterns.
7961
7962           Default values: 'scale=32', 'radius=5' and 'pattern_type=1'.
7963
7964           Example: [#1] 400,300 truchet ,
7965
7966         turbulence:
7967             _radius>0,_octaves={1,2,3...,12},_alpha>0,_differ‐
7968       ence={-10,10},_mode={0,1,2,3}
7969
7970           Render fractal noise or turbulence on selected images.
7971
7972           Default values: 'radius=32', 'octaves=6', 'alpha=3', 'difference=0'
7973       and 'mode=0'.
7974
7975           Example: [#1] 400,400,1,3 turbulence 16
7976
7977           Tutorial: https://gmic.eu/tutorial/_turbulence.shtml
7978
7979         yinyang:
7980
7981           Draw a yin-yang symbol on selected images.
7982
7983           Example: [#1] 400,400 yinyang
7984
7985         12.11. Matrix Computation
7986                ------------------
7987
7988         dijkstra (+):
7989             starting_node>=0,ending_node>=0
7990
7991           Compute minimal distances and paths from specified adjacency matri‐
7992       ces by the Dijkstra algorithm.
7993
7994         eigen (+):
7995
7996           Compute  the  eigenvalues  and  eigenvectors  of selected symmetric
7997       matrices or matrix fields.
7998           If one selected image has 3 or 6 channels,  it  is  regarded  as  a
7999       field of 2x2 or 3x3 symmetric
8000           matrices,
8001           whose eigen elements are computed at each point of the field.
8002
8003           Example: [#1] (1,0,0;0,2,0;0,0,3) +eigen
8004                    [#2] image.jpg structuretensors blur 2 eigen split[0] c
8005
8006           Tutorial: https://gmic.eu/tutorial/_eigen.shtml
8007
8008         invert (+):
8009             solver={ 0=SVD | 1=LU }
8010
8011           Compute the inverse of the selected matrices.
8012           SVD solver is slower but less numerically instable than LU.
8013
8014           Default value: 'solver=1'.
8015
8016           Example: [#1] (0,1,0;0,0,1;1,0,0) +invert
8017
8018         orthogonalize:
8019             _mode = { 0=orthogonalize | 1=orthonormalize }
8020
8021           Orthogonalize  or  orthonormalize selected matrices, using Modified
8022       Gram-Schmidt process.
8023
8024           Default value: 'mode=0'.
8025
8026         mproj (+):
8027             [dictionary],_method,_max_iter={ 0=auto | >0 },_max_residual>=0
8028
8029           Find best matching projection of selected matrices onto the span of
8030       an over-complete
8031           dictionary  D,  using the orthogonal projection or Matching Pursuit
8032       algorithm.
8033           Selected images are 2D-matrices in which each  column  represent  a
8034       signal to project.
8035           '[dictionary]'  is  a  matrix in which each column is an element of
8036       the dictionary D.
8037           'method' tells what projection algorithm must be  applied.  It  can
8038       be:
8039               -  0  = orthogonal projection (least-squares solution using LU-
8040       based solver).
8041              - 1 = matching pursuit.
8042              - 2 = matching pursuit, with a single orthogonal projection step
8043       at the end.
8044               - >=3 = orthogonal matching pursuit where an orthogonal projec‐
8045       tion step is performed
8046                      every 'method-2' iterations.
8047           'max_iter' sets the max number of  iterations  processed  for  each
8048       signal.
8049           If  set to '0' (default), 'max_iter' is equal to the number of col‐
8050       umns in D.
8051           (only meaningful for matching pursuit and its variants).
8052           'max_residual' gives a stopping criterion on signal  reconstruction
8053       accuracy.
8054           (only meaningful for matching pursuit and its variants).
8055           For each selected image, the result is returned as a matrix W
8056           whose  columns  correspond to the weights associated to each column
8057       of D,
8058           such that the matrix product D*W is an approximation of  the  input
8059       matrix.
8060
8061           Default values: 'method=0', 'max_iter=0' and 'max_residual=1e-6'.
8062
8063         solve (+):
8064             [image]
8065
8066           Solve linear system AX = B for selected B-matrices and specified A-
8067       matrix.
8068           If the system is under- or over-determined, the least squares solu‐
8069       tion is returned
8070           (using SVD-based solver).
8071
8072           Example: [#1] (0,1,0;1,0,0;0,0,1) (1;2;3) +solve[-1] [-2]
8073
8074         svd (+):
8075
8076           Compute SVD decomposition of selected matrices.
8077
8078           Example: [#1] 10,10,1,1,'if(x==y,x+u(-0.2,0.2),0)' +svd
8079
8080         transpose:
8081
8082           Transpose selected matrices.
8083
8084           Example: [#1] image.jpg +transpose
8085
8086         trisolve (+):
8087             [image]
8088
8089           Solve  tridiagonal  system AX = B for selected B-vectors and speci‐
8090       fied tridiagonal A-matrix.
8091           Tridiagonal matrix must be stored as a 3 column vector,  where  2nd
8092       column contains the
8093           diagonal  coefficients,  while 1st and 3rd columns contain the left
8094       and right coefficients.
8095
8096           Example: [#1] (0,0,1;1,0,0;0,1,0) (1;2;3) +trisolve[-1] [-2]
8097
8098         12.12. 3D Meshes
8099                ---------
8100
8101         +3d (+):
8102             Shortcut for command 'add3d'.
8103
8104         add3d (+):
8105             tx,_ty,_tz |
8106             [object3d] |
8107             (no arg)
8108
8109           Shift selected 3D objects with specified  displacement  vector,  or
8110       merge them with specified
8111           3D object, or merge all selected 3D objects together.
8112           (equivalent to shortcut command '+3d').
8113
8114           Default values: 'ty=tz=0'.
8115
8116           Example:  [#1]  sphere3d  10  repeat  5 +add3d[-1] 10,{u(-10,10)},0
8117       color3d[-1] ${-rgb} done add3d
8118                    [#2] repeat 20 torus3d 15,2 color3d[-1] ${-rgb}  mul3d[-1]
8119       0.5,1  if  $>%2  rotate3d[-1]  0,1,0,90        fi  add3d[-1]  70  add3d
8120       rotate3d[-1] 0,0,1,18 done double3d 0
8121
8122         animate3d:
8123             _width>0,_height>0,_angle_dx,_angle_dy,_angle_dz,_zoom_fac‐
8124       tor>=0,_filename
8125
8126           Animate selected 3D objects in a window.
8127           If  argument 'filename' is provided, each frame of the animation is
8128       saved as a numbered filename.
8129
8130           Default   values:    'width=640',    'height=480',    'angle_dx=0',
8131       'angle_dy=1', 'angle_dz=0',
8132             'zoom_factor=1' and 'filename=(undefined)'.
8133
8134         apply_camera3d:
8135             pos_x,pos_y,pos_z,target_x,target_y,target_z,up_x,up_y,up_z
8136
8137           Apply 3D camera matrix to selected 3D objects.
8138
8139           Default values: 'target_x=0', 'target_y=0', 'target_z=0', 'up_x=0',
8140       'up_y=-1' and 'up_z=0'.
8141
8142         apply_matrix3d:
8143             a11,a12,a13,...,a31,a32,a33
8144
8145           Apply specified 3D rotation matrix to selected 3D objects.
8146
8147           Example:       [#1]       torus3d       10,1        +apply_matrix3d
8148       {mul(rot(1,0,1,-15),[1,0,0,0,2,0,0,0,8],3)} double3d 0
8149
8150         array3d:
8151             size_x>=1,_size_y>=1,_size_z>=1,_offset_x[%],_offset_y[%],_off‐
8152       set_y[%]
8153
8154           Duplicate a 3D object along the X,Y and Z axes.
8155
8156           Default values: 'size_y=1', 'size_z=1' and  'offset_x=offset_y=off‐
8157       set_z=100%'.
8158
8159           Example: [#1] torus3d 10,1 +array3d 5,5,5,110%,110%,300%
8160
8161         arrow3d:
8162             x0,y0,z0,x1,y1,z1,_radius[%]>=0,_head_length[%]>=0,_head_radius[%]>=0
8163
8164           Input 3D arrow with specified starting and ending 3D points.
8165
8166           Default     values:     'radius=5%',     'head_length=25%'      and
8167       'head_radius=15%'.
8168
8169           Example:      [#1]     repeat     10     a={$>*2*pi/10}     arrow3d
8170       0,0,0,{cos($a)},{sin($a)},-0.5 done +3d
8171
8172         axes3d:
8173             _size_x,_size_y,_size_z,_font_size>0,_label_x,_label_y,_label_z,_is_ori‐
8174       gin={ 0=no | 1=yes }
8175
8176           Input  3D  axes  with  specified sizes along the x,y and z orienta‐
8177       tions.
8178
8179           Default    values:    'size_x=size_y=size_z=1',     'font_size=23',
8180       'label_x=X', 'label_y=Y',
8181             'label_z=Z' and 'is_origin=1'
8182
8183           Example: [#1] axes3d ,
8184
8185         boundingbox3d:
8186
8187           Replace selected 3D objects by their 3D bounding boxes.
8188
8189           Example: [#1] torus3d 100,30 +boundingbox3d +3d[-1] [-2]
8190
8191         box3d:
8192             _size_x,_size_y,_size_z
8193
8194           Input 3D box at (0,0,0), with specified geometry.
8195
8196           Default values: 'size_x=1' and 'size_z=size_y=size_x'.
8197
8198           Example: [#1] box3d 100,40,30 +primitives3d 1 color3d[-2] ${-rgb}
8199
8200         c3d:
8201             Shortcut for command 'center3d'.
8202
8203         center3d:
8204
8205           Center selected 3D objects at (0,0,0).
8206           (equivalent to shortcut command 'c3d').
8207
8208           Example: [#1] repeat 100 circle3d {u(100)},{u(100)},{u(100)},2 done
8209       add3d color3d[-1] 255,0,0 +center3d       color3d[-1] 0,255,0 add3d
8210
8211         circle3d:
8212             _x0,_y0,_z0,_radius>=0
8213
8214           Input 3D circle at specified coordinates.
8215
8216           Default values: 'x0=y0=z0=0' and 'radius=1'.
8217
8218           Example:     [#1]     repeat     500     a={$>*pi/250}     circle3d
8219       {cos(3*$a)},{sin(2*$a)},0,{$a/50}  color3d[-1]  ${-rgb},       0.4 done
8220       add3d
8221
8222         circles3d:
8223             _radius>=0,_is_wireframe={ 0 | 1 }
8224
8225           Convert specified 3D objects to sets of 3D circles  with  specified
8226       radius.
8227
8228           Default values: 'radius=1' and 'is_wireframe=1'.
8229
8230           Example:  [#1] image.jpg luminance resize2dy 40 threshold 50% * 255
8231       pointcloud3d color3d[-1] 255,255,255       circles3d 0.7
8232
8233         col3d (+):
8234             Shortcut for command 'color3d'.
8235
8236         color3d (+):
8237             R,_G,_B,_opacity
8238
8239           Set color and opacity of selected 3D objects.
8240           (equivalent to shortcut command 'col3d').
8241
8242           Default value: 'B=G=R' and 'opacity=(undefined)'.
8243
8244           Example: [#1] torus3d 100,10  double3d  0  repeat  7  +rotate3d[-1]
8245       1,0,0,20 color3d[-1] ${-rgb} done add3d
8246
8247         colorcube3d:
8248
8249           Input 3D color cube.
8250
8251           Example: [#1] colorcube3d mode3d 2 +primitives3d 1
8252
8253         cone3d:
8254             _radius,_height,_nb_subdivisions>0
8255
8256           Input 3D cone at (0,0,0), with specified geometry.
8257
8258           Default value: 'radius=1','height=1' and 'nb_subdivisions=24'.
8259
8260           Example: [#1] cone3d 10,40 +primitives3d 1 color3d[-2] ${-rgb}
8261
8262         cubes3d:
8263             _size>=0
8264
8265           Convert  specified  3D  objects  to sets of 3D cubes with specified
8266       size.
8267
8268           Default value: 'size=1'.
8269
8270           Example: [#1] image.jpg luminance resize2dy 40 threshold 50% *  255
8271       pointcloud3d color3d[-1] 255,255,255       cubes3d 1
8272
8273         cup3d:
8274             _resolution>0
8275
8276           Input 3D cup object.
8277
8278           Default value: 'resolution=128'.
8279
8280           Example: [#1] cup3d ,
8281
8282         cylinder3d:
8283             _radius,_height,_nb_subdivisions>0
8284
8285           Input 3D cylinder at (0,0,0), with specified geometry.
8286
8287           Default value: 'radius=1','height=1' and 'nb_subdivisions=24'.
8288
8289           Example: [#1] cylinder3d 10,40 +primitives3d 1 color3d[-2] ${-rgb}
8290
8291         delaunay3d:
8292
8293           Generate 3D delaunay triangulations from selected images.
8294           One  assumes  that the selected input images are binary images con‐
8295       taining the set of points to mesh.
8296           The output 3D object is a mesh composed of non-oriented triangles.
8297
8298           Example:  [#1]  500,500  noise  0.05,2  eq  1  *  255   +delaunay3d
8299       color3d[1]  255,128,0  dilate_circ[0]  5        to_rgb[0]  +object3d[0]
8300       [1],0,0,0,1,1 max[-1] [0]
8301
8302         distribution3d:
8303
8304           Get 3D color distribution of selected images.
8305
8306           Example: [#1] image.jpg distribution3d colorcube3d primitives3d[-1]
8307       1 add3d
8308
8309         /3d (+):
8310             Shortcut for command 'div3d'.
8311
8312         div3d (+):
8313             factor |
8314             factor_x,factor_y,_factor_z
8315
8316           Scale  selected  3D  objects isotropically or anisotropically, with
8317       the inverse of specified
8318           factors.
8319           (equivalent to shortcut command '/3d').
8320
8321           Default value: 'factor_z=0'.
8322
8323           Example: [#1] torus3d 5,2 repeat 5 +add3d[-1] 12,0,0 div3d[-1]  1.2
8324       color3d[-1] ${-rgb} done add3d
8325
8326         db3d (+):
8327             Shortcut for command 'double3d'.
8328
8329         double3d (+):
8330             _is_double_sided={ 0 | 1 }
8331
8332           Enable/disable double-sided mode for 3D rendering.
8333           (equivalent to shortcut command 'db3d').
8334
8335           Default value: 'is_double_sided=1'.
8336
8337           Example:  [#1]  mode3d  1  repeat  2  torus3d  100,30  rotate3d[-1]
8338       1,1,0,60 double3d $> snapshot3d[-1] 400 done
8339
8340         elevation3d (+):
8341             z-factor |
8342             [elevation_map] |
8343             'formula' |
8344             (no arg)
8345
8346           Build 3D elevation of selected images, with a  specified  elevation
8347       map.
8348           When invoked with (no arg) or 'z-factor', the elevation map is com‐
8349       puted as the pointwise L2 norm of
8350           the
8351           pixel values. Otherwise, the elevation map is taken from the speci‐
8352       fied image or formula.
8353
8354           Example: [#1] image.jpg +blur 5 elevation3d. 0.75
8355                    [#2]  128,128,1,3,u(255)  plasma 10,3 blur 4 sharpen 10000
8356       elevation3d[-1]
8357       'X=(x-64)/6;Y=(y-64)/6;-100*exp(-(X^2+Y^2)/30)*abs(cos(X)*sin(Y))'
8358
8359         empty3d:
8360
8361           Input empty 3D object.
8362
8363           Example: [#1] empty3d
8364
8365         extrude3d:
8366             _depth>0,_resolution>0,_smoothness[%]>=0
8367
8368           Generate extruded 3D object from selected binary XY-profiles.
8369
8370           Default   values:   'depth=16',   'resolution=1024'   and  'smooth‐
8371       ness=0.5%'.
8372
8373           Example: [#1] image.jpg threshold 50% extrude3d 16
8374
8375         f3d (+):
8376             Shortcut for command 'focale3d'.
8377
8378         focale3d (+):
8379             focale
8380
8381           Set 3D focale.
8382           (equivalent to shortcut command 'f3d').
8383
8384           Set 'focale' to 0 to enable parallel projection  (instead  of  per‐
8385       spective).
8386           Set negative 'focale' will disable 3D sprite zooming.
8387
8388           Default value: 'focale=700'.
8389
8390           Example:   [#1]  repeat  5  torus3d  100,30  rotate3d[-1]  1,1,0,60
8391       focale3d {$<*90} snapshot3d[-1] 400 done       remove[0]
8392
8393         gaussians3d:
8394             _size>0,_opacity
8395
8396           Convert selected 3D objects into set of 3D gaussian-shaped sprites.
8397
8398           Example: [#1] image.jpg r2dy 32 distribution3d gaussians3d 20  col‐
8399       orcube3d primitives3d[-1] 1 +3d
8400
8401         gmic3d:
8402
8403           Input a 3D G'MIC logo.
8404
8405           Example: [#1] gmic3d +primitives3d 1
8406
8407         gyroid3d:
8408             _resolution>0,_zoom
8409
8410           Input 3D gyroid at (0,0,0), with specified resolution.
8411
8412           Default values: 'resolution=32' and 'zoom=5'.
8413
8414           Example: [#1] gyroid3d 48 +primitives3d 1
8415
8416         histogram3d:
8417
8418           Get 3D color histogram of selected images.
8419
8420           Example:  [#1] image.jpg resize2dx 64 histogram3d circles3d 3 opac‐
8421       ity3d. 0.75 colorcube3d       primitives3d[-1] 1 add3d
8422
8423         image6cube3d:
8424
8425           Generate 3D mapped cubes from 6-sets of selected images.
8426
8427           Example: [#1] image.jpg animate flower,"30,0","30,5",6 image6cube3d
8428
8429         imageblocks3d:
8430             _maximum_elevation,_smoothness[%]>=0
8431
8432           Generate 3D blocks from selected images.
8433           Transparency of selected images is taken into account.
8434
8435           Default values: 'maximum_elevation=10' and 'smoothness=0'.
8436
8437           Example: [#1] image.jpg resize2dy 32 imageblocks3d -20 mode3d 3
8438
8439         imagecube3d:
8440
8441           Generate 3D mapped cubes from selected images.
8442
8443           Example: [#1] image.jpg imagecube3d
8444
8445         imageplane3d:
8446
8447           Generate 3D mapped planes from selected images.
8448
8449           Example: [#1] image.jpg imageplane3d
8450
8451         imagepyramid3d:
8452
8453           Generate 3D mapped pyramids from selected images.
8454
8455           Example: [#1] image.jpg imagepyramid3d
8456
8457         imagerubik3d:
8458             _xy_tiles>=1,0<=xy_shift<=100,0<=z_shift<=100
8459
8460           Generate 3D mapped rubik's cubes from selected images.
8461
8462           Default values: 'xy_tiles=3', 'xy_shift=5' and 'z_shift=5'.
8463
8464           Example: [#1] image.jpg imagerubik3d ,
8465
8466         imagesphere3d:
8467             _resolution1>=3,_resolution2>=3
8468
8469           Generate 3D mapped sphere from selected images.
8470
8471           Default values: 'resolution1=32' and 'resolutions2=16'.
8472
8473           Example: [#1] image.jpg imagesphere3d 32,16
8474
8475         isoline3d (+):
8476             isovalue[%] |
8477             'formula',value,_x0,_y0,_x1,_y1,_size_x>0[%],_size_y>0[%]
8478
8479           Extract 3D isolines with specified value from  selected  images  or
8480       from specified formula.
8481
8482           Default values: 'x0=y0=-3', 'x1=y1=3' and 'size_x=size_y=256'.
8483
8484           Example: [#1] image.jpg blur 1 isoline3d 50%
8485                    [#2]                isoline3d                'X=x-w/2;Y=y-
8486       h/2;(X^2+Y^2)%20',10,-10,-10,10,10
8487
8488         isosurface3d (+):
8489             isovalue[%] |
8490             'for‐
8491       mula',value,_x0,_y0,_z0,_x1,_y1,_z1,_size_x>0[%],_size_y>0[%],_size_z>0[%]
8492
8493           Extract 3D isosurfaces with specified value from selected images or
8494       from specified formula.
8495
8496           Default      values:      'x0=y0=z0=-3',      'x1=y1=z1=3'      and
8497       'size_x=size_y=size_z=32'.
8498
8499           Example: [#1]  image.jpg  resize2dy  128  luminance  threshold  50%
8500       expand_z 2,0 blur 1 isosurface3d 50%       mul3d 1,1,30
8501                    [#2] isosurface3d 'x^2+y^2+abs(z)^abs(4*cos(x*y*z*3))',3
8502
8503         label3d:
8504             "text",font_height>=0,_opacity,_color1,...
8505
8506           Generate 3D text label.
8507
8508           Default      values:      'font_height=13',     'opacity=1'     and
8509       'color=255,255,255'.
8510
8511         label_points3d:
8512             _label_size>0,_opacity
8513
8514           Add a numbered label to all vertices of selected 3D objects.
8515
8516           Default values: 'label_size=13' and 'opacity=0.8'.
8517
8518           Example: [#1] torus3d 100,40,6,6 label_points3d 23,1 mode3d 1
8519
8520         lathe3d:
8521             _resolution>0,_smoothness[%]>=0,_max_angle>=0
8522
8523           Generate 3D object from selected binary XY-profiles.
8524
8525           Default    values:    'resolution=128',    'smoothness=0.5%'    and
8526       'max_angle=361'.
8527
8528           Example:  [#1]  300,300  rand  -1,1  blur  40  sign normalize 0,255
8529       lathe3d ,
8530
8531         l3d (+):
8532             Shortcut for command 'light3d'.
8533
8534         light3d (+):
8535             position_x,position_y,position_z |
8536             [texture] |
8537             (no arg)
8538
8539           Set the light coordinates or the light texture for 3D rendering.
8540           (equivalent to shortcut command 'l3d').
8541
8542           (no arg) resets the 3D light to default.
8543
8544           Example: [#1] torus3d  100,30  double3d  0  specs3d  1.2  repeat  5
8545       light3d {$>*100},0,-300 +snapshot3d[0] 400       done remove[0]
8546
8547         line3d:
8548             x0,y0,z0,x1,y1,z1
8549
8550           Input 3D line at specified coordinates.
8551
8552           Example:      [#1]      repeat      100     a={$>*pi/50}     line3d
8553       0,0,0,{cos(3*$a)},{sin(2*$a)},0 color3d. ${-rgb} done add3d
8554
8555         lissajous3d:
8556             resolution>1,a,A,b,B,c,C
8557
8558           Input     3D      lissajous      curves      (x(t)=sin(a*t+A*2*pi),
8559       y(t)=sin(b*t+B*2*pi), z(t)=sin(c*t+C*2*pi)).
8560
8561           Default  values:  'resolution=1024',  'a=2',  'A=0',  'b=1', 'B=0',
8562       'c=0' and 'C=0'.
8563
8564           Example: [#1] lissajous3d ,
8565
8566         m3d (+):
8567             Shortcut for command 'mode3d'.
8568
8569         mode3d (+):
8570             _mode
8571
8572           Set static 3D rendering mode.
8573           (equivalent to shortcut command 'm3d').
8574
8575           'mode' can be { -1=bounding-box | 0=dots | 1=wireframe |  2=flat  |
8576       3=flat-shaded | 4=gouraud-shaded
8577           | 5=phong-shaded }.");
8578           Bounding-box  mode  ('mode==-1') is active only for the interactive
8579       3D viewer.
8580
8581           Default value: 'mode=4'.
8582
8583           Example: [#1] (0,1,2,3,4,5) double3d  0  repeat  w  torus3d  100,30
8584       rotate3d[-1]  1,1,0,60  mode3d  {0,@$>}        snapshot3d[-1]  300 done
8585       remove[0]
8586
8587         md3d (+):
8588             Shortcut for command 'moded3d'.
8589
8590         moded3d (+):
8591             _mode
8592
8593           Set dynamic 3D rendering mode for interactive 3D viewer.
8594           (equivalent to shortcut command 'md3d').
8595
8596           'mode' can be { -1=bounding-box | 0=dots | 1=wireframe |  2=flat  |
8597       3=flat-shaded | 4=gouraud-shaded
8598           | 5=phong-shaded }.
8599
8600           Default value: 'mode=-1'.
8601
8602         *3d (+):
8603             Shortcut for command 'mul3d'.
8604
8605         mul3d (+):
8606             factor |
8607             factor_x,factor_y,_factor_z
8608
8609           Scale  selected  3D  objects isotropically or anisotropically, with
8610       specified factors.
8611           (equivalent to shortcut command '*3d').
8612
8613           Default value: 'factor_z=0'.
8614
8615           Example: [#1] torus3d 5,2 repeat 5 +add3d[-1] 10,0,0 mul3d[-1]  1.2
8616       color3d[-1] ${-rgb} done add3d
8617
8618         n3d:
8619             Shortcut for command 'normalize3d'.
8620
8621         normalize3d:
8622
8623           Normalize selected 3D objects to unit size.
8624           (equivalent to shortcut command 'n3d').
8625
8626           Example:  [#1]  repeat  100  circle3d {u(3)},{u(3)},{u(3)},0.1 done
8627       add3d color3d[-1] 255,0,0        +normalize3d[-1]  color3d[-1]  0,255,0
8628       add3d
8629
8630         o3d (+):
8631             Shortcut for command 'opacity3d'.
8632
8633         opacity3d (+):
8634             _opacity
8635
8636           Set opacity of selected 3D objects.
8637           (equivalent to shortcut command 'o3d').
8638
8639           Default value: 'opacity=1'.
8640
8641           Example:  [#1]  torus3d  100,10  double3d  0 repeat 7 +rotate3d[-1]
8642       1,0,0,20 opacity3d[-1] {u} done add3d
8643
8644         parametric3d:
8645             _x(a,b),_y(a,b),_z(a,b),_amin,_amax,_bmin,_bmax,_res_a>0,_res_b>0,_res_x>0,_res_y>0,_res_z>0,
8646       _smoothness>=0,_isovalue>=0
8647
8648           Input   3D   object  from  specified  parametric  surface  (a,b)  ⟶
8649       (x(a,b),y(a,b),z(a,b)).
8650
8651           Default   values:   'x=(2+cos(b))*sin(a)',   'y=(2+cos(b))*cos(a)',
8652       'c=sin(b)', 'amin=-pi',
8653             'amax=pi',  'bmin=-pi',  'bmax=pi',  'res_a=512',  'res_b=res_a',
8654       'res_x=64', 'res_y=res_x',
8655             'res_z=res_y', 'smoothness=2%' and 'isovalue=10%'.
8656
8657           Example: [#1] parametric3d ,
8658
8659         pca_patch3d:
8660             _patch_size>0,_M>0,_N>0,_normalize_input={  0  |   1   },_normal‐
8661       ize_output={ 0 | 1 },_lambda_xy
8662
8663           Get 3D patch-pca representation of selected images.
8664           The  3D  patch-pca  is estimated from M patches on the input image,
8665       and displayed as a cloud of N 3D
8666           points.
8667
8668           Default  values:  'patch_size=7',  'M=1000',   'N=3000',   'normal‐
8669       ize_input=1', 'normalize_output=0',
8670              and 'lambda_xy=0'.
8671
8672           Example: [#1] image.jpg pca_patch3d 7
8673
8674         plane3d:
8675             _size_x,_size_y,_nb_subdivisions_x>0,_nb_subdisivions_y>0
8676
8677           Input 3D plane at (0,0,0), with specified geometry.
8678
8679           Default   values:   'size_x=1',  'size_y=size_x'  and  'nb_subdivi‐
8680       sions_x=nb_subdivisions_y=24'.
8681
8682           Example: [#1] plane3d 50,30 +primitives3d 1 color3d[-2] ${-rgb}
8683
8684         point3d:
8685             x0,y0,z0
8686
8687           Input 3D point at specified coordinates.
8688
8689           Example:     [#1]     repeat     1000     a={$>*pi/500}     point3d
8690       {cos(3*$a)},{sin(2*$a)},0 color3d[-1] ${-rgb} done add3d
8691
8692         pointcloud3d:
8693
8694           Convert selected planar or volumetric images to 3D point clouds.
8695
8696           Example:  [#1]  image.jpg luminance resize2dy 100 threshold 50% mul
8697       255 pointcloud3d color3d[-1] 255,255,      255
8698
8699         pose3d:
8700             p1,...,p12
8701
8702           Apply 3D pose matrix to selected 3D objects.
8703
8704           Example:         [#1]         torus3d         100,20         pose3d
8705       0.152437,1.20666,-0.546366,0,-0.535962,0.559129,1.08531,0,1.21132,
8706       0.0955431,0.548966,0,0,0,-206,1 snapshot3d 400
8707
8708         p3d:
8709             Shortcut for command 'primitives3d'.
8710
8711         primitives3d:
8712             mode
8713
8714           Convert primitives of selected 3D objects.
8715           (equivalent to shortcut command 'p3d').
8716
8717           'mode' can be { 0=points | 1=outlines | 2=non-textured }.
8718
8719           Example: [#1] sphere3d 30 primitives3d 1 torus3d 50,10  color3d[-1]
8720       ${-rgb} add3d
8721
8722         projections3d:
8723             _x[%],_y[%],_z[%],_is_bounding_box={ 0 | 1 }
8724
8725           Generate  3D  xy,xz,yz  projection planes from specified volumetric
8726       images.
8727
8728         pyramid3d:
8729             width,height
8730
8731           Input 3D pyramid at (0,0,0), with specified geometry.
8732
8733           Example:  [#1]  pyramid3d  100,-100  +primitives3d  1   color3d[-2]
8734       ${-rgb}
8735
8736         quadrangle3d:
8737             x0,y0,z0,x1,y1,z1,x2,y2,z2,x3,y3,z3
8738
8739           Input 3D quadrangle at specified coordinates.
8740
8741           Example:  [#1] quadrangle3d -10,-10,10,10,-10,10,10,10,10,-10,10,10
8742       repeat 10 +rotate3d[-1]  0,1,0,30        color3d[-1]  ${-rgb},0.6  done
8743       add3d mode3d 2
8744
8745         random3d:
8746             nb_points>=0
8747
8748           Input random 3D point cloud in [0,1]^3.
8749
8750           Example: [#1] random3d 100 circles3d 0.1 opacity3d 0.5
8751
8752         rv3d (+):
8753             Shortcut for command 'reverse3d'.
8754
8755         reverse3d (+):
8756
8757           Reverse primitive orientations of selected 3D objects.
8758           (equivalent to shortcut command 'rv3d').
8759
8760           Example: [#1] torus3d 100,40 double3d 0 +reverse3d
8761
8762         r3d (+):
8763             Shortcut for command 'rotate3d'.
8764
8765         rotate3d (+):
8766             u,v,w,angle
8767
8768           Rotate  selected  3D  objects  around specified axis with specified
8769       angle (in deg.).
8770           (equivalent to shortcut command 'r3d').
8771
8772           Example: [#1] torus3d 100,10  double3d  0  repeat  7  +rotate3d[-1]
8773       1,0,0,20 done add3d
8774
8775         rotation3d:
8776             u,v,w,angle
8777
8778           Input 3x3 rotation matrix with specified axis and angle (in deg).
8779
8780           Example:  [#1]  rotation3d  1,0,0,0  rotation3d 1,0,0,90 rotation3d
8781       1,0,0,180
8782
8783         sierpinski3d:
8784             _recursion_level>=0,_width,_height
8785
8786           Input 3d Sierpinski pyramid.
8787
8788           Example: [#1] sierpinski3d 3,100,-100 +primitives3d  1  color3d[-2]
8789       ${-rgb}
8790
8791         size3d:
8792
8793           Return bounding box size of the last selected 3D object.
8794
8795         skeleton3d:
8796             _metric,_frame_type={ 0=squares | 1=diamonds | 2=circles | 3=auto
8797       },_skeleton_opacity,       _frame_opacity,_is_frame_wireframe={ 0 | 1 }
8798
8799           Build 3D skeletal structure object from 2d binary shapes located in
8800       selected images.
8801           'metric' can be { 0=chebyshev | 1=manhattan | 2=euclidean }.
8802
8803           Default  values:  'metric=2',  'bones_type=3', 'skeleton_opacity=1'
8804       and 'frame_opacity=0.1'.
8805
8806           Example: [#1] shape_cupid 480 +skeleton3d ,
8807
8808         snapshot3d:
8809             _size>0,_zoom>=0,_backgroundR,_backgroundG,_backgroundB,_back‐
8810       groundA |
8811             [background_image],zoom>=0
8812
8813           Take 2d snapshots of selected 3D objects.
8814           Set 'zoom' to 0 to disable object auto-scaling.
8815
8816           Default     values:     'size=512',     'zoom=1'     and    '[back‐
8817       ground_image]=(default)'.
8818
8819           Example:  [#1]  torus3d   100,20   rotate3d   1,1,0,60   snapshot3d
8820       400,1.2,128,64,32
8821                    [#2]  torus3d  100,20  rotate3d  1,1,0,60  sample ? +snap‐
8822       shot3d[0] [1],1.2
8823
8824         sl3d (+):
8825             Shortcut for command 'specl3d'.
8826
8827         specl3d (+):
8828             value>=0
8829
8830           Set lightness of 3D specular light.
8831           (equivalent to shortcut command 'sl3d').
8832
8833           Default value: 'value=0.15'.
8834
8835           Example:  [#1]  (0,0.3,0.6,0.9,1.2)   repeat   w   torus3d   100,30
8836       rotate3d[-1]  1,1,0,60  color3d[-1] 255,0,0       specl3d {0,@$>} snap‐
8837       shot3d[-1] 400 done remove[0]
8838
8839         ss3d (+):
8840             Shortcut for command 'specs3d'.
8841
8842         specs3d (+):
8843             value>=0
8844
8845           Set shininess of 3D specular light.
8846           (equivalent to shortcut command 'ss3d').
8847
8848           Default value: 'value=0.8'.
8849
8850           Example:  [#1]  (0,0.3,0.6,0.9,1.2)   repeat   w   torus3d   100,30
8851       rotate3d[-1]  1,1,0,60  color3d[-1] 255,0,0       specs3d {0,@$>} snap‐
8852       shot3d[-1] 400 done remove[0]
8853
8854         sphere3d (+):
8855             radius,_nb_recursions>=0
8856
8857           Input 3D sphere at (0,0,0), with specified geometry.
8858
8859           Default value: 'nb_recursions=3'.
8860
8861           Example: [#1] sphere3d 100 +primitives3d 1 color3d[-2] ${-rgb}
8862
8863         spherical3d:
8864             _nb_azimuth>=3,_nb_zenith>=3,_radius_function(phi,theta)
8865
8866           Input 3D spherical object at (0,0,0), with specified geometry.
8867
8868           Default   values:   'nb_zenith=nb_azimut=64'   and    'radius_func‐
8869       tion="abs(1+0.5*cos(3*phi)*sin(4*thet
8870             a))"'.
8871
8872           Example: [#1] spherical3d 64 +primitives3d 1
8873
8874         spline3d:
8875             x0[%],y0[%],z0[%],u0[%],v0[%],w0[%],x1[%],y1[%],z1[%],u1[%],v1[%],w1[%],_nb_ver‐
8876       tices>=2
8877
8878           Input 3D spline with specified geometry.
8879
8880           Default values: 'nb_vertices=128'.
8881
8882           Example:         [#1]         repeat          100          spline3d
8883       {u},{u},{u},{u},{u},{u},{u},{u},{u},{u},{u},{u},128         color3d[-1]
8884       ${-rgb} done box3d 1 primitives3d[-1] 1 add3d
8885
8886         s3d (+):
8887             Shortcut for command 'split3d'.
8888
8889         split3d (+):
8890             _keep_shared_data={ 0 | 1 }
8891
8892           Split selected 3D objects into 6 feature vectors :
8893           { header, sizes, vertices, primitives, colors, opacities }.
8894           (equivalent to shortcut command 's3d').
8895
8896           To recreate the 3D object, append these 6 images along the y-axis.
8897
8898           Default value: 'keep_shared_data=1'.
8899
8900           Example: [#1] box3d 100 +split3d
8901
8902         sprite3d:
8903
8904           Convert selected images as 3D sprites.
8905           Selected images with alpha channels are managed.
8906
8907           Example: [#1] image.jpg sprite3d
8908
8909         sprites3d:
8910             [sprite],_sprite_has_alpha_channel={ 0 | 1 }
8911
8912           Convert selected 3D objects as a sprite cloud.
8913           Set 'sprite_has_alpha_channel' to 1 to make the last channel of the
8914       selected sprite be a
8915           transparency mask.
8916
8917           Default value: 'mask_has_alpha_channel=0'.
8918
8919           Example:  [#1]  torus3d 100,20 image.jpg resize2dy[-1] 64 100%,100%
8920       gaussian[-1] 30%,30%  *[-1]  255        append[-2,-1]  c  +sprites3d[0]
8921       [1],1 display_rgba[-2]
8922
8923         star3d:
8924             _nb_branches>0,0<=_thickness<=1
8925
8926           Input 3D star at position (0,0,0), with specified geometry.
8927
8928           Default values: 'nb_branches=5' and 'thickness=0.38'.
8929
8930           Example: [#1] star3d , +primitives3d 1 color3d[-2] ${-rgb}
8931
8932         streamline3d (+):
8933             x[%],y[%],z[%],_L>=0,_dl>0,_interpolation,_is_backward={  0  |  1
8934       },_is_oriented={ 0 | 1 } |
8935             'formula',x,y,z,_L>=0,_dl>0,_interpolation,_is_backward={ 0  |  1
8936       },_is_oriented={ 0 | 1 }
8937
8938           Extract  3D  streamlines from selected vector fields or from speci‐
8939       fied formula.
8940           'interpolation' can be { 0=nearest integer | 1=1st-order  |  2=2nd-
8941       order | 3=4th-order }.
8942
8943           Default  values:  'dl=0.1',  'interpolation=2', 'is_backward=0' and
8944       'is_oriented=0'.
8945
8946           Example: [#1] 100,100,100,3 rand -10,10 blur 3 repeat 300  +stream‐
8947       line3d[0] {u(100)},{u(100)},{u(100)},      1000,1,1 color3d[-1] ${-rgb}
8948       done remove[0] box3d 100 primitives3d[-1] 1 add3d
8949
8950         -3d (+):
8951             Shortcut for command 'sub3d'.
8952
8953         sub3d (+):
8954             tx,_ty,_tz
8955
8956           Shift selected 3D objects with the opposite of specified  displace‐
8957       ment vector.
8958           (equivalent to shortcut command '3d').
8959
8960           Default values: 'ty=tz=0'.
8961
8962           Example:  [#1]  sphere3d  10  repeat  5 +sub3d[-1] 10,{u(-10,10)},0
8963       color3d[-1] ${-rgb} done add3d
8964
8965         superformula3d:
8966             resolution>1,m>=1,n1,n2,n3
8967
8968           Input 2D superformula curve as a 3D object.
8969
8970           Default  values:  'resolution=1024',  'm=8',  'n1=1',  'n2=5'   and
8971       'n3=8'.
8972
8973           Example: [#1] superformula3d ,
8974
8975         tensors3d:
8976             _radius_factor>=0,_shape={ 0=box | >=N=ellipsoid },_radius_min>=0
8977
8978           Generate 3D tensor fields from selected images.
8979           when 'shape'>0, it gives the ellipsoid shape precision.
8980
8981           Default values: 'radius_factor=1', 'shape=2' and 'radius_min=0.05'.
8982
8983           Example:   [#1]  6,6,6,9,"U  =  [x,y,z]  -  [w,h,d]/2;  U/=norm(U);
8984       mul(U,U,3) + 0.3*eye(3)" tensors3d 0.8
8985
8986         text_pointcloud3d:
8987             _"text1",_"text2",_smoothness
8988
8989           Input 3D text pointcloud from the two specified strings.
8990
8991           Default  values:  'text1="text1"',  'text2="text2"'  and   'smooth‐
8992       ness=1'.
8993
8994           Example: [#1] text_pointcloud3d "G'MIC","Rocks!"
8995
8996         text3d:
8997             text,_font_height>0,_depth>0,_smoothness
8998
8999           Input a 3D text object from specified text.
9000
9001           Default values: 'font_height=53', 'depth=10' and 'smoothness=1.5'.
9002
9003           Example: [#1] text3d "G'MIC as a 3D logo!"
9004
9005         t3d:
9006             Shortcut for command 'texturize3d'.
9007
9008         texturize3d:
9009             [ind_texture],_[ind_coords]
9010
9011           Texturize  selected  3D  objects with specified texture and coordi‐
9012       nates.
9013           (equivalent to shortcut command 't3d').
9014
9015           When '[ind_coords]' is omitted, default XY  texture  projection  is
9016       performed.
9017
9018           Default value: 'ind_coords=(undefined)'.
9019
9020           Example:   [#1]   image.jpg  torus3d  100,30  texturize3d[-1]  [-2]
9021       keep[-1]
9022
9023         torus3d:
9024             _radius1,_radius2,_nb_subdivisions1>2,_nb_subdivisions2>2
9025
9026           Input 3D torus at (0,0,0), with specified geometry.
9027
9028           Default values: 'radius1=1',  'radius2=0.3',  'nb_subdivisions1=24'
9029       and 'nb_subdivisions2=12'.
9030
9031           Example: [#1] torus3d 10,3 +primitives3d 1 color3d[-2] ${-rgb}
9032
9033         triangle3d:
9034             x0,y0,z0,x1,y1,z1,x2,y2,z2
9035
9036           Input 3D triangle at specified coordinates.
9037
9038           Example:     [#1]     repeat     100     a={$>*pi/50}    triangle3d
9039       0,0,0,0,0,3,{cos(3*$a)},{sin(2*$a)},0  color3d[-1]        ${-rgb}  done
9040       add3d
9041
9042         volume3d:
9043
9044           Transform  selected  3D  volumetric  images  as 3D parallelepipedic
9045       objects.
9046
9047           Example: [#1] image.jpg animate blur,0,5,30 append z volume3d
9048
9049         weird3d:
9050             _resolution>0
9051
9052           Input 3D weird object at (0,0,0), with specified resolution.
9053
9054           Default value: 'resolution=32'.
9055
9056           Example: [#1] weird3d 48 +primitives3d 1 color3d[-2] ${-rgb}
9057
9058         12.13. Control Flow
9059                ------------
9060
9061         ap:
9062             Shortcut for command 'apply_parallel'.
9063
9064         apply_parallel:
9065             "command"
9066
9067           Apply specified command on each of the selected images,  by  paral‐
9068       lelizing it for all image of the
9069           list.
9070           (equivalent to shortcut command 'ap').
9071
9072           Example: [#1] image.jpg +mirror x +mirror y apply_parallel "blur 3"
9073
9074         apc:
9075             Shortcut for command 'apply_parallel_channels'.
9076
9077         apply_parallel_channels:
9078             "command"
9079
9080           Apply  specified  command on each of the selected images, by paral‐
9081       lelizing it for all channel
9082           of the images independently.
9083           (equivalent to shortcut command 'apc').
9084
9085           Example: [#1] image.jpg apply_parallel_channels "blur 3"
9086
9087         apo:
9088             Shortcut for command 'apply_parallel_overlap'.
9089
9090         apply_parallel_overlap:
9091             "command",overlap[%],nb_threads={ 0=auto | 1 | 2 | 4 | 8 | 16 }
9092
9093           Apply specified command on each of the selected images,  by  paral‐
9094       lelizing it on 'nb_threads'
9095           overlapped sub-images.
9096           (equivalent to shortcut command 'apo').
9097
9098           'nb_threads' must be a power of 2.
9099
9100           Default values: 'overlap=0','nb_threads=0'.
9101
9102           Example: [#1] image.jpg +apply_parallel_overlap "smooth 500,0,1",1
9103
9104         at:
9105             Shortcut for command 'apply_tiles'.
9106
9107         apply_tiles:
9108             "com‐
9109       mand",_tile_width[%]>0,_tile_height[%]>0,_tile_depth[%]>0,_over‐
9110       lap_width[%]>=0,                           _overlap_height[%]>=0,_over‐
9111       lap_depth[%]>=0,_boundary_conditions={  0=dirichlet   |   1=neumann   |
9112       2=periodic | 3=mirror }
9113
9114           Apply specified command on each tile (neighborhood) of the selected
9115       images, eventually with
9116           overlapping tiles.
9117           (equivalent to shortcut command 'at').
9118
9119           Default values: 'tile_width=tile_height=tile_depth=10%',
9120             'overlap_width=overlap_height=overlap_depth=0' and 'boundary_con‐
9121       ditions=1'.
9122
9123           Example:  [#1] image.jpg +equalize[0] 256 +apply_tiles[0] "equalize
9124       256",16,16,1,50%,50%
9125
9126         apply_timeout:
9127             "command",_timeout={ 0=no timeout | >0=with specified timeout (in
9128       seconds) }
9129
9130           Apply a command with a timeout.
9131           Set  variable '$_is_timeout' to '1' if timeout occurred, '0' other‐
9132       wise.
9133
9134           Default value: 'timeout=20'.
9135
9136         check (+):
9137             condition
9138
9139           Evaluate specified condition and display an error message if evalu‐
9140       ated to false.
9141           If 'expression' is not a math expression, it is regarded as a file‐
9142       name and checked if it exists.
9143
9144         check3d (+):
9145             _is_full_check={ 0 | 1 }
9146
9147           Check validity of selected 3D vector objects, and display an  error
9148       message
9149           if one of the selected images is not a valid 3D vector object.
9150           Full 3D object check is slower but more precise.
9151
9152           Default value: 'is_full_check=1'.
9153
9154         check_display:
9155
9156           Check if a display is available, and throw an error otherwise.
9157
9158         continue (+):
9159
9160           Go to end of current 'repeat...done', 'do...while' or 'local...end‐
9161       local' block.
9162
9163           Example: [#1] image.jpg repeat 10 blur 1 if 1==1 continue fi deform
9164       10 done
9165
9166         break (+):
9167
9168           Break  current  'repeat...done', 'do...while' or 'local...endlocal'
9169       block.
9170
9171           Example: [#1] image.jpg repeat 10 blur 1 if 1==1 break fi deform 10
9172       done
9173
9174         do (+):
9175
9176           Start a 'do...while' block.
9177
9178           Example:    [#1]    image.jpg    luminance    i={ia+2}    do    set
9179       255,{u(100)}%,{u(100)}% while ia<$i
9180
9181         done (+):
9182
9183           End a 'repeat/for...done' block, and go to associated  'repeat/for'
9184       position, if iterations remain.
9185
9186         elif (+):
9187             condition
9188
9189           Start  a  'elif...[else]...fi' block if previous 'if' was not veri‐
9190       fied
9191           and test if specified condition holds
9192           'condition' is  a  mathematical  expression,  whose  evaluation  is
9193       interpreted as { 0=false | other=true
9194           }..
9195
9196         else (+):
9197
9198           Execute  following  commands  if previous 'if' or 'elif' conditions
9199       failed.
9200
9201         fi (+):
9202
9203           End a 'if...[elif]...[else]...fi' block.
9204           (equivalent to shortcut command 'fi').
9205
9206         endl (+):
9207             Shortcut for command 'endlocal'.
9208
9209         endlocal (+):
9210
9211           End a 'local...endlocal' block.
9212           (equivalent to shortcut command 'endl').
9213
9214         error (+):
9215             message
9216
9217           Print specified error message on the standard  error  (stderr)  and
9218       exit interpreter, except
9219           if error is caught by a 'onfail' command.
9220           Command  selection  (if any) stands for displayed call stack subset
9221       instead of image indices.
9222
9223         eval (+):
9224             expression
9225
9226           Evaluate specified math expression.
9227           * If no command selection is specified, the expression is evaluated
9228       once and its result is set to
9229           status.
9230           *  If command selection is specified, the evaluation is looped over
9231       selected images. Status is not
9232           modified.
9233             (in this latter case, 'eval' is similar to 'fill' without assign‐
9234       ing the image values).
9235
9236         x (+):
9237             Shortcut for command 'exec'.
9238
9239         exec (+):
9240             _is_verbose={ 0 | 1 },"command"
9241
9242           Execute external command using a system call.
9243           The status value is then set to the error code returned by the sys‐
9244       tem call.
9245           If 'is_verbose=1', the executed command is  allowed  to  output  on
9246       stdout/stderr.
9247           (equivalent to shortcut command 'x').
9248
9249           Default value: 'is_verbose=1'.
9250
9251         for (+):
9252             condition
9253
9254           Start a 'for...done' block.
9255
9256           Example:  [#1]  image.jpg  resize2dy  32 400,400,1,3 x=0 for $x<400
9257       image[1] [0],$x,$x x+=40 done
9258
9259         if (+):
9260             condition
9261
9262           Start a 'if...[elif]...[else]...fi' block  and  test  if  specified
9263       condition holds.
9264           'condition'  is  a  mathematical  expression,  whose  evaluation is
9265       interpreted as { 0=false | other=true
9266           }.
9267
9268           Example: [#1] image.jpg if ia<64 add 50% elif ia<128 add  25%  elif
9269       ia<192 sub 25% else sub 50% fi cut 0,      255
9270
9271         l (+):
9272             Shortcut for command 'local'.
9273
9274         local (+):
9275
9276           Start a 'local...[onfail]...endlocal' block, with selected images.
9277           (equivalent to shortcut command 'l').
9278
9279           Example:  [#1]  image.jpg  local[] 300,300,1,3 rand[0] 0,255 blur 4
9280       sharpen 1000 endlocal
9281                    [#2] image.jpg +local repeat 3 deform 20 done endlocal
9282
9283           Tutorial: https://gmic.eu/tutorial/_local.shtml
9284
9285         mutex (+):
9286             index,_action={ 0=unlock | 1=lock }
9287
9288           Lock or unlock specified mutex for multi-threaded programming.
9289           A locked mutex can be unlocked only by the same thread. All mutexes
9290       are unlocked by default.
9291           'index' designates the mutex index, in [0,255].
9292
9293           Default value: 'action=1'.
9294
9295         noarg (+):
9296
9297           Used  in a custom command, 'noarg' tells the command that its argu‐
9298       ment list have not been used
9299           finally, and so they must be evaluated next in the G'MIC  pipeline,
9300       just as if the custom
9301           command takes no arguments at all.
9302           Use  this  command to write a custom command which can decide if it
9303       takes arguments or not.
9304
9305         onfail (+):
9306
9307           Execute following commands when an error is encountered in the body
9308       of the 'local...endlocal' block.
9309           The status value is set with the corresponding error message.
9310
9311           Example: [#1] image.jpg +local blur -3 onfail mirror x endlocal
9312
9313         parallel (+):
9314             _wait_threads,"command1","command2",...
9315
9316           Execute specified commands in parallel, each in a different thread.
9317           Parallel threads share the list of images.
9318           'wait_threads' can be { 0=when current environment ends | 1=immedi‐
9319       ately }.
9320
9321           Default value: 'wait_threads=1'.
9322
9323           Example: [#1] image.jpg [0] parallel "blur[0] 3","mirror[1] c"
9324
9325         progress (+):
9326             0<=value<=100 |
9327             -1
9328
9329           Set the progress index of the current processing pipeline.
9330           This command is useful only when G'MIC  is  used  by  an  embedding
9331       application.
9332
9333         q (+):
9334             Shortcut for command 'quit'.
9335
9336         quit (+):
9337
9338           Quit G'MIC interpreter.
9339           (equivalent to shortcut command 'q').
9340
9341         repeat (+):
9342             nb_iterations,_variable_name
9343
9344           Start 'nb_iterations' iterations of a 'repeat...done' block.
9345           'nb_iterations'  is  a  mathematical expression that will be evalu‐
9346       ated.
9347
9348           Example: [#1] image.jpg split y repeat  $!,n  shift[$n]  $<,0,0,0,2
9349       done append y
9350                    [#2]  image.jpg  mode3d  2  repeat  4 imagecube3d rotate3d
9351       1,1,0,40 snapshot3d 400,1.4 done
9352
9353           Tutorial: https://gmic.eu/tutorial/_repeat.shtml
9354
9355         return (+):
9356
9357           Return from current custom command.
9358
9359         rprogress:
9360             0<=value<=100          |           -1           |           "com‐
9361       mand",0<=value_min<=100,0<=value_max<=100
9362
9363           Set  the  progress  index of the current processing pipeline (rela‐
9364       tively to
9365           previously defined progress bounds), or call the specified  command
9366       with
9367           specified progress bounds.
9368
9369         run:
9370             "G'MIC pipeline"
9371
9372           Run specified G'MIC pipeline.
9373           This  is  only  useful  when used from a shell, e.g. to avoid shell
9374       substitutions to happen in argument.
9375
9376         skip (+):
9377             item
9378
9379           Do nothing but skip specified item.
9380
9381         u (+):
9382             Shortcut for command 'status'.
9383
9384         status (+):
9385             status_string
9386
9387           Set the current status. Used to define a  returning  value  from  a
9388       function.
9389           (equivalent to shortcut command 'u').
9390
9391           Example:  [#1]  image.jpg  command  "foo : u0=Dark u1=Bright status
9392       ${u{ia>=128}}" text_outline ${-foo},2,2,      23,2,1,255
9393
9394         while (+):
9395             condition
9396
9397           End a 'do...while' block and go back to associated 'do'  if  speci‐
9398       fied condition holds.
9399           'condition'  is  a  mathematical  expression,  whose  evaluation is
9400       interpreted as { 0=false | other=true
9401           }.
9402
9403         12.14. Arrays, Tiles and Frames
9404                ------------------------
9405
9406         array:
9407             M>0,_N>0,_expand_type={ 0=min | 1=max | 2=all }
9408
9409           Create MxN array from selected images.
9410
9411           Default values: 'N=M' and 'expand_type=0'.
9412
9413           Example: [#1] image.jpg array 3,2,2
9414
9415         array_fade:
9416             M>0,_N>0,0<=_fade_start<=100,0<=_fade_end<=100,_expand_type={0=min
9417       | 1=max | 2=all}
9418
9419           Create MxN array from selected images.
9420
9421           Default   values:   'N=M',   'fade_start=60',   'fade_end=90'   and
9422       'expand_type=1'.
9423
9424           Example: [#1] image.jpg array_fade 3,2
9425
9426         array_mirror:
9427             N>=0,_dir={ 0=x | 1=y | 2=xy | 3=tri-xy },_expand_type={ 0 | 1 }
9428
9429           Create 2^Nx2^N array from selected images.
9430
9431           Default values: 'dir=2' and 'expand_type=0'.
9432
9433           Example: [#1] image.jpg array_mirror 2
9434
9435         array_random:
9436             Ms>0,_Ns>0,_Md>0,_Nd>0
9437
9438           Create MdxNd array of tiles from selected MsxNs source arrays.
9439
9440           Default values: 'Ns=Ms', 'Md=Ms' and 'Nd=Ns'.
9441
9442           Example: [#1] image.jpg +array_random 8,8,15,10
9443
9444         frame:
9445             Shortcut for command 'frame_xy'.
9446
9447         frame_blur:
9448             _sharpness>0,_size>=0,_smoothness,_shading,_blur
9449
9450           Draw RGBA-colored round frame in selected images.
9451
9452           Default values: 'sharpness=10', 'size=30',  'smoothness=0',  'shad‐
9453       ing=1' and 'blur=3%'.
9454
9455           Example: [#1] image.jpg frame_blur 3,30,8,10%
9456
9457         frame_cube:
9458             _depth>=0,_centering_x,_centering_y,_left_side={0=normal | 1=mir‐
9459       ror-x          |          2=mirror-y          |           3=mirror-xy},
9460       _right_side,_lower_side,_upper_side
9461
9462           Insert 3D frames in selected images.
9463
9464           Default    values:   'depth=1',   'centering_x=centering_y=0'   and
9465       'left_side=right_side,
9466             lower_side=upper_side=0'.
9467
9468           Example: [#1] image.jpg frame_cube ,
9469
9470         frame_fuzzy:
9471             size_x[%]>=0,_size_y[%]>=0,_fuzzyness>=0,_smooth‐
9472       ness[%]>=0,_R,_G,_B,_A
9473
9474           Draw RGBA-colored fuzzy frame in selected images.
9475
9476           Default  values: 'size_y=size_x', 'fuzzyness=5', 'smoothness=1' and
9477       'R=G=B=A=255'.
9478
9479           Example: [#1] image.jpg frame_fuzzy 20
9480
9481         frame_painting:
9482             _size[%]>=0,0<=_contrast<=1,_profile_smooth‐
9483       ness[%]>=0,_R,_G,_B,_vignette_size[%]>=0,                _vignette_con‐
9484       trast>=0,_defects_contrast>=0,0<=_defects_den‐
9485       sity<=100,_defects_size>=0,                            _defects_smooth‐
9486       ness[%]>=0,_serial_number
9487
9488           Add a painting frame to selected images.
9489
9490           Default  values:   'size=10%',   'contrast=0.4',   'profile_smooth‐
9491       ness=6%', 'R=225', 'G=200',
9492             'B=120',       'vignette_size=2%',       'vignette_contrast=400',
9493       'defects_contrast=50', 'defects_density=10',
9494             'defects_size=1',  'defects_smoothness=0.5%'   and   'serial_num‐
9495       ber=123456789'.
9496
9497           Example: [#1] image.jpg frame_painting ,
9498
9499         frame_pattern:
9500             M>=3,_constrain_size={ 0 | 1 } |
9501             M>=3,_[frame_image],_constrain_size={ 0 | 1 }
9502
9503           Insert selected pattern frame in selected images.
9504
9505           Default values: 'pattern=0' and 'constrain_size=0'.
9506
9507           Example: [#1] image.jpg frame_pattern 8
9508
9509         frame_round:
9510             _sharpness>0,_size>=0,_smoothness,_shading,_R,_G,_B,_A
9511
9512           Draw RGBA-colored round frame in selected images.
9513
9514           Default  values:  'sharpness=10', 'size=10', 'smoothness=0', 'shad‐
9515       ing=0' and 'R=G=B=A=255'.
9516
9517           Example: [#1] image.jpg frame_round 10
9518
9519         frame_seamless:
9520             frame_size>=0,_patch_size>0,_blend_size>=0,_frame_direction={
9521       0=inner (preserve image size) |        1=outer }
9522
9523           Insert frame in selected images, so that tiling the resulting image
9524       makes less visible seams.
9525
9526           Default values: 'patch_size=7',  'blend_size=5'  and  'frame_direc‐
9527       tion=1'.
9528
9529           Example: [#1] image.jpg +frame_seamless 30 array 2,2
9530
9531         frame_x:
9532             size_x[%],_col1,...,_colN
9533
9534           Insert colored frame along the x-axis in selected images.
9535
9536           Default values: 'col1=col2=col3=255' and 'col4=255'.
9537
9538           Example: [#1] image.jpg frame_x 20,255,0,255
9539
9540         frame_xy:
9541             size_x[%],_size_y[%],_col1,...,_colN
9542
9543           Insert colored frame along the x-axis in selected images.
9544
9545           Default    values:    'size_y=size_x',   'col1=col2=col3=255'   and
9546       'col4=255'.
9547           (equivalent to shortcut command 'frame').
9548
9549           Example: [#1] image.jpg frame_xy 1,1,0 frame_xy 20,10,255,0,255
9550
9551         frame_xyz:
9552             size_x[%],_size_y[%],_size_z[%]_col1,...,_colN
9553
9554           Insert colored frame along the x-axis in selected images.
9555
9556           Default values:  'size_y=size_x=size_z',  'col1=col2=col3=255'  and
9557       'col4=255'.
9558
9559         frame_y:
9560             size_y[%],_col1,...,_colN
9561
9562           Insert colored frame along the y-axis in selected images.
9563
9564           Default values: 'col1=col2=col3=255' and 'col4=255'.
9565
9566           Example: [#1] image.jpg frame_y 20,255,0,255
9567
9568         img2ascii:
9569             _charset,_analysis_scale>0,_analysis_smoothness[%]>=0,_synthe‐
9570       sis_scale>0,_output_ascii_filename
9571
9572           Render selected images as binary ascii art.
9573           This command returns the  corresponding  the  list  of  widths  and
9574       heights (expressed as a number of
9575           characters)
9576           for each selected image.
9577
9578           Default  values:  'charset=[ascii  charset]',  'analysis_scale=16',
9579       'analysis_smoothness=20%',
9580             'synthesis_scale=16' and '_output_ascii_filename=[undefined]'.
9581
9582           Example: [#1] image.jpg img2ascii ,
9583
9584         imagegrid:
9585             M>0,_N>0
9586
9587           Create MxN image grid from selected images.
9588
9589           Default value: 'N=M'.
9590
9591           Example: [#1] image.jpg imagegrid 16
9592
9593         imagegrid_hexagonal:
9594             _resolution>0,0<=_outline<=1
9595
9596           Create hexagonal grids from selected images.
9597
9598           Default     values:     'resolution=32',     'outline=0.1'      and
9599       'is_antialiased=1'.
9600
9601           Example: [#1] image.jpg imagegrid_hexagonal 24
9602
9603         imagegrid_triangular:
9604             pattern_width>=1,_pattern_height>=1,_pattern_type,0<=_out‐
9605       line_opacity<=1,_outline_color1,...
9606
9607           Create triangular grids from selected images.
9608           'pattern type' can be { 0=horizontal |  1=vertical  |  2=crossed  |
9609       3=cube | 4=decreasing |
9610           5=increasing }.
9611
9612           Default values: 'pattern_width=24', 'pattern_height=pattern_width',
9613       'pattern_type=0',
9614             'outline_opacity=0.1' and 'outline_color1=0'.
9615
9616           Example: [#1] image.jpg imagegrid_triangular 6,10,3,0.5
9617
9618         linearize_tiles:
9619             M>0,_N>0
9620
9621           Linearize MxN tiles on selected images.
9622
9623           Default value: 'N=M'.
9624
9625           Example: [#1] image.jpg +linearize_tiles 16
9626
9627         map_sprites:
9628             _nb_sprites>=1,_allow_rotation={ 0=none | 1=90 deg. | 2=180  deg.
9629       }
9630
9631           Map  set  of  sprites (defined as the 'nb_sprites' latest images of
9632       the selection) to other selected
9633           images,
9634           according to the luminosity of their pixel values.
9635
9636           Example:   [#1]   image.jpg   resize2dy   48   repeat    16    ball
9637       {8+2*$>},${-rgb} mul[-1] {(1+$>)/16} done       map_sprites 16
9638
9639         pack:
9640             is_ratio_constraint={ 0 | 1 },_sort_criterion
9641
9642           Pack selected images into a single image.
9643           The returned status contains the list of new (x,y) offsets for each
9644       input image.
9645           Parameter 'is_ratio_constraint' tells if the resulting  image  must
9646       tend to a square image.
9647
9648           Default    values:    'is_ratio_constraint=0'    and   'sort_crite‐
9649       rion=max(w,h)'.
9650
9651           Example:  [#1]  image.jpg  repeat  10   +resize2dx[-1]   75%   bal‐
9652       ance_gamma[-1] ${-rgb} done pack 0
9653
9654         puzzle:
9655             _width>0,_height>0,_M>=1,_N>=1,_curvature,_centering,_connec‐
9656       tors_variability,_resolution>=1
9657
9658           Input puzzle binary mask with specified size and geometry.
9659
9660           Default values: 'width=height=512', 'M=N=5', 'curvature=0.5', 'cen‐
9661       tering=0.5',
9662             'connectors_variability=0.5' and 'resolution=64'.
9663
9664           Example: [#1] puzzle ,
9665
9666         quadratize_tiles:
9667             M>0,_N>0
9668
9669           Quadratize MxN tiles on selected images.
9670
9671           Default value: 'N=M'.
9672
9673           Example: [#1] image.jpg +quadratize_tiles 16
9674
9675         rotate_tiles:
9676             angle,_M>0,N>0
9677
9678           Apply MxN tiled-rotation effect on selected images.
9679
9680           Default values: 'M=8' and 'N=M'.
9681
9682           Example: [#1] image.jpg to_rgba rotate_tiles 10,8 drop_shadow 10,10
9683       display_rgba
9684
9685         shift_tiles:
9686             M>0,_N>0,_amplitude
9687
9688           Apply MxN tiled-shift effect on selected images.
9689
9690           Default values: 'N=M' and 'amplitude=20'.
9691
9692           Example: [#1] image.jpg +shift_tiles 8,8,10
9693
9694         taquin:
9695             M>0,_N>0,_remove_tile={ 0=none |  1=first  |  2=last  |  3=random
9696       },_relief,_border_thickness[%],       _border_outline[%],_outline_color
9697
9698           Create MxN taquin puzzle from selected images.
9699
9700           Default  value:  'N=M',  'relief=50',  'border_thickness=5',  'bor‐
9701       der_outline=0' and
9702             'remove_tile=0'.
9703
9704           Example: [#1] image.jpg +taquin 8
9705
9706         tunnel:
9707             _level>=0,_factor>0,_centering_x,_centering_y,_opacity,_angle
9708
9709           Apply tunnel effect on selected images.
9710
9711           Default  values:  'level=9',   'factor=80%',   'centering_x=center‐
9712       ing_y=0.5', 'opacity=1' and
9713             'angle=0'
9714
9715           Example: [#1] image.jpg tunnel 20
9716
9717         12.15. Artistic
9718                --------
9719
9720         boxfitting:
9721             _min_box_size>=1,_max_box_size>=0,_initial_den‐
9722       sity>=0,_nb_attempts>=1
9723
9724           Apply box fitting effect on selected images, as displayed  the  web
9725       page:
9726           [http://www.complexification.net/gallery/machines/boxFittingImg/]
9727
9728           Default  values:  'min_box_size=1', 'max_box_size=0', 'initial_den‐
9729       sity=0.1' and 'nb_attempts=3'.
9730
9731           Example: [#1] image.jpg boxfitting ,
9732
9733         brushify:
9734             [brush],_brush_nb_sizes>=1,0<=_brush_min_size_fac‐
9735       tor<=1,_brush_nb_orientations>=1,_brush_light_type,
9736       0<=_brush_light_strength<=1,_brush_opacity,_painting_density[%]>=0,
9737       0<=_painting_contours_coherence<=1,0<=_painting_orientation_coher‐
9738       ence<=1,               _painting_coherence_alpha[%]>=0,_painting_coher‐
9739       ence_sigma[%]>=0,_painting_primary_angle,       0<=_painting_angle_dis‐
9740       persion<=1
9741
9742           Apply specified brush to create  painterly  versions  of  specified
9743       images.
9744           'brush_light_type'  can be { 0=none | 1=flat | 2=darken | 3=lighten
9745       | 4=full }.
9746
9747           Default values:  'brush_nb_sizes=3',  'brush_min_size_factor=0.66',
9748       'brush_nb_orientations=12',
9749             'brush_light_type=0',  'brush_light_strength=0.25',  'brush_opac‐
9750       ity=0.8', 'painting_density=20%',
9751             'painting_contours_coherence=0.9',   'painting_orientation_coher‐
9752       ence=0.9',
9753             'painting_coherence_alpha=1',       'painting_coherence_sigma=1',
9754       'painting_primary_angle=0',
9755             'painting_angle_dispersion=0.2'
9756
9757           Example: [#1] image.jpg 40,40  gaussian[-1]  10,4  spread[-1]  10,0
9758       brushify[0] [1],1
9759
9760         cartoon:
9761             _smoothness,_sharpening,_threshold>=0,_thick‐
9762       ness>=0,_color>=0,quantization>0
9763
9764           Apply cartoon effect on selected images.
9765
9766           Default values: 'smoothness=3',  'sharpening=150',  'threshold=20',
9767       'thickness=0.25',
9768             'color=1.5' and 'quantization=8'.
9769
9770           Example: [#1] image.jpg cartoon 3,50,10,0.25,3,16
9771
9772         color_ellipses:
9773             _count>0,_radius>=0,_opacity>=0
9774
9775           Add random color ellipses to selected images.
9776
9777           Default values: 'count=400', 'radius=5' and 'opacity=0.1'.
9778
9779           Example: [#1] image.jpg +color_ellipses ,,0.15
9780
9781         cubism:
9782             _density>=0,0<=_thickness<=50,_max_angle,_opacity,_smoothness>=0
9783
9784           Apply cubism effect on selected images.
9785
9786           Default   values:   'density=50',  'thickness=10',  'max_angle=75',
9787       'opacity=0.7' and
9788             'smoothness=0'.
9789
9790           Example: [#1] image.jpg cubism ,
9791
9792         draw_whirl:
9793             _amplitude>=0
9794
9795           Apply whirl drawing effect on selected images.
9796
9797           Default value: 'amplitude=100'.
9798
9799           Example: [#1] image.jpg draw_whirl ,
9800
9801         drawing:
9802             _amplitude>=0
9803
9804           Apply drawing effect on selected images.
9805
9806           Default value: 'amplitude=200'.
9807
9808           Example: [#1] image.jpg +drawing ,
9809
9810         drop_shadow:
9811             _offset_x[%],_offset_y[%],_smoothness[%]>=0,0<=_curva‐
9812       ture<=1,_expand_size={ 0 | 1 }
9813
9814           Drop shadow behind selected images.
9815
9816           Default values: 'offset_x=20', 'offset_y=offset_x', 'smoothness=5',
9817       'curvature=0' and
9818             'expand_size=1'.
9819
9820           Example: [#1] image.jpg drop_shadow 10,20,5,0.5 expand_xy 20,0 dis‐
9821       play_rgba
9822
9823         ellipsionism:
9824             _R>0[%],_r>0[%],_smoothness>=0[%],_opacity,_outline>0,_density>0
9825
9826           Apply ellipsionism filter to selected images.
9827
9828           Default  values:  'R=10',  'r=3',  'smoothness=1%',  'opacity=0.7',
9829       'outline=8' and 'density=0.6'.
9830
9831           Example: [#1] image.jpg ellipsionism ,
9832
9833         fire_edges:
9834             _edges>=0,0<=_attenuation<=1,_smoothness>=0,_thresh‐
9835       old>=0,_nb_frames>0,_starting_frame>=0,       frame_skip>=0
9836
9837           Generate fire effect from edges of selected images.
9838
9839           Default  values: 'edges=0.7', 'attenuation=0.25', 'smoothness=0.5',
9840       'threshold=25',
9841             'nb_frames=1', 'starting_frame=20' and 'frame_skip=0'.
9842
9843           Example: [#1] image.jpg fire_edges ,
9844
9845         fractalize:
9846             0<=detail_level<=1
9847
9848           Randomly fractalize selected images.
9849
9850           Default value: 'detail_level=0.8'
9851
9852           Example: [#1] image.jpg fractalize ,
9853
9854         glow:
9855             _amplitude>=0
9856
9857           Add soft glow on selected images.
9858
9859           Default value: 'amplitude=1%'.
9860
9861           Example: [#1] image.jpg glow ,
9862
9863         halftone:
9864             nb_levels>=2,_size_dark>=2,_size_bright>=2,_shape={  0=square   |
9865       1=diamond | 2=circle | 3=inv-square        | 4=inv-diamond | 5=inv-cir‐
9866       cle },_smoothness[%]>=0
9867
9868           Apply halftone dithering to selected images.
9869
9870           Default  values:  'nb_levels=5',  'size_dark=8',   'size_bright=8',
9871       'shape=5' and 'smoothnesss=0'.
9872
9873           Example: [#1] image.jpg halftone ,
9874
9875         hardsketchbw:
9876             _amplitude>=0,_density>=0,_opacity,0<=_edge_thresh‐
9877       old<=100,_is_fast={ 0 | 1 }
9878
9879           Apply hard B&W sketch effect on selected images.
9880
9881           Default  values:  'amplitude=1000',  'sampling=3',   'opacity=0.1',
9882       'edge_threshold=20' and
9883             'is_fast=0'.
9884
9885           Example:  [#1]  image.jpg  +hardsketchbw 200,70,0.1,10 median[-1] 2
9886       +local reverse blur[-1] 3 blend[-2,-1]       overlay endlocal
9887
9888         hearts:
9889             _density>=0
9890
9891           Apply heart effect on selected images.
9892
9893           Default value: 'density=10'.
9894
9895           Example: [#1] image.jpg hearts ,
9896
9897         houghsketchbw:
9898             _density>=0,_radius>0,0<=_threshold<=100,0<=_opacity<=1,_vote‐
9899       size[%]>0
9900
9901           Apply hough B&W sketch effect on selected images.
9902
9903           Default  values: 'density=100', 'radius=3', 'threshold=100', 'opac‐
9904       ity=0.1' and 'votesize=100%'.
9905
9906           Example: [#1] image.jpg +houghsketchbw ,
9907
9908         lightrays:
9909             100<=_density<=0,_center_x[%],_cen‐
9910       ter_y[%],_ray_length>=0,_ray_attenuation>=0
9911
9912           Generate ray lights from the edges of selected images.
9913
9914           Default   values:  'density=50%',  'center_x=50%',  'center_y=50%',
9915       'ray_length=0.9' and
9916             'ray_attenuation=0.5'.
9917
9918           Example: [#1] image.jpg +lightrays , + cut 0,255
9919
9920         light_relief:
9921             _ambient_light,_specular_lightness,_specular_size,_dark‐
9922       ness,_light_smoothness,_xl,_yl,_zl,_zscale,                      _opac‐
9923       ity_is_heightmap={ 0 | 1 }
9924
9925           Apply relief light to selected images.
9926           Default values(s) : 'ambient_light=0.3',  'specular_lightness=0.5',
9927       'specular_size=0.2',
9928           'darkness=0', 'xl=0.2', 'yl=zl=0.5',
9929           'zscale=1', 'opacity=1' and 'opacity_is_heightmap=0'.
9930
9931           Example: [#1] image.jpg blur 2 light_relief 0.3,4,0.1,0
9932
9933         linify:
9934             0<=_density<=100,_spreading>=0,_resolution[%]>0,_line_opac‐
9935       ity>=0,_line_precision>0,_mode={        0=subtractive | 1=additive }
9936
9937           Apply linify effect on selected images.
9938           The algorithm is inspired from the one  described  on  the  webpage
9939       'http://linify.me/about'.
9940
9941           Default   values:  'density=50',  'spreading=2',  'resolution=40%',
9942       'line_opacity=10',
9943             'line_precision=24' and 'mode=0'.
9944
9945           Example: [#1] image.jpg linify 60
9946
9947         mosaic:
9948             0<=_density<=100
9949
9950           Create random mosaic from selected images.
9951
9952           Default values: 'density=30'.
9953
9954           Example:   [#1]   image.jpg   mosaic   ,    +fill    "I!=J(1)    ||
9955       I!=J(0,1)?[0,0,0]:I"
9956
9957         old_photo:
9958
9959           Apply old photo effect on selected images.
9960
9961           Example: [#1] image.jpg old_photo
9962
9963         pencilbw:
9964             _size>=0,_amplitude>=0
9965
9966           Apply B&W pencil effect on selected images.
9967
9968           Default values: 'size=0.3' and 'amplitude=60'.
9969
9970           Example: [#1] image.jpg pencilbw ,
9971
9972         pixelsort:
9973             _ordering={  + | - },_axis={ x | y | z | xy | yx },_[sorting_cri‐
9974       terion],_[mask]
9975
9976           Apply a 'pixel sorting' algorithm on selected images, as  described
9977       in the page :
9978           http://satyarth.me/articles/pixel-sorting/
9979
9980           Default   values:   'ordering=+',   'axis=x'   and  'sorting_crite‐
9981       rion=mask=(undefined)'.
9982
9983           Example: [#1] image.jpg +norm +ge[-1] 30% +pixelsort[0] +,y,[1],[2]
9984
9985         polaroid:
9986             _size1>=0,_size2>=0
9987
9988           Create polaroid effect in selected images.
9989
9990           Default values: 'size1=10' and 'size2=20'.
9991
9992           Example: [#1] image.jpg to_rgba polaroid 5,30 rotate 20 drop_shadow
9993       , drgba
9994
9995         polygonize:
9996             _warp_amplitude>=0,_smoothness[%]>=0,_min_area[%]>=0,_resolu‐
9997       tion_x[%]>0,_resolution_y[%]>0
9998
9999           Apply polygon effect on selected images.
10000
10001           Default     values:     'warp_amplitude=300',      'smoothness=2%',
10002       'min_area=0.1%',
10003             'resolution_x=resolution_y=10%'.
10004
10005           Example:  [#1] image.jpg image.jpg polygonize 100,10 +fill "I!=J(1)
10006       || I!=J(0,1)?[0,0,0]:I"
10007
10008         poster_edges:
10009             0<=_edge_threshold<=100,0<=_edge_shade<=100,_edge_thick‐
10010       ness>=0,_edge_antialiasing>=0,        0<=_posterization_level<=15,_pos‐
10011       terization_antialiasing>=0
10012
10013           Apply poster edges effect on selected images.
10014
10015           Default values: 'edge_threshold=40',  'edge_shade=5',  'edge_thick‐
10016       ness=0.5',
10017             'edge_antialiasing=10',  'posterization_level=12' and 'posteriza‐
10018       tion_antialiasing=0'.
10019
10020           Example: [#1] image.jpg poster_edges ,
10021
10022         poster_hope:
10023             _smoothness>=0
10024
10025           Apply Hope stencil poster effect on selected images.
10026
10027           Default value: 'smoothness=3'.
10028
10029           Example: [#1] image.jpg poster_hope ,
10030
10031         rodilius:
10032             0<=_amplitude<=100,_0<=thickness<=100,_sharpness>=0,_nb_orienta‐
10033       tions>0,_offset,_color_mode={        0=darker | 1=brighter }
10034
10035           Apply rodilius (fractalius-like) filter on selected images.
10036
10037           Default  values:  'amplitude=10',  'thickness=10', 'sharpness=400',
10038       'nb_orientations=7',
10039             'offset=0' and 'color_mode=1'.
10040
10041           Example: [#1] image.jpg rodilius 12,10,300,10 normalize_local 10,6
10042                    [#2] image.jpg normalize_local 10,16 rodilius  10,4,400,16
10043       smooth 60,0,1,1,4 normalize_local 10,      16
10044
10045         sketchbw:
10046             _nb_angles>0,_start_angle,_angle_range>=0,_length>=0,_thresh‐
10047       old>=0,_opacity,_bgfactor>=0,_density>0,         _sharpness>=0,_anisot‐
10048       ropy>=0,_smoothness>=0,_coherence>=0,_is_boost={ 0 | 1 },_is_curved={ 0
10049       | 1 }
10050
10051           Apply sketch effect to selected images.
10052
10053           Default values: 'nb_angles=2', 'start_angle=45', 'angle_range=180',
10054       'length=30',
10055             'threshold=3',   'opacity=0.03',   'bgfactor=0',   'density=0.6',
10056       'sharpness=0.1', 'anisotropy=0.6',
10057             'smoothness=0.25', 'coherence=1', 'is_boost=0' and 'is_curved=1'.
10058
10059           Example: [#1] image.jpg +sketchbw 1 reverse blur[-1] 3 blend[-2,-1]
10060       overlay
10061
10062         sponge:
10063             _size>0
10064
10065           Apply sponge effect on selected images.
10066
10067           Default value: 'size=13'.
10068
10069           Example: [#1] image.jpg sponge ,
10070
10071         stained_glass:
10072             _edges[%]>=0, shading>=0, is_thin_separators={ 0 | 1 }
10073
10074           Generate stained glass from selected images.
10075
10076           Default values: 'edges=40%', 'shading=0.2' and 'is_precise=0'.
10077
10078           Example: [#1] image.jpg stained_glass 20%,1 cut 0,20
10079
10080         stars:
10081             _density[%]>=0,_depth>=0,_size>0,_nb_branches>=1,0<=_thick‐
10082       ness<=1,_smoothness[%]>=0,_R,_G,_B,       _opacity
10083
10084           Add random stars to selected images.
10085
10086           Default    values:     'density=10%',     'depth=1',     'size=32',
10087       'nb_branches=5', 'thickness=0.38',
10088             'smoothness=0.5', 'R=G=B=200' and 'opacity=1'.
10089
10090           Example: [#1] image.jpg stars ,
10091
10092         stencil:
10093             _radius[%]>=0,_smoothness>=0,_iterations>=0
10094
10095           Apply stencil filter on selected images.
10096
10097           Default values: 'radius=3', 'smoothness=1' and 'iterations=8'.
10098
10099           Example: [#1] image.jpg +norm stencil. 2,1,4 +mul rm[0]
10100
10101         stencilbw:
10102             _edges>=0,_smoothness>=0
10103
10104           Apply B&W stencil effect on selected images.
10105
10106           Default values: 'edges=15' and 'smoothness=10'.
10107
10108           Example: [#1] image.jpg +stencilbw 40,4
10109
10110         stylize:
10111             [style_image],_fidelity_finest,_fidelity_coars‐
10112       est,_fidelity_smoothness_finest>=0,          _fidelity_smoothnes_coars‐
10113       est>=0,0<=_fidelity_chroma<=1,_init_type,_init_resolution>=0,
10114       init_max_gradient>=0,_patchsize_analysis>0,_patchsize_synthe‐
10115       sis>0,_patchsize_synthesis_final>0,
10116       _nb_matches_finest>=0,_nb_matches_coarsest>=0,_penalize_repeti‐
10117       tions>=0,_matching_precision>=0,                            _scale_fac‐
10118       tor>1,_skip_finest_scales>=0,_"image_matching_command"
10119
10120           Transfer colors and textures from specified style image to selected
10121       images, using a multi-scale
10122           patch-mathing algorithm.
10123           If instant display window[0] is opened, the steps of the image syn‐
10124       thesis are displayed on it.
10125           'init_type' can be { 0=best-match | 1=identity | 2=randomized }.
10126
10127           Default   values:   'fidelity_finest=0.5',   'fidelity_coarsest=2',
10128       'fidelity_smoothness_finest=3',
10129             'fidelity_smoothness_coarsest=0.5',        'fidelity_chroma=0.1',
10130       'init_type=0', 'init_resolution=16',
10131             'init_max_gradient=0', 'patchsize_analysis=5', 'patchsize_synthe‐
10132       sis=5',
10133             'patchsize_synthesis_final=5',  'nb_matches_finest=2', 'nb_match‐
10134       esc_coarsest=30',
10135             'penalize_repetitions=10',  'matching_precision=2',   'scale_fac‐
10136       tor=1.85', 'skip_finest_scales=0' and
10137             'image_matching_command'="s   c,-3   transfer_pca[0]  [2]  b[0,2]
10138       xy,0.7 n[0,2] 0,255 n[1,2] 0,200 a[0,1]
10139             c a[1,2] c"'.
10140
10141         tetris:
10142             _scale>0
10143
10144           Apply tetris effect on selected images.
10145
10146           Default value: 'scale=10'.
10147
10148           Example: [#1] image.jpg +tetris 10
10149
10150         warhol:
10151             _M>0,_N>0,_smoothness>=0,_color>=0
10152
10153           Create MxN Andy Warhol-like artwork from selected images.
10154
10155           Default values: 'M=3', 'N=M', 'smoothness=2' and 'color=20'.
10156
10157           Example: [#1] image.jpg warhol 3,3,3,40
10158
10159         weave:
10160             _density>=0,0<=_thickness<=100,0<=_shadow<=100,_shad‐
10161       ing>=0,_fibers_amplitude>=0,                            _fibers_smooth‐
10162       ness>=0,_angle,-1<=_x_curvature<=1,-1<=_y_curvature<=1
10163
10164           Apply weave effect to the selected images.
10165           'angle' can be { 0=0 deg. | 1=22.5 deg. | 2=45 deg. |  3=67.5  deg.
10166       }.
10167
10168           Default  values:  'density=6',  'thickness=65', 'shadow=40', 'shad‐
10169       ing=0.5', 'fibers_amplitude=0',
10170              _'fibers_smoothness=0',   'angle=0'   and    'curvature_x=curva‐
10171       ture_y=0'
10172
10173           Example: [#1] image.jpg weave ,
10174
10175         whirls:
10176             _texture>=0,_smoothness>=0,_darkness>=0,_lightness>=0
10177
10178           Add random whirl texture to selected images.
10179
10180           Default  values:  'texture=3',  'smoothness=6',  'darkness=0.5' and
10181       'lightness=1.8'.
10182
10183           Example: [#1] image.jpg whirls ,
10184
10185         12.16. Warpings
10186                --------
10187
10188         deform:
10189             _amplitude>=0,_interpolation
10190
10191           Apply random smooth deformation on selected images.
10192           'interpolation' can be { 0=none | 1=linear | 2=bicubic }.
10193
10194           Default value: 'amplitude=10'.
10195
10196           Example: [#1] image.jpg +deform[0] 10 +deform[0] 20
10197
10198         euclidean2polar:
10199             _center_x[%],_center_y[%],_stretch_factor>0,_boundary_condi‐
10200       tions={ 0=dirichlet | 1=neumann |        2=periodic | 3=mirror }
10201
10202           Apply euclidean to polar transform on selected images.
10203
10204           Default  values:  'center_x=center_y=50%',  'stretch_factor=1'  and
10205       'boundary_conditions=1'.
10206
10207           Example: [#1] image.jpg +euclidean2polar ,
10208
10209         equirectangular2nadirzenith:
10210
10211           Transform selected equirectangular images to nadir/zenith rectilin‐
10212       ear projections.
10213
10214         fisheye:
10215             _center_x,_center_y,0<=_radius<=100,_amplitude>=0
10216
10217           Apply fish-eye deformation on selected images.
10218
10219           Default values: 'x=y=50', 'radius=50' and 'amplitude=1.2'.
10220
10221           Example: [#1] image.jpg +fisheye ,
10222
10223         flower:
10224             _amplitude,_frequency,_offset_r[%],_angle,_center_x[%],_cen‐
10225       ter_y[%],_boundary_conditions={         0=dirichlet   |   1=neumann   |
10226       2=periodic | 3=mirror}
10227
10228           Apply flower deformation on selected images.
10229
10230           Default   values:   'amplitude=30',   'frequency=6',  'offset_r=0',
10231       'angle=0',
10232             'center_x=center_y=50%' and 'boundary_conditions=3'.
10233
10234           Example: [#1] image.jpg +flower ,
10235
10236         kaleidoscope:
10237             _center_x[%],_center_y[%],_radius,_angle,_boundary_conditions={
10238       0=dirichlet | 1=neumann |        2=periodic | 3=mirror }
10239
10240           Create kaleidoscope effect from selected images.
10241
10242           Default  values:  'center_x=center_y=50%', 'radius=100', 'angle=30'
10243       and 'boundary_conditions=3'.
10244
10245           Example: [#1] image.jpg kaleidoscope ,
10246
10247         map_sphere:
10248             _width>0,_height>0,_radius,_dilation>0,_fading>=0,_fad‐
10249       ing_power>=0
10250
10251           Map selected images on a sphere.
10252
10253           Default  values:  'width=height=512', 'radius=100', 'dilation=0.5',
10254       'fading=0' and
10255             'fading_power=0.5'.
10256
10257           Example: [#1] image.jpg map_sphere ,
10258
10259         nadirzenith2equirectangular:
10260
10261           Transform  selected   nadir/zenith   rectilinear   projections   to
10262       equirectangular images.
10263
10264         polar2euclidean:
10265             _center_x[%],_center_y[%],_stretch_factor>0,_boundary_condi‐
10266       tions={ 0=dirichlet | 1=neumann |        2=periodic | 3=mirror }
10267
10268           Apply euclidean to polar transform on selected images.
10269
10270           Default  values:  'center_x=center_y=50%',  'stretch_factor=1'  and
10271       'boundary_conditions=1'.
10272
10273           Example: [#1] image.jpg +euclidean2polar ,
10274
10275         raindrops:
10276             _amplitude,_density>=0,_wavelength>=0,_merging_steps>=0
10277
10278           Apply raindrops deformation on selected images.
10279
10280           Default  values:  'amplitude=80','density=0.1',  'wavelength=1' and
10281       'merging_steps=0'.
10282
10283           Example: [#1] image.jpg +raindrops ,
10284
10285         ripple:
10286             _amplitude,_bandwidth,_shape={ 0=bloc |  1=triangle  |  2=sine  |
10287       3=sine+ | 4=random },_angle,_offset
10288
10289           Apply ripple deformation on selected images.
10290
10291           Default    values:   'amplitude=10',   'bandwidth=10',   'shape=2',
10292       'angle=0' and 'offset=0'.
10293
10294           Example: [#1] image.jpg +ripple ,
10295
10296         rotoidoscope:
10297             _center_x[%],_center_y[%],_tiles>0,_smoothness[%]>=0,_bound‐
10298       ary_conditions={ 0=dirichlet | 1=neumann        | 2=periodic | 3=mirror
10299       }
10300
10301           Create rotational kaleidoscope effect from selected images.
10302
10303           Default values: 'center_x=center_y=50%', 'tiles=10', 'smoothness=1'
10304       and
10305             'boundary_conditions=3'.
10306
10307           Example: [#1] image.jpg +rotoidoscope ,
10308
10309         spherize:
10310             _radius[%]>=0,_strength,_smoothness[%]>=0,_center_x[%],_cen‐
10311       ter_y[%],_ratio_x/y>0,_angle,       _interpolation
10312
10313           Apply spherize effect on selected images.
10314
10315           Default values: 'radius=50%', 'strength=1',  'smoothness=0',  'cen‐
10316       ter_x=center_y=50%',
10317             'ratio_x/y=1', 'angle=0' and 'interpolation=1'.
10318
10319           Example: [#1] image.jpg grid 5%,5%,0,0,0.6,255 spherize ,
10320
10321         symmetrize:
10322             _x[%],_y[%],_angle,_boundary_conditions={ 0=dirichlet | 1=neumann
10323       |  2=periodic  |   3=mirror   },         _is_antisymmetry={   0   |   1
10324       },_swap_sides={ 0 | 1 }
10325
10326           Symmetrize selected images regarding specified axis.
10327
10328           Default  values:  'x=y=50%',  'angle=90',  'boundary_conditions=3',
10329       'is_antisymmetry=0' and
10330             'swap_sides=0'.
10331
10332           Example:  [#1]  image.jpg  +symmetrize  50%,50%,45  +symmetrize[-1]
10333       50%,50%,-45
10334
10335         transform_polar:
10336             "expr_radius",_"expr_angle",_center_x[%],_center_y[%],_bound‐
10337       ary_conditions={ 0=dirichlet |        1=neumann }
10338
10339           Apply user-defined transform on polar  representation  of  selected
10340       images.
10341
10342           Default  values: 'expr_radius=R-r', 'expr_rangle=a', 'center_x=cen‐
10343       ter_y=50%' and
10344             'boundary_conditions=1'.
10345
10346           Example: [#1]  image.jpg  +transform_polar[0]  R*(r/R)^2,a  +trans‐
10347       form_polar[0] r,2*a
10348
10349         twirl:
10350             _amplitude,_center_x[%],_center_y[%],_boundary_conditions={
10351       0=dirichlet | 1=neumann | 2=periodic |        3=mirror }
10352
10353           Apply twirl deformation on selected images.
10354
10355           Default values: 'amplitude=1', 'center_x=center_y=50%' and  'bound‐
10356       ary_conditions=3'.
10357
10358           Example: [#1] image.jpg twirl 0.6
10359
10360         warp_perspective:
10361             _x-angle,_y-angle,_zoom>0,_x-center,_y-center,_boundary_condi‐
10362       tions={ 0=dirichlet | 1=neumann |        2=periodic | 3=mirror }
10363
10364           Warp selected images with perspective deformation.
10365
10366           Default values: 'x-angle=1.5', 'y-angle=0', 'zoom=1',  'x-center=y-
10367       center=50' and
10368             'boundary_conditions=2'.
10369
10370           Example: [#1] image.jpg warp_perspective ,
10371
10372         water:
10373             _amplitude,_smoothness>=0,_angle
10374
10375           Apply water deformation on selected images.
10376
10377           Default values: 'amplitude=30', 'smoothness=1.5' and 'angle=45'.
10378
10379           Example: [#1] image.jpg water ,
10380
10381         wave:
10382             _amplitude>=0,_frequency>=0,_center_x,_center_y
10383
10384           Apply wave deformation on selected images.
10385
10386           Default  values:  'amplitude=4', 'frequency=0.4' and 'center_x=cen‐
10387       ter_y=50'.
10388
10389           Example: [#1] image.jpg wave ,
10390
10391         wind:
10392             _amplitude>=0,_angle,0<=_attenuation<=1,_threshold
10393
10394           Apply wind effect on selected images.
10395
10396           Default values: 'amplitude=20',  'angle=0',  'attenuation=0.7'  and
10397       'threshold=20'.
10398
10399           Example: [#1] image.jpg +wind ,
10400
10401         zoom:
10402             _factor,_cx,_cy,_cz,_boundary_conditions={  0=dirichlet  | 1=neu‐
10403       mann | 2=periodic | 3=mirror }
10404
10405           Apply zoom factor to selected images.
10406
10407           Default values:  'factor=1',  'cx=cy=cz=0.5'  and  'boundary_condi‐
10408       tions=0'.
10409
10410           Example: [#1] image.jpg +zoom[0] 0.6 +zoom[0] 1.5
10411
10412         12.17. Degradations
10413                ------------
10414
10415         cracks:
10416             0<=_density<=100,_is_relief={ 0 | 1 },_opacity,_color1,...
10417
10418           Draw random cracks on selected images with specified color.
10419
10420           Default   values:   'density=25',  'is_relief=0',  'opacity=1'  and
10421       'color1=0'.
10422
10423           Example: [#1] image.jpg +cracks ,
10424
10425         light_patch:
10426             _density>0,_darkness>=0,_lightness>=0
10427
10428           Add light patches to selected images.
10429
10430           Default values: 'density=10', 'darkness=0.9' and 'lightness=1.7'.
10431
10432           Example: [#1] image.jpg +light_patch 20,0.9,4
10433
10434         noise_hurl:
10435             _amplitude>=0
10436
10437           Add hurl noise to selected images.
10438
10439           Default value: 'amplitude=10'.
10440
10441           Example: [#1] image.jpg +noise_hurl ,
10442
10443         pixelize:
10444             _scale_x>0,_scale_y>0,_scale_z>0
10445
10446           Pixelize selected images with specified scales.
10447
10448           Default values: 'scale_x=20' and 'scale_y=scale_z=scale_x'.
10449
10450           Example: [#1] image.jpg +pixelize ,
10451
10452         scanlines:
10453             _amplitude,_bandwidth,_shape={ 0=bloc |  1=triangle  |  2=sine  |
10454       3=sine+ | 4=random },_angle,_offset
10455
10456           Apply ripple deformation on selected images.
10457
10458           Default values: 'amplitude=60', 'bandwidth=2', 'shape=0', 'angle=0'
10459       and 'offset=0'.
10460
10461           Example: [#1] image.jpg +scanlines ,
10462
10463         shade_stripes:
10464             _frequency>=0,_direction={  0=horizontal  |  1=vertical  },_dark‐
10465       ness>=0,_lightness>=0
10466
10467           Add shade stripes to selected images.
10468
10469           Default  values:  'frequency=5',  'direction=1', 'darkness=0.8' and
10470       'lightness=2'.
10471
10472           Example: [#1] image.jpg +shade_stripes 30
10473
10474         shadow_patch:
10475             _opacity>=0
10476
10477           Add shadow patches to selected images.
10478
10479           Default value: 'opacity=0.7'.
10480
10481           Example: [#1] image.jpg +shadow_patch 0.4
10482
10483         spread:
10484             _dx>=0,_dy>=0,_dz>=0
10485
10486           Spread pixel values of selected images randomly along x,y and z.
10487
10488           Default values: 'dx=3', 'dy=dx' and 'dz=0'.
10489
10490           Example: [#1] image.jpg +spread 3
10491
10492         stripes_y:
10493             _frequency>=0
10494
10495           Add vertical stripes to selected images.
10496
10497           Default value: 'frequency=10'.
10498
10499           Example: [#1] image.jpg +stripes_y ,
10500
10501         texturize_canvas:
10502             _amplitude>=0,_fibrousness>=0,_emboss_level>=0
10503
10504           Add paint canvas texture to selected images.
10505
10506           Default     values:     'amplitude=20',     'fibrousness=3'     and
10507       'emboss_level=0.6'.
10508
10509           Example: [#1] image.jpg +texturize_canvas ,
10510
10511         texturize_paper:
10512
10513           Add paper texture to selected images.
10514
10515           Example: [#1] image.jpg +texturize_paper
10516
10517         vignette:
10518             _strength>=0,0<=_radius_min<=100,0<=_radius_max<=100
10519
10520           Add vignette effect to selected images.
10521
10522           Default     values:     'strength=100',     'radius_min=70'     and
10523       'radius_max=90'.
10524
10525           Example: [#1] image.jpg vignette ,
10526
10527         watermark_visible:
10528             _text,0<_opacity<1,_size>0,_angle,_mode={   0=remove   |    1=add
10529       },_smoothness>=0
10530
10531           Add  or  remove a visible watermark on selected images (value range
10532       must be [0,255]).
10533
10534           Default  values:  'text=(c)   G'MIC',   'opacity=0.3',   'size=53',
10535       'angle=25', 'mode=1' and
10536             'smoothness=0'.
10537
10538           Example: [#1] image.jpg watermark_visible ,0.7
10539
10540         12.18. Blending and Fading
10541                -------------------
10542
10543         blend:
10544             [layer],blending_mode,_opacity[%],_selection_is={ 0=base-layers |
10545       1=top-layers } |
10546             blending_mode,_opacity[%]
10547
10548           Blend selected G,GA,RGB or RGBA images by specified layer or  blend
10549       all selected images together,
10550           using specified blending mode.
10551           'blending_mode'  can be { add | alpha | and | average | blue | burn
10552       | darken | difference |
10553           divide | dodge | edges | exclusion | freeze | grainextract | grain‐
10554       merge | green | hardlight |
10555           hardmix  | hue | interpolation | lighten | lightness | linearburn |
10556       linearlight | luminance |
10557           multiply | negation | or | overlay | pinlight |  red  |  reflect  |
10558       saturation | seamless |
10559           seamless_mixed |
10560           screen  |  shapeareamax  |  shapeareamax0  |  shapeareamin  |  sha‐
10561       peareamin0 | shapeaverage | shapeaverage0
10562           |
10563           shapemedian | shapemedian0 | shapemin  |  shapemin0  |  shapemax  |
10564       shapemax0 | softburn | softdodge |
10565           softlight | stamp | subtract | value | vividlight | xor }.
10566           'opacity'  should  be  in '[0,1]', or '[0,100]' if expressed with a
10567       '%'.
10568
10569           Default  values:  'blending_mode=alpha',  'opacity=1'  and  'selec‐
10570       tion_is=0'.
10571
10572           Example: [#1] image.jpg +drop_shadow , resize2dy[-1] 200 rotate[-1]
10573       20 +blend alpha display_rgba[-2]
10574                    [#2] image.jpg testimage2d {w},{h} blend overlay
10575                    [#3]  command  "ex  :  $""=arg  repeat  $""#   +blend[0,1]
10576       ${arg{$>+1}} text_outline[-1] Mode:"       "${arg{$>+1}},2,2,23,2,1,255
10577       done"  image.jpg  testimage2d  {w},{h}  ex  add,alpha,and,        aver‐
10578       age,blue,burn,darken
10579                    [#4]   command  "ex  :  $""=arg  repeat  $""#  +blend[0,1]
10580       ${arg{$>+1}} text_outline[-1] Mode:"       "${arg{$>+1}},2,2,23,2,1,255
10581       done"    image.jpg    testimage2d    {w},{h}    ex   difference,divide,
10582       dodge,exclusion,freeze,grainextract,grainmerge
10583                    [#5]  command  "ex  :  $""=arg  repeat  $""#   +blend[0,1]
10584       ${arg{$>+1}} text_outline[-1] Mode:"       "${arg{$>+1}},2,2,23,2,1,255
10585       done" image.jpg  testimage2d  {w},{h}  ex  green,hardlight,       hard‐
10586       mix,hue,interpolation,lighten,lightness
10587                    [#6]   command  "ex  :  $""=arg  repeat  $""#  +blend[0,1]
10588       ${arg{$>+1}} text_outline[-1] Mode:"       "${arg{$>+1}},2,2,23,2,1,255
10589       done"   image.jpg   testimage2d   {w},{h}   ex   linearburn,       lin‐
10590       earlight,luminance,multiply,negation,or,overlay
10591                    [#7]  command  "ex  :  $""=arg  repeat  $""#   +blend[0,1]
10592       ${arg{$>+1}} text_outline[-1] Mode:"       "${arg{$>+1}},2,2,23,2,1,255
10593       done" image.jpg testimage2d {w},{h} ex pinlight,red,reflect,      satu‐
10594       ration,screen,shapeaverage,softburn
10595                    [#8]   command  "ex  :  $""=arg  repeat  $""#  +blend[0,1]
10596       ${arg{$>+1}} text_outline[-1] Mode:"       "${arg{$>+1}},2,2,23,2,1,255
10597       done"    image.jpg    testimage2d   {w},{h}   ex   softdodge,softlight,
10598       stamp,subtract,value,vividlight,xor
10599
10600         blend_edges:
10601             smoothness[%]>=0
10602
10603           Blend selected images togethers using 'edges' mode.
10604
10605           Example: [#1] image.jpg testimage2d {w},{h} +blend_edges 0.8
10606
10607         blend_fade:
10608             [fading_shape]
10609
10610           Blend selected images together using specified fading shape.
10611
10612           Example:       [#1]       image.jpg       testimage2d       {w},{h}
10613       100%,100%,1,1,'cos(y/10)' normalize[-1] 0,1 +blend_fade[0,      1] [2]
10614
10615         blend_median:
10616
10617           Blend selected images together using 'median' mode.
10618
10619           Example:   [#1]   image.jpg   testimage2d   {w},{h}   +mirror[0]  y
10620       +blend_median
10621
10622         blend_seamless:
10623             _is_mixed_mode={ 0 | 1 },_inner_fading[%]>=0,_outer_fading[%]>=0
10624
10625           Blend selected images using  a  seamless  blending  mode  (Poisson-
10626       based).
10627
10628           Default  values:  'is_mixed=0',  'inner_fading=0'  and  'outer_fad‐
10629       ing=100%'.
10630
10631         fade_diamond:
10632             0<=_start<=100,0<=_end<=100
10633
10634           Create diamond fading from selected images.
10635
10636           Default values: 'start=80' and 'end=90'.
10637
10638           Example: [#1] image.jpg testimage2d {w},{h} +fade_diamond 80,85
10639
10640         fade_linear:
10641             _angle,0<=_start<=100,0<=_end<=100
10642
10643           Create linear fading from selected images.
10644
10645           Default values: 'angle=45', 'start=30' and 'end=70'.
10646
10647           Example: [#1] image.jpg testimage2d {w},{h} +fade_linear 45,48,52
10648
10649         fade_radial:
10650             0<=_start<=100,0<=_end<=100
10651
10652           Create radial fading from selected images.
10653
10654           Default values: 'start=30' and 'end=70'.
10655
10656           Example: [#1] image.jpg testimage2d {w},{h} +fade_radial 30,70
10657
10658         fade_x:
10659             0<=_start<=100,0<=_end<=100
10660
10661           Create horizontal fading from selected images.
10662
10663           Default values: 'start=30' and 'end=70'.
10664
10665           Example: [#1] image.jpg testimage2d {w},{h} +fade_x 30,70
10666
10667         fade_y:
10668             0<=_start<=100,0<=_end<=100
10669
10670           Create vertical fading from selected images.
10671
10672           Default values: 'start=30' and 'end=70'.
10673
10674           Example: [#1] image.jpg testimage2d {w},{h} +fade_y 30,70
10675
10676         fade_z:
10677             0<=_start<=100,0<=_end<=100
10678
10679           Create transversal fading from selected images.
10680
10681           Default values: 'start=30' and 'end=70'.
10682
10683         sub_alpha:
10684             [base_image],_opacity_gain>=1
10685
10686           Compute the minimal alpha-channel  difference  (opposite  of  alpha
10687       blending) between the selected
10688           images
10689           and the specified base image.
10690           The  alpha  difference  A-B  is defined as the image having minimal
10691       opacity, such that
10692           alpha_blend(B,A-B) = A.
10693
10694           Default value: 'opacity_gain=1'.
10695
10696           Example: [#1] image.jpg testimage2d {w},{h} +sub_alpha[0] [1]  dis‐
10697       play_rgba
10698
10699         12.19. Image Sequences and Videos
10700                --------------------------
10701
10702         animate:
10703             fil‐
10704       ter_name,"param1_start,...,paramN_start","param1_end,...,paramN_end",nb_frames>=0,
10705       _output_frames={ 0 | 1 },_output_filename |
10706             delay>0,_back and forth={ 0 | 1 }
10707
10708           Animate  filter  from  starting  parameters to ending parameters or
10709       animate selected images
10710           in a display window.
10711
10712           Default value: 'delay=30'.
10713
10714           Example: [#1] image.jpg animate flower,"0,3","20,8",9
10715
10716         apply_camera:
10717             _"command",_camera_index>=0,_skip_frames>=0,_output_filename
10718
10719           Apply specified command on live camera stream, and  display  it  on
10720       display window [0].
10721
10722           Default  values:  'command=""',  'camera_index=0' (default camera),
10723       'skip_frames=0' and
10724             'output_filename=""'.
10725
10726         apply_files:
10727             "filename_pattern",_"command",_first_frame>=0,_last_frame={ >=0 |
10728       -1=last },_frame_step>=1,       _output_filename
10729
10730           Apply a G'MIC command on specified input image files, in a streamed
10731       way.
10732           If a display window is opened, rendered frames are displayed in  it
10733       during processing.
10734           The  output  filename may have extension '.avi' (saved as a video),
10735       or any other usual image file
10736           extension (saved as a sequence of images).
10737
10738           Default     values:     'command=(undefined)',     'first_frame=0',
10739       'last_frame=-1', 'frame_step=1' and
10740             'output_filename=(undefined)'.
10741
10742         apply_video:
10743             video_filename,_"command",_first_frame>=0,_last_frame={   >=0   |
10744       -1=last },_frame_step>=1,       _output_filename
10745
10746           Apply a G'MIC command on all frames of the  specified  input  video
10747       file, in a streamed way.
10748           If  a display window is opened, rendered frames are displayed in it
10749       during processing.
10750           The output filename may have extension '.avi' (saved as  a  video),
10751       or any other usual image
10752           file extension (saved as a sequence of images).
10753
10754           Default  values:  'first_frame=0',  'last_frame=-1', 'frame_step=1'
10755       and
10756             'output_filename=(undefined)'.
10757
10758         average_files:
10759             "filename_pattern",_first_frame>=0,_last_frame={  >=0  |  -1=last
10760       },_frame_step>=1,_output_filename
10761
10762           Average specified input image files, in a streamed way.
10763           If  a display window is opened, rendered frames are displayed in it
10764       during processing.
10765           The output filename may have extension '.avi' (saved as  a  video),
10766       or any other usual image
10767           file extension (saved as a sequence of images).
10768
10769           Default  values:  'first_frame=0',  'last_frame=-1', 'frame_step=1'
10770       and
10771             'output_filename=(undefined)'.
10772
10773         average_video:
10774             video_filename,_first_frame>=0,_last_frame={   >=0   |    -1=last
10775       },_frame_step>=1,_output_filename
10776
10777           Average frames of specified input video file, in a streamed way.
10778           If  a display window is opened, rendered frames are displayed in it
10779       during processing.
10780           The output filename may have extension '.avi' (saved as  a  video),
10781       or any other usual image
10782           file extension (saved as a sequence of images).
10783
10784           Default  values:  'first_frame=0',  'last_frame=-1', 'frame_step=1'
10785       and
10786             'output_filename=(undefined)'.
10787
10788         fade_files:
10789             "filename_pat‐
10790       tern",_nb_inner_frames>0,_first_frame>=0,_last_frame={  >=0  |  -1=last
10791       },_frame_step>=1,       _output_filename
10792
10793           Generate a temporal fading from specified input image files,  in  a
10794       streamed way.
10795           If  a display window is opened, rendered frames are displayed in it
10796       during processing.
10797           The output filename may have extension 'avi' (saved as a video), or
10798       any other usual image
10799           file extension (saved as a sequence of images).
10800
10801           Default      values:     'nb_inner_frames=10',     'first_frame=0',
10802       'last_frame=-1', 'frame_step=1' and
10803             'output_filename=(undefined)'.
10804
10805         fade_video:
10806             video_filename,_nb_inner_frames>0,_first_frame>=0,_last_frame={
10807       >=0 | -1=last },_frame_step>=1,       _output_filename
10808
10809           Create  a temporal fading sequence from specified input video file,
10810       in a streamed way.
10811           If a display window is opened, rendered frames are displayed in  it
10812       during processing.
10813
10814           Default      values:     'nb_inner_frames=10',     'first_frame=0',
10815       'last_frame=-1', 'frame_step=1' and
10816             'output_filename=(undefined)'.
10817
10818         files2video:
10819             "filename_pattern",_output_filename,_fps>0,_codec
10820
10821           Convert several files into a single video file.
10822
10823           Default   values:   'output_filename=output.avi',   'fps=25'    and
10824       'codec=mp4v'.
10825
10826         median_files:
10827             "filename_pattern",_first_frame>=0,_last_frame={  >=0  |  -1=last
10828       },_frame_step>=1,_frame_rows[%]>=1,       _is_fast_approximation={ 0  |
10829       1 }
10830
10831           Compute  the  median  frame  of  specified  input image files, in a
10832       streamed way.
10833           If a display window is opened, rendered frame is  displayed  in  it
10834       during processing.
10835
10836           Default  values:  'first_frame=0', 'last_frame=-1', 'frame_step=1',
10837       'frame_rows=20%' and
10838             'is_fast_approximation=0'.
10839
10840         median_video:
10841             video_filename,_first_frame>=0,_last_frame={   >=0   |    -1=last
10842       },_frame_step>=1,_frame_rows[%]>=1,        _is_fast_approximation={ 0 |
10843       1 }
10844
10845           Compute the median of all frames of  an  input  video  file,  in  a
10846       streamed way.
10847           If  a  display  window is opened, rendered frame is displayed in it
10848       during processing.
10849
10850           Default values: 'first_frame=0',  'last_frame=-1',  'frame_step=1',
10851       'frame_rows=100%' and
10852             'is_fast_approximation=1'.
10853
10854         morph:
10855             nb_inner_frames>=1,_smoothness>=0,_precision>=0
10856
10857           Create morphing sequence between selected images.
10858
10859           Default values: 'smoothness=0.1' and 'precision=4'.
10860
10861           Example: [#1] image.jpg +rotate 20,1,1,50%,50% morph 9
10862
10863         morph_files:
10864             "filename_pattern",_nb_inner_frames>0,_smoothness>=0,_preci‐
10865       sion>=0,_first_frame>=0,_last_frame={            >=0     |      -1=last
10866       },_frame_step>=1,_output_filename
10867
10868           Generate a temporal morphing from specified input image files, in a
10869       streamed way.
10870           If a display window is opened, rendered frames are displayed in  it
10871       during processing.
10872           The  output  filename may have extension '.avi' (saved as a video),
10873       or any other usual image
10874           file extension (saved as a sequence of images).
10875
10876           Default  values:  'nb_inner_frames=10',  'smoothness=0.1',  'preci‐
10877       sion=4', 'first_frame=0',
10878             'last_frame=-1',   'frame_step=1'   and   'output_filename=(unde‐
10879       fined)'.
10880
10881         morph_rbf:
10882             nb_inner_frames>=1,xs0[%],ys0[%],xt0[%],yt0[%],...,xsN[%],ysN[%],xtN[%],ytN[%]
10883
10884           Create  morphing  sequence between selected images, using RBF-based
10885       interpolation.
10886           Each argument (xsk,ysk)-(xtk,ytk) corresponds to the coordinates of
10887       a keypoint
10888           respectively  on  the source and target images. The set of all key‐
10889       points define the overall image
10890           deformation.
10891
10892         morph_video:
10893             video_filename,_nb_inner_frames>0,_smoothness>=0,_preci‐
10894       sion>=0,_first_frame>=0,_last_frame={      >=0     |            -1=last
10895       },_frame_step>=1,_output_filename
10896
10897           Generate a temporal morphing from specified input video file, in  a
10898       streamed way.
10899           If  a display window is opened, rendered frames are displayed in it
10900       during processing.
10901           The output filename may have extension '.avi' (saved as  a  video),
10902       or any other usual image
10903           file extension (saved as a sequence of images).
10904
10905           Default  values:  'nb_inner_frames=10',  'smoothness=0.1',  'preci‐
10906       sion=4', 'first_frame=0',
10907             'last_frame=-1',   'frame_step=1'   and   'output_filename=(unde‐
10908       fined)'.
10909
10910         register_nonrigid:
10911             [destination],_smoothness>=0,_precision>0,_nb_scale>=0
10912
10913           Register  selected  source images with specified destination image,
10914       using non-rigid warp.
10915
10916           Default     values:     'smoothness=0.2',     'precision=6'     and
10917       'nb_scale=0(auto)'.
10918
10919           Example:   [#1]  image.jpg  +rotate  20,1,1,50%,50%  +register_non‐
10920       rigid[0] [1]
10921
10922         register_rigid:
10923             [destination],_smoothness>=0,_boundary_conditions={ 0=dirichlet |
10924       1=neumann | 2=periodic | 3=mirror        }
10925
10926           Register  selected  source images with specified destination image,
10927       using rigid warp (shift).
10928
10929           Default values: 'smoothness=0.1%' and 'boundary_conditions=0'.
10930
10931           Example: [#1] image.jpg +shift 30,20 +register_rigid[0] [1]
10932
10933         transition:
10934             [transition_shape],nb_added_frames>=0,100>=shading>=0,_sin‐
10935       gle_frame_only={ -1=disabled | >=0 }
10936
10937           Generate a transition sequence between selected images.
10938
10939           Default values: 'shading=0' and 'single_frame_only=-1'.
10940
10941           Example:  [#1] image.jpg +mirror c 100%,100% plasma[-1] 1,1,6 tran‐
10942       sition[0,1] [2],5
10943
10944         transition3d:
10945             _nb_frames>=2,_nb_xtiles>0,_nb_ytiles>0,_axis_x,_axis_y,_axis_z,_is_antialias={
10946       0 | 1 }
10947
10948           Create 3D transition sequence between selected consecutive images.
10949           'axis_x',  'axis_y' and 'axis_z' can be set as mathematical expres‐
10950       sions, depending on 'x' and 'y'.
10951
10952           Default    values:     'nb_frames=10',     'nb_xtiles=nb_ytiles=3',
10953       'axis_x=1', 'axis_y=1', 'axis_z=0'
10954             and 'is_antialias=1'.
10955
10956           Example: [#1] image.jpg +blur 5 transition3d 9 display_rgba
10957
10958         video2files:
10959             input_filename,_output_filename,_first_frame>=0,_last_frame={ >=0
10960       | -1=last },_frame_step>=1
10961
10962           Split specified input video file into image  files,  one  for  each
10963       frame.
10964           First  and last frames as well as step between frames can be speci‐
10965       fied.
10966
10967           Default   values:   'output_filename=frame.png',   'first_frame=0',
10968       'last_frame=-1' and
10969             'frame_step=1'.
10970
10971         12.20. Neural Networks
10972                ---------------
10973
10974         nn_new_input:
10975             module_name,width,_height,_spectrum
10976
10977           Add an input module with specified size to the neural network.
10978
10979         nn_new_output:
10980             module_name,previous_module_name
10981
10982           Add an output module to the neural network.
10983
10984         nn_new_fullyconnected:
10985             module_name,previous_module_name,nb_neurons,activation_function
10986
10987           Add a fully-connected module to the neural network.
10988
10989         nn_propagate_batch:
10990             module_name,[inputs_zstacked]
10991
10992           Batch propagate specified inputs through the neural network.
10993           Insert  image  of  corresponding  network outputs at the end of the
10994       list.
10995
10996         nn_propagate:
10997             module_name
10998
10999           Propagate input through the neural network.
11000
11001         nn_backpropagate_batch:
11002             module_name,[inputs_zstacked],[expected_out‐
11003       puts_zstacked],_insert_network_outputs={ 0 | 1 },       _loss_function
11004
11005           Batch  propagate and backpropagate inputs and errors in neural net‐
11006       work.
11007           Optionnally insert image of corresponding network  outputs  at  the
11008       end of the list.
11009           Return averaged loss.
11010
11011         nn_backpropagate:
11012             module_name,[expected_output],_loss_function
11013
11014           Propagate input, then back-propagate output error, through the neu‐
11015       ral network.
11016           This command set the network output.
11017           Return average loss.
11018
11019         nn_update:
11020             module_name,epsilon
11021
11022           Update neural network weights, after back-propagation of the error.
11023
11024         nn_output:
11025             module_name,filename
11026
11027           Output specified network as a file.
11028
11029         nn_serialize:
11030             module_name,_is_compressed={ 0 | 1 }
11031
11032           Serialize network into a single image, optionnally in a  compressed
11033       form.
11034
11035         nn_unserialize:
11036
11037           Unserialize specified selection to retrieve a neural network.
11038
11039         nn_input:
11040             "filename"
11041
11042           Input neural network from file.
11043
11044         12.21. Convenience Functions
11045                ---------------------
11046
11047         alert:
11048             _title,_message,_label_button1,_label_button2,...
11049
11050           Display an alert box and wait for user's choice.
11051           If  a  single  image is in the selection, it is used as an icon for
11052       the alert box.
11053
11054           Default values: 'title=[G'MIC Alert]' and 'message=This is an alert
11055       box.'.
11056
11057         arg:
11058             n>=1,_arg1,...,_argN
11059
11060           Return the n-th argument of the specified argument list.
11061
11062         arg0:
11063             n>=0,_arg0,...,_argN
11064
11065           Return  the n-th argument of the specified argument list (where 'n'
11066       starts from '0').
11067
11068         arg2var:
11069             variable_name,argument_1,...,argument_N
11070
11071           For each i in [1...N], set 'variable_name$i=argument_i'.
11072           The variable name should be global  to  make  this  command  useful
11073       (i.e. starts by an underscore).
11074
11075         autocrop_coords:
11076             value1,value2,... | auto
11077
11078           Return  coordinates  (x0,y0,z0,x1,y1,z1) of the autocrop that could
11079       be performed on the latest
11080           of the selected images.
11081
11082           Default value: 'auto'
11083
11084         average_colors:
11085
11086           Return the average vector-value  of  the  latest  of  the  selected
11087       images.
11088
11089         base642img:
11090             "base64_string"
11091
11092           Decode given base64-encoded string as a newly inserted image at the
11093       end of the list.
11094           The  argument  string  must  have  been  generated  using   command
11095       'img2base64'.
11096
11097         base642uchar:
11098             "base64_string"
11099
11100           Decode  given  base64-encoded  string  as a newly inserted 1-column
11101       image at the end of the list.
11102           The  argument  string  must  have  been  generated  using   command
11103       'uchar2base64'.
11104
11105         basename:
11106             file_path,_variable_name_for_folder
11107
11108           Return the basename of a file path, and opt. its folder location.
11109           When  specified 'variable_name_for_folder' must starts by an under‐
11110       score
11111           (global variable accessible from calling function).
11112
11113         bin:
11114             binary_int1,...
11115
11116           Print specified binary integers into their octal, decimal, hexadec‐
11117       imal and string representations.
11118
11119         bin2dec:
11120             binary_int1,...
11121
11122           Convert  specified  binary  integers into their decimal representa‐
11123       tions.
11124
11125         covariance_colors:
11126             _avg_outvarname
11127
11128           Return the covariance matrix of the  vector-valued  colors  in  the
11129       latest of the selected images
11130           (for arbitrary number of channels).
11131           Parameter  'avg_outvarname'  is  used as a variable name that takes
11132       the value of the average
11133           vector-value.
11134
11135         dec:
11136             decimal_int1,...
11137
11138           Print specified decimal integers into their binary, octal, hexadec‐
11139       imal and string representations.
11140
11141         dec2str:
11142             decimal_int1,...
11143
11144           Convert specifial decimal integers into its string representation.
11145
11146         dec2bin:
11147             decimal_int1,...
11148
11149           Convert  specified  decimal  integers into their binary representa‐
11150       tions.
11151
11152         dec2hex:
11153             decimal_int1,...
11154
11155           Convert specified decimal integers into their hexadecimal represen‐
11156       tations.
11157
11158         dec2oct:
11159             decimal_int1,...
11160
11161           Convert  specified  decimal  integers  into their octal representa‐
11162       tions.
11163
11164         fact:
11165             value
11166
11167           Return the factorial of the specified value.
11168
11169         fibonacci:
11170             N>=0
11171
11172           Return the Nth number of the Fibonacci sequence.
11173
11174           Example: [#1] echo ${"fibonacci 10"}
11175             [gmic]-0./ Start G'MIC interpreter.0-0./ 550-0./ End G'MIC inter‐
11176       preter.
11177
11178         file_mv:
11179             filename_src,filename_dest
11180
11181           Rename or move a file from a location $1 to another location $2.
11182
11183         file_rand:
11184
11185           Return a random filename for storing temporary data.
11186
11187         file_rm:
11188             filename
11189
11190           Delete a file.
11191
11192         filename:
11193             filename,_number1,_number2,...,_numberN
11194
11195           Return a filename numbered with specified indices.
11196
11197         files (+):
11198             _mode,path
11199
11200           Return the list of files and/or subfolders from specified path.
11201           'path' can be eventually a matching pattern.
11202           'mode'  can  be { 0=files only | 1=folders only | 2=files + folders
11203       }.
11204           Add '3' to 'mode' to return full paths instead of filenames only.
11205
11206           Default value: 'mode=5'.
11207
11208         fitratio_wh:
11209             min_width,min_height,ratio_wh
11210
11211           Return  a   2D   size   'width,height'   which   is   bigger   than
11212       'min_width,min_height' and has the specified
11213           w/h ratio.
11214
11215         fitscreen:
11216             width,height,_depth,_minimal_size[%],_maximal_size[%] |
11217             [image],_minimal_size[%],_maximal_size[%]
11218
11219           Return  the  'ideal'  size  WxH for a window intended to display an
11220       image of specified size on screen.
11221
11222           Default   values:   'depth=1',   'minimal_size=128'   and    'maxi‐
11223       mal_size=85%'.
11224
11225         fontchart:
11226
11227           Insert G'MIC font chart at the end of the image list.
11228
11229           Example: [#1] fontchart
11230
11231         fps:
11232
11233           Return the number of time this function is called per second, or -1
11234       if this info is not yet
11235           available.
11236           Useful to display the framerate when displaying animations.
11237
11238         gcd:
11239             a,b
11240
11241           Return the GCD (greatest common divisor) between a and b.
11242
11243         hex:
11244             hexadecimal_int1,...
11245
11246           Print specified hexadecimal integers into their binary, octal, dec‐
11247       imal and string representations.
11248
11249         hex2dec:
11250             hexadecimal_int1,...
11251
11252           Convert specified hexadecimal integers into their decimal represen‐
11253       tations.
11254
11255         hex2img:
11256             "hexadecimal_string"
11257
11258           Insert new image 1xN at the end of the list with  values  specified
11259       by the given hexadecimal-encoded
11260           string.
11261
11262         hex2str:
11263             hexadecimal_string
11264
11265           Convert specified hexadecimal string into a string.
11266
11267         img2base64:
11268             _encoding={ 0=base64 | 1=base64url },_store_names={ 0 | 1 }
11269
11270           Encode selected images as a base64-encoded string.
11271           The images can be then decoded using command 'base642img'.
11272
11273           Default values: 'encoding=0'.
11274
11275         img2hex:
11276
11277           Return  representation  of  last  image  as  an hexadecimal-encoded
11278       string.
11279           Input image must have values that are integers in [0,255].
11280
11281         img2str:
11282
11283           Return the content of the latest of the selected images as  a  spe‐
11284       cial G'MIC input string.
11285
11286         img2text:
11287             _line_separator
11288
11289           Return text contained in a multi-line image.
11290
11291           Default value: 'line_separator= '.
11292
11293         img82hex:
11294
11295           Convert selected 8bits-valued vectors into their hexadecimal repre‐
11296       sentations (ascii-encoded).
11297
11298         hex2img8:
11299
11300           Convert selected hexadecimal representations  (ascii-encoded)  into
11301       8bits-valued vectors.
11302
11303         is_3d:
11304
11305           Return 1 if all of the selected images are 3D objects, 0 otherwise.
11306
11307         is_change:
11308             _value={ 0=false | 1=true }
11309
11310           Set or unset the 'is_change' flag associated to the image list.
11311           This  flag  tells  the  interpreter  whether  or not the image list
11312       should be displayed when the pipeline
11313           ends.
11314
11315           Default value: 'value=1'.
11316
11317         is_half:
11318
11319           Return 1 if the type of image pixels is limited to half-float.
11320
11321         is_ext:
11322             filename,_extension
11323
11324           Return 1 if specified filename has a given extensioin.
11325
11326         is_image_arg:
11327             string
11328
11329           Return 1 if specified string looks like '[ind]'.
11330
11331         is_pattern:
11332             string
11333
11334           Return  1  if  specified  string  looks  like  a  drawing   pattern
11335       '0x......'.
11336
11337         is_percent:
11338             string
11339
11340           Return 1 if specified string ends with a '%', 0 otherwise.
11341
11342         is_variable_name:
11343             "str"
11344
11345           Returns  1  if  specified  argument can be considered as a variable
11346       name, 0 otherwise.
11347
11348         is_videofilename:
11349
11350           Return 1 if extension of specified filename is typical  from  video
11351       files.
11352
11353         is_macos:
11354
11355           Return 1 if current computer OS is Darwin (MacOS), 0 otherwise.
11356
11357         is_windows:
11358
11359           Return 1 if current computer OS is Windows, 0 otherwise.
11360
11361         math_lib:
11362
11363           Return  string  that defines a set of several useful macros for the
11364       embedded math evaluator.
11365
11366         mad:
11367
11368           Return the MAD (Maximum Absolute Deviation) of  the  last  selected
11369       image.
11370           The MAD is defined as MAD = med_i|x_i-med_j(x_j)|
11371
11372         max_w:
11373
11374           Return the maximal width between selected images.
11375
11376         max_h:
11377
11378           Return the maximal height between selected images.
11379
11380         max_d:
11381
11382           Return the maximal depth between selected images.
11383
11384         max_s:
11385
11386           Return the maximal spectrum between selected images.
11387
11388         max_wh:
11389
11390           Return the maximal wxh size of selected images.
11391
11392         max_whd:
11393
11394           Return the maximal wxhxd size of selected images.
11395
11396         max_whds:
11397
11398           Return the maximal wxhxdxs size of selected images.
11399
11400         median_color:
11401
11402           Return the median color value of the last selected image.
11403
11404         min_w:
11405
11406           Return the minimal width between selected images.
11407
11408         min_h:
11409
11410           Return the minimal height between selected images.
11411
11412         min_d:
11413
11414           Return the minimal depth between selected images.
11415
11416         min_s:
11417
11418           Return the minimal s size of selected images.
11419
11420         min_wh:
11421
11422           Return the minimal wxh size of selected images.
11423
11424         min_whd:
11425
11426           Return the minimal wxhxd size of selected images.
11427
11428         min_whds:
11429
11430           Return the minimal wxhxdxs size of selected images.
11431
11432         nmd (+):
11433             Shortcut for command 'named'.
11434
11435         named (+):
11436             _mode,"name1","name2",...
11437
11438           Return  the set of indices corresponding to images of the selection
11439       with specified names.
11440           After this command returns, the status contains a list  of  indices
11441       (unsigned integers),
11442           separated  by  commas  (or  an empty string if no images with those
11443       names have been found).
11444           (equivalent to shortcut command 'nmd').
11445
11446           'mode' can be { 0=all indices (default) | 1=lowest index |  2=high‐
11447       est index | 3 = all indices (case
11448           insensitive)  |  4  = lowest index (case insensitive) | 5 = highest
11449       index (case insensitive)}
11450
11451         normalize_filename:
11452             filename
11453
11454           Return a "normalized" version of the  specified  filename,  without
11455       spaces and capital letters.
11456
11457         oct:
11458             octal_int1,...
11459
11460           Print specified octal integers into their binary, decimal, hexadec‐
11461       imal and string representations.
11462
11463         oct2dec:
11464             octal_int1,...
11465
11466           Convert specified octal integers  into  their  decimal  representa‐
11467       tions.
11468
11469         padint:
11470             number,_size>0
11471
11472           Return  a  integer  with 'size' digits (eventually left-padded with
11473       '0').
11474
11475         path_cache:
11476
11477           Return a path to store G'MIC data files for one user  (whose  value
11478       is OS-dependent).
11479
11480         path_current:
11481
11482           Return current folder from where G'MIC has been run.
11483
11484         path_gimp:
11485
11486           Return a path to store GIMP configuration files for one user (whose
11487       value is OS-dependent).
11488
11489         path_tmp:
11490
11491           Return a path to store temporary files (whose  value  is  OS-depen‐
11492       dent).
11493
11494         remove_copymark:
11495             "image_name"
11496
11497           Remove copy mark from names of selected images.
11498
11499         reset:
11500
11501           Reset global parameters of the interpreter environment.
11502
11503         rgb:
11504
11505           Return a random int-valued RGB color.
11506
11507         rgba:
11508
11509           Return a random int-valued RGBA color.
11510
11511         std_noise:
11512
11513           Return  the estimated noise standard deviation of the last selected
11514       image.
11515
11516         str:
11517             string
11518
11519           Print specified string into its binary, octal, decimal and hexadec‐
11520       imal representations.
11521
11522         str2hex:
11523             string
11524
11525           Convert specified string into a sequence of hexadecimal values.
11526
11527         strcapitalize:
11528             string
11529
11530           Capitalize specified string.
11531
11532         strcontains:
11533             string1,string2
11534
11535           Return 1 if the first string contains the second one.
11536
11537         strlen:
11538             string1
11539
11540           Return the length of specified string argument.
11541
11542         strreplace:
11543             string,search,replace
11544
11545           Search and replace substrings in an input string.
11546
11547         strlowercase:
11548             string
11549
11550           Return a lower-case version of the specified string.
11551
11552         struppercase:
11553             string
11554
11555           Return an upper-case version of the specified string.
11556
11557         strvar:
11558             string
11559
11560           Return  a  simplified  version of the specified string, that can be
11561       used as a variable name.
11562
11563         strver:
11564             _version
11565
11566           Return the specified version number of the G'MIC interpreter, as  a
11567       string.
11568
11569           Default value: 'version=$_version'.
11570
11571         tic:
11572
11573           Initialize tic-toc timer.
11574           Use it in conjunction with 'toc'.
11575
11576         toc:
11577
11578           Display  elapsed  time  of the tic-toc timer since the last call to
11579       'tic'.
11580           This command returns the elapsed time in the status value.
11581           Use it in conjunction with 'tic'.
11582
11583         to_clutname:
11584             "string"
11585
11586           Return simplified name that can be used as a CLUT name, from speci‐
11587       fied input string.
11588
11589         uchar2base64:
11590             _encoding={ 0=base64 | 1=base64url }
11591
11592           Encode  the  values  of  the  latest  of  the  selected images as a
11593       base64-encoded string.
11594           The string can be decoded using command 'base642uchar'.
11595           Selected images must have values that are integers in [0,255].
11596
11597           Default values: 'encoding=0'.
11598
11599         12.22. Other Interactive Commands
11600                --------------------------
11601
11602         demos:
11603             _run_in_parallel={ 0=no | 1=yes | 2=auto }
11604
11605           Show a menu to select and view all G'MIC interactive demos.
11606
11607         tixy:
11608             "expression"
11609
11610           Animate specified mathematical expression with a 16x16 grid of cir‐
11611       cles, using the rules described
11612           at https://tixy.land
11613
11614         x_2048:
11615
11616           Launch the 2048 game.
11617
11618         x_blobs:
11619
11620           Launch the blobs editor.
11621
11622         x_bouncing:
11623
11624           Launch the bouncing balls demo.
11625
11626         x_color_curves:
11627             _colorspace={  rgb  |  cmy | cmyk | hsi | hsl | hsv | lab | lch |
11628       ycbcr | last }
11629
11630           Apply color curves on selected RGB[A] images, using an  interactive
11631       window.
11632           Set 'colorspace' to 'last' to apply last defined color curves with‐
11633       out opening interactive windows.
11634
11635           Default value: 'colorspace=rgb'.
11636
11637         x_colorize:
11638             _is_lineart={ 0 | 1 },_max_resolution={ 0 |  >=128  },_multichan‐
11639       nels_output={ 0 | 1 },_[palette1],       _[palette2],_[grabber1]
11640
11641           Colorized selected B&W images, using an interactive window.
11642           When  >0, argument 'max_resolution' defines the maximal image reso‐
11643       lution used in the interactive
11644           window.
11645
11646           Default values: 'is_lineart=1', 'max_resolution=1024'  and  'multi‐
11647       channels_output=0'.
11648
11649         x_connect4:
11650
11651           Launch the Connect Four game.
11652
11653         xz:
11654             Shortcut for command 'x_crop'.
11655
11656         x_crop:
11657
11658           Crop selected images interactively.
11659           (equivalent to shortcut command 'xz').
11660
11661         x_cut:
11662
11663           Cut selected images interactively.
11664
11665         x_fire:
11666
11667           Launch the fire effect demo.
11668
11669         x_fireworks:
11670
11671           Launch the fireworks demo.
11672
11673         x_fisheye:
11674
11675           Launch the fish-eye effect demo.
11676
11677         x_fourier:
11678
11679           Launch the fourier filtering demo.
11680
11681         x_grab_color:
11682             _variable_name
11683
11684           Open a color grabber widget from the first selected image.
11685           Argument  'variable_name'  specifies the variable that contains the
11686       selected color values at any time.
11687           Assigning '-1' to it forces the interactive window to close.
11688
11689           Default values: 'variable_name=xgc_variable'.
11690
11691         x_hanoi:
11692
11693           Launch the Tower of Hanoi game.
11694
11695         x_histogram:
11696
11697           Launch the histogram demo.
11698
11699         x_hough:
11700
11701           Launch the hough transform demo.
11702
11703         x_jawbreaker:
11704             0<_width<20,0<_height<20,0<_balls<=8
11705
11706           Launch the Jawbreaker game.
11707
11708         x_landscape:
11709
11710           Launch the virtual landscape demo.
11711
11712         x_life:
11713
11714           Launch the game of life.
11715
11716         x_light:
11717
11718           Launch the light effect demo.
11719
11720         x_mandelbrot:
11721             _julia={ 0 | 1 },_c0r,_c0i
11722
11723           Launch Mandelbrot/Julia explorer.
11724
11725         x_mask_color:
11726             _colorspace={ all | rgb | lrgb | ycbcr | lab | lch | hsv | hsi  |
11727       hsl  |  cmy  |  cmyk | yiq },       _spatial_tolerance>=0,_color_toler‐
11728       ance>=0
11729
11730           Interactively select a color, and add an alpha  channel  containing
11731       the corresponding color mask.
11732           Argument  'colorspace'  refers  to the color metric used to compute
11733       color similarities, and can be
11734           basically
11735           one of { rgb | lrgb | ycbcr | lab | lch | hsv | hsi | hsl |  cmy  |
11736       cmyk | yiq }.
11737           You  can also select one one particular channel of this colorspace,
11738       by setting 'colorspace' as
11739           'colorspace_channel' (e.g. 'hsv_h' for the hue).
11740
11741           Default   values:   'colorspace=all',   'spatial_tolerance=5'   and
11742       'color_tolerance=5'.
11743
11744         x_metaballs3d:
11745
11746           Launch the 3D metaballs demo.
11747
11748         x_minesweeper:
11749             8<=_width=<20,8<=_height<=20
11750
11751           Launch the Minesweeper game.
11752
11753         x_minimal_path:
11754
11755           Launch the minimal path demo.
11756
11757         x_morph:
11758             _nb_frames>=2,_preview_fidelity={  0=coarsest | 1=coarse | 2=nor‐
11759       mal | 3=fine | 4=finest }
11760
11761           Launch the interactive image morpher.
11762
11763           Default values: 'nb_frames=16' and 'preview_fidelity=3'.
11764
11765         x_pacman:
11766
11767           Launch pacman game.
11768
11769         x_paint:
11770
11771           Launch the interactive painter.
11772
11773         x_plasma:
11774
11775           Launch the plasma effect demo.
11776
11777         x_quantize_rgb:
11778             _nbcolors>=2
11779
11780           Launch the RGB color quantization demo.
11781
11782         x_reflection3d:
11783
11784           Launch the 3D reflection demo.
11785
11786         x_rubber3d:
11787
11788           Launch the 3D rubber object demo.
11789
11790         x_segment:
11791             _max_resolution={ 0 | >=128 }
11792
11793           Segment foreground from background in selected opaque  RGB  images,
11794       interactively.
11795           Return RGBA images with binary alpha-channels.
11796
11797           Default value: 'max_resolution=1024'.
11798
11799         x_select_color:
11800             _variable_name
11801
11802           Display a RGB or RGBA color selector.
11803           Argument  'variable_name'  specifies the variable that contains the
11804       selected color values (as
11805           R,G,B,[A])
11806           at any time.
11807           Its value specifies the initial selected color. Assigning  '-1'  to
11808       it forces the interactive window
11809           to close.
11810
11811           Default value: 'variable_name=xsc_variable'.
11812
11813         x_select_function1d:
11814             _variable_name,_background_curve_R,_background_curve_G,_back‐
11815       ground_curve_B
11816
11817           Open an interactive window, where the user can defined its  own  1D
11818       function.
11819           If  an image is selected, it is used to display additional informa‐
11820       tion :
11821             - The first row defines the values of  a  background  curve  dis‐
11822       played on the window (e.g. an
11823           histogram).
11824             -  The  2nd,  3rd  and 4th rows define the R,G,B color components
11825       displayed beside the X and Y axes.
11826           Argument 'variable_name' specifies the variable that  contains  the
11827       selected function keypoints at
11828           any time.
11829           Assigning '-1' to it forces the interactive window to close.
11830
11831           Default      values:      'variable_name=xsf_variable',      'back‐
11832       ground_curve_R=220',
11833             'background_curve_G=background_curve_B=background_curve_T'.
11834
11835         x_select_palette:
11836             _variable_name,_number_of_columns={ 0=auto | >0 }
11837
11838           Open a RGB or RGBA color selector widget from a palette.
11839           The palette is given as a selected image.
11840           Argument 'variable_name' specifies the variable that  contains  the
11841       selected color values (as
11842           R,G,B,[A])
11843           at any time.
11844           Assigning '-1' to it forces the interactive window to close.
11845
11846           Default  values:  'variable_name=xsp_variable'  and 'number_of_col‐
11847       umns=2'.
11848
11849         x_shadebobs:
11850
11851           Launch the shade bobs demo.
11852
11853         x_spline:
11854
11855           Launch spline curve editor.
11856
11857         x_starfield3d:
11858
11859           Launch the 3D starfield demo.
11860
11861         x_tetris:
11862
11863           Launch tetris game.
11864
11865         x_threshold:
11866
11867           Threshold selected images interactively.
11868
11869         x_tictactoe:
11870
11871           Launch tic-tac-toe game.
11872
11873         x_warp:
11874             _nb_keypoints_xgrid>=2,_nb_keypoints_ygrid>=2,_nb_keypoints_con‐
11875       tours>=0,_preview_fidelity={         0=coarsest | 1=coarse | 2=normal |
11876       3=fine | 4=finest },_[background_image],0<=_background_opacity<=1
11877
11878           Launch the interactive image warper.
11879
11880           Default values: 'nb_keypoints_xgrid=nb_keypoints_ygrid=2', 'nb_key‐
11881       points_contours=0' and
11882             'preview_fidelity=1'.
11883
11884         x_waves:
11885
11886           Launch the image waves demo.
11887
11888         x_whirl:
11889             _opacity>=0
11890
11891           Launch the fractal whirls demo.
11892
11893           Default values: 'opacity=0.2'.
11894
11895         13. Examples of Use
11896             ---------------
11897
11898         gmic  is  a generic image processing tool which can be used in a wide
11899       variety of situations. The
11900         few examples below illustrate possible uses of this tool:
11901
11902         ## View a list of images:
11903
11904           $ gmic file1.bmp file2.jpeg
11905
11906         ## Convert an image file:
11907
11908           $ gmic input.bmp output output.jpg
11909
11910         ## Create a volumetric image from a movie sequence:
11911
11912           $ gmic input.mpg append z output output.hdr
11913
11914         ## Compute image gradient norm:
11915
11916           $ gmic input.bmp gradient_norm
11917
11918         ## Denoise a color image:
11919
11920           $ gmic image.jpg denoise 30,10 output denoised.jpg
11921
11922         ## Compose two images using overlay layer blending:
11923
11924           $ gmic image1.jpg image2.jpg blend overlay output blended.jpg
11925
11926         ## Evaluate a mathematical expression:
11927
11928           $ gmic echo "cos(pi/4)^2+sin(pi/4)^2={cos(pi/4)^2+sin(pi/4)^2}"
11929
11930         ## Plot a 2D function:
11931
11932           $                gmic                1000,1,1,2                fill
11933       "X=3*(x-500)/500;X^2*sin(3*X^2)+if(c==0,u(0,-1),cos(X*10))" plot
11934
11935         ## Plot a 3D elevated function in random colors:
11936
11937           $ gmic 128,128,1,3,"u(0,255)" plasma 10,3 blur 4 sharpen 10000 ele‐
11938       vation3d[-1]
11939         "'X=(x-64)/6;Y=(y-64)/6;100*exp(-(X^2+Y^2)/30)*abs(cos(X)*sin(Y))'"
11940
11941         ## Plot the isosurface of a 3D volume:
11942
11943           $   gmic   mode3d   5   moded3d   5   double3d    0    isosurface3d
11944       "'x^2+y^2+abs(z)^abs(4*cos(x*y*z*3))'",3
11945
11946         ## Render a G'MIC 3D logo:
11947
11948           $  gmic 0 text G´MIC,0,0,53,1,1,1,1 expand_xy 10,0 blur 1 normalize
11949       0,100 +plasma 0.4 add blur 1
11950         elevation3d -0.1 moded3d 4
11951
11952         ## Generate a 3D ring of torii:
11953
11954           $     gmic     repeat     20     torus3d      15,2      color3d[-1]
11955       "{u(60,255)},{u(60,255)},{u(60,255)}" *3d[-1] 0.5,1 if
11956         "{$>%2}"   rotate3d[-1]  0,1,0,90  fi  add3d[-1]  70  add3d  rotate3d
11957       0,0,1,18 done moded3d 3 mode3d 5
11958         double3d 0
11959
11960         ## Create a vase from a 3D isosurface:
11961
11962           $ gmic moded3d 4 isosurface3d "'x^2+2*abs(y/2)*sin(2*y)^2+z^2-3',0"
11963       sphere3d 1.5 sub3d[-1] 0,5
11964         plane3d  15,15  rotate3d[-1]  1,0,0,90  center3d[-1]  add3d[-1] 0,3.2
11965       color3d[-1] 180,150,255
11966         color3d[-2] 128,255,0 color3d[-3] 255,128,0 add3d
11967
11968         ## Display filtered webcam stream:
11969
11970           $ gmic apply_camera
11971
11972         ## Launch a set of interactive demos:
11973
11974           $ gmic demos
11975
11976         ** G'MIC comes  with  ABSOLUTELY  NO  WARRANTY;  for  details  visit:
11977       https://gmic.eu **
11978
11979
11980
11981                                                                      G'MIC(1)
Impressum