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 3.2.6
12               (https://gmic.eu)
13
14               Copyright (c) Since 2008, 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
23          script-based  programming language dedicated to the design of possi‐
24       bly complex
25          image processing pipelines and operators.
26         It can be used to convert, manipulate,  filter  and  visualize  image
27       datasets made
28          of one or several 1D/2D or 3D multi-spectral images.
29
30         This  reference  documentation describes all the technical aspects of
31       the G'MIC
32          framework, in its current version 3.2.6.
33
34         As a starting point, you may want  to  visit  our  detailed  tutorial
35       pages, at:
36          https://gmic.eu/tutorial/
37
38         2. Overall Context
39            ---------------
40
41          *  At  any  time, G'MIC manages one list of numbered (and optionally
42       named)
43          pixel-based images,  entirely  stored  in  computer  memory  (uncom‐
44       pressed).
45          * The first image of the list has index '0' and is denoted by
46          '[0]'. The second image of the list is denoted by '[1]', the third
47          by '[2]' and so on.
48          *  Negative  indices are treated in a periodic way: '[-1]' refers to
49       the
50          last image of the list, '[-2]' to the penultimate one, etc. Thus, if
51       the
52          list has 4 images, '[1]' and '[-3]' both designate the second image
53          of the list.
54          * A named image may be also indicated by '[name]', if 'name' uses
55          the  character  set '[a-zA-Z0-9_]' and does not start with a number.
56       Image
57          names can be set or reassigned at any moment during  the  processing
58       pipeline
59          (see command name for this purpose).
60          *  G'MIC  defines  a set of various commands and substitution mecha‐
61       nisms to allow
62          the design of complex pipelines and operators managing this list  of
63       images, in
64          a  very  flexible  way: You can insert or remove images in the list,
65       rearrange
66          image order, process images (individually or grouped),  merge  image
67       data
68          together, display and output image files, etc.
69          * Such a pipeline can define a new custom G'MIC command (stored in a
70       user
71          command file), and re-used afterwards as a  regular  command,  in  a
72       larger
73          pipeline if necessary.
74
75
76         3. Image Definition and Terminology
77            --------------------------------
78
79          *  In  G'MIC,  each  image is modeled as a 1D, 2D, 3D or 4D array of
80       scalar
81          values, uniformly discretized on a rectangular/parallelepipedic  do‐
82       main.
83          * The four dimensions of this array are respectively denoted by:
84            -  'width', the number of image columns (size along the
85          'x-axis').
86            -  'height', the number of image rows (size along the 'y-axis').
87            -  'depth', the number of image slices (size along the
88          'z-axis'). The depth is equal to '1' for usual color or grayscale
89          2D images.
90            -  'spectrum', the number of image channels (size along the
91          'c-axis'). The spectrum is respectively equal to '3' and '4'
92          for usual 'RGB' and 'RGBA' color images.
93
94          *  There are no hard limitations on the size of the image along each
95       dimension.
96          For instance, the number of image slices or channels can be of arbi‐
97       trary size
98          within the limits of the available memory.
99          * The 'width', 'height' and 'depth' of an image are
100          considered as spatial dimensions, while the 'spectrum' has a
101          multi-spectral meaning. Thus, a 4D image in G'MIC should be most of‐
102       ten
103          regarded as a 3D dataset of multi-spectral voxels. Most of the G'MIC
104       commands
105          will stick with this idea (e.g. command blur blurs images only along
106       the
107          spatial 'xyz'-axes).
108          * G'MIC stores all the image data as buffers of 'float'  values  (32
109       bits,
110          value  range '[-3.4E38,+3.4E38]'. It performs all its image process‐
111       ing
112          operations with floating point numbers. Each image pixel takes then
113          32bits/channel (except if double-precision buffers have been enabled
114       during the
115          compilation of the software, in which case 64bits/channel can be the
116       default).
117          * Considering 'float'-valued pixels ensure to keep the numerical
118          precision when executing image processing pipelines. For  image  in‐
119       put/output
120          operations,  you may want to prescribe the image datatype to be dif‐
121       ferent than
122          'float' (like 'bool', 'char', 'int', etc.). This is
123          possible by specifying it as a file option when using I/O  commands.
124       (see
125          section Input/Output Properties to learn more about file options).
126
127
128         4. Items of a Processing Pipeline
129            ------------------------------
130
131          *  In G'MIC, an image processing pipeline is described as a sequence
132       of
133          items separated by the space character. Such items  are  interpreted
134       and executed
135          from the left to the right. For instance, the expression:
136
137           filename.jpg   blur   3,0   sharpen   10  resize  200%,200%  output
138       file_out.jpg
139
140         defines a valid pipeline composed of nine G'MIC items.
141
142          * Each G'MIC item is a string that is either a command, a list of
143          command arguments, a filename or a special input string.
144          * Escape characters '' and double quotes '"' can be used  to  define
145       items
146          containing spaces or other special characters. For instance, the two
147       strings
148          'single item' and '"single item"' both define the same single item,
149           with a space in it.
150
151
152         5. Input Data Items
153            ----------------
154
155          * If a specified G'MIC item appears to be an existing filename, the
156          corresponding image data are loaded and inserted at the end  of  the
157       image list
158          (which is equivalent to the use of 'input filename').
159          * Special filenames '-' and '-.ext' stand for the standard
160          input/output  streams,  optionally  forced to be in a specific 'ext'
161       file
162          format (e.g. '-.jpg' or '-.png').
163          * The following special input strings may be used as G'MIC items  to
164       create and
165          insert  new  images  with prescribed values, at the end of the image
166       list:
167            -  '[selection]' or '[selection]xN': Insert 1 or N copies of
168          already existing images. 'selection' may represent  one  or  several
169       images
170          (see section Command Items and Selections to learn more about selec‐
171       tions).
172            -   'width[%],_height[%],_depth[%],_spectrum[%],_values[xN]':  In‐
173       sert
174          one  or N images with specified size and values (adding '%' to a di‐
175       mension
176          means "percentage of the size along the same axis", taken  from  the
177       last
178          image '[-1]'). Any specified dimension can be also written as
179          '[image]', and is then set to the size (along the same axis) of the
180          existing specified image '[image]'. 'values' can be either a
181          sequence  of  numbers separated by commas ',', or a mathematical ex‐
182       pression,
183           as e.g. in input item '256,256,1,3,[x,y,128]' which creates a
184          '256x256' RGB color image with a spatial  shading  on  the  red  and
185       green
186          channels. (see section Mathematical Expressions to learn more about
187          mathematical expressions).
188            -  '(v1,v2,..)[xN]': Insert one or 'N' new images from specified
189          prescribed  values.  Value  separator  inside parentheses can be ','
190       (column
191          separator), ';' (row separator), '/' (slice separator) or '^'
192          (channel separator). For instance, expression '(1,2,3;4,5,6;7,8,9)'
193          creates a 3x3 matrix (scalar image), with values running from  1  to
194       9.
195            -  '('string'[:delimiter])[xN]': Insert one or N new images from
196          specified  string,  by  filling  the images with the character codes
197       composing the
198          string. When specified, 'delimiter' tells about the main orientation
199       of
200          the image. Delimiter can be 'x' (eq. to ',' which is the default),
201          'y' (eq. to ';'), 'z' (eq. to '/') or 'c' (eq. to
202          '^'). When specified delimiter is ',', ';', '/' or
203          '^', the expression is actually equivalent to
204          '({'string'[:delimiter]})[xN]' (see section Substitution Rules for
205          more information on the syntax).
206            -  '0[xN]': Insert one or N new 'empty' images, containing no
207          pixel data. Empty images are used only in rare occasions.
208
209          * Input item 'name=value' declares a new variable 'name', or
210          assign  a  new  string value to an existing variable. Variable names
211       must use the
212          character set '[a-zA-Z0-9_]' and cannot start with a number.
213          * A variable definition is always local to the current  command  ex‐
214       cept when it
215          starts  by  the  underscore  character '_'. In that case, it becomes
216       also
217          accessible by any command invoked outside the current command  scope
218       (global
219          variable).
220          * If a variable name starts with two underscores '__', the global
221          variable  is also shared among different threads and can be read/set
222       by commands
223          running in parallel (see command parallel for this purpose).  Other‐
224       wise,
225          it remains local to the thread that defined it.
226          *  Numerical  variables can be updated with the use of these special
227       operators:
228          '+=' (addition), '-=' (subtraction), '*=' (multiplication),
229          '/=' (division), '%=' (modulo), '&=' (bitwise and),
230          '|=' (bitwise or), '^=' (power), '<<=' and '>>'
231          (bitwise left and right shifts). For instance, 'foo=1' 'foo+=3'.
232          * Input item 'name.=string' appends specified 'string' at the end
233          of variable 'name'.
234          * Input item 'name..=string' prepends specified 'string' at the
235          beginning of variable 'name'.
236          * Multiple variable assignments and updates are  allowed,  with  ex‐
237       pressions:
238          'name1,name2,...,nameN=value'         or        'name1,name2,...,na‐
239       meN=value1,value2,
240          ...,valueN' where assignment operator '=' can be replaced by one of
241          the allowed operators (e.g. '+=').
242          * Variables usually store numbers or strings. Use command store to
243          assign variables from image data (and syntax  'input  $variable'  to
244       bring
245          them back on the image list afterwards).
246
247
248         6. Command Items and Selections
249            ----------------------------
250
251          * A G'MIC item that is not a filename nor a special input string
252          designates a 'command' most of the time. Generally, commands perform
253          image  processing  operations  on one or several available images of
254       the list.
255          * Reccurent commands have two equivalent names ('regular' and
256          'short'). For instance, command names 'resize' and 'r' refer
257          to the same image resizing action.
258          * A G'MIC command may have mandatory or optional arguments. Command
259          arguments must be specified in the next item on  the  command  line.
260       Commas ',
261          '  are used to separate multiple arguments of a single command, when
262       required.
263          * The execution of a G'MIC command may be restricted only to a  sub‐
264       set of
265          the  image list, by appending '[selection]' to the command name. Ex‐
266       amples
267          of valid syntaxes for 'selection' are:
268            -  'command[-2]': Apply command only on the penultimate image
269          '[-2]' of the list.
270            -  'command[0,1,3]': Apply command only on images '[0]',
271          '[1]' and '[3]'.
272            -  'command[3-6]': Apply command only on images '[3]' to
273          '[6]' (i.e, '[3]', '[4]', '[5]' and '[6]').
274            -  'command[50%-100%]': Apply command only on the second  half  of
275       the
276          image list.
277            -   'command[0,-4--1]':  Apply command only on the first image and
278       the
279          last four images.
280            -  'command[0-9:3]': Apply command only on images '[0]' to
281          '[9]', with a step of 3 (i.e. on images '[0]', '[3]',
282          '[6]' and '[9]').
283            -  'command[0--1:2]': Apply command only on  images  of  the  list
284       with
285          even indices.
286            -  'command[0,2-4,50%--1]': Apply command on images '[0]',
287          '[2]', '[3]', '[4]' and on the second half of the image list.
288            -   'command[^0,1]':  Apply command on all images except the first
289       two.
290            -  'command[name1,name2]': Apply command on named images 'name1'
291          and 'name2'.
292
293          * Indices in selections are always sorted in increasing  order,  and
294       duplicate
295          indices  are  discarded.  For  instance,  selections '[3-1,1-3]' and
296       '[1,1,
297          1,3,2]' are both equivalent to '[1-3]'. If you want to repeat a sin‐
298       gle
299          command  multiple  times  on an image, use a 'repeat..done' loop in‐
300       stead.
301          Inverting the order of images for a command is achieved  by  explic‐
302       itly inverting
303          the  order  of  the images in the list, with command 'reverse[selec‐
304       tion]'.
305          * Command selections '[-1]', '[-2]' and '[-3]' are so often
306          used they have their own shortcuts, respectively '.', '..' and
307          '...'. For instance, command 'blur..' is equivalent to
308          'blur[-2]'. These shortcuts work also when specifying command  argu‐
309       ments.
310          *  G'MIC  commands  invoked without '[selection]' are applied on all
311       images
312          of the list, i.e. the default selection is '[0--1]' (except for com‐
313       mand
314          input whose default selection is '[-1]'').
315          * Prepending a single hyphen '-' to a G'MIC command is allowed. This
316       may
317          be useful to recognize command items  more  easily  in  a  one-liner
318       pipeline
319          (typically invoked from a shell).
320          * A G'MIC command prepended with a plus sign '+' does not act
321          in-place  but inserts its result as one or several new images at the
322       end
323          of the image list.
324          * There are two different types of commands that can be run  by  the
325       G'MIC
326          interpreter:
327            -  Built-in commands are the hard-coded functionalities in the
328          interpreter  core.  They  are  thus  compiled as binary code and run
329       fast, most of
330          the time. Omitting an argument when invoking a built-in  command  is
331       not
332          permitted,  except  if all following arguments are also omitted. For
333       instance,
334          invoking 'plasma 10,,5' is invalid but 'plasma 10' is correct.
335            -  Custom commands, are defined as G'MIC pipelines of built-in or
336          other custom commands. They are parsed by the G'MIC interpreter, and
337       thus run a
338          bit  slower than built-in commands. Omitting arguments when invoking
339       a custom
340          command is permitted. For instance, expressions  'flower  ,,,100,,2'
341       or
342          'flower ,' are correct.
343
344          *  Most  of  the  existing commands in G'MIC are actually defined as
345       custom
346          commands.
347          * A user can easily add its own custom commands to the G'MIC  inter‐
348       preter (see
349          section  Adding Custom Commands for more details). New built-in com‐
350       mands
351          cannot be added (unless you modify the G'MIC interpreter source code
352       and
353          recompile it).
354
355
356         7. Input/Output Properties
357            -----------------------
358
359          *  G'MIC is able to read/write most of the classical image file for‐
360       mats,
361          including:
362            -  2D grayscale/color files: '.png', '.jpeg', '.gif',
363          '.pnm', '.tif', '.bmp', ...
364            -  3D volumetric files: '.dcm', '.hdr', '.nii',
365          '.cube', '.pan', '.inr', '.pnk', ...
366            -  Video files: '.mpeg', '.avi', '.mp4', '.mov',
367          '.ogg', '.flv', ...
368            -  Generic text or binary data files: '.gmz', '.cimg',
369          '.cimgz', 'flo', 'ggr', 'gpl', '.dlm',
370          '.asc', '.pfm', '.raw', '.txt', '.h'.
371            -  3D mesh files: '.off', '.obj'.
372
373          * When dealing with color images, G'MIC generally reads, writes  and
374       displays
375          data using the usual sRGB color space.
376          * When loading a '.png' and '.tiff' file, the bit-depth of the
377          input image(s) is returned to the status.
378          * G'MIC is able to manage 3D objects that may be read from files or
379          generated  by  G'MIC commands. A 3D object is stored as a one-column
380       scalar image
381          containing the object data, in the following order: {  magic_number;
382       sizes;
383          vertices;  primitives; colors; opacities }. These 3D representations
384       can be
385          then processed as regular images (see command split3d for  accessing
386       each
387          of these 3D object data separately).
388          *  Be  aware that usual file formats may be sometimes not adapted to
389       store all
390          the available image data, since G'MIC uses float-valued  image  buf‐
391       fers. For
392          instance,   saving   an   image  that  was  initially  loaded  as  a
393       16bits/channel image,
394          as a '.jpg' file will result in a loss of information. Use the
395          G'MIC-specific file extension '.gmz' to ensure that all data  preci‐
396       sion is
397          preserved when saving images.
398          * Sometimes, file options may/must be set for file formats:
399            -   Video  files:  Only  sub-frames  of  an  image sequence may be
400       loaded,
401          using the input expression 'filename.ext,[first_frame[,last_frame[,
402          step]]]'. Set 'last_frame==-1' to tell it must be the last frame of
403          the video. Set 'step' to '0' to force an opened video file to be
404          opened/closed. Output framerate and codec can be also set  by  using
405       the output
406          expression 'filename.avi,_fps,_codec,_keep_open' where 'keep_open'
407          can be { 0 | 1 }. 'codec' is a 4-char string (see
408          http://www.fourcc.org/codecs.php ) or '0' for the default codec.
409          'keep_open' tells if the output video file must be kept open for
410          appending new frames afterwards.
411            -  '.cimg[z]' files: Only crops and sub-images of .cimg files
412          can be loaded, using the input expressions 'filename.cimg,N0,N1',
413          'filename.cimg,N0,N1,x0,x1', 'filename.cimg,N0,N1,x0,y0,x1,y1',
414          'filename.cimg,N0,N1,x0,y0,z0,x1,y1,z1'           or          'file‐
415       name.cimg,N0,N1,x0,y0,
416          z0,c0,x1,y1,z1,c1'. Specifying '-1' for one coordinates  stands  for
417       the
418          maximum     possible     value.     Output     expression     'file‐
419       name.cimg[z][,datatype]'
420          can be used to force the output pixel type. 'datatype' can be { auto
421       |
422          bool  |  uint8  |  int8 | uint16 | int16 | uint32 | int32 | uint64 |
423       int64 |
424          float32 | float64 }.
425            -  '.raw' binary files: Image dimensions and input pixel type
426          may be specified when loading '.raw' files with input expression
427          'filename.raw[,datatype][,width][,height[,depth[,dim[,offset]]]]]'.
428       If no
429          dimensions are specified, the resulting image is a one-column vector
430       with
431          maximum possible height. Pixel type can also be specified  with  the
432       output
433          expression 'filename.raw[,datatype]'. 'datatype' can be the same as
434          for '.cimg[z]' files.
435            -  '.yuv' files: Image dimensions must be specified when loading,
436           and  only  sub-frames of an image sequence may be loaded, using the
437       input
438          expression                'filename.yuv,width,height[,chroma_subsam‐
439       pling[,first_frame[,
440          last_frame[,step]]]'. 'chroma_subsampling' can be { 420 | 422 | 444
441          }. When saving, chroma subsampling mode can be specified with output
442          expression 'filename.yuv[,chroma_subsampling]'.
443            -  '.tiff' files: Only sub-images of multi-pages tiff files can
444          be     loaded,     using     the     input     expression     'file‐
445       name.tif,_first_frame,_last_frame,
446          _step'. Output expression 'filename.tiff,_datatype,_compression,
447          _force_multipage,_use_bigtiff' can be used  to  specify  the  output
448       pixel type,
449          as well as the compression method. 'datatype' can be the same as for
450          '.cimg[z]' files. 'compression' can be  { none (default) | lzw |
451          jpeg }. 'force_multipage' can be { 0=no (default) | 1=yes }.
452          'use_bigtiff' can be { 0=no | 1=yes (default) }.
453            -  '.pdf' files: When loading a file, the rendering resolution
454          can  be  specified  using the input expression 'filename.pdf,resolu‐
455       tion',
456          where 'resolution' is an unsigned integer value.
457            -  '.gif' files: Animated gif files can be saved, using the
458          input expression 'filename.gif,fps>0,nb_loops'. Specify
459          'nb_loops=0' to get an infinite number of animation loops  (this  is
460       the
461          default behavior).
462            -  '.jpeg' files: The output quality may be specified (in %),
463          using  the  output  expression 'filename.jpg,30' (here, to get a 30%
464       quality
465          output). '100' is the default.
466            -  '.mnc' files: The output header can set from another file,
467          using the output expression 'filename.mnc,header_template.mnc'.
468            -  '.pan', '.cpp', '.hpp', '.c' and '.h'
469          files: The output datatype can be selected with output expression
470          'filename[,datatype]'. 'datatype' can be the same as for
471          '.cimg[z]' files.
472            -  '.gmic' files: These filenames are assumed to be G'MIC custom
473          commands files. Loading such a file will add the commands it defines
474       to the
475          interpreter.  Debug information can be enabled/disabled by the input
476       expression
477          'filename.gmic[,add_debug_info]' where 'debug_info' can be {
478          0=false | 1=true }.
479            -  Inserting 'ext:' on the beginning of a filename (e.g.
480          'jpg:filename') forces G'MIC to read/write the file as it would have
481       been
482          done if it had the specified extension '.ext'.
483
484          *  Some  input/output  formats and options may not be supported, de‐
485       pending on the
486          configuration flags that have been set during the build of the G'MIC
487       software.
488
489
490         8. Substitution Rules
491            ------------------
492
493          * G'MIC items containing '$' or '{}' are substituted before
494          being interpreted. Use these substituting expressions to access var‐
495       ious data
496          from the interpreter environment.
497          * '$name' and '${name}' are both substituted by the value of the
498          specified named variable (set previously by the item  'name=value').
499       If
500          this  variable  has  not been already set, the expression is substi‐
501       tuted by the
502          highest positive index of the named image '[name]'. If no image  has
503       this
504          name,  the expression is substituted by the value of the OS environ‐
505       ment variable
506          with same name (it may be thus an empty string  if  it  is  not  de‐
507       fined).
508          *  The  following reserved variables are predefined by the G'MIC in‐
509       terpreter:
510            -  '$!': The current number of images in the list.
511            -  '$>' and '$<': The increasing/decreasing index of the latest
512          (currently running) 'repeat...done' loop. '$>' goes from '0'
513          (first loop iteration) to 'nb_iterations - 1' (last iteration).
514          '$<' does the opposite.
515            -  '$/': The current call stack.  Stack  items  are  separated  by
516       slashes
517          '/'.
518            -  '$|': The current value (expressed in seconds) of a millisecond
519          precision timer.
520            -  '$^': The current verbosity level.
521            -  '$_cpus': The number of computation cores available on your ma‐
522       chine.
523            -  '$_flags': The list of enabled flags when G'MIC interpreter has
524          been compiled.
525            -  '$_host': A string telling about the host running the G'MIC
526          interpreter (e.g. 'cli' or 'gimp').
527            -  '$_os': A string describing the running operating system.
528            -  '$_path_rc': The path to the G'MIC folder used to store
529          configuration files (its value is OS-dependent).
530            -  '$_path_user': The path to the G'MIC user file '.gmic' or
531          'user.gmic' (its value is OS-dependent).
532            -  '$_path_commands': A list of all imported command files (stored
533       as
534          an image list).
535            -  '$_pid': The current process identifier, as an integer.
536            -  '$_pixeltype': The type of image pixels (default: 'float32').
537            -   '$_prerelease':  For pre-releases, the date of the pre-release
538       as
539          'yymmdd'. For stable releases, this variable is set to '0'.
540            -  '$_version': A 3-digits number telling about the  current  ver‐
541       sion of
542          the G'MIC interpreter  (e.g. '326').
543            -  '$_vt100': Set to '1' if colored text output is allowed on
544          the console. Otherwise, set to '0'.
545
546          * '$$name' and '$${name}' are both substituted by the G'MIC script
547          code  of the specified named 'custom command', or by an empty string
548       if no
549          custom command with specified name exists.
550          * '${"-pipeline"}' is substituted by the status value after the
551          execution of the specified G'MIC pipeline (see command status).
552          Expression '${}' thus stands for the current status value.
553          * '{``string}' (starting with two backquotes) is substituted by a
554          double-quoted version of the specified string.
555          * '{/string}' is substituted by the escaped version of the specified
556          string.
557          * '{'string'[:delimiter]}' (between single quotes) is substituted by
558       the
559          sequence of character codes that composes the specified string, sep‐
560       arated by
561          specified delimiter. Possible delimiters are ',' (default), ';',
562          '/', '^' or ' '. For instance, item '{'foo'}' is substituted
563          by '102,111,111' and '{'foo':;}' by '102;111;111'.
564          * '{image,feature[:delimiter]}' is substituted by a specific feature
565       of
566          the image '[image]'. 'image' can be either an image number or an
567          image  name.  It  can  be also eluded, in which case, the last image
568       '[-1]'
569          of the list is considered for the requested feature. Specified 'fea‐
570       ture'
571          can be one of:
572            -   'b': The image basename (i.e. filename without the folder path
573       nor
574          extension).
575            -  'f': The image folder name.
576            -  'n': The image name or filename (if the  image  has  been  read
577       from a
578          file).
579            -   't': The text string from the image values regarded as charac‐
580       ter
581          codes.
582            -  'x': The image extension (i.e the characters after the last
583          '.' in the image name).
584            -  '^': The sequence of all image values, separated by commas ',
585          '.
586            -  '@subset': The sequence of image values corresponding to the
587          specified subset, and separated by commas ','.
588            -  Any other 'feature' is considered as a mathematical
589          expression associated to the image '[image]' and is  substituted  by
590       the
591          result  of  its  evaluation  (float value). For instance, expression
592       '{0,
593          w+h}' is substituted by the sum of the width and height of the first
594       image
595          (see section Mathematical Expressions for more details). If a
596          mathematical expression starts with an underscore '_', the resulting
597          value  is truncated to a readable format. For instance, item '{_pi}'
598       is
599          substituted by '3.14159' (while '{pi}' is substituted by
600          '3.141592653589793').
601            -  A 'feature' delimited by backquotes is  replaced  by  a  string
602       whose
603          character  codes correspond to the list of values resulting from the
604       evaluation
605          of  the  specified  mathematical  expression.  For  instance,   item
606       '{`[102,111,
607          111]`}' is substituted by 'foo' and item '{`vector8(65)`}' by
608          'AAAAAAAA'.
609
610          *  '{*}'  is substituted by the visibility state of the instant dis‐
611       play
612          window '#0' (can be { 0=closed | 1=visible }.
613          * '{*[index],feature1,...,featureN[:delimiter]}' is substituted by a
614          specific set of features of the instant display window '#0' (or
615          '#index', if specified). Requested 'features' can be:
616            -  'u': screen width (actually independent on the window size).
617            -  'v': screen height (actually independent on the window size).
618            -  'uv': screen width x screen height.
619            -  'd': window width (i.e. width of the window widget).
620            -  'e': window height (i.e. height of the window widget).
621            -  'de': window width x window height.
622            -  'w': display width (i.e. width of the display area  managed  by
623       the
624          window).
625            -  'h': display height (i.e. height of the display area managed by
626       the
627          window).
628            -  'wh': display width x display height.
629            -  'i': X-coordinate of the display window.
630            -  'j': Y-coordinate of the display window.
631            -  'n': current normalization type of the instant display.
632            -  't': window title of the instant display.
633            -  'x': X-coordinate of the mouse position (or -1, if outside the
634          display area).
635            -  'y': Y-coordinate of the mouse position (or -1, if outside the
636          display area).
637            -  'b': state of the mouse buttons { 1=left-but. | 2=right-but. |
638          4=middle-but. }.
639            -  'o': state of the mouse wheel.
640            -  'k': decimal code of the pressed key if any, 0 otherwise.
641            -  'c': boolean (0 or 1) telling if the instant display has been
642          closed recently.
643            -  'r': boolean telling if the instant display has been resized
644          recently.
645            -  'm': boolean telling if the instant display has been moved  re‐
646       cently.
647            -   Any other 'feature' stands for a keycode name (in capital let‐
648       ters),
649          and is substituted by a boolean describing the current key  state  {
650       0=pressed
651          | 1=released }.
652            -  You can also prepend a hyphen '-' to a 'feature' (that
653          supports  it)  to  flush  the  corresponding event immediately after
654       reading its
655          state (works for keys, mouse and window events).
656
657          * Item substitution is  never  performed  in  items  between  double
658       quotes.
659          One  must  break  the quotes to enable substitution if needed, as in
660       '"3+8 kg =
661          "{3+8}" kg"'. Using double quotes is then a convenient way  to  dis‐
662       able the
663          substitutions mechanism in items, when necessary.
664          *  One  can also disable the substitution mechanism on items outside
665       double
666          quotes, by escaping the '{', '}' or '$' characters, as in
667          '3+4 doesn't evaluate'.
668
669
670         9. Mathematical Expressions
671            ------------------------
672
673          * G'MIC has an embedded mathematical parser, used to evaluate
674          (possibly complex) math expressions specified inside braces '{}', or
675          formulas in commands that may take one as an argument (e.g. fill or
676          eval).
677          * When the context allows it, a formula is evaluated for each  pixel
678       of
679          the selected images (e.g. fill or eval).
680          * A math expression may return a scalar or a vector-valued result
681          (with a fixed number of components).
682         The  mathematical  parser understands the following set of functions,
683       operators
684          and variables:
685
686         ## Usual math operators:
687
688         '||' (logical or), '&&' (logical and), '|' (bitwise or),
689          '&' (bitwise and), '!=', '==', '<=', '>=',
690          '<', '>', '<<' (left bitwise shift), '>>' (right
691          bitwise shift), '-', '+', '*', '/', '%' (modulo),
692          '^' (power), '!' (logical not), '~' (bitwise not), '++',
693           '--', '+=', '-=', '*=', '/=', '%=',
694          '&=', '|=', '^=', '>>', '<<=' (in-place
695          operators).
696
697         ## Usual math functions:
698
699         'abs()', 'acos()', 'acosh()', 'arg()', 'arg0()',
700          'argkth()', 'argmax()', 'argmaxabs()', 'argmin()',
701          'argminabs()', 'asin()', 'asinh()', 'atan()',
702          'atan2()', 'atanh()', 'avg()', 'bool()', 'cbrt()',
703           'ceil()', 'cos()', 'cosh()', 'cut()',
704          'deg2rad()', 'erf()', 'erfinv()', 'exp()',
705          'fact()', 'fibo()', 'floor()', 'gamma()',
706          'gauss()', 'gcd()', 'int()', 'isnan()', 'isnum()',
707           'isinf()', 'isint()', 'isbool()', 'isexpr()',
708          'isfile()', 'isdir()', 'isin()', 'kth()', 'log()',
709           'log2()', 'log10()', 'max()', 'maxabs()',
710          'med()', 'min()', 'minabs()', 'narg()', 'prod()',
711          'rad2deg()', 'rol()' (left bit rotation), 'ror()' (right bit
712          rotation), 'round()', 'sign()', 'sin()', 'sinc()',
713          'sinh()', 'sqrt()', 'std()', 'srand(_seed)',
714          'sum()', 'tan()', 'tanh()', 'var()', 'xor()'.
715
716          * 'cov(A,B,_avgA,_avgB)' estimates the covariance between vectors
717          'A' and 'B' (estimated averages of these vectors may be specified
718          as arguments).
719          * 'mse(A,B)' returns the mean-squared error between vectors 'A'
720          and 'B'.
721          * 'atan2(y,x)' is the version of 'atan()' with two arguments
722          'y' and 'x' (as in C/C++).
723          * 'permut(k,n,with_order)' computes the number of permutations of
724          'k' objects from a set of 'n' objects.
725          * 'gauss(x,_sigma,_is_normalized)' returns
726          'exp(-x^2/(2*s^2))/(is_normalized?sqrt(2*pi*sigma^2):1)'.
727          * 'cut(value,min,max)' returns 'value' if it is in range '[min,
728          max]', or 'min' or 'max' otherwise.
729          * 'narg(a_1,...,a_N)' returns  the  number  of  specified  arguments
730       (here,
731          'N').
732          * 'arg(i,a_1,..,a_N)' returns the 'i'-th argument 'a_i'.
733          * 'isnum()', 'isnan()', 'isinf()', 'isint()',
734          'isbool()'  test the type of the given number or expression, and re‐
735       turn
736          '0' (false) or '1' (true).
737          * 'isfile('path')' (resp. 'isdir('path')') returns '0'
738          (false) or '1' (true) whether its string argument is a path to an
739          existing file (resp. to a directory) or not.
740          * 'isvarname('str')' returns '0' (false) or '1' (true)
741          whether its string argument would be a valid to name a  variable  or
742       not.
743          * 'isin(v,a_1,...,a_n)' returns '0' (false) or '1' (true)
744          whether the first argument 'v' appears in the set of other argument
745          'a_i'.
746          * 'inrange(value,m,M,include_m,include_M)' returns '0' (false) or
747          '1' (true) whether the specified value lies in range '[m,M]' or not
748          ('include_m' and 'includeM' tells how boundaries 'm' and
749          'M' are considered).
750          * 'argkth()', 'argmin()', 'argmax()', 'argminabs()',
751          'argmaxabs()'', 'avg()', 'kth()', 'min()',
752          'max()', 'minabs()', 'maxabs()', 'med()',
753          'prod()', 'std()', 'sum()' and 'var()' can be called
754          with an arbitrary number of scalar/vector arguments.
755          * 'vargkth()', 'vargmin()', 'vargmax()',
756          'vargminabs()', 'vargmaxabs()', 'vavg()', 'vkth()',
757          'vmin()', 'vmax()', 'vminabs()', 'vmaxabs()',
758          'vmed()', 'vprod()', 'vstd()', 'vsum()' and
759          'vvar()'  are the versions of the previous function with vector-val‐
760       ued
761          arguments.
762          * 'round(value,rounding_value,direction)' returns a rounded value.
763          'direction' can be { -1=to-lowest | 0=to-nearest | 1=to-highest }.
764          * 'lerp(a,b,t)' returns 'a*(1-t)+b*t'.
765          * 'swap(a,b)' swaps the values of the given arguments.
766
767         ## Variable names:
768
769         Variable names below are pre-defined. They can be overridden.
770          * 'l': length of the associated list of images.
771          * 'k': index of the associated image, in '[0,l-1]'.
772          * 'w': width of the associated image, if any ('0' otherwise).
773          * 'h': height of the associated image, if any ('0' otherwise).
774          * 'd': depth of the associated image, if any ('0' otherwise).
775          * 's': spectrum of the associated image, if any ('0' otherwise).
776          * 'r': shared state of the associated image, if any ('0'
777          otherwise).
778          * 'wh': shortcut for width x height.
779          * 'whd': shortcut for width x height x depth.
780          * 'whds': shortcut for width x height x depth x spectrum (i.e.  num‐
781       ber of
782          image values).
783          * 'im', 'iM', 'ia', 'iv', 'id', 'is',
784          'ip', 'ic', 'in': Respectively the minimum, maximum, average,
785          variance, standard deviation, sum, product, median value and L2-norm
786       of the
787          associated image, if any ('0' otherwise).
788          * 'xm', 'ym', 'zm', 'cm': The pixel coordinates of the
789          minimum value in the associated image, if any ('0' otherwise).
790          * 'xM', 'yM', 'zM', 'cM': The pixel coordinates of the
791          maximum value in the associated image, if any ('0' otherwise).
792          * All these variables are considered as constant values by the math
793          parser (for optimization purposes) which is indeed the case most  of
794       the time.
795          Anyway, this might not be the case, if function 'resize(#ind,..)' is
796       used
797          in the math expression. If so,  it  is  safer  to  invoke  functions
798       'l()',
799          'w(_#ind)', 'h(_#ind)', ... 's(_#ind)' and 'in(_#ind)'
800          instead of the corresponding named variables.
801          * 'i': current processed pixel value (i.e. value located at '(x,y,z,
802          c)') in the associated image, if any ('0' otherwise).
803          * 'iN': N-th channel value of current processed pixel (i.e. value
804          located at '(x,y,z,N)' in the associated image, if any ('0'
805          otherwise). 'N' must be an integer in range '[0,9]'.
806          * 'R', 'G', 'B' and 'A' are equivalent to 'i0',
807          'i1', 'i2' and 'i3' respectively.
808          *  'I':  current vector-valued processed pixel in the associated im‐
809       age, if
810          any ('0' otherwise). The number of vector components is equal to the
811          number of image channels (e.g. 'I' = '[ R,G,B ]' for a 'RGB'
812          image).
813          * You may add '#ind' to any of the variable name above  to  retrieve
814       the
815          information  for  any  numbered image '[ind]' of the list (when this
816       makes
817          sense). For instance 'ia#0' denotes the average value of  the  first
818       image
819          of the list).
820          * 'x': current processed column of the associated image, if any
821          ('0' otherwise).
822          * 'y': current processed row of the associated image, if any ('0'
823          otherwise).
824          * 'z': current processed slice of the associated image, if any
825          ('0' otherwise).
826          * 'c': current processed channel of the associated image, if any
827          ('0' otherwise).
828          *  't':  thread  id  when  an  expression is evaluated with multiple
829       threads
830          ('0' means master thread).
831          * 'n': maximum number of threads when expression is evaluated in
832          parallel (so that 't' goes from '0' to 'n-1').
833          * 'e': value of e, i.e. '2.71828...'.
834          * 'pi': value of pi, i.e. '3.1415926...'.
835          * 'u': a random value between '[0,1]', following a uniform
836          distribution.
837          * 'v': a random value between '[-1,1]', following a uniform
838          distribution.
839          * 'g': a random value, following a gaussian distribution of variance
840       1
841          (roughly in '[-6,6]').
842          * 'interpolation': value of the default interpolation mode used when
843          reading pixel values with the pixel access operators (i.e. when the
844          interpolation  argument  is  not explicitly specified, see below for
845       more details
846          on pixel access operators). Its initial default value is '0'.
847          * 'boundary': value of the default  boundary  conditions  used  when
848       reading
849          pixel values with the pixel access operators (i.e. when the boundary
850       condition
851          argument is not explicitly specified, see below for more details  on
852       pixel
853          access operators). Its initial default value is '0'.
854          * The last image of the list is always associated to the evaluations
855       of
856          'expressions', e.g. G'MIC sequence
857
858           256,128 fill {w}
859
860          will create a 256x128 image filled with value 256.
861
862         ## Vector calculus:
863
864         Most operators are also able to work with vector-valued elements.
865          * '[a0,a1,...,aN-1]' defines a 'N'-dimensional vector with scalar
866          coefficients 'ak'.
867          * 'vectorN(a0,a1,,...,aN-1)' does the same, with the 'ak' being
868          repeated periodically if only a few are specified.
869          * 'vector(#N,a0,a1,,...,aN-1)' does the same, and can  be  used  for
870       any
871          constant expression 'N'.
872          * In previous expressions, the 'ak' can be vectors themselves, to be
873          concatenated into a single vector.
874          * The scalar element 'ak' of a vector 'X' is retrieved by
875          'X[k]'.
876          * The sub-vector '[X[p],X[p+s]...X[p+s*(q-1)]]' (of size 'q') of a
877          vector 'X' is retrieved by 'X[p,q,s]'.
878          * 'expr(formula,_w,_h,_d,_s)' outputs a vector of size 'w*h*d*s'
879          with  values  generated  from  the specified formula, as if one were
880       filling an
881          image with dimensions '(w,h,d,s)'.
882          * Equality/inequality comparisons between two vectors is  done  with
883       operators
884          '==' and '!='.
885          *  Some  vector-specific  functions  can  be  used on vector values:
886       'cross(X,
887          Y)' (cross product), 'dot(X,Y)' (dot product), 'size(X)' (vector
888          dimension), 'sort(X,_is_increasing,_nb_elts,_size_elt)' (sorted val‐
889       ues),
890          'reverse(A)' (reverse order of components), 'map(X,P,_nb_channelsX,
891          _nb_channelsP,_boundary_conditions)', 'shift(A,_length,
892          _boundary_conditions)' and 'same(A,B,_nb_vals,_is_case_sensitive)'
893          (vector equality test).
894          * Function 'normP(u1,...,un)' computes the LP-norm of the specified
895          vector ('P' being a constant or 'inf', as in e.g. 'norm1()').
896          *  Function 'normp(V,_p)' computes the Lp-norm of the specified vec‐
897       tor
898          'V'. Here, 'p' can be variable. Default value for 'p' is 2.
899          * Function 'unitnorm(V,_p)' returns a normalized version
900          'V/normp(V)' of specified vector 'V'. Default value for 'p'
901          is 2.
902          * Function 'resize(A,size,_interpolation,_boundary_conditions)'  re‐
903       turns
904          a resized version of a vector 'A' with specified interpolation mode.
905          'interpolation' can be { -1=none (memory content) | 0=none | 1=near‐
906       est
907          | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }, and
908          'boundary_conditions' can be { 0=dirichlet | 1=neumann |  2=periodic
909       |
910          3=mirror }.
911          * Function 'resize(A,ow,oh,od,os,nw,_nh,_nd,_ns,_interpolation,
912          _boundary_conditions,_ax,_ay,_az,_ac)' is an extended version of the
913          previous  function.  It  allows to resize the vector 'A', seen as an
914       image
915          of size 'ow x oh x od x os' as a new image of size 'nw x nh x  nd  x
916       ns', with
917          specified resizing options.
918          *  Function 'find(A,B,_starting_index,_search_step)' returns the in‐
919       dex
920          where sub-vector 'B' appears in vector 'A', (or '-1' if
921          'B' is not contained in 'A'). Argument 'A' can be also
922          replaced by an image index '#ind'.
923          * A '2'-dimensional vector may be seen as a complex number and  used
924       in
925          those particular functions/operators: '**' (complex multiplication),
926          '//' (complex division), '^^' (complex exponentiation), '**='
927          (complex self-multiplication), '//=' (complex self-division), '^^='
928          (complex self-exponentiation), 'cabs()' (complex modulus), 'carg()'
929          (complex argument), 'cconj()' (complex conjugate), 'cexp()'
930          (complex exponential), 'clog()' (complex logarithm),  'ccos()'
931          (complex cosine), 'csin()' (complex sine), 'csqrt()' (complex
932          square root), 'ctan()' (complex tangent), 'ccosh()' (complex
933          hyperpolic cosine), 'csinh()' (complex hyperbolic sine) and
934          'ctanh()' (complex hyperbolic tangent).
935          * A 'MN'-dimensional vector may be seen as a 'M' x 'N'
936          matrix and used in those particular functions/operators: '*'
937          (matrix-vector multiplication), 'det(A)' (determinant), 'diag(V)'
938          (diagonal  matrix  from  a  vector), 'eig(A)' (eigenvalues/eigenvec‐
939       tors),
940          'eye(n)' (n x n identity matrix), 'invert(A,_nb_colsA,_use_LU,
941          _lambda)' (matrix inverse), 'mul(A,B,_nb_colsB)' (matrix-matrix
942          multiplication), 'rot(u,v,w,angle)' (3D rotation matrix),
943          'rot(angle)' (2D rotation matrix), 'solve(A,B,_nb_colsB,_use_LU)'
944          (solver of linear system  A.X  =  B),  'svd(A,_nb_colsA)'  (singular
945       value
946          decomposition), 'trace(A)' (matrix trace) and 'transpose(A,
947          nb_colsA)' (matrix transpose). Argument 'nb_colsB' may be omitted if
948          it is equal to '1'.
949          *        'mproj(S,nb_colsS,D,nb_colsD,method,max_iter,max_residual)'
950       projects a
951          matrix 'S' onto a dictionary (matrix) 'D'. Equivalent to command
952          mproj but inside the math evaluator.
953          * Specifying a vector-valued math expression as  an  argument  of  a
954       command that
955          operates  on  image values (e.g. 'fill') modifies the whole spectrum
956       range
957          of the processed image(s), for each spatial  coordinates  '(x,y,z)'.
958       The
959          command does not loop over the 'c'-axis in this case.
960
961         ## String manipulation:
962
963         Character  strings  are defined and managed as vectors objects. Dedi‐
964       cated
965          functions and initializers to manage strings are:
966          * '['string']' and ''string'' define a vector whose values are the
967          character codes of the specified 'character string' (e.g. ''foo''
968          is equal to '[ 102,111,111 ]').
969          * '_'character'' returns the (scalar) byte code of the specified
970          character (e.g. '_'A'' is equal to '65').
971          * A special case happens for empty strings: Values of  both  expres‐
972       sions
973          '['']' and '''' are '0'.
974          * Functions 'lowercase()' and 'uppercase()' return string with all
975          string characters lowercased or uppercased.
976          *  Function  's2v(str,_starting_index,_is_strict)'  parses specified
977       string
978          'str' and returns the value contained in it.
979          * Function 'v2s(expr,_nb_digits,_siz)' returns a vector of size
980          'siz' which contains the  character  representation  of  values  de‐
981       scribed by
982          expression 'expr'. 'nb_digits' can be { <-1=0-padding of
983          integers | -1=auto-reduced | 0=all | >0=max number of digits }.
984          *  Function  'echo(str1,str2,...,strN)'  prints the concatenation of
985       given
986          string arguments on the console.
987          * Function 'string(_#siz,str1,str2,...,strN)' generates a vector
988          corresponding to the concatenation of given string/number arguments.
989
990         ## Dynamic arrays:
991
992         A dynamic array is defined as a one-column (or empty)  image  '[ind]'
993       in
994          the image list. It allows elements to be added or removed, each ele‐
995       ment having
996          the same dimension (which is actually the number of channels of  im‐
997       age
998          '[ind]').  Dynamic arrays adapt their size to the number of elements
999       they
1000          contain.
1001
1002         A dynamic array can be manipulated in a  math  expression,  with  the
1003       following
1004          functions:
1005          * 'da_size(_#ind)': Return the number of elements in dynamic array
1006          '[ind]'.
1007          * 'da_back(_#ind)': Return the last element of the dynamic array
1008          '[ind]'.
1009          * 'da_insert(_#ind,pos,elt_1,_elt_2,...,_elt_N)': Insert 'N' new
1010          elements 'elt_k' starting from index 'pos' in dynamic array
1011          '[ind]'.
1012          * 'da_push(_#ind,elt1,_elt2,...,_eltN)': Insert 'N' new elements
1013          'elt_k' at the end of dynamic array '[ind]'.
1014          * 'da_pop(_#ind)': Same as 'da_back()' but also remove last
1015          element from the dynamic array '[ind]'.
1016          * 'da_remove(_#ind,_start,_end)': Remove elements located between
1017          indices 'start' and 'end' (included) in dynamic array '[ind]'.
1018          *  'da_freeze(_#ind)': Convert a dynamic array into a 1-column image
1019       with
1020          height 'da_size(#ind)'.
1021          * The value of the k-th element of  dynamic  array  '[ind]'  is  re‐
1022       trieved
1023          with 'i[_#ind,k]' (if the element is a scalar value), or 'I[_#ind,
1024          k]' (if the element is a vector).
1025
1026         In  the functions above, argument '#ind' may be omitted in which case
1027       it
1028          is assumed to be '#-1'.
1029
1030         ## Special operators:
1031
1032          * ';': expression separator. The returned value is always the last
1033          encountered expression. For instance expression '1;2;pi'  is  evalu‐
1034       ated as
1035          'pi'.
1036          *  '=':  variable  assignment.  Variables in mathematical parser can
1037       only
1038          refer to numerical values (vectors or scalars). Variable names are
1039          case-sensitive. Use this operator in conjunction with ';' to  define
1040       more
1041          complex evaluable expressions, such as
1042
1043           t = cos(x); 3*t^2 + 2*t + 1
1044
1045         These variables remain local to the mathematical parser and cannot be
1046          accessed outside the evaluated expression.
1047          * Variables defined in math parser may have a constant property, by
1048          specifying keyword 'const' before the variable name (e.g. 'const foo
1049       =
1050          pi/4;'). The value set to such a variable must be indeed a constant
1051          scalar. Constant variables allows certain types of optimizations  in
1052       the math
1053          JIT compiler.
1054
1055         ## Specific functions:
1056
1057          *  'addr(expr)': return the pointer address to the specified expres‐
1058       sion
1059          'expr'.
1060          * 'o2c(_#ind,offset)' and 'c2o(_#ind,x,_y,_z,_c)': Convert image
1061          offset to image coordinates and vice-versa.
1062          * 'fill(target,expr)' or 'fill(target,index_name,expr)' fill the
1063          content of the specified target (often vector-valued) using a  given
1064       expression,
1065          e.g.  'V  = vector16(); fill(V,k,k^2 + k + 1);'. For a vector-valued
1066       target,
1067           it is basically equivalent to: 'for (index_name = 0,
1068          index_name<size(target), ++index_name, target[index_name] = expr);'.
1069          * 'u(max)' or 'u(min,max,_include_min,_include_max)': return a
1070          random value in range '0...max' or 'min...max', following a uniform
1071          distribution. Each range extremum can be included (default)  in  the
1072       distribution
1073          or not.
1074          * 'f2ui(value)' and 'ui2f(value)': Convert a large unsigned
1075          integer as a negative floating point value (and vice-versa), so that
1076       32bits
1077          floats can be used to store large integers while keeping  a  unitary
1078       precision.
1079          *  'i(_a,_b,_c,_d,_interpolation_type,_boundary_conditions)': return
1080       the
1081          value of the pixel located at position '(a,b,c,d)' in the associated
1082          image, if any ('0' otherwise). 'interpolation_type' can be {
1083          0=nearest neighbor | 1=linear | 2=cubic }. 'boundary_conditions' can
1084          be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. Omitted
1085          coordinates are replaced by their default values which  are  respec‐
1086       tively
1087          'x', 'y', 'z', 'c', 'interpolation' and
1088          'boundary'. For instance command
1089
1090           fill 0.5*(i(x+1)-i(x-1))
1091
1092          will  estimate  the X-derivative of an image with a classical finite
1093       difference
1094          scheme.
1095          * 'j(_dx,_dy,_dz,_dc,_interpolation_type,_boundary_conditions)' does
1096       the
1097          same  for  the  pixel  located  at  position '(x+dx,y+dy,z+dz,c+dc)'
1098       (pixel
1099          access relative to the current coordinates).
1100          * 'i[offset,_boundary_conditions]' returns the value of the pixel
1101          located at specified 'offset' in the associated image buffer (or
1102          '0' if offset is out-of-bounds).
1103          * 'j[offset,_boundary_conditions]' does the same for an offset rela‐
1104       tive
1105          to the current pixel coordinates '(x,y,z,c)'.
1106          *         'i(#ind,_x,_y,_z,_c,_interpolation,_boundary_conditions)',
1107       'j(#ind,
1108          _dx,_dy,_dz,_dc,_interpolation,_boundary_conditions)',  'i[#ind,off‐
1109       set,
1110          _boundary_conditions]' and 'i[offset,_boundary_conditions]' are
1111          similar expressions used to access pixel values for any numbered im‐
1112       age
1113          '[ind]' of the list.
1114          * 'I/J[_#ind,offset,_boundary_conditions]' and 'I/J(_#ind,_x,_y,_z,
1115          _interpolation,_boundary_conditions)' do the same as 'i/j[_#ind,off‐
1116       set,
1117          _boundary_conditions]' and 'i/j(_#ind,_x,_y,_z,_c,_interpolation,
1118          _boundary_conditions)' but return a vector instead of a scalar (e.g.
1119       a
1120          vector '[ R,G,B ]' for a pixel at '(a,b,c)' in a color image).
1121          * 'crop(_#ind,_x,_y,_z,_c,_dx,_dy,_dz,_dc,_boundary_conditions)' re‐
1122       turns
1123          a  vector whose values come from the cropped region of image '[ind]'
1124       (or
1125          from default image selected if 'ind' is not specified). Cropped  re‐
1126       gion
1127          starts from point '(x,y,z,c)' and has a size of 'dx x dy x dz x
1128          dc'.  Arguments for coordinates and sizes can be omitted if they are
1129       not
1130          ambiguous (e.g. 'crop(#ind,x,y,dx,dy)' is a valid invocation of this
1131          function).
1132          * 'crop(S,w,h,d,s,_x,_y,_z,_c,_dx,_dy,_dz,_dc,_boundary_conditions)'
1133          does the same but extracts the  cropped  data  from  a  vector  'S',
1134       viewed as
1135          an image of size 'w x h x d x s'.
1136          *     'draw(_#ind,S,_x,_y,_z,_c,_dx,_dy,_dz,_dc,_opacity,_M,_max_M)'
1137       draws a
1138          sprite 'S' in image '[ind]' (or in default image selected if
1139          'ind' is not specified) at coordinates '(x,y,z,c)'.
1140          * 'draw(D,w,h,s,d,S,_x,_y,_z,_c,_dx,_dy,_dz,_dc,_opacity,_M,_max_M)'
1141          does the same but draw the sprite 'S' in the vector 'D', viewed as
1142          an image of size 'w x h x d x s'.
1143          * 'polygon(_#ind,nb_vertices,coords,_opacity,_color)' draws a filled
1144          polygon in image '[ind]' (or in default image selected if 'ind' is
1145          not specified) at specified coordinates. It draws a single line if
1146          'nb_vertices' is set to 2.
1147          *      'polygon(_#ind,-nb_vertices,coords,_opacity,_pattern,_color)'
1148       draws a
1149          outlined polygon in image '[ind]' (or in default image selected if
1150          'ind'  is not specified) at specified coordinates and with specified
1151       line
1152          pattern. It draws a single line if 'nb_vertices' is set to 2.
1153          *     'ellipse(_#ind,xc,yc,radius1,_radius2,_angle,_opacity,_color)'
1154       draws a
1155          filled ellipse in image '[ind]' (or in default image selected if
1156          'ind' is not specified) with specified coordinates.
1157          * 'ellipse(_#ind,xc,yc,-radius1,-_radius2,_angle,_opacity,_pattern,
1158          _color)' draws an outlined ellipse in image '[ind]' (or in default
1159          image selected if 'ind' is not specified).
1160          *                   'resize(#ind,w,_h,_d,_s,_interp,_boundary_condi‐
1161       tions,_cx,_cy,_cz,_cc)'
1162          resizes an image of the associated list with specified dimension and
1163          interpolation method. When using this function, you should  consider
1164       retrieving
1165          the (non-constant) image dimensions using the dynamic functions
1166          'w(_#ind)', 'h(_#ind)', 'd(_#ind)', 's(_#ind)',
1167          'wh(_#ind)', 'whd(_#ind)' and 'whds(_#ind)' instead of the
1168          corresponding constant variables.
1169          * 'if(condition,expr_then,_expr_else)': return value of
1170          'expr_then' or 'expr_else', depending on the value of
1171          'condition' { 0=false | other=true }. 'expr_else' can be
1172          omitted  in  which  case  '0'  is returned if the condition does not
1173       hold.
1174          Using the ternary operator  'condition?expr_then[:expr_else]'  gives
1175       an
1176          equivalent expression. For instance, G'MIC commands
1177
1178           fill if(x%10==0,255,i)
1179
1180          and
1181
1182           fill x%10?i:255
1183
1184          both draw blank vertical lines on every 10th column of an image.
1185          * 'do(expression,_condition)' repeats the evaluation of
1186          'expression' until 'condition' vanishes (or until
1187          'expression' vanishes if no 'condition' is specified). For instance,
1188           the expression:
1189
1190           if(N<2,N,n=N-1;F0=0;F1=1;do(F2=F0+F1;F0=F1;F1=F2,n=n-1))
1191
1192          returns the N-th value of the Fibonacci sequence, for 'N>=0' (e.g.,
1193          '46368' for 'N=24'). 'do(expression,condition)' always
1194          evaluates the specified expression at least once, then check for the
1195       loop
1196          condition. When done, it returns the last value of 'expression'.
1197          * 'for(init,condition,_procedure,body)' first evaluates the  expres‐
1198       sion
1199          'init', then iteratively evaluates 'body' (followed by
1200          'procedure' if specified) while 'condition' holds (i.e. not zero).
1201          It  may  happen that no iterations are done, in which case the func‐
1202       tion returns
1203          'nan'. Otherwise, it returns the last value of 'body'. For instance,
1204           the expression:
1205
1206           if(N<2,N,for(n=N;F0=0;F1=1,n=n-1,F2=F0+F1;F0=F1;F1=F2))
1207
1208          returns the 'N'-th value of the Fibonacci sequence, for 'N>=0'
1209          (e.g., '46368' for 'N=24').
1210          * 'while(condition,expression)' is exactly the same as 'for(init,
1211          condition,expression)' without the specification of an initializing
1212          expression.
1213          * 'repeat(nb_iters,expr)' or 'fill(nb_iters,iter_name,expr)' run
1214          'nb_iters' iterations of the specified expression 'expr', e.g.
1215          'V = vector16(); repeat(16,k,V[k] = k^2 + k + 1);'. It is basically
1216          equivalent to: 'for (iter_name = 0, iter_name<nb_iters, ++iter_name,
1217          expr);'.
1218          * 'break()' and 'continue()' respectively breaks and continues the
1219          current running block.
1220          * 'fsize('filename')' returns the size of the specified 'filename'
1221          (or '-1' if file does not exist).
1222          * 'date(attr,'path')' returns the date attribute for the given
1223          'path' (file or directory), with 'attr' being { 0=year | 1=month
1224          | 2=day | 3=day of week | 4=hour | 5=minute | 6=second }, or a  vec‐
1225       tor of
1226          those values.
1227          * 'date(_attr)' returns the specified attribute for the current (lo‐
1228       cale)
1229          date (attributes being { 0...6=same meaning as above  |  7=millisec‐
1230       onds }).
1231          * 'print(expr1,expr2,...)' or 'print(#ind)' prints the value of
1232          the specified expressions (or image information) on the console, and
1233       returns
1234          the value of the last expression (or 'nan' in  case  of  an  image).
1235       Function
1236          'prints(expr)'  also  prints  the  string  composed of the character
1237       codes
1238          defined by the vector-valued expression (e.g. 'prints('Hello')').
1239          * 'debug(expression)' prints detailed debug info about the  sequence
1240       of
1241          operations  done  by the math parser to evaluate the expression (and
1242       returns its
1243          value).
1244          * 'display(_X,_w,_h,_d,_s)' or 'display(#ind)' display the
1245          contents of the vector 'X' (or specified image) and  wait  for  user
1246       events.
1247          if  no  arguments are provided, a memory snapshot of the math parser
1248       environment
1249          is displayed instead.
1250          * 'begin(expression)' and 'end(expression)' evaluates the
1251          specified expressions only once, respectively at the  beginning  and
1252       end of the
1253          evaluation  procedure,  and this, even when multiple evaluations are
1254       required
1255          (e.g. in 'fill ">begin(foo = 0); ++foo"').
1256          * 'copy(dest,src,_nb_elts,_inc_d,_inc_s,_opacity)' copies an entire
1257          memory block of 'nb_elts' elements starting from a source value
1258          'src' to a specified destination 'dest', with increments defined by
1259          'inc_d' and 'inc_s' respectively for the destination and source
1260          pointers.
1261          * 'stats(_#ind)' returns the statistics vector of the running image
1262          '[ind]', i.e the vector '[ im,iM,ia,iv,xm,ym,zm,cm,xM,yM,zM,cM,is,ip
1263          ]' (14 values).
1264          * 'ref(expr,a)' references specified expression 'expr' as variable
1265          name 'a'.
1266          * 'unref(a,b,...)' destroys references to the named  variable  given
1267       as
1268          arguments.
1269          *  'breakpoint()' inserts a possible computation breakpoint (useless
1270       with
1271          the cli interface).
1272          * '_(comment) expr' just returns expression 'expr' (useful  for  in‐
1273       serting
1274          inline comments in math expressions).
1275          *  'run('pipeline')'  executes the specified G'MIC pipeline as if it
1276       was
1277          called outside the currently evaluated expression.
1278          * 'set('variable_name',A)' set the G'MIC variable '$variable_name'
1279          with the value of expression 'A'. If 'A' is a vector-valued
1280          variable, it is assumed to encode a string.
1281          *  'store('variable_name',A,_w,_h,_d,_s,_is_compressed)'   transfers
1282       the
1283          data of vector 'A' as a 'w x h x d x s' image to the G'MIC variable
1284          '$variable_name'. Thus, the data becomes available outside the math
1285          expression  (that  is equivalent to using the regular command store,
1286       but
1287          directly in the math expression).
1288          * 'get('variable_name',_size,_return_as_string)' returns  the  value
1289       of
1290          the specified variable, as a vector of 'size' values, or as a scalar
1291       (if
1292          'size' is zero or not specified).
1293          * 'name(_#ind,size)' returns a vector of size 'size', whose values
1294          are the characters codes of the name of image  '[ind]'  (or  default
1295       image
1296          selected if 'ind' is not specified).
1297          * 'correlate(I,wI,hI,dI,sI,K,wK,hK,dK,sK,_boundary_conditions,
1298          _is_normalized,_channel_mode,_xcenter,_ycenter,_zcenter,_xstart,_ys‐
1299       tart,_zstart,
1300          _xend,_yend,_zend,_xstride,_ystride,_zstride,_xdilation,_ydila‐
1301       tion,_zdilation,
1302          _interpolation_type)' returns the correlation, unrolled as a vector,
1303       of the
1304          'wI x hI x dI x sI'-sized image 'I' with the 'wK x hK x dK x
1305          sK'-sized kernel 'K' (the meaning of the  other  arguments  are  the
1306       same
1307          as in command 'correlate'). Similar function 'convolve(...)' is
1308          also defined for computing the convolution between 'I' and 'K'.
1309
1310         ## User-defined macros:
1311
1312          *  Custom macro functions can be defined in a math expression, using
1313       the
1314          assignment operator '=', e.g.
1315
1316           foo(x,y) = cos(x + y); result = foo(1,2) + foo(2,3)
1317
1318          * Trying to override a built-in function (e.g. 'abs()') has  no  ef‐
1319       fect.
1320          * Overloading macros with different number of arguments is possible.
1321          Re-defining a previously defined macro with the same number of argu‐
1322       ments
1323          discards its previous definition.
1324          * Macro functions are indeed processed as macros by the mathematical
1325          evaluator. You should avoid invoking them with  arguments  that  are
1326       themselves
1327          results of assignments or self-operations. For instance,
1328
1329           foo(x) = x + x; z = 0; foo(++z)
1330
1331          returns '4' rather than expected value '2'.
1332          *  When  substituted, macro arguments are placed inside parentheses,
1333       except if a
1334          number sign '#' is located just before or after the  argument  name.
1335       For
1336          instance, expression
1337
1338           foo(x,y) = x*y; foo(1+2,3)
1339
1340          returns '9' (being substituted as '(1+2)*(3)'), while expression
1341
1342           foo(x,y) = x#*y#; foo(1+2,3)
1343
1344          returns '7' (being substituted as '1+2*3').
1345          *  Number  signs appearing between macro arguments function actually
1346       count for
1347          empty separators. They may be used  to  force  the  substitution  of
1348       macro
1349          arguments in unusual places, e.g. as in
1350
1351           str(N) = ['I like N#'];
1352
1353          *  Macros  with  variadic  arguments can be defined, by specifying a
1354       single
1355          argument name followed by '...'. For instance,
1356
1357           foo(args...) = sum([ args ]^2);
1358
1359          defines a macro that returns the sum of its  squared  arguments,  so
1360       'foo(1,2,
1361          3)' returns '14' and 'foo(4,5)' returns '41'.
1362
1363         ## Multi-threaded and in-place evaluation:
1364
1365          *  If  your  image  data  are large enough and you have several CPUs
1366       available, it
1367          is likely that the math expression passed to a 'fill', 'eval' or
1368          'input' commands is evaluated in parallel, using  multiple  computa‐
1369       tion
1370          threads.
1371          * Starting an expression with ':' or '*' forces the evaluations
1372          required  for  an image to be run in parallel, even if the amount of
1373       data to
1374          process is small (beware, it may  be  slower  to  evaluate  in  this
1375       case!). Specify
1376          ':' (rather than '*') to avoid possible image copy done before
1377          evaluating  the  expression  (this saves memory, but do this only if
1378       you are sure
1379          this step is not required!)
1380          * If the specified expression starts with '>' or '<', the pixel
1381          access operators 'i()', 'i[]', 'j()' and 'j[]' return
1382          values of the image being currently modified, in forward ('>') or
1383          backward ('<') order. The multi-threading evaluation of the  expres‐
1384       sion is
1385          disabled in this case.
1386          *  Function  'critical(expr)'  forces the execution of the given ex‐
1387       pression
1388          in a single thread at a time.
1389          * 'begin_t(expr)' and 'end_t(expr)' evaluates the specified
1390          expression once for each running thread (so possibly several  times)
1391       at the
1392          beginning and the end of the evaluation procedure.
1393          * 'merge(variable,operator)' tells to merge the local variable value
1394          computed  by  threads, with the specified operator, when all threads
1395       have
1396          finished computing.
1397          * Expressions 'i(_#ind,x,_y,_z,_c)=value', 'j(_#ind,x,_y,_z,
1398          _c)=value', 'i[_#ind,offset]=value' and 'j[_#ind,offset]=value'
1399          set a pixel value at a different location than the  running  one  in
1400       the image
1401          '[ind]' (or in the associated image if argument '#ind' is omitted),
1402          either with global coordinates/offsets (with 'i(...)' and 'i[...]'),
1403           or relatively to the current position '(x,y,z,c)' (with 'j(...)'
1404          and 'j[...]'). These expressions always return 'value'.
1405
1406
1407         10. Image and Data Viewers
1408             ----------------------
1409
1410          * G'MIC has some very handy embedded visualization modules, for 1D
1411          signals (command plot), 1D/2D/3D images (command display) and 3D
1412          vector  objects (command display3d). It manages interactive views of
1413       the
1414          selected image data.
1415          * The following actions are available in the interactive viewers:
1416            -  '(mousewheel)': Zoom in/out.
1417            -  'ESC': Close window.
1418            -  'CTRL+D': Increase window size.
1419            -  'CTRL+C': Decrease window size.
1420            -  'CTRL+R': Reset window size.
1421            -  'CTRL+F': Toggle fullscreen mode.
1422            -  'CTRL+S': Save current view as a numbered file
1423          'gmic_xxxx.ext'.
1424            -  'CTRL+O': Save copy of the viewed data, as a numbered file
1425          'gmic_xxxx.ext'.
1426
1427          * Actions specific to the 1D/2D image viewer (command display) are:
1428            -  'Left mouse button': Create an image selection  and  zoom  into
1429       it.
1430            -  'Middle mouse button', or 'CTRL+left mouse button': Move
1431          image.
1432            -  'Mouse wheel' or 'PADD+/-': Zoom in/out.
1433            -  'Arrow keys': Move image left/right/up/down.
1434            -  'CTRL+A': Enable/disable transparency (show alpha channel).
1435            -  'CTRL+N': Change normalization mode (can be { none | normal |
1436          channel-by-channel }).
1437            -  'CTRL+SPACE': Reset view.
1438            -  'CTRL+X': Show/hide axes.
1439            -  'CTRL+Z': Hold/release aspect ratio.
1440
1441          * Actions specific to the 3D volumetric image viewer (command
1442          display) are:
1443            -  'CTRL+P': Play z-stack of frames as a movie.
1444            -  'CTRL+V': Show/hide 3D view on bottom right zone.
1445            -  'CTRL+X': Show/hide axes.
1446            -  'CTRL+(mousewheel)': Go up/down.
1447            -  'SHIFT+(mousewheel)': Go left/right.
1448            -  'Numeric PAD': Zoom in/out ('+'/'-') and move through
1449          zoomed image (digits).
1450            -  'BACKSPACE': Reset zoom scale.
1451
1452          * Actions specific to the 3D object viewer (command display3d) are:
1453            -  '(mouse)+(left mouse button)': Rotate 3D object.
1454            -  '(mouse)+(right mouse button)': Zoom 3D object.
1455            -  '(mouse)+(middle mouse button)': Shift 3D object.
1456            -  'F1 ... F6': Toggle between different 3D rendering modes.
1457            -  'F7/F8': Decrease/increase focale.
1458            -  'F9': Select animation mode.
1459            -  'F10': Select animation speed.
1460            -  'SPACE': Start/stop animation.
1461            -  'CTRL+A': Show/hide 3D axes.
1462            -  'CTRL+B': Switch between available background.
1463            -  'CTRL+G': Save 3D object, as numbered file 'gmic_xxxx.obj'.
1464            -  'CTRL+L': Show/hide outline.
1465            -  'CTRL+P': Print current 3D pose on stderr.
1466            -  'CTRL+T': Switch between single/double-sided 3D modes.
1467            -  'CTRL+V': Start animation with video output.
1468            -  'CTRL+X': Show/hide 3D bounding box.
1469            -  'CTRL+Z': Enable/disable z-buffered rendering.
1470
1471
1472         11. Adding Custom Commands
1473             ----------------------
1474
1475          *  New  custom commands can be added by the user, through the use of
1476       G'MIC
1477          custom commands files.
1478          * A command file is a simple text file, where each line  starts  ei‐
1479       ther by
1480
1481           command_name: command_definition
1482
1483          or
1484
1485           command_definition (continuation)
1486
1487          * At startup, G'MIC automatically includes user's command file
1488          '$HOME/.gmic' (on Unix) or '%USERPROFILE%ser.gmic' (on
1489          Windows). The CLI tool 'gmic' automatically runs the command
1490          'cli_start' if defined.
1491          *  Custom  command  names  must use character set '[a-zA-Z0-9_]' and
1492       cannot
1493          start with a number.
1494          * Any '# comment' expression found in a custom commands file is
1495          discarded by the G'MIC parser, wherever it is located in a line.
1496          * In a custom command, the following '$-expressions' are  recognized
1497       and
1498          substituted:
1499            -   '$*' is substituted by a verbatim copy of the specified string
1500       of
1501          arguments (do not include arguments set to default values).
1502            -  '$"*"' is substituted by the sequence of specified arguments,
1503          separated by commas ',', each being double-quoted (include arguments
1504       set
1505          to default values).
1506            -   '$#'  is  substituted  by the maximum index of known arguments
1507       (either
1508          specified by the user or set to a default value in the  custom  com‐
1509       mand).
1510            -  '$[]' is substituted by the list of selected image indices that
1511          have been specified in the command invocation.
1512            -  '$?' is substituted by a printable version of '$[]' to be
1513          used in command descriptions.
1514            -  '$i' and '${i}' are both substituted by the 'i'-th
1515          specified argument. Negative indices such as '${-j}' are allowed and
1516          refer to the 'j'-th latest argument. '$0' is substituted by the
1517          custom command name.
1518            -  '${i=default}' is substituted by the value of '$i' (if
1519          defined) or by its new value set to 'default' otherwise ('default'
1520          may be a '$-expression' as well).
1521            -  '${subset}' is substituted by the argument values (separated by
1522          commas ',') of a specified argument subset. For instance expression
1523          '${2--2}'  is  substituted by all specified command arguments except
1524       the
1525          first and the last one. Expression '${^0}' is  then  substituted  by
1526       all
1527          arguments  of the invoked command (eq. to '$*' if all arguments have
1528       been
1529          indeed specified).
1530            -  '$=var' is substituted by the set of instructions that will as‐
1531       sign
1532          each argument '$i' to the named variable 'var$i' (for i in
1533          '[0...$#]'.  This  is particularly useful when a custom command want
1534       to
1535          manage variable numbers of arguments. Variables names must use char‐
1536       acter set
1537          '[a-zA-Z0-9_]' and cannot start with a number.
1538
1539          * These particular '$-expressions' for custom commands are always
1540          substituted, even in double-quoted items or when the dollar sign '$'
1541          is  escaped  with  a  backslash '$'. To avoid substitution, place an
1542       empty
1543          double quoted string just after the '$' (as in '$""1').
1544          * Specifying arguments may be skipped when invoking  a  custom  com‐
1545       mand, by
1546          replacing them by commas ',' as in expression
1547
1548           flower ,,3
1549
1550          Omitted  arguments  are  set  to their default values, which must be
1551       thus
1552          explicitly defined in the code of the corresponding  custom  command
1553       (using
1554          default argument expressions as '${1=default}').
1555          *  If  one  numbered  argument required by a custom command misses a
1556       value, an
1557          error is thrown by the G'MIC interpreter.
1558          * It is possible to specialize the invocation of a '+command' by
1559          defining it as
1560
1561           +command_name: command_definition
1562
1563          * A +-specialization takes priority over the regular command defini‐
1564       tion when
1565          the command is invoked with a prepended '+'.
1566          * When only a +-specialization of a command is defined, invoking
1567          'command' is actually equivalent to '+command'.
1568
1569
1570         12. List of Commands
1571             ----------------
1572
1573         All  available G'MIC commands are listed below, by categories. An ar‐
1574       gument
1575          specified between '[]' or starting by '_' is optional except when
1576          standing for an existing image '[image]', where 'image' can be
1577          either an index number or an image name. In this case, the '[]'
1578          characters are mandatory when writing the item. Note that all images
1579       that serve
1580          as  illustrations  in this reference documentation are normalized in
1581       range '[0,
1582          255]' before being displayed. You may need  to  do  this  explicitly
1583       (command
1584          'normalize 0,255') if you want to save and view images with the same
1585          aspect than those illustrated in the example codes.
1586         The  examples accompanying this 'List of Commands' illustrate the use
1587       of the
1588          G'MIC language and are written as they would appear in a custom com‐
1589       mand.
1590          While  some examples may work if entered directly at a shell prompt,
1591       there is no
1592          guarantee. No attempt has been made to escape special characters  in
1593       these
1594          examples, which many shells reserve.
1595
1596         12.1. Global Options
1597               --------------
1598
1599         debug (+):
1600
1601           Activate debug mode.
1602           When activated, the G'MIC interpreter becomes very verbose and out‐
1603       puts additional log
1604           messages about its internal state on the standard output (stdout).
1605           This option is useful for developers or to report possible bugs  of
1606       the interpreter.
1607
1608         h:
1609             Shortcut for command 'help'.
1610
1611         help:
1612             command |
1613             (no arg)
1614
1615           Display help (optionally for specified command only) and exit.
1616           (equivalent to shortcut command 'h').
1617
1618         version:
1619
1620           Display current version number on stdout.
1621
1622         12.2. Input / Output
1623               --------------
1624
1625         camera (+):
1626             _camera_index>=0,_nb_frames>0,_skip_frames>=0,_cap‐
1627       ture_width>=0,_capture_height>=0
1628
1629           Insert one or several frames from specified camera.
1630           When 'nb_frames==0', the camera stream is released instead of  cap‐
1631       turing new images.
1632           This command requires features from the OpenCV library (not enabled
1633       in G'MIC by default).
1634
1635           Default values: 'camera_index=0' (default  camera),  'nb_frames=1',
1636       'skip_frames=0' and 'capture_width=capture_height=0' (default size).
1637
1638         m (+):
1639             Shortcut for command 'command'.
1640
1641         command (+):
1642             _add_debug_info={ 0 | 1 },{ filename | http[s]://URL | "string" }
1643
1644           Import G'MIC custom commands from specified file, URL or string.
1645           (equivalent to shortcut command 'm').
1646
1647           Imported  commands are available directly after the 'command' invo‐
1648       cation.
1649           Specified filename is not allowed to contain colons ':'.
1650
1651           Default value: 'add_debug_info=1' (except for a "string"  argument,
1652       in which case 'add_debug_info=0').
1653
1654           Example:
1655             [#1]  image.jpg  command  "foo  : mirror y deform $""1" +foo[0] 5
1656       +foo[0] 15
1657
1658         cursor (+):
1659             _mode = { 0=hide | 1=show }
1660
1661           Show or hide mouse cursor for selected instant display windows.
1662           Command selection (if any) stands for instant  display  window  in‐
1663       dices instead of image indices.
1664
1665           Default value: 'mode=1'.
1666
1667         delete (+):
1668             filename1[,filename2,...]
1669
1670           Delete specified filenames on disk. Multiple filenames must be sep‐
1671       arated by commas.
1672
1673         d (+):
1674             Shortcut for command 'display'.
1675
1676         display (+):
1677             _X[%]>=0,_Y[%]>=0,_Z[%]>=0,_exit_on_anykey={ 0 | 1 }
1678
1679           Display selected images in an interactive viewer (use  the  instant
1680       display window [0] if opened).
1681           (equivalent to shortcut command 'd').
1682
1683           Arguments  'X','Y','Z' determine the initial selection view, for 3D
1684       volumetric images.
1685
1686           Default value: 'X=Y=Z=0' and 'exit_on_anykey=0'.
1687
1688           Tutorial: https://gmic.eu/oldtutorial/_display
1689
1690         d0:
1691             Shortcut for command 'display0'.
1692
1693         display0:
1694
1695           Display selected images without value normalization.
1696           (equivalent to shortcut command 'd0').
1697
1698         d2d:
1699             Shortcut for command 'display2d'.
1700
1701         display2d:
1702
1703           Display selected 2d images in an interactive window.
1704           (equivalent to shortcut command 'd2d').
1705
1706           This command is used by default by command 'display' when  display‐
1707       ing 2D images.
1708           If selected image is a volumetric image, each slice is displayed on
1709       a separate display
1710           window (up to 10 images can be displayed simultaneously this  way),
1711       with synchronized moves.
1712           When interactive window is opened, the following actions are possi‐
1713       ble:
1714            * Left mouse button: Create an image selection and zoom into it.
1715            * Middle mouse button, or CTRL+left mouse button: Move image.
1716            * Mouse wheel or PADD+/-: Zoom in/out.
1717            * Arrow keys: Move image left/right/up/down.
1718            * 'CTRL + A': Enable/disable transparency (show/hide  alpha  chan‐
1719       nel).
1720            * 'CTRL + C': Decrease window size.
1721            * 'CTRL + D': Increase window size.
1722            * 'CTRL + F': Toggle fullscreen mode.
1723            *  'CTRL + N': Change normalization mode (can be { none | normal |
1724       channel-by-channel }).
1725            * 'CTRL + O': Save a copy of the input image, as a  numbered  file
1726       'gmic_xxxxxx.gmz'.
1727            * 'CTRL + R': Reset both window size and view.
1728            * 'CTRL + S': Save a screenshot of the current view, as a numbered
1729       file 'gmic_xxxxxx.png'.
1730            * 'CTRL + SPACE': Reset view.
1731            * 'CTRL + X': Show/hide axes.
1732            * 'CTRL + Z': Hold/release aspect ratio.
1733
1734         d3d:
1735             Shortcut for command 'display3d'.
1736
1737         display3d:
1738             _[background_image],_exit_on_anykey={ 0 | 1 } |
1739             _exit_on_anykey={ 0 | 1 }
1740
1741           Display selected 3D objects in an interactive viewer (use  the  in‐
1742       stant display window [0] if opened).
1743           (equivalent to shortcut command 'd3d').
1744
1745           Default       values:       '[background_image]=(default)'      and
1746       'exit_on_anykey=0'.
1747
1748         da:
1749             Shortcut for command 'display_array'.
1750
1751         display_array:
1752             _width>0,_height>0
1753
1754           Display images in interactive windows where pixel neighborhoods can
1755       be explored.
1756
1757           Default values: 'width=13' and 'height=width'.
1758
1759         dc:
1760             Shortcut for command 'display_camera'.
1761
1762         display_camera:
1763
1764           Open camera viewer.
1765           This command requires features from the OpenCV library (not enabled
1766       in G'MIC by default).
1767
1768         dclut:
1769             Shortcut for command 'display_clut'.
1770
1771         display_clut:
1772             _image_resolution>0,_clut_resolution>0
1773
1774           Display selected 3D color LUTs.
1775
1776           Default values: 'image_resolution=320' and 'clut_resolution=33'.
1777
1778           Example:
1779             [#1] clut tealorange clut summer clut 60s display_clut 400
1780
1781         dfft:
1782             Shortcut for command 'display_fft'.
1783
1784         display_fft:
1785
1786           Display fourier transform of selected images,  with  centered  log-
1787       module and argument.
1788           (equivalent to shortcut command 'dfft').
1789
1790           Example:
1791             [#1] image.jpg +display_fft
1792
1793         dg:
1794             Shortcut for command 'display_graph'.
1795
1796         display_graph:
1797             _width>=0,_height>=0,_plot_type,_ver‐
1798       tex_type,_xmin,_xmax,_ymin,_ymax,_xlabel,_ylabel
1799
1800           Render graph plot from selected image data.
1801           'plot_type' can be { 0=none | 1=lines | 2=splines | 3=bar }.
1802           'vertex_type' can be { 0=none | 1=points | 2,3=crosses  |  4,5=cir‐
1803       cles | 6,7=squares }.
1804           'xmin','xmax','ymin','ymax'  set  the  coordinates of the displayed
1805       xy-axes.
1806           if specified 'width' or 'height' is '0', then image size is set  to
1807       half the screen size.
1808
1809           Default   values:   'width=0',   'height=0',  'plot_type=1',  'ver‐
1810       tex_type=1', 'xmin=xmax=ymin=ymax=0 (auto)', 'xlabel="x-axis"' and
1811            'ylabel="y-axis"'.
1812
1813           Example:
1814             [#1] 128,1,1,1,'cos(x/10+u)' +display_graph 400,300,3
1815
1816         dh:
1817             Shortcut for command 'display_histogram'.
1818
1819         display_histogram:
1820             _width>=0,_height>=0,_clus‐
1821       ters>0,_min_value[%],_max_value[%],_show_axes={ 0 | 1 },_expression.
1822
1823           Render a channel-by-channel histogram.
1824           If  selected images have several slices, the rendering is performed
1825       for all input slices.
1826           'expression' is a mathematical expression  used  to  transform  the
1827       histogram data for visualization purpose.
1828           (equivalent to shortcut command 'dh').
1829
1830           if  specified 'width' or 'height' is '0', then image size is set to
1831       half the screen size.
1832
1833           Default    values:    'width=0',    'height=0',     'clusters=256',
1834       'min_value=0%', 'max_value=100%', 'show_axes=1' and 'expression=i'.
1835
1836           Example:
1837             [#1] image.jpg +display_histogram 512,300
1838
1839         display_parametric:
1840             _width>0,_height>0,_outline_opacity,_vertex_radius>=0,_is_an‐
1841       tialiased={ 0 | 1 },_is_decorated={ 0 | 1 },_xlabel,_ylabel
1842
1843           Render 2D or 3D parametric curve or point clouds from selected  im‐
1844       age data.
1845           Curve points are defined as pixels of a 2 or 3-channel image.
1846           If  the point image contains more than 3 channels, additional chan‐
1847       nels define the (R,G,B) color for each vertex.
1848           If 'outline_opacity>1', the outline is  colored  according  to  the
1849       specified vertex colors and
1850           'outline_opacity-1' is used as the actual drawing opacity.
1851
1852           Default  values:  'width=512', 'height=width', 'outline_opacity=3',
1853       'vertex_radius=0', 'is_antialiased=1','is_decorated=1',
1854            'xlabel="x-axis"' and 'ylabel="y-axis"'.
1855
1856           Example:
1857             [#1]
1858       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)'
1859       display_parametric 512,512
1860             [#2] 1000,1,1,2,u(-100,100) quantize 4,1 noise  12  channels  0,2
1861       +normalize 0,255 append c display_parametric 512,512,0.1,8
1862
1863         dp:
1864             Shortcut for command 'display_parallel'.
1865
1866         display_parallel:
1867
1868           Display  each selected image in a separate interactive display win‐
1869       dow.
1870           (equivalent to shortcut command 'dp').
1871
1872         dp0:
1873             Shortcut for command 'display_parallel0'.
1874
1875         display_parallel0:
1876
1877           Display each selected image in a separate interactive display  win‐
1878       dow, without value normalization.
1879           (equivalent to shortcut command 'dp0').
1880
1881         display_polar:
1882             _width>32,_height>32,_out‐
1883       line_type,_fill_R,_fill_G,_fill_B,_theta_start,_theta_end,_xlabel,_yla‐
1884       bel
1885
1886           Render polar curve from selected image data.
1887           'outline_type'  can  be  { r<0=dots with radius -r | 0=no outline |
1888       r>0=lines+dots with radius r }.
1889           'fill_color' can be { -1=no fill | R,G,B=fill with specified  color
1890       }.
1891
1892           Default   values:  'width=500',  'height=width',  'outline_type=1',
1893       'fill_R=fill_G=fill_B=200', 'theta_start=0', 'theta_end=360',
1894            'xlabel="x-axis"' and 'ylabel="y-axis"'.
1895
1896           Example:
1897             [#1]   300,1,1,1,'0.3+abs(cos(10*pi*x/w))+u(0.4)'   display_polar
1898       512,512,4,200,255,200
1899             [#2]              3000,1,1,1,'x^3/1e10'             display_polar
1900       400,400,1,-1,,,0,{15*360}
1901
1902         dq:
1903             Shortcut for command 'display_quiver'.
1904
1905         display_quiver:
1906             _size_factor>0,_arrow_size>=0,_color_mode={    0=monochrome     |
1907       1=grayscale | 2=color }
1908
1909           Render selected images of 2D vectors as a field of 2D arrows.
1910           (equivalent to shortcut command 'dq').
1911
1912           Default     values:    'size_factor=16',    'arrow_size=1.5'    and
1913       'color_mode=1'.
1914
1915           Example:
1916             [#1] image.jpg +luminance  gradient[-1]  xy  rv[-2,-1]  *[-2]  -1
1917       a[-2,-1] c crop 60,10,90,30 +display_quiver[1] ,
1918
1919         drgba:
1920             Shortcut for command 'display_rgba'.
1921
1922         display_rgba:
1923             _background_RGB_color
1924
1925           Render  selected  RGBA  images over a checkerboard or colored back‐
1926       ground.
1927           (equivalent to shortcut command 'drgba').
1928
1929           Default values: 'background_RGB_color=undefined' (checkerboard).
1930
1931           Example:
1932             [#1] image.jpg +norm threshold[-1] 40% blur[-1]  3  normalize[-1]
1933       0,255 append c display_rgba
1934
1935         dt:
1936             Shortcut for command 'display_tensors'.
1937
1938         display_tensors:
1939             _size_factor>0,_ellipse_size>=0,_color_mode={    0=monochrome   |
1940       1=grayscale | 2=color },_outline>=0
1941
1942           Render selected images of tensors as a field of 2D ellipses.
1943           (equivalent to shortcut command 'dt').
1944
1945           Default     values:      'size_factor=16',      'ellipse_size=1.5',
1946       'color_mode=2' and 'outline=2'.
1947
1948           Example:
1949             [#1]  image.jpg  +diffusiontensors  0.1,0.9  resize2dx.  32 +dis‐
1950       play_tensors. 64,2
1951
1952           Tutorial: https://gmic.eu/oldtutorial/_display_tensors
1953
1954         dv3d:
1955             Shortcut for command 'display_voxels3d'.
1956
1957         display_voxels3d:
1958
1959           Display selected images as set of 3D voxels.
1960           (equivalent to shortcut command 'dv3d').
1961
1962         dw:
1963             Shortcut for command 'display_warp'.
1964
1965         display_warp:
1966             _cell_size>0
1967
1968           Render selected 2D warping fields.
1969           (equivalent to shortcut command 'dw').
1970
1971           Default value: 'cell_size=15'.
1972
1973           Example:
1974             [#1]                                    400,400,1,2,'x=x-w/2;y=y-
1975       h/2;r=sqrt(x*x+y*y);a=atan2(y,x);5*sin(r/10)*[cos(a),sin(a)]'     +dis‐
1976       play_warp 10
1977
1978         e (+):
1979             Shortcut for command 'echo'.
1980
1981         echo (+):
1982             message
1983
1984           Output specified message on the error output.
1985           (equivalent to shortcut command 'e').
1986
1987           Command selection (if any) stands for displayed call  stack  subset
1988       instead of image indices.
1989           When  invoked  with a '+' prefix (i.e. '+echo'), the command output
1990       its message on stdout rather than stderr.
1991
1992         echo_file:
1993             filename,message
1994
1995           Output specified message, appending it to specified output file.
1996           (similar to 'echo' for specified output file stream).
1997
1998         function1d:
1999             0<=smoothness<=1,x0>=0,y0,x1>=0,y1,...,xn>=0,yn
2000
2001           Insert continuous 1D function  from  specified  list  of  keypoints
2002       (xk,yk)
2003           in range [0,max(xk)] (xk are positive integers).
2004
2005           Example:
2006             [#1]   function1d   1,0,0,10,30,40,20,70,30,80,0   +display_graph
2007       400,300
2008
2009         identity:
2010             _width>=0,_height>=0,_depth>=0
2011
2012           Insert an identity map of given size at the end of the image list.
2013
2014           Default values: 'height=width' and 'depth=1'.
2015
2016           Example:
2017             [#1] identity 5,1 identity 8,8
2018
2019         i (+):
2020             Shortcut for command 'input'.
2021
2022         input (+):
2023             [type:]filename |
2024             [type:]http://URL |
2025             [selection]x_nb_copies>0 |
2026             {  width>0[%]  |  [image_w]  },{  _height>0[%]  |  [image_h]  },{
2027       _depth>0[%]   |   [image_d]   },{   _spectrum>0[%]   |  [image_s]  },_{
2028       value1,_value2,... | 'formula' } |
2029             (value1{,|;|/|^}value2{,|;|/|^}...[:{x|y|z|c|,|;|/|^}]) |
2030             0
2031
2032           Insert a new image taken from a filename or from a copy of  an  ex‐
2033       isting image [index],
2034           or  insert  new  image with specified dimensions and values. Single
2035       quotes may be omitted in
2036           'formula'. Specifying argument '0' inserts an 'empty' image.
2037           (equivalent to shortcut command 'i').
2038
2039           Default  values:   'nb_copies=1',   'height=depth=spectrum=1'   and
2040       'value1=0'.
2041
2042           Example:
2043             [#1] input image.jpg
2044             [#2] input (1,2,3;4,5,6;7,8,9^9,8,7;6,5,4;3,2,1)
2045             [#3]       image.jpg       (1,2,3;4,5,6;7,8,9)       (255^128^64)
2046       400,400,1,3,'(x>w/2?x:y)*c'
2047
2048           Tutorial: https://gmic.eu/tutorial/input
2049
2050         input_565:
2051             filename,width>0,height>0,reverse_endianness={ 0 | 1 }
2052
2053           Insert image data from a raw RGB-565 file, at the end of the list.
2054
2055           Default value: 'reverse_endianness=0'.
2056
2057         ib:
2058             Shortcut for command 'input_bytes'.
2059
2060         input_bytes:
2061             filename
2062
2063           Input specified filename as a 1D array of bytes.
2064           (equivalent to shortcut command 'ib').
2065
2066         input_csv:
2067             "filename",_read_data_as={ 0=numbers | 1=strings | _variable_name
2068       }
2069
2070           Insert number of string array from specified .csv file.
2071           If  'variable_name'  is provided, the string of each cell is stored
2072       in a numbered variable '_variable_name_x_y', where 'x' and 'y' are  the
2073       indices of
2074           the cell column and row respectively (starting from '0').
2075           Otherwise,  a  'WxH' image is inserted at the end of the list, with
2076       each vector-valued pixel 'I(x,y)' encoding the number or the string  of
2077       each cell.
2078           This  command returns the 'W,H' dimension of the read array, as the
2079       status.
2080
2081           Default value: 'read_data_as=1'.
2082
2083         input_cube:
2084             "filename",_convert_1d_cluts_to_3d={ 0 | 1 }.
2085
2086           Insert CLUT data from a .cube filename (Adobe CLUT file format).
2087
2088           Default value: 'convert_1d_cluts_to_3d=1'.
2089
2090         input_flo:
2091             "filename"
2092
2093           Insert optical flow  data  from  a  .flo  filename  (vision.middle‐
2094       bury.edu file format).
2095
2096         ig:
2097             Shortcut for command 'input_glob'.
2098
2099         input_glob:
2100             pattern
2101
2102           Insert  new  images from several filenames that match the specified
2103       glob pattern.
2104           (equivalent to shortcut command 'ig').
2105
2106         input_gpl:
2107             filename
2108
2109           Input specified filename as a .gpl palette data file.
2110
2111         input_cached:
2112             "basename.ext",_try_downloading_from_gmic_server={ 0 | 1 }
2113
2114           Input specified filename, assumed to be stored in one of the  G'MIC
2115       resource folder.
2116           If  file not found and 'try_downloading=1', file is downloaded from
2117       the G'MIC server and stored
2118           in the '${-path_cache}' folder.
2119
2120           Default value: 'try_downloading_from_gmic_server=1'.
2121
2122         input_obj:
2123             filename
2124
2125           Input specified 3D mesh from a .obj Wavefront file.
2126
2127         it:
2128             Shortcut for command 'input_text'.
2129
2130         input_text:
2131             filename
2132
2133           Input specified text-data filename as a new image.
2134           (equivalent to shortcut command 'it').
2135
2136         lorem:
2137             _width>0,_height>0
2138
2139           Input random image of specified size, retrieved from Internet.
2140
2141           Default values: 'width=height=800'.
2142
2143         network (+):
2144             mode={ -1=disabled | 0=enabled w/o timeout | >0=enabled w/ speci‐
2145       fied timeout in seconds }
2146
2147           Enable/disable load-from-network and set corresponding timeout.
2148           (Default mode is 'enabled w/o timeout').
2149
2150         o (+):
2151             Shortcut for command 'output'.
2152
2153         output (+):
2154             [type:]filename,_format_options
2155
2156           Output selected images as one or several numbered file(s).
2157           (equivalent to shortcut command 'o').
2158
2159           Default value: 'format_options'=(undefined).
2160
2161         output_565:
2162             "filename",reverse_endianness={ 0=false | 1=true }
2163
2164           Output selected images as raw RGB-565 files.
2165
2166           Default value: 'reverse_endianness=0'.
2167
2168         output_cube:
2169             "filename"
2170
2171           Output selected CLUTs as a .cube file (Adobe CLUT format).
2172
2173         output_flo:
2174             "filename"
2175
2176           Output  selected optical flow as a .flo file (vision.middlebury.edu
2177       file format).
2178
2179         output_ggr:
2180             filename,_gradient_name
2181
2182           Output selected images as .ggr gradient files (GIMP).
2183           If no gradient name is specified, it is deduced from the filename.
2184
2185         output_gmz:
2186             filename,_datatype
2187
2188           Output selected images as .gmz files (G'MIC native file format).
2189           'datatype' can be { bool | uint8 | int8 | uint16 | int16 | uint32 |
2190       int32 | uint64 | int64 | float32 | float64 }.
2191
2192         output_obj:
2193             filename,_save_materials={ 0=no | 1=yes }
2194
2195           Output selected 3D meshes as Wavefront 3D object files.
2196           Set  'save_materials'  to  '1'  to produce a corresponding material
2197       file ('.mtl') and eventually texture files.
2198           Beware, the export to '.obj' files may be quite slow for  large  3D
2199       objects.
2200
2201           Default value: 'save_materials=1'.
2202
2203         ot:
2204             Shortcut for command 'output_text'.
2205
2206         output_text:
2207             filename
2208
2209           Output selected images as text-data filenames.
2210           (equivalent to shortcut command 'ot').
2211
2212         on:
2213             Shortcut for command 'outputn'.
2214
2215         outputn:
2216             filename,_index
2217
2218           Output  selected  images as automatically numbered filenames in re‐
2219       peat...done loops.
2220           (equivalent to shortcut command 'on').
2221
2222         op:
2223             Shortcut for command 'outputp'.
2224
2225         outputp:
2226             prefix
2227
2228           Output selected images as prefixed versions of their original file‐
2229       names.
2230           (equivalent to shortcut command 'op').
2231
2232           Default value: 'prefix=_'.
2233
2234         ow:
2235             Shortcut for command 'outputw'.
2236
2237         outputw:
2238
2239           Output selected images by overwriting their original location.
2240           (equivalent to shortcut command 'ow').
2241
2242         ox:
2243             Shortcut for command 'outputx'.
2244
2245         outputx:
2246             extension1,_extension2,_...,_extensionN,_output_at_same_loca‐
2247       tion={ 0 | 1 }
2248
2249           Output selected images with same base filenames but for N different
2250       extensions.
2251           (equivalent to shortcut command 'ox').
2252
2253           Default value: 'output_at_same_location=0'.
2254
2255         parse_cli:
2256             _output_mode,_{ * | command_name }
2257
2258           Parse  definition  of  '@cli'-documented  commands  and output info
2259       about them in specified output mode.
2260           'output_mode' can be { ascii | bashcompletion |  html  |  images  |
2261       print }.
2262
2263           Default values: 'output_mode=print' and 'command_name=*'.
2264
2265         parse_gmd:
2266
2267           Parse  and tokenize selected images, viewed as text strings format‐
2268       ted with the G'MIC markdown syntax.
2269
2270         gmd2html:
2271             _include_default_header_footer={ 0=none | 1=Reference  |  2=Tuto‐
2272       rial | 3=News } |
2273             (no arg)
2274
2275           Convert selected gmd-formatted text images to html format.
2276
2277           Default values: 'include_default_header_footer=1'.
2278
2279         gmd2ascii:
2280             _max_line_length>0,_indent_forced_newlines>=0 |
2281             (no arg)
2282
2283           Convert selected gmd-formatted text images to ascii format.
2284
2285           Default values: 'max_line_length=80' and 'indent_forced_newline=0'.
2286
2287         parse_gui:
2288             _outputmode,_{ * | filter_name}
2289
2290           Parse  selected  filter definitions and generate info about filters
2291       in selected output mode.
2292           'outputmode' can be { gmicol | images |  json  |  list  |  print  |
2293       strings | update | zart }.
2294           It  is possible to define a custom output mode, by implementing the
2295       following commands
2296           ('outputmode' must be replaced by the name of the custom user  out‐
2297       put mode):
2298           .  'parse_gui_outputmode'  : A command that outputs the parsing in‐
2299       formation with a custom format.
2300           . 'parse_gui_parseparams_outputmode' (optional): A  simple  command
2301       that returns 0 or 1. It tells the parser whether parameters of matching
2302       filter must be analyzed
2303           (slower) or not.
2304           . 'parse_gui_trigger_outputmode'  (optional):  A  command  that  is
2305       called  by the parser just before parsing the set of each matching fil‐
2306       ters.
2307           Here is the list of global variables set by the parser,  accessible
2308       in command 'parse_gui_outputmode':
2309           '$_nb_filters': Number of matching filters.
2310           '$_nongui'  (stored as an image): All merged lines in the file that
2311       do not correspond to '#@gui' lines.
2312           For each filter '     * '$_fF_name' : Filter name.
2313            * '$_fF_path' : Full path.
2314            * '$_fF_locale' : Filter locale (empty, if not specified).
2315            * '$_fF_command' : Filter command.
2316            * '$_fF_command_preview' : Filter preview command (empty,  if  not
2317       specified).
2318            *  '$_fF_zoom_factor'  : Default zoom factor (empty, if not speci‐
2319       fied).
2320            * '$_fF_preview_accuracy' : Preview accuracy (can be { 0=does  not
2321       support zoom in/out | 1=support zoom in/out | 2=pixel-perfect }).
2322            *  '$_fF_input_mode' : Default preferred input mode (empty, if not
2323       specified).
2324            * '$_fF_hide' : Path of filter hid by current filter  (for  local‐
2325       ized filters, empty if not specified).
2326            * '$_fF_nb_params' : Number of parameters.
2327           For each parameter '     * '$_fF_pP_name' : Parameter name.
2328            * '$_fF_pP_type' : Parameter type.
2329            *  '$_fF_pP_responsivity' : Parameter responsivity (can be { 0 | 1
2330       }).
2331            * '$_fF_pP_visibility' : Parameter visibility.
2332            * '$_fF_pP_propagation' : Propagation of the parameter visibility.
2333            * '$_fF_pP_nb_args' : Number of parameter arguments.
2334           For each argument '     * '$_fF_pP_aA' : Argument value
2335           Default parameters: 'filter_name=*' and 'output_format=print'.
2336
2337         pass (+):
2338             _shared_state={ -1=status only | 0=non-shared (copy) | 1=shared |
2339       2=adaptive }
2340
2341           Insert  images  from  parent context of a custom command or a local
2342       environment.
2343           Command selection (if any) stands for a selection of images in  the
2344       parent context.
2345           By default (adaptive shared state), selected images are inserted in
2346       a shared state if they do not belong
2347           to the context (selection) of the current custom command  or  local
2348       environment as well.
2349           Typical  use  of  command 'pass' concerns the design of custom com‐
2350       mands that take images as arguments.
2351           This commands return the list of corresponding indices in the  sta‐
2352       tus.
2353
2354           Default value: 'shared_state=2'.
2355
2356           Example:
2357             [#1]  command "average : pass$""1 add[^-1] [-1] remove[-1] div 2"
2358       sample ? +mirror y +average[0] [1]
2359
2360         plot (+):
2361             _plot_type,_vertex_type,_xmin,_xmax,_ymin,_ymax,_exit_on_anykey={
2362       0 | 1 } |
2363             'formula',_resolution>=0,_plot_type,_ver‐
2364       tex_type,_xmin,xmax,_ymin,_ymax,_exit_on_anykey={ 0 | 1 }
2365
2366           Display selected images or formula in an  interactive  viewer  (use
2367       the instant display window [0] if opened).
2368           'plot_type' can be { 0=none | 1=lines | 2=splines | 3=bar }.
2369           'vertex_type'  can  be { 0=none | 1=points | 2,3=crosses | 4,5=cir‐
2370       cles | 6,7=squares }.
2371           'xmin', 'xmax', 'ymin', 'ymax' set the coordinates of the displayed
2372       xy-axes.
2373
2374           Default        values:        'plot_type=1',       'vertex_type=1',
2375       'xmin=xmax=ymin=ymax=0 (auto)' and 'exit_on_anykey=0'.
2376
2377         p (+):
2378             Shortcut for command 'print'.
2379
2380         print (+):
2381
2382           Output information  on  selected  images,  on  the  standard  error
2383       (stderr).
2384           (equivalent to shortcut command 'p').
2385
2386           When  invoked with a '+' prefix (i.e. '+print'), the command output
2387       its message on stdout rather than stderr.
2388
2389         random_pattern:
2390             _width>0,_height>0,_min_detail_level>=0
2391
2392           Insert a new RGB image of specified size at the end  of  the  image
2393       list, rendered with a random pattern.
2394
2395           Default values: 'width=height=512' and 'min_detail_level=2'.
2396
2397           Example:
2398             [#1] repeat 6 { random_pattern 256 }
2399
2400         screen (+):
2401             _x0[%],_y0[%],_x1[%],_y1[%]
2402
2403           Take screenshot, optionally grabbed with specified coordinates, and
2404       insert it
2405           at the end of the image list.
2406
2407         select (+):
2408             feature_type,_X[%]>=0,_Y[%]>=0,_Z[%]>=0,_exit_on_anykey={ 0  |  1
2409       },_is_deep_selection={ 0 | 1 }
2410
2411           Interactively  select  a  feature from selected images (use the in‐
2412       stant display window [0] if opened).
2413           'feature_type' can be { 0=point | 1=segment | 2=rectangle  |  3=el‐
2414       lipse }.
2415           Arguments  'X','Y','Z' determine the initial selection view, for 3D
2416       volumetric images.
2417           The retrieved  feature  is  returned  as  a  3D  vector  (if  'fea‐
2418       ture_type==0') or as a 6d vector
2419           (if 'feature_type!=0') containing the feature coordinates.
2420
2421           Default   values:   'X=Y=Z=(undefined)',   'exit_on_anykey=0'   and
2422       'is_deep_selection=0'.
2423
2424         serialize (+):
2425             _datatype,_is_compressed={ 0 | 1 },_store_names={ 0 | 1 }
2426
2427           Serialize selected list of images into a single  image,  optionally
2428       in a compressed form.
2429           'datatype' can be { auto | uint8 | int8 | uint16 | int16 | uint32 |
2430       int32 | uint64 | int64 | float32 | float64 }.
2431           Specify 'datatype' if all selected images have a  range  of  values
2432       constrained to a particular datatype,
2433           in order to minimize the memory footprint.
2434           The  resulting  image  has  only integers values in [0,255] and can
2435       then be saved as a raw image of
2436           unsigned chars (doing so will  output  a  valid  .cimg[z]  or  .gmz
2437       file).
2438           If  'store_names' is set to '1', serialization uses the .gmz format
2439       to store data in memory
2440           (otherwise the .cimg[z] format).
2441
2442           Default    values:    'datatype=auto',    'is_compressed=1'     and
2443       'store_names=1'.
2444
2445           Example:
2446             [#1] image.jpg +serialize uint8 +unserialize[-1]
2447
2448         shape_circle:
2449             _size>=0
2450
2451           Input a 2D circle binary shape with specified size.
2452
2453           Default value: 'size=512'.
2454
2455           Example:
2456             [#1] shape_circle ,
2457
2458         shape_cupid:
2459             _size>=0
2460
2461           Input a 2D cupid binary shape with specified size.
2462
2463           Default value: 'size=512'.
2464
2465           Example:
2466             [#1] shape_cupid ,
2467
2468         shape_diamond:
2469             _size>=0
2470
2471           Input a 2D diamond binary shape with specified size.
2472
2473           Default value: 'size=512'.
2474
2475           Example:
2476             [#1] shape_diamond ,
2477
2478         shape_dragon:
2479             _size>=0,_recursion_level>=0,_angle
2480
2481           Input a 2D Dragon curve with specified size.
2482
2483           Default value: 'size=512', 'recursion_level=18' and 'angle=0'.
2484
2485           Example:
2486             [#1] shape_dragon ,
2487
2488         shape_fern:
2489             _size>=0,_density[%]>=0,_angle,0<=_opacity<=1,_type={ 0=Asplenium
2490       adiantum-nigrum | 1=Thelypteridaceae }
2491
2492           Input a 2D Barnsley fern with specified size.
2493
2494           Default value: 'size=512', 'density=50%', 'angle=30', 'opacity=0.3'
2495       and 'type=0'.
2496
2497           Example:
2498             [#1] shape_fern ,
2499
2500         shape_gear:
2501             _size>=0,_nb_teeth>0,0<=_height_teeth<=100,0<=_off‐
2502       set_teeth<=100,0<=_inner_radius<=100
2503
2504           Input a 2D gear binary shape with specified size.
2505
2506           Default value: 'size=512', 'nb_teeth=12', 'height_teeth=20',  'off‐
2507       set_teeth=0' and 'inner_radius=40'.
2508
2509           Example:
2510             [#1] shape_gear ,
2511
2512         shape_heart:
2513             _size>=0
2514
2515           Input a 2D heart binary shape with specified size.
2516
2517           Default value: 'size=512'.
2518
2519           Example:
2520             [#1] shape_heart ,
2521
2522         shape_menger:
2523             _nb_iterations>=0
2524
2525           Input a 3D voxelized representation of the Menger sponge.
2526
2527           Default value: 'nb_iterations=3'.
2528
2529           Example:
2530             [#1] shape_menger 4 surfels3d , color3d 200 m3d 3
2531
2532         shape_mosely:
2533             _nb_iterations>=0
2534
2535           Input a 3D voxelized representation of the Mosely snowflake.
2536
2537           Default value: 'nb_iterations=3'.
2538
2539           Example:
2540             [#1] shape_mosely 4 surfels3d , color3d 200 m3d 3
2541
2542         shape_polygon:
2543             _size>=0,_nb_vertices>=3,_angle
2544
2545           Input a 2D polygonal binary shape with specified geometry.
2546
2547           Default value: 'size=512', 'nb_vertices=5' and 'angle=0'.
2548
2549           Example:
2550             [#1] repeat 6 { shape_polygon 256,{3+$>} }
2551
2552         shape_snowflake:
2553             size>=0,0<=_nb_recursions<=6
2554
2555           Input a 2D snowflake binary shape with specified size.
2556
2557           Default values: 'size=512' and 'nb_recursions=5'.
2558
2559           Example:
2560             [#1] repeat 6 { shape_snowflake 256,$> }
2561
2562         shape_star:
2563             _size>=0,_nb_branches>0,0<=_thickness<=1
2564
2565           Input a 2D star binary shape with specified size.
2566
2567           Default values: 'size=512', 'nb_branches=5' and 'thickness=0.38'.
2568
2569           Example:
2570             [#1] repeat 9 { shape_star 256,{$>+2} }
2571
2572         sh (+):
2573             Shortcut for command 'shared'.
2574
2575         shared (+):
2576             x0[%],x1[%],y[%],z[%],c[%] |
2577             y0[%],y1[%],z[%],c[%] |
2578             z0[%],z1[%],c[%] |
2579             c0[%],c1[%] |
2580             c0[%] |
2581             (no arg)
2582
2583           Insert  shared  buffers  from (opt. points/rows/planes/channels of)
2584       selected images.
2585           Shared buffers cannot be returned by a command, nor a  local  envi‐
2586       ronment.
2587           (equivalent to shortcut command 'sh').
2588
2589           Example:
2590             [#1] image.jpg shared 1 blur[-1] 3 remove[-1]
2591             [#2]  image.jpg  repeat  s { shared 25%,75%,0,$> mirror[-1] x re‐
2592       move[-1] }
2593
2594           Tutorial: https://gmic.eu/oldtutorial/_shared
2595
2596         sp:
2597             Shortcut for command 'sample'.
2598
2599         sample:
2600             _name1={ ? | apples | balloons | barbara | boats | bottles | but‐
2601       terfly | cameraman | car | cat | cliff | chick | colorful | david | dog
2602       | duck | eagle | elephant | earth |
2603               flower | fruits | gmicky  |  gmicky_mahvin  |  gmicky_wilber  |
2604       greece | gummy | house | inside | landscape | leaf | lena | leno | lion
2605       | mandrill | monalisa | monkey |
2606               parrots | pencils | peppers | portrait0 | portrait1 | portrait2
2607       | portrait3 | portrait4 | portrait5 | portrait6 | portrait7 | portrait8
2608       | portrait9 | roddy | rooster
2609               | rose | square | swan | teddy | tiger | tulips | wall | water‐
2610       fall  | zelda },_name2,...,_nameN,_width={ >=0 | 0 (auto) },_height = {
2611       >=0 | 0 (auto) } |
2612             (no arg)
2613
2614           Input a new sample RGB image (opt. with specified size).
2615           (equivalent to shortcut command 'sp').
2616
2617           Argument 'name' can be replaced by an integer  which  serves  as  a
2618       sample index.
2619
2620           Example:
2621             [#1] repeat 6 { sample }
2622
2623         srand (+):
2624             value |
2625             (no arg)
2626
2627           Set random generator seed.
2628           If  no  argument is specified, a random value is used as the random
2629       generator seed.
2630
2631         store (+):
2632             _is_compressed={ 0 | 1 },variable_name1,_variable_name2,...
2633
2634           Store selected images into one or several named variables.
2635           Selected images are transferred to the variables, and  are  so  re‐
2636       moved from the image list.
2637           (except if the prepended variant of the command '+store[selection]'
2638       is used).
2639           If a single variable name is specified, all images of the selection
2640       are assigned
2641           to  the  named  variable. Otherwise, there must be as many variable
2642       names as images
2643           in the selection, and each selected image is assigned to each spec‐
2644       ified named variable.
2645           Use  command 'input $variable_name' to bring the stored images back
2646       in the list.
2647
2648           Default value: 'is_compressed=0'.
2649
2650           Example:
2651             [#1] sample eagle,earth store img1,img2 input $img2 $img1
2652
2653           Tutorial: https://gmic.eu/tutorial/store
2654
2655         testimage2d:
2656             _width>0,_height>0,_spectrum>0
2657
2658           Input a 2D synthetic image.
2659
2660           Default values: 'width=512', 'height=width' and 'spectrum=3'.
2661
2662           Example:
2663             [#1] testimage2d 512
2664
2665         um:
2666             Shortcut for command 'uncommand'.
2667
2668         uncommand (+):
2669             command_name[,_command_name2,...] |
2670             *
2671
2672           Discard definition of specified custom commands.
2673           Set argument to '*' for discarding all existing custom commands.
2674           (equivalent to shortcut command 'um').
2675
2676         uniform_distribution:
2677             nb_levels>=1,spectrum>=1
2678
2679           Input set of uniformly distributed spectrum-d points in [0,1]^spec‐
2680       trum.
2681
2682           Example:
2683             [#1]   uniform_distribution   64,3  *  255  +distribution3d  cir‐
2684       cles3d[-1] 10
2685
2686         unserialize (+):
2687
2688           Recreate lists of images from serialized  image  buffers,  obtained
2689       with command 'serialize'.
2690
2691         up:
2692             Shortcut for command 'update'.
2693
2694         update:
2695
2696           Update  commands  from  the  latest  definition  file  on the G'MIC
2697       server.
2698           (equivalent to shortcut command 'up').
2699
2700         v (+):
2701             Shortcut for command 'verbose'.
2702
2703         verbose (+):
2704             level |
2705             { + | - }
2706
2707           Set or increment/decrement the verbosity level. Default level is 0.
2708           (equivalent to shortcut command 'v').
2709
2710           When 'level>0', G'MIC log messages are displayed  on  the  standard
2711       error (stderr).
2712
2713           Default value: 'level=1'.
2714
2715         wait (+):
2716             delay |
2717             (no arg)
2718
2719           Wait  for  a given delay (in ms), optionally since the last call to
2720       'wait'.
2721           or wait for a user event occurring on the selected instant  display
2722       windows.
2723           'delay' can be { <0=delay+flush events | 0=event | >0=delay }.
2724           Command  selection  (if  any) stands for instant display window in‐
2725       dices instead of image indices.
2726           If no window indices are specified and if 'delay' is positive,  the
2727       command results
2728           in a 'hard' sleep during specified delay.
2729
2730           Default value: 'delay=0'.
2731
2732         warn (+):
2733             _force_visible={ 0 | 1 },_message
2734
2735           Print specified warning message, on the standard error (stderr).
2736           Command  selection  (if any) stands for displayed call stack subset
2737       instead of image indices.
2738
2739         w (+):
2740             Shortcut for command 'window'.
2741
2742         window (+):
2743             _width[%]>=-1,_height[%]>=-1,_normaliza‐
2744       tion,_fullscreen,_pos_x[%],_pos_y[%],_title
2745
2746           Display  selected images into an instant display window with speci‐
2747       fied size, normalization type,
2748           fullscreen mode and title.
2749           (equivalent to shortcut command 'w').
2750
2751           If 'width' or 'height' is set to -1, the corresponding dimension is
2752       adjusted to the window
2753           or image size.
2754           Specify  'pos_x' and 'pos_y' arguments only if the window has to be
2755       moved to the specified
2756           coordinates. Otherwise, they can be avoided.
2757           'width'=0 or 'height'=0 closes the instant display window.
2758           'normalization' can be { -1=keep same | 0=none | 1=always |  2=1st-
2759       time | 3=auto }.
2760           'fullscreen' can be { -1=keep same | 0=no | 1=yes }.
2761           You  can manage up to 10 different instant display windows by using
2762       the numbered variants
2763           'w0' (default, eq. to 'w'),'w1',...,'w9' of the command 'w'.
2764           Invoke 'window' with no selection to make the window visible, if it
2765       has been closed by the user.
2766
2767           Default values: 'width=height=normalization=fullscreen=-1' and 'ti‐
2768       tle=(undefined)'.
2769
2770         12.3. List Manipulation
2771               -----------------
2772
2773         k (+):
2774             Shortcut for command 'keep'.
2775
2776         keep (+):
2777
2778           Keep only selected images.
2779           (equivalent to shortcut command 'k').
2780
2781           Example:
2782             [#1] image.jpg split x keep[0-50%:2] append x
2783             [#2] image.jpg split x keep[^30%-70%] append x
2784
2785         kn:
2786             Shortcut for command 'keep_named'.
2787
2788         keep_named:
2789             "name1","name2",...
2790
2791           Keep all images with specified names from the list of images.
2792           Remove all images if no images with those names exist.
2793           (equivalent to shortcut command 'kmn').
2794
2795         mv (+):
2796             Shortcut for command 'move'.
2797
2798         move (+):
2799             position[%]
2800
2801           Move selected images at specified position.
2802           Images are actually inserted between current positions 'position-1'
2803       and 'position'.
2804           (equivalent to shortcut command 'mv').
2805
2806           Example:
2807             [#1] image.jpg split x,3 move[1] 0
2808             [#2] image.jpg split x move[50%--1:2] 0 append x
2809
2810         nm (+):
2811             Shortcut for command 'name'.
2812
2813         => (+):
2814             Shortcut for command 'name'.
2815
2816         name (+):
2817             "name1","name2",...,"nameN"
2818
2819           Set names of selected images.
2820            *  If no explicit image selection is given, image selection is as‐
2821       sumed to be '[-N--1]', where 'N' is the number of specified arguments.
2822            * If 'N' is higher than the number of images in selection, an  er‐
2823       ror is thrown.
2824            *  If  'N'  is lower than the number of images in selection, image
2825       names are assigned  in  a  periodic  way,  i.e.  'name(selection[k])  =
2826       arg[k%N]'.
2827           (equivalent to shortcut command '=>').
2828
2829           Example:
2830             [#1] image.jpg name image blur[image] 2
2831
2832           Tutorial: https://gmic.eu/tutorial/name
2833
2834         rm (+):
2835             Shortcut for command 'remove'.
2836
2837         remove (+):
2838
2839           Remove selected images.
2840           (equivalent to shortcut command 'rm').
2841
2842           Example:
2843             [#1] image.jpg split x remove[30%-70%] append x
2844             [#2] image.jpg split x remove[0-50%:2] append x
2845
2846         remove_duplicates:
2847
2848           Remove duplicates images in the selected images list.
2849
2850           Example:
2851             [#1] (1,2,3,4,2,4,3,1,3,4,2,1) split x remove_duplicates append x
2852
2853         remove_empty:
2854
2855           Remove empty images in the selected image list.
2856
2857         rmn:
2858             Shortcut for command 'remove_named'.
2859
2860         remove_named:
2861             "name1","name2",...
2862
2863           Remove all images with specified names from the list of images.
2864           Does nothing if no images with those names exist.
2865           (equivalent to shortcut command 'rmn').
2866
2867         rv (+):
2868             Shortcut for command 'reverse'.
2869
2870         reverse (+):
2871
2872           Reverse positions of selected images.
2873           (equivalent to shortcut command 'rv').
2874
2875           Example:
2876             [#1] image.jpg split x,3 reverse[-2,-1]
2877             [#2] image.jpg split x,-16 reverse[50%-100%] append x
2878
2879         sort_list:
2880             _ordering={ + | - },_criterion
2881
2882           Sort  list of selected images according to the specified image cri‐
2883       terion.
2884
2885           Default values: 'ordering=+', 'criterion=i'.
2886
2887           Example:
2888             [#1] (1;4;7;3;9;2;4;7;6;3;9;1;0;3;3;2) split y sort_list +,i  ap‐
2889       pend y
2890
2891         12.4. Mathematical Operators
2892               ----------------------
2893
2894         abs (+):
2895
2896           Compute the pointwise absolute values of selected images.
2897
2898           Example:
2899             [#1] image.jpg +sub {ia} abs[-1]
2900             [#2] 300,1,1,1,'cos(20*x/w)' +abs display_graph 400,300
2901
2902         acos (+):
2903
2904           Compute the pointwise arccosine of selected images.
2905
2906           Example:
2907             [#1] image.jpg +normalize -1,1 acos[-1]
2908             [#2] 300,1,1,1,'cut(x/w+0.1*u,0,1)' +acos display_graph 400,300
2909
2910           Tutorial:      https://gmic.eu/oldtutorial/trigometric-and-inverse-
2911       trigometric-commands
2912
2913         acosh (+):
2914
2915           Compute the pointwise hyperbolic arccosine of selected images.
2916
2917         + (+):
2918             Shortcut for command 'add'.
2919
2920         add (+):
2921             value[%] |
2922             [image] |
2923             'formula' |
2924             (no arg)
2925
2926           Add specified value, image or mathematical expression  to  selected
2927       images, or compute the pointwise sum of selected images.
2928           (equivalent to shortcut command '+').
2929
2930           Example:
2931             [#1] image.jpg +add 30% cut 0,255
2932             [#2] image.jpg +blur 5 normalize 0,255 add[1] [0]
2933             [#3] image.jpg add '80*cos(80*(x/w-0.5)*(y/w-0.5)+c)' cut 0,255
2934             [#4]  image.jpg  repeat  9 { +rotate[0] {$>*36},1,0,50%,50% } add
2935       div 10
2936
2937         & (+):
2938             Shortcut for command 'and'.
2939
2940         and (+):
2941             value[%] |
2942             [image] |
2943             'formula' |
2944             (no arg)
2945
2946           Compute the bitwise AND of selected images  with  specified  value,
2947       image  or  mathematical expression, or compute the pointwise sequential
2948       bitwise AND of selected images.
2949           (equivalent to shortcut command '&').
2950
2951           Example:
2952             [#1] image.jpg and {128+64}
2953             [#2] image.jpg +mirror x and
2954
2955         argmax:
2956
2957           Compute the argmax of selected images. Returns a single image
2958           with each pixel value being the index of the input image with maxi‐
2959       mal value.
2960
2961           Example:
2962             [#1] image.jpg sample lena,lion,square +argmax
2963
2964         argmaxabs:
2965
2966           Compute the argmaxabs of selected images. Returns a single image
2967           with  each pixel value being the index of the input image with max‐
2968       abs value.
2969
2970         argmin:
2971
2972           Compute the argmin of selected images. Returns a single image
2973           with each pixel value being the index of the input image with mini‐
2974       mal value.
2975
2976           Example:
2977             [#1] image.jpg sample lena,lion,square +argmin
2978
2979         argminabs:
2980
2981           Compute the argminabs of selected images. Returns a single image
2982           with  each  pixel  value  being  the  index of the input image with
2983       minabs value.
2984
2985         asin (+):
2986
2987           Compute the pointwise arcsine of selected images.
2988
2989           Example:
2990             [#1] image.jpg +normalize -1,1 asin[-1]
2991             [#2] 300,1,1,1,'cut(x/w+0.1*u,0,1)' +asin display_graph 400,300
2992
2993           Tutorial:      https://gmic.eu/oldtutorial/trigometric-and-inverse-
2994       trigometric-commands
2995
2996         asinh (+):
2997
2998           Compute the pointwise hyperbolic arcsine of selected images.
2999
3000         atan (+):
3001
3002           Compute the pointwise arctangent of selected images.
3003
3004           Example:
3005             [#1] image.jpg +normalize 0,8 atan[-1]
3006             [#2] 300,1,1,1,'4*x/w+u' +atan display_graph 400,300
3007
3008           Tutorial:      https://gmic.eu/oldtutorial/trigometric-and-inverse-
3009       trigometric-commands
3010
3011         atan2 (+):
3012             [x_argument]
3013
3014           Compute the pointwise oriented arctangent of selected images.
3015           Each selected image is regarded as the y-argument of the arctangent
3016       function, while the
3017           specified image gives the corresponding x-argument.
3018
3019           Example:
3020             [#1]  (-1,1) (-1;1) resize 400,400,1,1,3 atan2[1] [0] keep[1] mod
3021       {pi/8}
3022
3023           Tutorial:      https://gmic.eu/oldtutorial/trigometric-and-inverse-
3024       trigometric-commands
3025
3026         atanh (+):
3027
3028           Compute the pointwise hyperbolic arctangent of selected images.
3029
3030         << (+):
3031             Shortcut for command 'bsl'.
3032
3033         bsl (+):
3034             value[%] |
3035             [image] |
3036             'formula' |
3037             (no arg)
3038
3039           Compute  the  bitwise  left shift of selected images with specified
3040       value, image or mathematical expression, or compute the  pointwise  se‐
3041       quential bitwise left shift of selected
3042           images.
3043           (equivalent to shortcut command '<<').
3044
3045           Example:
3046             [#1] image.jpg bsl 'round(3*x/w,0)' cut 0,255
3047
3048         >> (+):
3049             Shortcut for command 'bsr'.
3050
3051         bsr (+):
3052             value[%] |
3053             [image] |
3054             'formula' |
3055             (no arg)
3056
3057           Compute  the  bitwise right shift of selected images with specified
3058       value, image or mathematical expression, or compute the  pointwise  se‐
3059       quential bitwise right shift of
3060           selected images.
3061           (equivalent to shortcut command '>>').
3062
3063           Example:
3064             [#1] image.jpg bsr 'round(3*x/w,0)' cut 0,255
3065
3066         cos (+):
3067
3068           Compute the pointwise cosine of selected images.
3069
3070           Example:
3071             [#1] image.jpg +normalize 0,{2*pi} cos[-1]
3072             [#2] 300,1,1,1,'20*x/w+u' +cos display_graph 400,300
3073
3074           Tutorial:      https://gmic.eu/oldtutorial/trigometric-and-inverse-
3075       trigometric-commands
3076
3077         cosh (+):
3078
3079           Compute the pointwise hyperbolic cosine of selected images.
3080
3081           Example:
3082             [#1] image.jpg +normalize -3,3 cosh[-1]
3083             [#2] 300,1,1,1,'4*x/w+u' +cosh display_graph 400,300
3084
3085         deg2rad:
3086
3087           Convert pointwise angle values of selected images, from degrees  to
3088       radians (apply 'i*pi/180').
3089
3090         / (+):
3091             Shortcut for command 'div'.
3092
3093         div (+):
3094             value[%] |
3095             [image] |
3096             'formula' |
3097             (no arg)
3098
3099           Divide  selected  images  by specified value, image or mathematical
3100       expression, or compute the pointwise quotient of selected images.
3101           (equivalent to shortcut command '/').
3102
3103           Example:
3104             [#1] image.jpg div '1+abs(cos(x/10)*sin(y/10))'
3105             [#2] image.jpg +norm add[-1] 1 +div
3106
3107         div_complex:
3108             [divider_real,divider_imag],_epsilon>=0
3109
3110           Perform division of the selected complex pairs (real1,imag1,...,re‐
3111       alN,imagN) of images by
3112           specified complex pair of images (divider_real,divider_imag).
3113           In  complex pairs, the real image must be always located before the
3114       imaginary image in the image list.
3115
3116           Default value: 'epsilon=1e-8'.
3117
3118         == (+):
3119             Shortcut for command 'eq'.
3120
3121         eq (+):
3122             value[%] |
3123             [image] |
3124             'formula' |
3125             (no arg)
3126
3127           Compute the boolean equality  of  selected  images  with  specified
3128       value,  image or mathematical expression, or compute the boolean equal‐
3129       ity of selected images.
3130           (equivalent to shortcut command '==').
3131
3132           Example:
3133             [#1] image.jpg round 40 eq {round(ia,40)}
3134             [#2] image.jpg +mirror x eq
3135
3136         erf (+):
3137
3138           Compute the pointwise error function of selected images.
3139
3140           Example:
3141             [#1] image.jpg +normalize 0,2 erf[-1]
3142             [#2] 300,1,1,1,'7*x/w-3.5+u' +erf display_graph 400,300
3143
3144         exp (+):
3145
3146           Compute the pointwise exponential of selected images.
3147
3148           Example:
3149             [#1] image.jpg +normalize 0,2 exp[-1]
3150             [#2] 300,1,1,1,'7*x/w+u' +exp display_graph 400,300
3151
3152         >= (+):
3153             Shortcut for command 'ge'.
3154
3155         ge (+):
3156             value[%] |
3157             [image] |
3158             'formula' |
3159             (no arg)
3160
3161           Compute the boolean 'greater or equal than' of selected images with
3162       specified value, image
3163           or  mathematical  expression,  or  compute  the boolean 'greater or
3164       equal than' of selected images.
3165           (equivalent to shortcut command '>=').
3166
3167           Example:
3168             [#1] image.jpg ge {ia}
3169             [#2] image.jpg +mirror x ge
3170
3171         > (+):
3172             Shortcut for command 'gt'.
3173
3174         gt (+):
3175             value[%] |
3176             [image] |
3177             'formula' |
3178             (no arg)
3179
3180           Compute the boolean 'greater than' of selected images  with  speci‐
3181       fied  value,  image  or mathematical expression, or compute the boolean
3182       'greater than' of selected images.
3183           (equivalent to shortcut command '>').
3184
3185           Example:
3186             [#1] image.jpg gt {ia}
3187             [#2] image.jpg +mirror x gt
3188
3189         <= (+):
3190             Shortcut for command 'le'.
3191
3192         le (+):
3193             value[%] |
3194             [image] |
3195             'formula' |
3196             (no arg)
3197
3198           Compute the boolean 'less or equal than' of  selected  images  with
3199       specified value, image or mathematical expression, or compute the bool‐
3200       ean 'less or equal than' of selected
3201           images.
3202           (equivalent to shortcut command '<=').
3203
3204           Example:
3205             [#1] image.jpg le {ia}
3206             [#2] image.jpg +mirror x le
3207
3208         < (+):
3209             Shortcut for command 'lt'.
3210
3211         lt (+):
3212             value[%] |
3213             [image] |
3214             'formula' |
3215             (no arg)
3216
3217           Compute the boolean 'less than' of selected images  with  specified
3218       value,  image  or mathematical expression, or compute the boolean 'less
3219       than' of selected images.
3220           (equivalent to shortcut command '<').
3221
3222           Example:
3223             [#1] image.jpg lt {ia}
3224             [#2] image.jpg +mirror x lt
3225
3226         log (+):
3227
3228           Compute the pointwise base-e logarithm of selected images.
3229
3230           Example:
3231             [#1] image.jpg +add 1 log[-1]
3232             [#2] 300,1,1,1,'7*x/w+u' +log display_graph 400,300
3233
3234         log10 (+):
3235
3236           Compute the pointwise base-10 logarithm of selected images.
3237
3238           Example:
3239             [#1] image.jpg +add 1 log10[-1]
3240             [#2] 300,1,1,1,'7*x/w+u' +log10 display_graph 400,300
3241
3242         log2 (+):
3243
3244           Compute the pointwise base-2 logarithm of selected images
3245
3246           Example:
3247             [#1] image.jpg +add 1 log2[-1]
3248             [#2] 300,1,1,1,'7*x/w+u' +log2 display_graph 400,300
3249
3250         max (+):
3251             value[%] |
3252             [image] |
3253             'formula' |
3254             (no arg)
3255
3256           Compute the maximum between selected images  and  specified  value,
3257       image  or  mathematical expression, or compute the pointwise maxima be‐
3258       tween selected images.
3259
3260           Example:
3261             [#1] image.jpg +mirror x max
3262             [#2] image.jpg max 'R=((x/w-0.5)^2+(y/h-0.5)^2)^0.5;255*R'
3263
3264         maxabs (+):
3265             value[%] |
3266             [image] |
3267             'formula' |
3268             (no arg)
3269
3270           Compute the maxabs between selected images and specified value, im‐
3271       age or mathematical expression, or compute the pointwise maxabs between
3272       selected images.
3273
3274         m/ (+):
3275             Shortcut for command 'mdiv'.
3276
3277         mdiv (+):
3278             value[%] |
3279             [image] |
3280             'formula' |
3281             (no arg)
3282
3283           Compute the matrix division of selected matrices/vectors by  speci‐
3284       fied value, image or mathematical expression, or compute the matrix di‐
3285       vision of selected images.
3286           (equivalent to shortcut command 'm/').
3287
3288         med:
3289
3290           Compute the median of selected images.
3291
3292           Example:
3293             [#1] image.jpg sample lena,lion,square +med
3294
3295         min (+):
3296             value[%] |
3297             [image] |
3298             'formula' |
3299             (no arg)
3300
3301           Compute the minimum between selected images  and  specified  value,
3302       image  or  mathematical expression, or compute the pointwise minima be‐
3303       tween selected images.
3304
3305           Example:
3306             [#1] image.jpg +mirror x min
3307             [#2] image.jpg min 'R=((x/w-0.5)^2+(y/h-0.5)^2)^0.5;255*R'
3308
3309         minabs (+):
3310             value[%] |
3311             [image] |
3312             'formula' |
3313             (no arg)
3314
3315           Compute the minabs between selected images and specified value, im‐
3316       age or mathematical expression, or compute the pointwise minabs between
3317       selected images.
3318
3319         % (+):
3320             Shortcut for command 'mod'.
3321
3322         mod (+):
3323             value[%] |
3324             [image] |
3325             'formula' |
3326             (no arg)
3327
3328           Compute the modulo of selected images with specified  value,  image
3329       or  mathematical expression, or compute the pointwise sequential modulo
3330       of selected images.
3331           (equivalent to shortcut command '%').
3332
3333           Example:
3334             [#1] image.jpg +mirror x n. 1,255 round. mod
3335             [#2] image.jpg mod 'R=((x/w-0.5)^2+(y/h-0.5)^2)^0.5;255*R'
3336
3337         m* (+):
3338             Shortcut for command 'mmul'.
3339
3340         mmul (+):
3341             value[%] |
3342             [image] |
3343             'formula' |
3344             (no arg)
3345
3346           Compute the matrix right multiplication of  selected  matrices/vec‐
3347       tors  by  specified value, image or mathematical expression, or compute
3348       the matrix right multiplication of
3349           selected images.
3350           (equivalent to shortcut command 'm*').
3351
3352           Example:
3353             [#1] (0,1,0;0,0,1;1,0,0) (1;2;3) +mmul
3354
3355         * (+):
3356             Shortcut for command 'mul'.
3357
3358         mul (+):
3359             value[%] |
3360             [image] |
3361             'formula' |
3362             (no arg)
3363
3364           Multiply selected images by specified value, image or  mathematical
3365       expression, or compute the pointwise product of selected images.
3366           (equivalent to shortcut command '*').
3367
3368           See also: add, sub, div.
3369
3370           Example:
3371             [#1] image.jpg +mul 2 cut 0,255
3372             [#2] image.jpg (1,2,3,4,5,6,7,8) ri[-1] [0] mul[0] [-1]
3373             [#3] image.jpg mul '1-3*abs(x/w-0.5)' cut 0,255
3374             [#4] image.jpg +luminance negate[-1] +mul
3375
3376         mul_channels:
3377             value1,_value2,...,_valueN
3378
3379           Multiply  channels of selected images by specified sequence of val‐
3380       ues.
3381
3382           Example:
3383             [#1] image.jpg +mul_channels 1,0.5,0.8
3384
3385         mul_complex:
3386             [multiplier_real,multiplier_imag]
3387
3388           Perform   multiplication   of   the    selected    complex    pairs
3389       (real1,imag1,...,realN,imagN) of images by
3390           specified complex pair of images (multiplier_real,multiplier_imag).
3391           In  complex pairs, the real image must be always located before the
3392       imaginary image in the image list.
3393
3394         != (+):
3395             Shortcut for command 'neq'.
3396
3397         neq (+):
3398             value[%] |
3399             [image] |
3400             'formula' |
3401             (no arg)
3402
3403           Compute the boolean inequality of selected  images  with  specified
3404       value,  image  or  mathematical  expression, or compute the boolean in‐
3405       equality of selected images.
3406           (equivalent to shortcut command '!=').
3407
3408           Example:
3409             [#1] image.jpg round 40 neq {round(ia,40)}
3410
3411         | (+):
3412             Shortcut for command 'or'.
3413
3414         or (+):
3415             value[%] |
3416             [image] |
3417             'formula' |
3418             (no arg)
3419
3420           Compute the bitwise OR of selected images with specified value, im‐
3421       age  or  mathematical  expression,  or compute the pointwise sequential
3422       bitwise OR of selected images.
3423           (equivalent to shortcut command '|').
3424
3425           Example:
3426             [#1] image.jpg or 128
3427             [#2] image.jpg +mirror x or
3428
3429         ^ (+):
3430             Shortcut for command 'pow'.
3431
3432         pow (+):
3433             value[%] |
3434             [image] |
3435             'formula' |
3436             (no arg)
3437
3438           Raise selected images to the power of  specified  value,  image  or
3439       mathematical  expression, or compute the pointwise sequential powers of
3440       selected images.
3441           (equivalent to shortcut command '^').
3442
3443           Example:
3444             [#1] image.jpg div 255 +pow 0.5 mul 255
3445             [#2] image.jpg gradient pow 2 add pow 0.2
3446
3447         rad2deg:
3448
3449           Convert pointwise angle values of selected images, from radians  to
3450       degrees (apply 'i*180/pi').
3451
3452         rol (+):
3453             value[%] |
3454             [image] |
3455             'formula' |
3456             (no arg)
3457
3458           Compute the bitwise left rotation of selected images with specified
3459       value, image or mathematical expression, or compute the  pointwise  se‐
3460       quential bitwise left rotation of
3461           selected images.
3462
3463           Example:
3464             [#1] image.jpg rol 'round(3*x/w,0)' cut 0,255
3465
3466         ror (+):
3467             value[%] |
3468             [image] |
3469             'formula' |
3470             (no arg)
3471
3472           Compute  the  bitwise right rotation of selected images with speci‐
3473       fied value, image or mathematical expression, or compute the  pointwise
3474       sequential bitwise right rotation of
3475           selected images.
3476
3477           Example:
3478             [#1] image.jpg ror 'round(3*x/w,0)' cut 0,255
3479
3480         sign (+):
3481
3482           Compute the pointwise sign of selected images.
3483
3484           Example:
3485             [#1] image.jpg +sub {ia} sign[-1]
3486             [#2] 300,1,1,1,'cos(20*x/w+u)' +sign display_graph 400,300
3487
3488         sin (+):
3489
3490           Compute the pointwise sine of selected images.
3491
3492           Example:
3493             [#1] image.jpg +normalize 0,{2*pi} sin[-1]
3494             [#2] 300,1,1,1,'20*x/w+u' +sin display_graph 400,300
3495
3496           Tutorial:      https://gmic.eu/oldtutorial/trigometric-and-inverse-
3497       trigometric-commands
3498
3499         sinc (+):
3500
3501           Compute the pointwise sinc function of selected images.
3502
3503           Example:
3504             [#1] image.jpg +normalize {-2*pi},{2*pi} sinc[-1]
3505             [#2] 300,1,1,1,'20*x/w+u' +sinc display_graph 400,300
3506
3507         sinh (+):
3508
3509           Compute the pointwise hyperbolic sine of selected images.
3510
3511           Example:
3512             [#1] image.jpg +normalize -3,3 sinh[-1]
3513             [#2] 300,1,1,1,'4*x/w+u' +sinh display_graph 400,300
3514
3515         sqr (+):
3516
3517           Compute the pointwise square function of selected images.
3518
3519           Example:
3520             [#1] image.jpg +sqr
3521             [#2] 300,1,1,1,'40*x/w+u' +sqr display_graph 400,300
3522
3523         sqrt (+):
3524
3525           Compute the pointwise square root of selected images.
3526
3527           Example:
3528             [#1] image.jpg +sqrt
3529             [#2] 300,1,1,1,'40*x/w+u' +sqrt display_graph 400,300
3530
3531         - (+):
3532             Shortcut for command 'sub'.
3533
3534         sub (+):
3535             value[%] |
3536             [image] |
3537             'formula' |
3538             (no arg)
3539
3540           Subtract specified value, image or mathematical expression  to  se‐
3541       lected images, or compute the pointwise difference of selected images.
3542           (equivalent to shortcut command '-').
3543
3544           Example:
3545             [#1] image.jpg +sub 30% cut 0,255
3546             [#2] image.jpg +mirror x sub[-1] [0]
3547             [#3] image.jpg sub 'i(w/2+0.9*(x-w/2),y)'
3548             [#4] image.jpg +mirror x sub
3549
3550         tan (+):
3551
3552           Compute the pointwise tangent of selected images.
3553
3554           Example:
3555             [#1] image.jpg +normalize {-0.47*pi},{0.47*pi} tan[-1]
3556             [#2] 300,1,1,1,'20*x/w+u' +tan display_graph 400,300
3557
3558           Tutorial:      https://gmic.eu/oldtutorial/trigometric-and-inverse-
3559       trigometric-commands
3560
3561         tanh (+):
3562
3563           Compute the pointwise hyperbolic tangent of selected images.
3564
3565           Example:
3566             [#1] image.jpg +normalize -3,3 tanh[-1]
3567             [#2] 300,1,1,1,'4*x/w+u' +tanh display_graph 400,300
3568
3569         xor (+):
3570             value[%] |
3571             [image] |
3572             'formula' |
3573             (no arg)
3574
3575           Compute the bitwise XOR of selected images  with  specified  value,
3576       image  or  mathematical expression, or compute the pointwise sequential
3577       bitwise XOR of selected images.
3578
3579           Example:
3580             [#1] image.jpg xor 128
3581             [#2] image.jpg +mirror x xor
3582
3583         12.5. Values Manipulation
3584               -------------------
3585
3586         apply_curve:
3587             0<=smoothness<=1,x0,y0,x1,y1,x2,y2,...,xN,yN
3588
3589           Apply curve transformation to image values.
3590
3591           Default values: 'smoothness=1', 'x0=0', 'y0=100'.
3592
3593           Example:
3594             [#1] image.jpg +apply_curve 1,0,0,128,255,255,0
3595
3596         apply_gamma:
3597             gamma>=0
3598
3599           Apply gamma correction to selected images.
3600
3601           Example:
3602             [#1] image.jpg +apply_gamma 2
3603
3604         balance_gamma:
3605             _ref_color1,...
3606
3607           Compute gamma-corrected color balance of selected image,  with  re‐
3608       spect to specified reference color.
3609
3610           Default value: 'ref_color1=128'.
3611
3612           Example:
3613             [#1] image.jpg +balance_gamma 128,64,64
3614
3615         cast:
3616             datatype_source,datatype_target
3617
3618           Cast  datatype of image buffer from specified source type to speci‐
3619       fied target type.
3620           'datatype_source' and 'datatype_target' can be {  uint8  |  int8  |
3621       uint16 | int16 | uint32 | int32 | uint64 | int64 | float32 | float64 }.
3622
3623         complex2polar:
3624
3625           Compute complex to polar transforms of selected images.
3626
3627           Example:
3628             [#1]   image.jpg   +fft  complex2polar[-2,-1]  log[-2]  shift[-2]
3629       50%,50%,0,0,2 remove[-1]
3630
3631         compress_clut:
3632             _max_error>0,_avg_error>0,_max_nbpoints>=8 |  0  (unlimited),_er‐
3633       ror_metric={  0=L2-norm  | 1=deltaE_1976 | 2=deltaE_2000 },_reconstruc‐
3634       tion_colorspace={ 0=srgb | 1=rgb | 2=lab },
3635               _try_rbf_first={ 0 | 1 }
3636
3637           Compress selected color LUTs as sequences of colored keypoints.
3638
3639           Default      values:       'max_error=1.5',       'avg_error=0.75',
3640       'max_nb_points=2048',  'error_metric=2',  'reconstruction_colorspace=0'
3641       and
3642            'try_rbf_first=1'.
3643
3644         compress_huffman:
3645             [huffman_tree],_max_leaf_value
3646
3647           Compress selected images with Huffman coding.
3648           See also: decompress_huffman, huffman_tree.
3649
3650         huffman_tree:
3651
3652           Generate Huffman coding tree from the statistics  of  all  selected
3653       images.
3654           Huffman  tree is returned as a 1xN image inserted at the end of the
3655       image list, representing the 'N' vector-valued leafs/nodes of the tree,
3656       encoded as '[ value,parent,
3657           child0,child1 ]'.
3658           Last row of the returned image corresponds to the tree root.
3659           Selected images must contain only positive integer values.
3660           Return maximal value of the input data in the status.
3661           See also: compress_huffman, decompress_huffman.
3662
3663         compress_rle:
3664             _is_binary_data={ 0 | 1 },_maximum_sequence_length>=0
3665
3666           Compress selected images as 2xN data matrices, using RLE algorithm.
3667           Set  'maximum_sequence_length=0'  to  disable  maximum  length con‐
3668       straint.
3669
3670           Default values: 'is_binary_data=0' and 'maximum_sequence_length=0'.
3671
3672           Example:
3673             [#1] image.jpg resize2dy 100 quantize  4  round  +compress_rle  ,
3674       +decompress_rle[-1]
3675
3676         cumulate (+):
3677             { x | y | z | c }...{ x | y | z | c } |
3678             (no arg)
3679
3680           Compute the cumulative function of specified image data, optionally
3681       along the specified axes.
3682
3683           Example:
3684             [#1] image.jpg +histogram 256 +cumulate[-1]  display_graph[-2,-1]
3685       400,300,3
3686
3687         c (+):
3688             Shortcut for command 'cut'.
3689
3690         cut (+):
3691             { value0[%] | [image0] },{ value1[%] | [image1] } |
3692             [image]
3693
3694           Cut values of selected images in specified range.
3695           (equivalent to shortcut command 'c').
3696
3697           Example:
3698             [#1] image.jpg +add 30% cut[-1] 0,255
3699             [#2] image.jpg +cut 25%,75%
3700
3701         decompress_clut:
3702             _width>0,_height>0,_depth>0,_reconstruction_colorspace={ 0=srgb |
3703       1=rgb | 2=lab }
3704
3705           Decompress selected colored keypoints into 3D CLUTs, using a  mixed
3706       RBF/PDE approach.
3707
3708           Default  values:  'width=height=depth=33'  and 'reconstruction_col‐
3709       orspace=0'.
3710
3711         decompress_clut_rbf:
3712             _width>0,_height>0,_depth>0,_reconstruction_colorspace={ 0=srgb |
3713       1=rgb | 2=lab }
3714
3715           Decompress selected colored keypoints into 3D CLUTs, using RBF thin
3716       plate spline interpolation.
3717
3718           Default  value:  'width=height=depth=33'  and  'reconstruction_col‐
3719       orspace=0'.
3720
3721         decompress_clut_pde:
3722             _width>0,_height>0,_depth>0,_reconstruction_colorspace={ 0=srgb |
3723       1=rgb | 2=lab }
3724
3725           Decompress selected colored keypoints into 3D CLUTs,  using  multi‐
3726       scale diffusion PDE's.
3727
3728           Default  values:  'width=height=depth=33'  and 'reconstruction_col‐
3729       orspace=0'.
3730
3731         decompress_huffman:
3732             [huffman_tree]
3733
3734           Decompress selected images with Huffman decoding.
3735           See also: compress_huffman, huffman_tree.
3736
3737           Example:
3738             [#1]  image.jpg   huffman_tree   compress_huffman..   .   +decom‐
3739       press_huffman.. .
3740
3741         decompress_rle:
3742
3743           Decompress selected data vectors, using RLE algorithm.
3744
3745         discard (+):
3746             _value1,_value2,... |
3747             { x | y | z | c}...{ x | y | z | c},_value1,_value2,... |
3748             (no arg)
3749
3750           Discard  specified values in selected images or discard neighboring
3751       duplicate values,
3752           optionally only for the values along the first of a specified axis.
3753           If no arguments are specified,  neighboring  duplicate  values  are
3754       discarded.
3755           If  all pixels of a selected image are discarded, an empty image is
3756       returned.
3757
3758           Example:
3759             [#1] (1;2;3;4;3;2;1) +discard 2
3760             [#2] (1,2,2,3,3,3,4,4,4,4) +discard x
3761
3762         eigen2tensor:
3763
3764           Recompose selected pairs of eigenvalues/eigenvectors as 2x2 or  3x3
3765       tensor fields.
3766
3767           Tutorial: https://gmic.eu/tutorial/eigen2tensor
3768
3769         endian (+):
3770             _datatype
3771
3772           Reverse  data endianness of selected images, eventually considering
3773       the pixel being of the specified datatype.
3774           'datatype' can be { bool | uint8 | int8 | uint16 | int16 | uint32 |
3775       int32 | uint64 | int64 | float32 | float64 }.
3776           This command does nothing for 'bool', 'uint8' and 'int8' datatypes.
3777
3778         equalize (+):
3779             _nb_levels>0[%],_value_min[%],_value_max[%] |
3780             (no arg)
3781
3782           Equalize histograms of selected images.
3783           If value range is specified, the equalization is done only for pix‐
3784       els in the specified
3785           value range.
3786
3787           Default     values:     'nb_levels=256',     'value_min=0%'     and
3788       'value_max=100%'.
3789
3790           Example:
3791             [#1] image.jpg +equalize
3792             [#2] image.jpg +equalize 4,0,128
3793
3794         f (+):
3795             Shortcut for command 'fill'.
3796
3797         fill (+):
3798             value1,_value2,... |
3799             [image] |
3800             'formula'
3801
3802           Fill  selected  images  with  values  read from the specified value
3803       list, existing image
3804           or mathematical expression. Single quotes may be omitted  in  'for‐
3805       mula'.
3806           (equivalent to shortcut command 'f').
3807
3808           Example:
3809             [#1] 4,4 fill 1,2,3,4,5,6,7
3810             [#2] 4,4 (1,2,3,4,5,6,7) fill[-2] [-1]
3811             [#3]   400,400,1,3   fill   "X=x-w/2;  Y=y-h/2;  R=sqrt(X^2+Y^2);
3812       a=atan2(Y,X);
3813       if(R<=180,255*abs(cos(c+200*(x/w-0.5)*(y/h-0.5))),850*(a%(0.1*(c+1))))"
3814
3815           Tutorial: https://gmic.eu/tutorial/fill
3816
3817         index (+):
3818             {  [palette] | palette_name },0<=_dithering<=1,_map_palette={ 0 |
3819       1 }
3820
3821           Index selected vector-valued images by specified vector-valued pal‐
3822       ette.
3823           'palette_name'  can be { default | hsv | lines | hot | cool | jet |
3824       flag | cube | rainbow | algae | amp |balance | curl | deep  |  delta  |
3825       dense | diff | haline | ice
3826           | matter | oxy | phase | rain | solar | speed | tarn |tempo | ther‐
3827       mal | topo | turbid | aurora | hocuspocus | srb2 | uzebox }
3828
3829           Default values: 'dithering=0' and 'map_palette=0'.
3830
3831           Example:
3832             [#1] image.jpg +index 1,1,1
3833             [#2] image.jpg (0;255;255^0;128;255^0;0;255) +index[-2] [-1],1,1
3834
3835           Tutorial: https://gmic.eu/tutorial/gindex
3836
3837         ir:
3838             Shortcut for command 'inrange'.
3839
3840         inrange:
3841             min[%],max[%],_include_min_boundary={   0=no   |   1=yes   },_in‐
3842       clude_max_boundary={ 0=no | 1=yes }
3843
3844           Detect  pixels  whose values are in specified range '[min,max]', in
3845       selected images.
3846           (equivalent to shortcut command 'ir').
3847
3848           Default value: 'include_min_boundary=include_max_boundary=1'.
3849
3850           Example:
3851             [#1] image.jpg +inrange 25%,75%
3852
3853         map (+):
3854             [palette],_boundary_conditions |
3855             palette_name,_boundary_conditions
3856
3857           Map specified vector-valued palette to selected indexed scalar  im‐
3858       ages.
3859           'palette_name'  can be { default | hsv | lines | hot | cool | jet |
3860       flag | cube | rainbow | algae | amp | balance | curl | deep |  delta  |
3861       dense | diff | gray |
3862           haline | ice | matter | oxy | phase | rain | solar | speed | tarn |
3863       tempo | thermal | topo | turbid | aurora | hocuspocus | srb2 | uzebox }
3864           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
3865       | 3=mirror }.
3866
3867           Default value: 'boundary_conditions=0'.
3868
3869           Example:
3870             [#1] image.jpg +luminance map[-1] 3
3871             [#2]   image.jpg  +rgb2ycbcr  split[-1]  c  (0,255,0)  resize[-1]
3872       256,1,1,1,3 map[-4] [-1] remove[-1] append[-3--1] c ycbcr2rgb[-1]
3873
3874           Tutorial: https://gmic.eu/tutorial/map
3875
3876         mix_channels:
3877             (a00,...,aMN) |
3878             [matrix]
3879
3880           Apply specified matrix to channels of selected images.
3881
3882           Example:
3883             [#1] image.jpg +mix_channels (0,1,0;1,0,0;0,0,1)
3884
3885         negate:
3886             base_value |
3887             (no arg)
3888
3889           Negate image values.
3890
3891           Default value: 'base_value=(undefined)'.
3892
3893           Example:
3894             [#1] image.jpg +negate
3895
3896         noise (+):
3897             std_deviation>=0[%],_noise_type
3898
3899           Add random noise to selected images.
3900           'noise_type' can be { 0=gaussian  |  1=uniform  |  2=salt&pepper  |
3901       3=poisson | 4=rice }.
3902
3903           Default value: 'noise_type=0'.
3904
3905           Example:
3906             [#1]  image.jpg  +noise[0] 50,0 +noise[0] 50,1 +noise[0] 10,2 cut
3907       0,255
3908             [#2] 300,300,1,3 [0] noise[0] 20,0 noise[1] 20,1  +histogram  100
3909       display_graph[-2,-1] 400,300,3
3910
3911         noise_perlin:
3912             _scale_x[%]>0,_scale_y[%]>0,_scale_z[%]>0,_seed_x,_seed_y,_seed_z
3913
3914           Render 2D or 3D Perlin noise on selected images, from specified co‐
3915       ordinates.
3916           The Perlin noise is a specific type of smooth noise,
3917           described here : https://en.wikipedia.org/wiki/Perlin_noise.
3918
3919           Default       values:       'scale_x=scale_y=scale_z=16'        and
3920       'seed_x=seed_y=seed_z=0'.
3921
3922           Example:
3923             [#1] 500,500,1,3 noise_perlin ,
3924
3925         noise_poissondisk:
3926             _radius[%]>0,_max_sample_attempts>0,_p_norm>0
3927
3928           Add poisson disk sampling noise to selected images.
3929           Implements  the  algorithm from the article "Fast Poisson Disk Sam‐
3930       pling in Arbitrary Dimensions",
3931           by Robert Bridson (SIGGRAPH'2007).
3932
3933           Default   values:    'radius=8',    'max_sample_attempts=30'    and
3934       'p_norm=2'.
3935
3936           Example:
3937             [#1] 300,300 noise_poissondisk 8
3938
3939         normp:
3940             p>=0
3941
3942           Compute  the  pointwise Lp-norm norm of vector-valued pixels in se‐
3943       lected images.
3944
3945           Default value: 'p=2'.
3946
3947           Example:
3948             [#1] image.jpg +normp[0] 0 +normp[0] 1 +normp[0] 2 +normp[0] inf
3949
3950         norm1:
3951
3952           Compute the pointwise L1-norm of vector-valued pixels  in  selected
3953       images.
3954
3955           Example:
3956             [#1] image.jpg +norm1
3957
3958           Tutorial: https://gmic.eu/tutorial/norm1
3959
3960         norm:
3961             Shortcut for command 'norm2'.
3962
3963         norm2:
3964
3965           Compute  the  pointwise  L2-norm  (euclidean norm) of vector-valued
3966       pixels in selected images.
3967
3968           Example:
3969             [#1] image.jpg +norm
3970
3971           Tutorial: https://gmic.eu/tutorial/norm2
3972
3973         n (+):
3974             Shortcut for command 'normalize'.
3975
3976         normalize (+):
3977             {  value0[%]  |  [image0]  },{  value1[%]  |   [image1]   },_con‐
3978       stant_case_ratio |
3979             [image]
3980
3981           Linearly normalize values of selected images in specified range.
3982           (equivalent to shortcut command 'n').
3983
3984           Example:
3985             [#1] image.jpg split x,2 normalize[-1] 64,196 append x
3986
3987           Tutorial: https://gmic.eu/tutorial/normalize
3988
3989         normalize_l2:
3990
3991           Normalize selected images such that they have a unit L2 norm.
3992
3993         normalize_sum:
3994
3995           Normalize selected images such that they have a unit sum.
3996
3997           Example:
3998             [#1] image.jpg +histogram 256 normalize_sum[-1] display_graph[-1]
3999       400,300
4000
4001         not:
4002
4003           Apply boolean not operation on selected images.
4004
4005           Example:
4006             [#1] image.jpg +ge 50% +not[-1]
4007
4008         orientation:
4009
4010           Compute the pointwise orientation of vector-valued  pixels  in  se‐
4011       lected images.
4012
4013           Example:
4014             [#1] image.jpg +orientation +norm[-2] negate[-1] mul[-2] [-1] re‐
4015       verse[-2,-1]
4016
4017           Tutorial: https://gmic.eu/tutorial/orientation
4018
4019         oneminus:
4020
4021           For each selected image, compute one minus image.
4022
4023           Example:
4024             [#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:
4036             [#1] image.jpg luminance +otsu ,
4037
4038         polar2complex:
4039
4040           Compute polar to complex transforms of selected images.
4041
4042         quantize:
4043             nb_levels>=1,_keep_values={  0  | 1 },_quantization_type={ -1=me‐
4044       dian-cut | 0=k-means | 1=uniform }
4045
4046           Quantize selected images.
4047
4048           Default value: 'keep_values=1' and 'quantization_type=0'.
4049
4050           Example:
4051             [#1] image.jpg luminance +quantize 3
4052             [#2]  200,200,1,1,'cos(x/10)*sin(y/10)'  +quantize[0]  6   +quan‐
4053       tize[0] 4 +quantize[0] 3 +quantize[0] 2
4054
4055         quantize_area:
4056             _min_area>0
4057
4058           Quantize  selected  images  such  that each flat region has an area
4059       greater or equal to 'min_area'.
4060
4061           Default value: 'min_area=10'.
4062
4063           Example:
4064             [#1] image.jpg quantize 3 +blur 1 round[-1] +quantize_area[-1] 2
4065
4066         rand (+):
4067             { value0[%] | [image0] },_{ value1[%] | [image1] } |
4068             [image]
4069
4070           Fill selected images with random values  uniformly  distributed  in
4071       the specified range.
4072
4073           Example:
4074             [#1] 400,400,1,3 rand -10,10 +blur 10 sign[-1]
4075
4076         replace:
4077             source,target
4078
4079           Replace pixel values in selected images.
4080
4081           Example:
4082             [#1] (1;2;3;4) +replace 2,3
4083
4084         replace_inf:
4085             _expression
4086
4087           Replace all infinite values in selected images by specified expres‐
4088       sion.
4089
4090           Example:
4091             [#1] (0;1;2) log +replace_inf 2
4092
4093         replace_nan:
4094             _expression
4095
4096           Replace all NaN values in selected images by specified expression.
4097
4098           Example:
4099             [#1] (-1;0;2) sqrt +replace_nan 2
4100
4101         replace_naninf:
4102             _expression
4103
4104           Replace all NaN and infinite values in selected images by specified
4105       expression.
4106
4107         replace_seq:
4108             "search_seq","replace_seq"
4109
4110           Search and replace a sequence of values in selected images.
4111
4112           Example:
4113             [#1] (1;2;3;4;5) +replace_seq "2,3,4","7,8"
4114
4115         replace_str:
4116             "search_str","replace_str"
4117
4118           Search  and replace a string in selected images (viewed as strings,
4119       i.e. sequences of character codes).
4120
4121           Example:
4122             [#1]  ('"Hello  there,  how  are  you  ?"')  +replace_str  "Hello
4123       there","Hi David"
4124
4125         round (+):
4126             rounding_value>=0,_rounding_type |
4127             (no arg)
4128
4129           Round values of selected images.
4130           'rounding_type' can be { -1=backward | 0=nearest | 1=forward }.
4131
4132           Default value: 'rounding_type=0'.
4133
4134           Example:
4135             [#1] image.jpg +round 100
4136             [#2] image.jpg mul {pi/180} sin +round
4137
4138         roundify:
4139             gamma>=0
4140
4141           Apply  roundify transformation on float-valued data, with specified
4142       gamma.
4143
4144           Default value: 'gamma=0'.
4145
4146           Example:
4147             [#1] 1000 fill '4*x/w' repeat 5 { +roundify[0] {$>*0.2} }  append
4148       c display_graph 400,300
4149
4150         = (+):
4151             Shortcut for command 'set'.
4152
4153         set (+):
4154             value,_x[%],_y[%],_z[%],_c[%]
4155
4156           Set pixel value in selected images, at specified coordinates.
4157           (equivalent to shortcut command '=').
4158
4159           If specified coordinates are outside the image bounds, no action is
4160       performed.
4161
4162           Default values: 'x=y=z=c=0'.
4163
4164           Example:
4165             [#1] 2,2 set 1,0,0 set 2,1,0 set 3,0,1 set 4,1,1
4166             [#2]       image.jpg       repeat       10000        {        set
4167       255,{u(100)}%,{u(100)}%,0,{u(100)}% }
4168
4169         threshold:
4170             value[%],_is_soft={ 0 | 1 } :
4171
4172           Threshold values of selected images.
4173           'soft' can be { 0=hard-thresholding | 1=soft-thresholding }.
4174
4175           Default value: 'is_soft=0'.
4176
4177           Example:
4178             [#1] image.jpg +threshold[0] 50% +threshold[0] 50%,1
4179
4180           Tutorial: https://gmic.eu/tutorial/threshold
4181
4182         vector2tensor:
4183
4184           Convert selected vector fields to corresponding tensor fields.
4185
4186         12.6. Colors
4187               ------
4188
4189         adjust_colors:
4190             -100<=_brightness<=100,-100<=_con‐
4191       trast<=100,-100<=_gamma<=100,-100<=_hue_shift<=100,-100<=_satura‐
4192       tion<=100,_value_min,_value_max
4193
4194           Perform a global adjustment of colors on selected images.
4195           Range   of   correct   image   values   are  considered  to  be  in
4196       [value_min,value_max] (e.g. [0,255]).
4197           If 'value_min==value_max==0', value range is estimated from min/max
4198       values of selected images.
4199           Processed    images    have    pixel    values    constrained    in
4200       [value_min,value_max].
4201
4202           Default   values:    'brightness=0',    'contrast=0',    'gamma=0',
4203       'hue_shift=0', 'saturation=0', 'value_min=value_max=0'.
4204
4205           Example:
4206             [#1] image.jpg +adjust_colors 0,30,0,0,30
4207
4208         ac:
4209             Shortcut for command 'apply_channels'.
4210
4211         apply_channels:
4212             "command",color_channels,_value_action={  0=none | 1=cut | 2=nor‐
4213       malize }
4214
4215           Apply specified command on the chosen color channel(s) of each  se‐
4216       lected images.
4217           (equivalent to shortcut command 'ac').
4218
4219           Argument  'color_channels' refers to a colorspace, and can be basi‐
4220       cally one of
4221           { all | rgba | [s]rgb | ryb | lrgb | ycbcr | lab | lch | hsv |  hsi
4222       | hsl | cmy | cmyk | yiq }.
4223           You can also make the processing focus on a few particular channels
4224       of this colorspace,
4225           by setting 'color_channels' as 'colorspace_channel'  (e.g.  'hsv_h'
4226       for the hue).
4227           All  channel  values  are  considered to be provided in the [0,255]
4228       range.
4229
4230           Default value: 'value_action=0'.
4231
4232           Example:
4233             [#1] image.jpg +apply_channels "equalize blur 2",ycbcr_cbcr
4234
4235         autoindex:
4236             nb_colors>0,0<=_dithering<=1,_method={ 0=median-cut | 1=k-means }
4237
4238           Index selected vector-valued images by adapted colormaps.
4239
4240           Default values: 'dithering=0' and 'method=1'.
4241
4242           Example:
4243             [#1] image.jpg +autoindex[0] 4 +autoindex[0] 8 +autoindex[0] 16
4244
4245         bayer2rgb:
4246             _GM_smoothness,_RB_smoothness1,_RB_smoothness2
4247
4248           Transform selected RGB-Bayer sampled images to color images.
4249
4250           Default  values:  'GM_smoothness=RB_smoothness=1'  and  'RB_smooth‐
4251       ness2=0.5'.
4252
4253           Example:
4254             [#1] image.jpg rgb2bayer 0 +bayer2rgb 1,1,0.5
4255
4256         clut:
4257             "clut_name",_resolution>0,_cut_and_round={ 0=no | 1=yes }
4258
4259           Insert  one  of  the 1105 pre-defined CLUTs at the end of the image
4260       list.
4261           'clut_name' can be { 12_years_a_slave | 1917  |  2-strip-process  |
4262       60s  |  60s_faded  |  60s_faded_alt | 7drk_21 | action_magenta_01 | ac‐
4263       tion_red_01 | ad_astra |
4264           adventure_1453 | agfa_apx_100 | agfa_apx_25  |  agfa_precisa_100  |
4265       agfa_ultra_color_100  |  agfa_vista_200  | agressive_highligjtes_recov‐
4266       ery_5 | aladdin | alberto_street |
4267           alien_green | ampio | amstragram | amstragram+  |  analog_film_1  |
4268       analogfx_anno_1870_color | analogfx_old_style_i | analogfx_old_style_ii
4269       | analogfx_old_style_iii |
4270           analogfx_sepia_color        |        analogfx_soft_sepia_i        |
4271       analogfx_soft_sepia_ii  | anime | ant-man | apocalypse_this_very_moment
4272       | aqua | aqua_and_orange_dark | aquaman | arabica_12 |
4273           asistas | atomic_pink | atusa | autumn  |  ava_614  |  avalanche  |
4274       avengers_endgame | azrael_93 | baby_driver | bad_boys_for_life | basuco
4275       | bboyz_2 | bc_darkum |
4276           beach_aqua_orange    |     beach_faded_analog     |     beati     |
4277       beauty_and_the_beast   |  berlin_sky  |  bisogno  |  black_and_white  |
4278       black_panther | black_star | black_white_01 | black_white_02
4279           | black_white_03 | black_white_04 | black_white_05 | black_white_06
4280       |  blade_runner  |  bleach_bypass  |  bleachbypass_1 | bleachbypass_2 |
4281       bleachbypass_3 | bleachbypass_4 |
4282           bleech_bypass_green | bleech_bypass_yellow_01  |  blue_cold_fade  |
4283       blue_dark  |  blue_house  |  blue_ice  |  blue_mono | blue_shadows_01 |
4284       bluearchitecture | bluehour | blues |
4285           bob_ford | bohemian_rhapsody | bombshell | bourbon_64  |  boyado  |
4286       bright_green_01  |  bright_teal_orange  |  bright_warm  | brightgreen |
4287       brown_mobster | brownbm | brownish | bw_1
4288           | bw_10 | bw_2 | bw_3 | bw_4 | bw_5 | bw_6 | bw_7 | bw_8 |  bw_9  |
4289       bw_but_yellow  |  byers_11  |  calidum | candlelight | captain_marvel |
4290       caribe | chemical_168 | chrome_01 |
4291           cineblue | cinebm_4k | cinema | cinema_2 | cinema_3  |  cinema_4  |
4292       cinema_5  |  cinema_noir  |  cinematic-1 | cinematic-10 | cinematic-2 |
4293       cinematic-3 | cinematic-4 | cinematic-5 |
4294           cinematic-6 | cinematic-7  |  cinematic-8  |  cinematic-9  |  cine‐
4295       matic_01  |  cinematic_02  |  cinematic_03 | cinematic_for_flog | cine‐
4296       matic_forest | cinematic_lady_bird |
4297           cinematic_mexico | city | city_7 | city_dust | city_of_god |  clas‐
4298       sic_films_01 | classic_films_02 | classic_films_03 | classic_films_04 |
4299       classic_films_05 |
4300           classic_teal_and_orange   |   clayton_33   |   clear_teal_fade    |
4301       clouseau_54  | cobi_3 | coffee_44 | cold_clear_blue | cold_clear_blue_1
4302       | cold_ice | cold_simplicity_2 | coldchrome |
4303           color_rich | colore | colorful_0209 | colornegative | conflict_01 |
4304       contrail_35 | contrast_with_highlights_protection | contrasty_afternoon
4305       | contrasty_green | convold | cosa
4306           | creed_2 | crispautumn | crispromance | crispwarm | crispwinter  |
4307       cross_process_cp_130  |  cross_process_cp_14  |  cross_process_cp_15  |
4308       cross_process_cp_16 |
4309           cross_process_cp_18 |  cross_process_cp_3  |  cross_process_cp_4  |
4310       cross_process_cp_6   |   crushin   |  cubicle_99  |  culor  |  d_o_1  |
4311       dark_blues_in_sunlight | dark_green_02 |
4312           dark_green_1 | dark_man_x  |  dark_orange_teal  |  dark_place_01  |
4313       darkandsomber  |  darkness  |  date_39  |  day_4nite  | day_for_night |
4314       day_to_night_kings_blue | deep | deep_blue |
4315           deep_dark_warm   |   deep_high_contrast    |    deep_teal_fade    |
4316       deep_warm_fade | deepskintones_2 | deepskintones_3 | delicatessen | de‐
4317       noiser_simple_40 | desert_gold_37 | dimension |
4318           dimmer | directions_23 | django_25 | doctor_strange | domingo_145 |
4319       dream_1  |  dream_85  | drop_green_tint_14 | dropblues | dunkirk | duo‐
4320       tone_blue_red | earth_tone_boost |
4321           edgyember | elegance_38 | enchanted | ensaya  |  eterna_for_flog  |
4322       expired_69  |  expired_fade  |  expired_polaroid  |  extreme  |  fade |
4323       fade_to_green | faded | faded_47 | faded_alt
4324           | faded_analog | faded_extreme |  faded_green  |  faded_pink-ish  |
4325       faded_print | faded_retro_01 | faded_retro_02 | faded_vivid | fadedlook
4326       | fallcolors | falua | farkling |
4327           fatos   |   faux_infrared   |   faux_infrared_bw_1    |    faux_in‐
4328       frared_color_p_2 | faux_infrared_color_p_3 | faux_infrared_color_r_0a |
4329       faux_infrared_color_r_0b |
4330           faux_infrared_color_yp_1 | fezzle | fgcinebasic  |  fgcinebright  |
4331       fgcinecold  |  fgcinedrama  | fgcinetealorange_1 | fgcinetealorange_2 |
4332       fgcinevibrant | fgcinewarm | fight_club
4333           |  film_0987  |  film_9879  |  film_gb-19  |  film_high_contrast  |
4334       film_print_01   |   film_print_02   |   filmic   |  filo  |  flat_30  |
4335       flat_blue_moon | flavin | foggynight | folger_50 |
4336           ford_v_ferrari | foresta | formula_b | french_comedy  |  frosted  |
4337       frostedbeachpicnic   |   fuji_160c   |  fuji_160c_+  |  fuji_160c_++  |
4338       fuji_160c_- | fuji_3510_constlclip |
4339           fuji_3510_constlmap | fuji_3510_cuspclip |  fuji_3513_constlclip  |
4340       fuji_3513_constlmap  |  fuji_3513_cuspclip  | fuji_400h | fuji_400h_+ |
4341       fuji_400h_++ | fuji_400h_- | fuji_800z
4342           | fuji_800z_+ | fuji_800z_++ | fuji_800z_- | fuji_astia_100_generic
4343       |  fuji_astia_100f  | fuji_fp-100c | fuji_fp-100c_+ | fuji_fp-100c_++ |
4344       fuji_fp-100c_+++ |
4345           fuji_fp-100c_++_alt   |   fuji_fp-100c_-   |   fuji_fp-100c_--    |
4346       fuji_fp-100c_alt    |   fuji_fp-100c_cool   |   fuji_fp-100c_cool_+   |
4347       fuji_fp-100c_cool_++ | fuji_fp-100c_cool_- |
4348           fuji_fp-100c_cool_-- | fuji_fp-100c_negative  |  fuji_fp-100c_nega‐
4349       tive_+   |   fuji_fp-100c_negative_++   |  fuji_fp-100c_negative_+++  |
4350       fuji_fp-100c_negative_++_alt |
4351           fuji_fp-100c_negative_- | fuji_fp-100c_negative_-- |  fuji_fp-3000b
4352       |    fuji_fp-3000b_+   |   fuji_fp-3000b_++   |   fuji_fp-3000b_+++   |
4353       fuji_fp-3000b_- | fuji_fp-3000b_-- |
4354           fuji_fp-3000b_hc  |  fuji_fp-3000b_negative  |  fuji_fp-3000b_nega‐
4355       tive_+   |  fuji_fp-3000b_negative_++  |  fuji_fp-3000b_negative_+++  |
4356       fuji_fp-3000b_negative_- |
4357           fuji_fp-3000b_negative_--    |    fuji_fp-3000b_negative_early    |
4358       fuji_fp_100c  |  fuji_hdr  |  fuji_neopan_1600  |  fuji_neopan_1600_+ |
4359       fuji_neopan_1600_++ | fuji_neopan_1600_- |
4360           fuji_neopan_acros_100 | fuji_provia_100_generic |  fuji_provia_100f
4361       |  fuji_provia_400f  |  fuji_provia_400x | fuji_sensia_100 | fuji_supe‐
4362       ria_100 | fuji_superia_100_+ |
4363           fuji_superia_100_++  |  fuji_superia_100_-  |  fuji_superia_1600  |
4364       fuji_superia_1600_+  |  fuji_superia_1600_++  |  fuji_superia_1600_-  |
4365       fuji_superia_200 | fuji_superia_200_xpro |
4366           fuji_superia_400  |  fuji_superia_400_+  |  fuji_superia_400_++   |
4367       fuji_superia_400_- | fuji_superia_800 | fuji_superia_800_+ | fuji_supe‐
4368       ria_800_++ | fuji_superia_800_- |
4369           fuji_superia_hg_1600  |  fuji_superia_reala_100  |  fuji_superia_x-
4370       tra_800     |     fuji_velvia_100_generic     |     fuji_velvia_50    |
4371       fuji_xtrans_iii_acros | fuji_xtrans_iii_acros+g |
4372           fuji_xtrans_iii_acros+r      |      fuji_xtrans_iii_acros+ye      |
4373       fuji_xtrans_iii_astia      |      fuji_xtrans_iii_classic_chrome      |
4374       fuji_xtrans_iii_mono | fuji_xtrans_iii_mono+g |
4375           fuji_xtrans_iii_mono+r      |       fuji_xtrans_iii_mono+ye       |
4376       fuji_xtrans_iii_pro_neg_hi      |     fuji_xtrans_iii_pro_neg_std     |
4377       fuji_xtrans_iii_provia | fuji_xtrans_iii_sepia |
4378           fuji_xtrans_iii_velvia | fusion_88 | futuristicbleak_1  |  futuris‐
4379       ticbleak_2 | futuristicbleak_3 | futuristicbleak_4 | going_for_a_walk |
4380       golden | golden_bright | golden_fade |
4381           golden_mono | golden_night_softner_43 | golden_sony_37 | golden_vi‐
4382       brant   |  goldengate  |  goldentime  |  goldfx_bright_spring_breeze  |
4383       goldfx_bright_summer_heat |
4384           goldfx_hot_summer_heat | goldfx_perfect_sunset_01min |  goldfx_per‐
4385       fect_sunset_05min  | goldfx_perfect_sunset_10min | goldfx_spring_breeze
4386       | goldfx_summer_heat | good_morning |
4387           green_15  |  green_2025  |   green_action   |   green_afternoon   |
4388       green_and_orange   |   green_blues  |  green_book  |  green_conflict  |
4389       green_day_01 | green_day_02 | green_g_09 |
4390           green_indoor | green_light | green_mono  |  green_yellow  |  green‐
4391       ish_contrasty  | greenish_fade | greenish_fade_1 | gremerta | greyhound
4392       | hackmanite | hallowen_dark |
4393           happyness_133  |  hard_teal_orange  |  hardboost  |   harsh_day   |
4394       harsh_sunset  |  helios  |  herderite  | heulandite | hiddenite | high‐
4395       lights_protection | hilutite | hitman | hlg_1_1 |
4396           honey_light | hong_kong | horrorblue | howlite | huesio | husmes  |
4397       huyan  |  hydracore  |  hyla_68  | hypersthene | hypnosis | hypressen |
4398       i_tonya | ideo | ilford_delta_100 |
4399           ilford_delta_3200 | ilford_delta_3200_+  |  ilford_delta_3200_++  |
4400       ilford_delta_3200_-  |  ilford_delta_400  |  ilford_fp_4_plus_125 | il‐
4401       ford_hp_5 | ilford_hp_5_+ | ilford_hp_5_++
4402           | ilford_hp_5_-  |  ilford_hp_5_plus_400  |  ilford_hps_800  |  il‐
4403       ford_pan_f_plus_50  |  ilford_xp_2  |  inception | indoor_blue | indus‐
4404       trial_33 | infrared_-_dust_pink | instantc |
4405           jarklin | jojo_rabbit | joker  |  jumanji_the_next_level  |  juras‐
4406       sic_world_fallen_kingdom  |  justice_league  |  justpeachy | jwick_21 |
4407       k_tone_vintage_kodachrome | kh_1 | kh_10 |
4408           kh_2 | kh_3 | kh_4 | kh_5 | kh_6 | kh_7 | kh_8 | kh_9 |  killstreak
4409       | kingsman_the_golden_circle | knives_out | kodak_2383_constlclip | ko‐
4410       dak_2383_constlmap |
4411           kodak_2383_cuspclip | kodak_2393_constlclip |  kodak_2393_constlmap
4412       | kodak_2393_cuspclip | kodak_bw_400_cn | kodak_e-100_gx_ektachrome_100
4413       | kodak_ektachrome_100_vs |
4414           kodak_ektachrome_100_vs_generic    |    kodak_ektar_100    |    ko‐
4415       dak_elite_100_xpro  | kodak_elite_chrome_200 | kodak_elite_chrome_400 |
4416       kodak_elite_color_200 | kodak_elite_color_400 |
4417           kodak_elite_extracolor_100   |   kodak_hie_hs_infra   |   kodak_ko‐
4418       dachrome_200  |  kodak_kodachrome_25  | kodak_kodachrome_64 | kodak_ko‐
4419       dachrome_64_generic | kodak_portra_160 |
4420           kodak_portra_160_+ | kodak_portra_160_++ | kodak_portra_160_- | ko‐
4421       dak_portra_160_nc  |  kodak_portra_160_nc_+  | kodak_portra_160_nc_++ |
4422       kodak_portra_160_nc_- |
4423           kodak_portra_160_vc   |    kodak_portra_160_vc_+    |    kodak_por‐
4424       tra_160_vc_++  |  kodak_portra_160_vc_- | kodak_portra_400 | kodak_por‐
4425       tra_400_+ | kodak_portra_400_++ |
4426           kodak_portra_400_- | kodak_portra_400_nc | kodak_portra_400_nc_+  |
4427       kodak_portra_400_nc_++  | kodak_portra_400_nc_- | kodak_portra_400_uc |
4428       kodak_portra_400_uc_+ |
4429           kodak_portra_400_uc_++   |   kodak_portra_400_uc_-   |   kodak_por‐
4430       tra_400_vc  |  kodak_portra_400_vc_+  |  kodak_portra_400_vc_++  |  ko‐
4431       dak_portra_400_vc_- | kodak_portra_800 |
4432           kodak_portra_800_+ | kodak_portra_800_++ | kodak_portra_800_- | ko‐
4433       dak_portra_800_hc  |  kodak_t-max_100  |  kodak_t-max_3200  |  kodak_t-
4434       max_400 | kodak_tmax_3200 |
4435           kodak_tmax_3200_+ | kodak_tmax_3200_++ |  kodak_tmax_3200_-  |  ko‐
4436       dak_tmax_3200_alt  |  kodak_tri-x_400  | kodak_tri-x_400_+ | kodak_tri-
4437       x_400_++ | kodak_tri-x_400_- |
4438           kodak_tri-x_400_alt | korben_214  |  la_la_land  |  landscape_01  |
4439       landscape_02 | landscape_03 | landscape_04 | landscape_05 | landscape_1
4440       | landscape_10 | landscape_2 |
4441           landscape_3 | landscape_4 | landscape_5 | landscape_6 | landscape_7
4442       |  landscape_8  |  landscape_9 | lateafternoonwanderlust | latesunset |
4443       lavark | lc_1 | lc_10 | lc_2 | lc_3 |
4444           lc_4 | lc_5 | lc_6 | lc_7 | lc_8 |  lc_9  |  lenox_340  |  levex  |
4445       life_giving_tree | light_blown | litore | little_women | logan | lomo |
4446       lomography_redscale_100 |
4447           lomography_x-pro_slide_200 |  london_nights  |  longbeachmorning  |
4448       loro  |  lotta  | louetta | low_contrast_blue | low_key_01 | lucky_64 |
4449       lushgreen | lushgreensummer |
4450           mad_max_fury_road | maesky | magenta_day  |  magenta_day_01  |  ma‐
4451       genta_dream  |  magenta_yellow  |  magentacoffee  |  magichour  |  mar‐
4452       riage_story | matrix | mckinnon_75 | memories |
4453           mercato | metropolis  |  milo_5  |  minimalistcaffeination  |  mod‐
4454       ern_film  |  modern_films_01 | modern_films_02 | modern_films_03 | mod‐
4455       ern_films_04 | modern_films_05 |
4456           modern_films_06 | modern_films_07 | molti  |  mono_tinted  |  mono‐
4457       chrome  |  monochrome_1 | monochrome_2 | moody_1 | moody_10 | moody_2 |
4458       moody_3 | moody_4 | moody_5 | moody_6 |
4459           moody_7 | moody_8 | moody_9 |  moonlight  |  moonlight_01  |  moon‐
4460       light_2  |  moonrise | morning_6 | morroco_16 | mostly_blue | mother! |
4461       motus | moviz_1 | moviz_10 | moviz_11 |
4462           moviz_12 | moviz_13 | moviz_14 | moviz_15 | moviz_16 |  moviz_17  |
4463       moviz_18  |  moviz_19  |  moviz_2  |  moviz_20  | moviz_21 | moviz_22 |
4464       moviz_23 | moviz_24 | moviz_25 | moviz_26 |
4465           moviz_27 | moviz_28 | moviz_29 | moviz_3 | moviz_30  |  moviz_31  |
4466       moviz_32  |  moviz_33  |  moviz_34  |  moviz_35 | moviz_36 | moviz_37 |
4467       moviz_38 | moviz_39 | moviz_4 | moviz_40 |
4468           moviz_41 | moviz_42 | moviz_43 | moviz_44 | moviz_45 |  moviz_46  |
4469       moviz_47 | moviz_48 | moviz_5 | moviz_6 | moviz_7 | moviz_8 | moviz_9 |
4470       mucca | mute_shift | muted_01 |
4471           muted_fade | mysticpurplesunset | nah |  natural_vivid  |  natural‐
4472       boost  | nemesis | neon_770 | neutral_pump | neutral_teal_orange | neu‐
4473       tral_warm_fade | newspaper | night_01 |
4474           night_blade_4  |  night_king_141  |  night_spy  |  nightfromday   |
4475       nightlife | nigrum | no_time_to_die | nostalgiahoney | nostalgic | nw-1
4476       | nw-10 | nw-2 | nw-3 | nw-4 | nw-5 | nw-6
4477           |  nw-7  |  nw-8  |  nw-9   |   old_west   |   once_upon_a_time   |
4478       once_upon_a_time_in_hollywood  |  onda | only_red | only_red_and_blue |
4479       operation_yellow | orange_dark_4 | orange_dark_7 |
4480           orange_dark_look | orange_tone | orange_underexposed  |  orangeand‐
4481       blue  |  oranges | padre | paladin | paladin_1875 | parasite | partia |
4482       pasadena_21 | passing_by | perso |
4483           picola | pink_fade | pirates_of_the_caribbean | pitaya_15 | pmcine‐
4484       matic_01  |  pmcinematic_02 | pmcinematic_03 | pmcinematic_04 | pmcine‐
4485       matic_05 | pmcinematic_06 |
4486           pmcinematic_07 | pmnight_01 | pmnight_02 | pmnight_03 |  pmnight_04
4487       |  pmnight_05  |  polaroid_664  |  polaroid_665  | polaroid_665_+ | po‐
4488       laroid_665_++ | polaroid_665_- |
4489           polaroid_665_-- | polaroid_665_negative | polaroid_665_negative_+ |
4490       polaroid_665_negative_- | polaroid_665_negative_hc | polaroid_667 | po‐
4491       laroid_669 | polaroid_669_+ |
4492           polaroid_669_++  |  polaroid_669_+++   |   polaroid_669_-   |   po‐
4493       laroid_669_--   |   polaroid_669_cold   |   polaroid_669_cold_+  |  po‐
4494       laroid_669_cold_- | polaroid_669_cold_-- | polaroid_672 |
4495           polaroid_690 | polaroid_690_+ | polaroid_690_++ | polaroid_690_-  |
4496       polaroid_690_--   |   polaroid_690_cold  |  polaroid_690_cold_+  |  po‐
4497       laroid_690_cold_++ | polaroid_690_cold_- |
4498           polaroid_690_cold_-- | polaroid_690_warm  |  polaroid_690_warm_+  |
4499       polaroid_690_warm_++ | polaroid_690_warm_- | polaroid_690_warm_-- | po‐
4500       laroid_polachrome |
4501           polaroid_px-100uv+_cold   |   polaroid_px-100uv+_cold_+    |    po‐
4502       laroid_px-100uv+_cold_++    |    polaroid_px-100uv+_cold_+++    |   po‐
4503       laroid_px-100uv+_cold_- | polaroid_px-100uv+_cold_-- |
4504           polaroid_px-100uv+_warm   |   polaroid_px-100uv+_warm_+    |    po‐
4505       laroid_px-100uv+_warm_++    |    polaroid_px-100uv+_warm_+++    |   po‐
4506       laroid_px-100uv+_warm_- | polaroid_px-100uv+_warm_-- |
4507           polaroid_px-680 |  polaroid_px-680_+  |  polaroid_px-680_++  |  po‐
4508       laroid_px-680_-  |  polaroid_px-680_--  |  polaroid_px-680_cold  |  po‐
4509       laroid_px-680_cold_+ | polaroid_px-680_cold_++ |
4510           polaroid_px-680_cold_++_alt   |   polaroid_px-680_cold_-   |    po‐
4511       laroid_px-680_cold_-- | polaroid_px-680_warm | polaroid_px-680_warm_+ |
4512       polaroid_px-680_warm_++ |
4513           polaroid_px-680_warm_- | polaroid_px-680_warm_-- | polaroid_px-70 |
4514       polaroid_px-70_+   |   polaroid_px-70_++  |  polaroid_px-70_+++  |  po‐
4515       laroid_px-70_- | polaroid_px-70_-- |
4516           polaroid_px-70_cold     |     polaroid_px-70_cold_+      |      po‐
4517       laroid_px-70_cold_++ | polaroid_px-70_cold_- | polaroid_px-70_cold_-- |
4518       polaroid_px-70_warm | polaroid_px-70_warm_+ |
4519           polaroid_px-70_warm_++    |     polaroid_px-70_warm_-     |     po‐
4520       laroid_px-70_warm_--     |     polaroid_time_zero_expired     |     po‐
4521       laroid_time_zero_expired_+ | polaroid_time_zero_expired_++ |
4522           polaroid_time_zero_expired_- | polaroid_time_zero_expired_-- |  po‐
4523       laroid_time_zero_expired_---  |  polaroid_time_zero_expired_cold  | po‐
4524       laroid_time_zero_expired_cold_- |
4525           polaroid_time_zero_expired_cold_--     |     polaroid_time_zero_ex‐
4526       pired_cold_---  |  portrait_1 | portrait_10 | portrait_2 | portrait_3 |
4527       portrait_4 | portrait_5 | portrait_6 |
4528           portrait_7 | portrait_8 | portrait_9 | progressen  |  protect_high‐
4529       lights_01  |  prussian_blue | pseudogrey | purple | purple_2 | randas |
4530       red_afternoon_01 | red_day_01 |
4531           red_dream_01  |  redblueyellow  |  reds  |  reds_oranges_yellows  |
4532       reeve_38  |  remy_24  |  rest_33  |  retro | retro_brown_01 | retro_ma‐
4533       genta_01 | retro_summer_3 | retro_yellow_01 |
4534           rocketman     |     rollei_ir_400     |      rollei_ortho_25      |
4535       rollei_retro_100_tonal  |  rollei_retro_80s | rotate_muted | rotate_vi‐
4536       brant | rotated | rotated_crush | satid | saturated_blue |
4537           saving_private_damon | scala | science_fiction | scrittle |  sea  |
4538       seges  | selor | sensum | separation | serenity | seringe_4 | serpent |
4539       seventies_magazine | sevsuz |
4540           shade_kings_ink |  shadow_king_39  |  shine  |  sicario  |  sino  |
4541       skin_tones | smart_contrast | smokey | smooth_clear | smooth_cromeish |
4542       smooth_fade | smooth_green_orange |
4543           smooth_sailing | smooth_teal_orange | soft_fade | softblackandwhite
4544       |  softwarming  | solarized_color | solarized_color_2 | soldi | spider-
4545       man_far_from_home | spotlight |
4546           springmorning | sprocket_231 | spy_29 |  star_wars_the_rise_of_sky‐
4547       walker  |  strano  |  street | stringa | studio_skin_tone_shaper | sub‐
4548       tle_blue | subtle_green | subtle_yellow |
4549           sully | summer | summer_alt | sunlightlove | sunny  |  sunny_alt  |
4550       sunny_rich  |  sunny_warm  |  sunset_aqua_orange  | sunset_intense_vio‐
4551       let_blue | sunset_violet_mood | super_warm |
4552           super_warm_rich | sutro_fx  |  sweet_bubblegum  |  sweet_gelatto  |
4553       taiga | tarraco | teal_fade | teal_moonlight | tealmagentagold | tealo‐
4554       range | tealorange_1 | tealorange_2 |
4555           tealorange_3 | technicalfx_backlight_filter | teigen_28 |  tenet  |
4556       tensiongreen_1  |  tensiongreen_2  |  tensiongreen_3 | tensiongreen_4 |
4557       terra_4 | the_dark_knight |
4558           the_darkest_hour  |  the_gentelmen  |  the_grand_budapest_hotel   |
4559       the_hurt_locker   |  the_irishman  |  the_lighthouse  |  the_lobster  |
4560       the_martian | the_matrices | the_revenant |
4561           the_shape_of_water   |   the_social_network   |   the_two_popes   |
4562       the_way_back  |  thor_ragnarok  | thriller_2 | tirare | toastedgarden |
4563       top_gun_maverick | trent_18 | true_colors_8 |
4564           turkiest_42 | tutto | tweed_71 | ultra_water | uncut_gems | undeni‐
4565       able  |  undeniable_2  | underwater | unknown | upglow | urban_01 | ur‐
4566       ban_02 | urban_03 | urban_04 | urban_05 |
4567           urban_cowboy | uzbek_bukhara | uzbek_marriage | uzbek_samarcande  |
4568       valize  | valsky | velvetia | venom | very_warm_greenish | vfb_21 | vi‐
4569       brant | vibrant_alien |
4570           vibrant_contrast | vibrant_cromeish |  victory  |  vintage  |  vin‐
4571       tage_01  |  vintage_02  |  vintage_03  | vintage_04 | vintage_05 | vin‐
4572       tage_163 | vintage_alt | vintage_brighter |
4573           vintage_chrome | vintage_mob | vintage_warmth_1  |  violet_taste  |
4574       vireo_37  |  vita  |  vubes  |  war_for_the_planet_of_the_apes | warm |
4575       warm_dark_contrasty | warm_fade |
4576           warm_fade_1 | warm_highlight |  warm_neutral  |  warm_sunset_red  |
4577       warm_teal  | warm_vintage | warm_yellow | wavefire | waves | well_see |
4578       western | westernlut_2 | whiter_whites
4579           | winterlighthouse | wipe | wolf_of_wall_street  |  wonder_woman  |
4580       wooden_gold_20  |  x-men_dark_phoenix  |  yellow_55b | yellow_film_01 |
4581       yellowstone | you_can_do_it | zed_32 |
4582           zeke_39  |  zilverfx_bw_solarization  |  zilverfx_infrared  |  zil‐
4583       verfx_vintage_bw | zombieland_double_tap }
4584
4585           Default values: 'resolution=33' and 'cut_and_round=1'.
4586
4587           Example:
4588             [#1] clut summer clut alien_green,17 clut orange_dark4,48
4589
4590         cmy2rgb:
4591
4592           Convert color representation of selected images from CMY to RGB.
4593
4594         cmyk2rgb:
4595
4596           Convert color representation of selected images from CMYK to RGB.
4597
4598         colorblind:
4599             type={ 0=protanopia | 1=protanomaly | 2=deuteranopia | 3=deutera‐
4600       nomaly | 4=tritanopia |  5=tritanomaly  |  6=achromatopsia  |  7=achro‐
4601       matomaly }
4602
4603           Simulate color blindness vision.
4604           Simulation  method of Vienot, Brettel & Mollon 1999, "Digital video
4605       colourmaps for checking the legibility of displays by dichromats".
4606           The  dichromacy  matrices  of  the  paper  were  adapted  to   sRGB
4607       (RGB->XYZ).
4608           Anomalous  trichromacy  simulated via linear interpolation with the
4609       identity and a factor of 0.6.
4610
4611           Example:
4612             [#1] image.jpg +colorblind 0
4613
4614         colormap:
4615             nb_levels>=0,_method={ 0=median-cut | 1=k-means },_sort_vectors
4616
4617           Estimate best-fitting colormap with 'nb_colors' entries,  to  index
4618       selected images.
4619           Set 'nb_levels==0' to extract all existing colors of an image.
4620           'sort_vectors'  can  be  { 0=unsorted | 1=by increasing norm | 2=by
4621       decreasing occurrence }.
4622
4623           Default value: 'method=1' and 'sort_vectors=1'.
4624
4625           Example:
4626             [#1] image.jpg +colormap[0] 4 +colormap[0] 8 +colormap[0] 16
4627
4628           Tutorial: https://gmic.eu/oldtutorial/_colormap
4629
4630         compose_channels:
4631
4632           Compose all channels of each selected image, using specified arith‐
4633       metic operator (+,-,or,min,...).
4634
4635           Default value: '1=+'.
4636
4637           Example:
4638             [#1] image.jpg +compose_channels and
4639
4640           Tutorial: https://gmic.eu/tutorial/compose_channels
4641
4642         deltaE:
4643             [image],_metric={  0=deltaE_1976  | 1=deltaE_2000 },"_to_Lab_com‐
4644       mand"
4645
4646           Compute the CIE DeltaE color difference between selected images and
4647       specified [image].
4648           Argument  'to_Lab_command'  is  a command able to convert colors of
4649       [image] into a Lab representation.
4650
4651           Default values: 'metric=1' and 'to_Lab_command="srgb2lab"'.
4652
4653           Example:
4654             [#1] image.jpg +blur 2 +deltaE[0] [1],1,srgb2lab
4655
4656         direction2rgb:
4657
4658           Compute RGB representation of selected 2D direction fields.
4659
4660           Example:
4661             [#1] image.jpg luminance gradient append  c  blur  2  orientation
4662       +direction2rgb
4663
4664         ditheredbw:
4665
4666           Create dithered B&W version of selected images.
4667
4668           Example:
4669             [#1] image.jpg +equalize ditheredbw[-1]
4670
4671         fc:
4672             Shortcut for command 'fill_color'.
4673
4674         fill_color:
4675             col1,...,colN
4676
4677           Fill selected images with specified color.
4678           (equivalent to shortcut command 'fc').
4679
4680           Example:
4681             [#1] image.jpg +fill_color 255,0,255
4682
4683           Tutorial: https://gmic.eu/oldtutorial/_fill_color
4684
4685         gradient2rgb:
4686             _is_orientation={ 0 | 1 }
4687
4688           Compute RGB representation of 2D gradient of selected images.
4689
4690           Default value: 'is_orientation=0'.
4691
4692           Example:
4693             [#1] image.jpg +gradient2rgb 0 equalize[-1]
4694
4695         hcy2rgb:
4696
4697           Convert color representation of selected images from HCY to RGB.
4698
4699         hsi2rgb:
4700
4701           Convert color representation of selected images from HSI to RGB.
4702
4703         hsi82rgb:
4704
4705           Convert color representation of selected images from HSI8 to RGB.
4706
4707         hsl2rgb:
4708
4709           Convert color representation of selected images from HSL to RGB.
4710
4711         hsl82rgb:
4712
4713           Convert color representation of selected images from HSL8 to RGB.
4714
4715         hsv2rgb:
4716
4717           Convert color representation of selected images from HSV to RGB.
4718
4719           Example:
4720             [#1] (0,360;0,360^0,0;1,1^1,1;1,1) resize 400,400,1,3,3 hsv2rgb
4721
4722         hsv82rgb:
4723
4724           Convert color representation of selected images from HSV8 to RGB.
4725
4726         int2rgb:
4727
4728           Convert color representation of selected images from INT24 to RGB.
4729
4730         ipremula:
4731
4732           Convert  selected  images with premultiplied alpha colors to normal
4733       colors.
4734           See also: premula.
4735
4736         jzazbz2rgb:
4737             illuminant={ 0=D50 | 1=D65 | 2=E } |
4738             (no arg)
4739
4740           Convert color representation of selected images from RGB to Jzazbz.
4741
4742           Default value: 'illuminant=2'.
4743
4744         jzazbz2xyz:
4745
4746           Convert color representation of selected images from RGB to XYZ.
4747
4748         lab2lch:
4749
4750           Convert color representation of selected images from Lab to Lch.
4751
4752         lab2rgb:
4753             illuminant={ 0=D50 | 1=D65 | 2=E } |
4754             (no arg)
4755
4756           Convert color representation of selected images from Lab to RGB.
4757
4758           Default value: 'illuminant=2'.
4759
4760           Example:
4761             [#1]   (50,50;50,50^-3,3;-3,3^-3,-3;3,3)   resize   400,400,1,3,3
4762       lab2rgb
4763
4764         lab2srgb:
4765             illuminant={ 0=D50 | 1=D65 | 2=E } |
4766             (no arg)
4767
4768           Convert color representation of selected images from Lab to sRGB.
4769
4770           Default value: 'illuminant=2'.
4771
4772           Example:
4773             [#1]   (50,50;50,50^-3,3;-3,3^-3,-3;3,3)   resize   400,400,1,3,3
4774       lab2rgb
4775
4776         lab82srgb:
4777             illuminant={ 0=D50 | 1=D65 | 2=E } |
4778             (no arg)
4779
4780           Convert color representation of selected images from Lab8 to sRGB.
4781
4782           Default value: 'illuminant=2'.
4783
4784           Example:
4785             [#1]   (50,50;50,50^-3,3;-3,3^-3,-3;3,3)   resize   400,400,1,3,3
4786       lab2rgb
4787
4788         lab2xyz:
4789             illuminant={ 0=D50 | 1=D65 | 2=E } |
4790             (no arg)
4791
4792           Convert color representation of selected images from Lab to XYZ.
4793
4794           Default value: 'illuminant=2'.
4795
4796         lab82rgb:
4797             illuminant={ 0=D50 | 1=D65 | 2=E } |
4798             (no arg)
4799
4800           Convert color representation of selected images from Lab8 to RGB.
4801
4802           Default value: 'illuminant=2'.
4803
4804         lch2lab:
4805
4806           Convert color representation of selected images from Lch to Lab.
4807
4808         lch2rgb:
4809             illuminant={ 0=D50 | 1=D65 | 2=E } |
4810             (no arg)
4811
4812           Convert color representation of selected images from Lch to RGB.
4813
4814           Default value: 'illuminant=2'.
4815
4816         lch82rgb:
4817             illuminant={ 0=D50 | 1=D65 | 2=E } |
4818             (no arg)
4819
4820           Convert color representation of selected images from Lch8 to RGB.
4821
4822           Default value: 'illuminant=2'.
4823
4824         luminance:
4825
4826           Compute luminance of selected sRGB images.
4827
4828           Example:
4829             [#1] image.jpg +luminance
4830
4831           Tutorial: https://gmic.eu/tutorial/luminance
4832
4833         lightness:
4834
4835           Compute lightness of selected sRGB images.
4836
4837           Example:
4838             [#1] image.jpg +lightness
4839
4840         lut_contrast:
4841             _nb_colors>1,_min_rgb_value
4842
4843           Generate  a  RGB  colormap  where consecutive colors have high con‐
4844       trast.
4845           This function performs a specific score  maximization  to  generate
4846       the result, so
4847           it may take some time when 'nb_colors' is high.
4848
4849           Default values: 'nb_colors=256' and 'min_rgb_value=64'.
4850
4851         map_clut:
4852             [clut] | "clut_name"
4853
4854           Map specified RGB color LUT to selected images.
4855
4856           Example:
4857             [#1]   image.jpg   uniform_distribution   {2^6},3   mirror[-1]  x
4858       +map_clut[0] [1]
4859
4860         match_histogram:
4861             [reference_image],_nb_levels>0,_color_channels
4862
4863           Transfer histogram of the specified reference image to selected im‐
4864       ages.
4865           Argument  'color channels' is the same as with command 'apply_chan‐
4866       nels'.
4867
4868           Default value: 'nb_levels=256' and 'color_channels=all'.
4869
4870           Example:
4871             [#1] image.jpg 100,100,1,3,"u([256,200,100])" +match_histogram[0]
4872       [1]
4873
4874         match_icp:
4875             [reference_image],_precision>0,_transformation_variable
4876
4877           Transform  selected set of d-dimensional vectors to match specified
4878       set of reference vectors, using ICP  (Iterative  Closest  Point)  algo‐
4879       rithm.
4880           A       description      of      ICP      is      available      at
4881       https://en.wikipedia.org/wiki/Iterative_closest_point.
4882           Return the L2 alignment error.
4883
4884           Default values: 'precision=1e-2' and  'transformation_variable=(un‐
4885       defined)'.
4886           sample lena,earth +match_icp[0] [1]
4887
4888         match_pca:
4889             [reference_image],_color_channels
4890
4891           Transfer mean and covariance matrix of specified vector-valued ref‐
4892       erence image to selected images.
4893           Argument 'color channels' is the same as with command  'apply_chan‐
4894       nels'.
4895
4896           Default value: 'color_channels=all'.
4897
4898           Example:
4899             [#1] sample lena,earth +match_pca[0] [1]
4900
4901         match_rgb:
4902             [target],_gamma>=0,_regularization>=0,_luminosity_con‐
4903       straints>=0,_rgb_resolution>=0,_is_constraints={ 0 | 1 }
4904
4905           Transfer colors from selected source images to  selected  reference
4906       image (given as argument).
4907           'gamma'  determines  the  importance  of  color  occurrences in the
4908       matching process (0=none to 1=huge).
4909           'regularization' determines the number of guided filter  iterations
4910       to remove quantization effects.
4911           'luminosity_constraints'  tells  if  luminosity constraints must be
4912       applied on non-confident matched colors.
4913           'is_constraints' tells if additional hard color constraints must be
4914       set (opens an interactive window).
4915
4916           Default  values:  'gamma=0.3','regularization=8',  'luminosity_con‐
4917       straints=0.1', 'rgb_resolution=64' and 'is_constraints=0'.
4918
4919           Example:
4920             [#1] sample pencils,wall +match_rgb[0] [1],0,0.01
4921
4922         mix_rgb:
4923             a11,a12,a13,a21,a22,a23,a31,a32,a33
4924
4925           Apply 3x3 specified matrix to RGB colors of selected images.
4926
4927           Default values: 'a11=1', 'a12=a13=a21=0', 'a22=1',  'a23=a31=a32=0'
4928       and 'a33=1'.
4929
4930           Example:
4931             [#1] image.jpg +mix_rgb 0,1,0,1,0,0,0,0,1
4932
4933           Tutorial: https://gmic.eu/tutorial/mix_rgb
4934
4935         oklab2rgb:
4936
4937           Convert color representation of selected images from OKlab to RGB.
4938           (see       colorspace      definition      at:      https://bottos
4939       son.github.io/posts/oklab/ ).
4940           See also: rgb2oklab.
4941
4942         palette:
4943             palette_name | palette_number
4944
4945           Input specified color palette at the end of the image list.
4946           'palette_name' can be { default | hsv | lines | hot | cool | jet  |
4947       flag  |  cube  | rainbow | parula | spring | summer | autumn | winter |
4948       bone | copper | pink | vga |
4949           algae | amp | balance | curl | deep | delta | dense | diff | gray |
4950       haline  |  ice  |  matter | oxy | phase | rain | solar | speed | tarn |
4951       tempo | thermal | topo | turbid |
4952           aurora | hocuspocus | srb2 | uzebox | amiga7800 |  amiga7800mess  |
4953       fornaxvoid1 }
4954
4955           Example:
4956             [#1] palette hsv
4957
4958         premula:
4959
4960           Convert  selected  images with normal colors to premultiplied alpha
4961       colors.
4962           After conversion, alpha channel of resulting images  has  value  in
4963       [0,1] range.
4964           See also: ipremula.
4965
4966         pseudogray:
4967             _max_increment>=0,_JND_threshold>=0,_bits_depth>0
4968
4969           Generate  pseudogray  colormap with specified increment and percep‐
4970       tual threshold.
4971           If 'JND_threshold' is 0, no perceptual constraints are applied.
4972
4973           Default   values:   'max_increment=5',   'JND_threshold=2.3'    and
4974       'bits_depth=8'.
4975
4976           Example:
4977             [#1] pseudogray 5
4978
4979         random_clut:
4980
4981           Generate a 33x33x33 random 3D color LUT.
4982
4983           Example:
4984             [#1] image.jpg random_clut +map_clut.. .
4985
4986         random_clut:
4987             _seed = { >=0 | -1 }
4988
4989           Generate a 33x33x33 random 3D color LUT.
4990           If  specified 'seed' is positive, it is used as a seed for the ran‐
4991       dom number generator @cli : (so that using the same  seed  will  return
4992       the same CLUT).
4993
4994           Example:
4995             [#1] image.jpg random_clut +map_clut.. .
4996
4997         replace_color:
4998             tolerance[%]>=0,smoothness[%]>=0,src1,src2,...,dest1,dest2,...
4999
5000           Replace pixels from/to specified colors in selected images.
5001
5002           Example:
5003             [#1] image.jpg +replace_color 40,3,204,153,110,255,0,0
5004
5005         retinex:
5006             _value_offset>0,_colorspace={  hsi  |  hsv  |  lab | lrgb | rgb |
5007       ycbcr
5008       },0<=_min_cut<=100,0<=_max_cut<=100,_sigma_low>0,_sigma_mid>0,_sigma_high>0
5009
5010           Apply multi-scale retinex algorithm on selected images  to  improve
5011       color consistency.
5012           (as described in the page http://www.ipol.im/pub/art/2014/107/).
5013
5014           Default    values:   'offset=1',   'colorspace=hsv',   'min_cut=1',
5015       'max_cut=1', 'sigma_low=15','sigma_mid=80' and 'sigma_high=250'.
5016
5017         rgb2bayer:
5018             _start_pattern=0,_color_grid=0
5019
5020           Transform selected color images to RGB-Bayer sampled images.
5021
5022           Default values: 'start_pattern=0' and 'color_grid=0'.
5023
5024           Example:
5025             [#1] image.jpg +rgb2bayer 0
5026
5027         rgb2cmy:
5028
5029           Convert color representation of selected images from RGB to CMY.
5030
5031           Example:
5032             [#1] image.jpg rgb2cmy split c
5033
5034         rgb2cmyk:
5035
5036           Convert color representation of selected images from RGB to CMYK.
5037
5038           Example:
5039             [#1] image.jpg rgb2cmyk split c
5040             [#2] image.jpg rgb2cmyk split c fill[3] 0 append c cmyk2rgb
5041
5042         rgb2hcy:
5043
5044           Convert color representation of selected images from RGB to HCY.
5045
5046           Example:
5047             [#1] image.jpg rgb2hcy split c
5048
5049         rgb2hsi:
5050
5051           Convert color representation of selected images from RGB to HSI.
5052
5053           Example:
5054             [#1] image.jpg rgb2hsi split c
5055
5056         rgb2hsi8:
5057
5058           Convert color representation of selected images from RGB to HSI8.
5059
5060           Example:
5061             [#1] image.jpg rgb2hsi8 split c
5062
5063         rgb2hsl:
5064
5065           Convert color representation of selected images from RGB to HSL.
5066
5067           Example:
5068             [#1] image.jpg rgb2hsl split c
5069             [#2] image.jpg rgb2hsl +split  c  add[-3]  100  mod[-3]  360  ap‐
5070       pend[-3--1] c hsl2rgb
5071
5072         rgb2hsl8:
5073
5074           Convert color representation of selected images from RGB to HSL8.
5075
5076           Example:
5077             [#1] image.jpg rgb2hsl8 split c
5078
5079         rgb2hsv:
5080
5081           Convert color representation of selected images from RGB to HSV.
5082
5083           Example:
5084             [#1] image.jpg rgb2hsv split c
5085             [#2]  image.jpg  rgb2hsv  +split  c  add[-2]  0.3 cut[-2] 0,1 ap‐
5086       pend[-3--1] c hsv2rgb
5087
5088         rgb2hsv8:
5089
5090           Convert color representation of selected images from RGB to HSV8.
5091
5092           Example:
5093             [#1] image.jpg rgb2hsv8 split c
5094
5095         rgb2int:
5096
5097           Convert color representation of selected images from RGB  to  INT24
5098       scalars.
5099
5100           Example:
5101             [#1] image.jpg rgb2int
5102
5103         rgb2jzazbz:
5104             illuminant={ 0=D50 | 1=D65 | 2=E } |
5105             (no arg)
5106
5107           Convert color representation of selected images from RGB to Jzazbz.
5108
5109           Default value: 'illuminant=2'.
5110
5111         rgb2lab:
5112             illuminant={ 0=D50 | 1=D65 | 2=E } |
5113             (no arg)
5114
5115           Convert color representation of selected images from RGB to Lab.
5116
5117           Default value: 'illuminant=2'.
5118
5119         rgb2lab8:
5120             illuminant={ 0=D50 | 1=D65 | 2=E } |
5121             (no arg)
5122
5123           Convert color representation of selected images from RGB to Lab8.
5124
5125           Default value: 'illuminant=2'.
5126
5127           Example:
5128             [#1] image.jpg rgb2lab8 split c
5129
5130         rgb2lch:
5131             illuminant={ 0=D50 | 1=D65 | 2=E } |
5132             (no arg)
5133
5134           Convert color representation of selected images from RGB to Lch.
5135
5136           Default value: 'illuminant=2'.
5137
5138           Example:
5139             [#1] image.jpg rgb2lch split c
5140
5141         rgb2lch8:
5142             illuminant={ 0=D50 | 1=D65 | 2=E } |
5143             (no arg)
5144
5145           Convert color representation of selected images from RGB to Lch8.
5146
5147           Default value: 'illuminant=2'.
5148
5149           Example:
5150             [#1] image.jpg rgb2lch8 split c
5151
5152         rgb2luv:
5153
5154           Convert color representation of selected images from RGB to LUV.
5155
5156           Example:
5157             [#1] image.jpg rgb2luv split c
5158
5159         rgb2oklab:
5160
5161           Convert color representation of selected images from RGB to Oklab.
5162           (see       colorspace      definition      at:      https://bottos
5163       son.github.io/posts/oklab/ ).
5164           See also: oklab2rgb.
5165
5166         rgb2ryb:
5167
5168           Convert color representation of selected images from RGB to RYB.
5169
5170           Example:
5171             [#1] image.jpg rgb2ryb split c
5172
5173         rgb2srgb:
5174
5175           Convert color representation of selected images from linear RGB  to
5176       sRGB.
5177
5178         rgb2xyz:
5179             illuminant={ 0=D50 | 1=D65 | 2=E } |
5180             (no arg)
5181
5182           Convert color representation of selected images from RGB to XYZ.
5183
5184           Default value: 'illuminant=2'.
5185
5186           Example:
5187             [#1] image.jpg rgb2xyz split c
5188
5189         rgb2xyz8:
5190             illuminant={ 0=D50 | 1=D65 | 2=E } |
5191             (no arg)
5192
5193           Convert color representation of selected images from RGB to XYZ8.
5194
5195           Default value: 'illuminant=2'.
5196
5197           Example:
5198             [#1] image.jpg rgb2xyz8 split c
5199
5200         rgb2yiq:
5201
5202           Convert color representation of selected images from RGB to YIQ.
5203
5204           Example:
5205             [#1] image.jpg rgb2yiq split c
5206
5207         rgb2yiq8:
5208
5209           Convert color representation of selected images from RGB to YIQ8.
5210
5211           Example:
5212             [#1] image.jpg rgb2yiq8 split c
5213
5214         rgb2ycbcr:
5215
5216           Convert color representation of selected images from RGB to YCbCr.
5217
5218           Example:
5219             [#1] image.jpg rgb2ycbcr split c
5220
5221         rgb2yuv:
5222
5223           Convert color representation of selected images from RGB to YUV.
5224
5225           Example:
5226             [#1] image.jpg rgb2yuv split c
5227
5228         rgb2yuv8:
5229
5230           Convert color representation of selected images from RGB to YUV8.
5231
5232           Example:
5233             [#1] image.jpg rgb2yuv8 split c
5234
5235         remove_opacity:
5236
5237           Remove opacity channel of selected images.
5238
5239         ryb2rgb:
5240
5241           Convert color representation of selected images from RYB to RGB.
5242
5243         select_color:
5244             tolerance[%]>=0,col1,...,colN
5245
5246           Select pixels with specified color in selected images.
5247
5248           Example:
5249             [#1] image.jpg +select_color 40,204,153,110
5250
5251           Tutorial: https://gmic.eu/oldtutorial/_select_color
5252
5253         sepia:
5254
5255           Apply sepia tones effect on selected images.
5256
5257           Example:
5258             [#1] image.jpg sepia
5259
5260         solarize:
5261
5262           Solarize selected images.
5263
5264           Example:
5265             [#1] image.jpg solarize
5266
5267         split_colors:
5268             _tolerance>=0,_max_nb_outputs>0,_min_area>0
5269
5270           Split selected images as several image containing a single color.
5271           One selected image can be split as at most 'max_nb_outputs' images.
5272           Output  images are sorted by decreasing area of extracted color re‐
5273       gions and have an additional alpha-channel.
5274
5275           Default    values:    'tolerance=0',    'max_nb_outputs=256'    and
5276       'min_area=8'.
5277
5278           Example:
5279             [#1] image.jpg quantize 5 +split_colors , display_rgba
5280
5281         split_opacity:
5282
5283           Split color and opacity parts of selected images.
5284           This command returns 1 or 2 images for each selected image, whether
5285       it has an opacity channel or not.
5286
5287         srgb2lab:
5288             illuminant={ 0=D50 | 1=D65 | 2=E } |
5289             (no arg)
5290
5291           Convert color representation of selected images from sRGB to Lab.
5292
5293           Default value: 'illuminant=2'.
5294
5295           Example:
5296             [#1] image.jpg srgb2lab split c
5297             [#2] image.jpg srgb2lab +split c mul[-2,-1] 2.5  append[-3--1]  c
5298       lab2srgb
5299
5300         srgb2lab8:
5301             illuminant={ 0=D50 | 1=D65 | 2=E } |
5302             (no arg)
5303
5304           Convert color representation of selected images from sRGB to Lab8.
5305
5306           Default value: 'illuminant=2'.
5307
5308         srgb2rgb:
5309
5310           Convert color representation of selected images from sRGB to linear
5311       RGB.
5312
5313         to_a:
5314
5315           Force selected images to have an alpha channel.
5316
5317         to_color:
5318
5319           Force selected images to be in color mode (RGB or RGBA).
5320
5321         to_colormode:
5322             mode={ 0=adaptive | 1=G | 2=GA | 3=RGB | 4=RGBA }
5323
5324           Force selected images to be in a given color mode.
5325
5326           Default value: 'mode=0'.
5327
5328         to_gray:
5329
5330           Force selected images to be in GRAY mode.
5331
5332           Example:
5333             [#1] image.jpg +to_gray
5334
5335         to_graya:
5336
5337           Force selected images to be in GRAYA mode.
5338
5339         to_pseudogray:
5340             _max_step>=0,_is_perceptual_constraint={ 0 | 1 },_bits_depth>0
5341
5342           Convert selected  scalar  images  ([0-255]-valued)  to  pseudo-gray
5343       color images.
5344
5345           Default   values:  'max_step=5',  'is_perceptual_constraint=1'  and
5346       'bits_depth=8'.
5347           The original pseudo-gray technique  has  been  introduced  by  Rich
5348       Franzen http://r0k.us/graphics/pseudoGrey.html.
5349           Extension of this technique to arbitrary increments for more tones,
5350       has been done by David Tschumperlé.
5351
5352         to_rgb:
5353
5354           Force selected images to be in RGB mode.
5355
5356         to_rgba:
5357
5358           Force selected images to be in RGBA mode.
5359
5360         to_automode:
5361
5362           Force selected images to be in the most significant color mode.
5363           This commands checks for useless alpha channel (all values equal to
5364       255), as well as
5365           detects grayscale images encoded as color images.
5366
5367         xyz2jzazbz:
5368
5369           Convert color representation of selected images from XYZ to RGB.
5370
5371         xyz2lab:
5372             illuminant={ 0=D50 | 1=D65 | 2=E } |
5373             (no arg)
5374
5375           Convert color representation of selected images from XYZ to Lab.
5376
5377           Default value: 'illuminant=2'.
5378
5379         xyz2rgb:
5380             illuminant={ 0=D50 | 1=D65 | 2=E } |
5381             (no arg)
5382
5383           Convert color representation of selected images from XYZ to RGB.
5384
5385           Default value: 'illuminant=2'.
5386
5387         xyz82rgb:
5388             illuminant={ 0=D50 | 1=D65 | 2=E } |
5389             (no arg)
5390
5391           Convert color representation of selected images from XYZ8 to RGB.
5392
5393           Default value: 'illuminant=2'.
5394
5395         ycbcr2rgb:
5396
5397           Convert color representation of selected images from YCbCr to RGB.
5398
5399         yiq2rgb:
5400
5401           Convert color representation of selected images from YIQ to RGB.
5402
5403         yiq82rgb:
5404
5405           Convert color representation of selected images from YIQ8 to RGB.
5406
5407         yuv2rgb:
5408
5409           Convert color representation of selected images from YUV to RGB.
5410
5411         yuv82rgb:
5412
5413           Convert selected images from YUV8 to RGB color bases.
5414
5415         12.7. Geometry Manipulation
5416               ---------------------
5417
5418         a (+):
5419             Shortcut for command 'append'.
5420
5421         append (+):
5422             [image],axis,_centering |
5423             axis,_centering
5424
5425           Append  specified  image to selected images, or all selected images
5426       together, along specified axis.
5427           (equivalent to shortcut command 'a').
5428
5429           'axis' can be { x | y | z | c }.
5430           Usual 'centering' values are { 0=left-justified  |  0.5=centered  |
5431       1=right-justified }.
5432
5433           Default value: 'centering=0'.
5434
5435           Example:
5436             [#1] image.jpg split y,10 reverse append y
5437             [#2]  image.jpg repeat 5 { +rows[0] 0,{10+18*$>}% } remove[0] ap‐
5438       pend x,0.5
5439             [#3] image.jpg append[0] [0],y
5440
5441         append_tiles:
5442             _M>=0,_N>=0,0<=_centering_x<=1,0<=_centering_y<=1
5443
5444           Append MxN selected tiles as new images.
5445           If 'N' is set to 0, number of rows is estimated automatically.
5446           If 'M' is set to 0, number of columns is estimated automatically.
5447           If 'M' and 'N' are both set to '0', auto-mode is used.
5448           If 'M' or 'N' is set to 0, only a single image is produced.
5449           'centering_x' and 'centering_y' tells about the centering of  tiles
5450       when they have different sizes.
5451
5452           Default values: 'M=0', 'N=0', 'centering_x=centering_y=0.5'.
5453
5454           Example:
5455             [#1] image.jpg split xy,4 append_tiles ,
5456
5457         apply_scales:
5458             "command",num‐
5459       ber_of_scales>0,_min_scale[%]>=0,_max_scale[%]>=0,_scale_gamma>0,_in‐
5460       terpolation
5461
5462           Apply specified command on different scales of selected images.
5463           'interpolation'  can be { 0=none | 1=nearest | 2=average | 3=linear
5464       | 4=grid | 5=bicubic | 6=lanczos }.
5465
5466           Default value: 'min_scale=25%',  'max_scale=100%'  and  'interpola‐
5467       tion=3'.
5468
5469           Example:
5470             [#1] image.jpg apply_scales "blur 5 sharpen 1000",4
5471
5472         autocrop (+):
5473             value1,value2,... |
5474             (no arg)
5475
5476           Autocrop selected images by specified vector-valued intensity.
5477           If no arguments are provided, cropping value is guessed.
5478
5479           Example:
5480             [#1]      400,400,1,3      fill_color      64,128,255     ellipse
5481       50%,50%,120,120,0,1,255 +autocrop
5482
5483         autocrop_components:
5484             _threshold[%],_min_area[%]>=0,_is_high_connectivity={   0   |   1
5485       },_output_type={ 0=crop | 1=segmentation | 2=coordinates }
5486
5487           Autocrop  and  extract connected components in selected images, ac‐
5488       cording to a mask given as the last channel of
5489           each of the selected image (e.g. alpha-channel).
5490
5491           Default values: 'threshold=0%',  'min_area=0.1%',  'is_high_connec‐
5492       tivity=0' and 'output_type=1'.
5493
5494           Example:
5495             [#1] 256,256 noise 0.1,2 eq 1 dilate_circ 20 label_fg 0,1 normal‐
5496       ize 0,255 +neq 0 *[-1] 255 append c +autocrop_components ,
5497
5498         autocrop_seq:
5499             value1,value2,... | auto
5500
5501           Autocrop selected images using the crop geometry of the last one by
5502       specified vector-valued intensity,
5503           or by automatic guessing the cropping value.
5504
5505           Default value: auto mode.
5506
5507           Example:
5508             [#1]  image.jpg +fill[-1] 0 ellipse[-1] 50%,50%,30%,20%,0,1,1 au‐
5509       tocrop_seq 0
5510
5511         channels:
5512             c0[%],_c1[%]
5513
5514           Keep only specified channels of selected images.
5515           Dirichlet boundary is used  when  specified  channels  are  out  of
5516       range.
5517
5518           Default value: 'c1=c0'.
5519
5520           Example:
5521             [#1] image.jpg channels 0,1
5522             [#2] image.jpg luminance channels 0,2
5523
5524         columns:
5525             x0[%],_x1[%]
5526
5527           Keep only specified columns of selected images.
5528           Dirichlet boundary is used when specified columns are out of range.
5529
5530           Default value: 'x1=x0'.
5531
5532           Example:
5533             [#1] image.jpg columns -25%,50%
5534
5535         z (+):
5536             Shortcut for command 'crop'.
5537
5538         crop (+):
5539             x0[%],x1[%],_boundary_conditions |
5540             x0[%],y0[%],x1[%],y1[%],_boundary_conditions |
5541             x0[%],y0[%],z0[%],x1[%],y1[%],z1[%],_boundary_conditions |
5542             x0[%],y0[%],z0[%],c0[%],x1[%],y1[%],z1[%],c1[%],_boundary_condi‐
5543       tions
5544
5545           Crop selected images with specified region coordinates.
5546           (equivalent to shortcut command 'z').
5547
5548           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
5549       | 3=mirror }.
5550
5551           Default value: 'boundary_conditions=0'.
5552
5553           Example:
5554             [#1]      image.jpg     +crop     -230,-230,280,280,1     crop[0]
5555       -230,-230,280,280,0
5556             [#2] image.jpg crop 25%,25%,75%,75%
5557
5558         diagonal:
5559
5560           Transform selected vectors as diagonal matrices.
5561
5562           Example:
5563             [#1] 1,10,1,1,'y' +diagonal
5564
5565         edgels:
5566             x0,y0 |
5567             (no arg)
5568
5569           Retrieve list of edgels (and their normals) that go around a 2D bi‐
5570       nary silhouette.
5571           When  specified,  arguments  'x0,y0'  are the 2D coordinates of the
5572       starting point (must be located at the edge of the binary silhouette).
5573           Output image has 3 channels '[x,y,n]' where 'x' and 'y' are the  2D
5574       coordinates of the edgel point, and 'n' is the orientation of its asso‐
5575       ciated
5576           canonical normal (can be { 0=[1,0] | 1=[0,1] | 2=[-1,0] |  3=[0,-1]
5577       }.
5578
5579         elevate:
5580             _depth,_is_plain={ 0 | 1 },_is_colored={ 0 | 1 }
5581
5582           Elevate selected 2D images into 3D volumes.
5583
5584           Default values: 'depth=64', 'is_plain=1' and 'is_colored=1'.
5585
5586         expand_x:
5587             size_x>=0,_boundary_conditions={  0=dirichlet | 1=neumann | 2=pe‐
5588       riodic | 3=mirror }
5589
5590           Expand selected images along the x-axis.
5591
5592           Default value: 'boundary_conditions=0'.
5593
5594           Example:
5595             [#1] image.jpg expand_x 30,0
5596
5597         expand_xy:
5598             size>=0,_boundary_conditions={ 0=dirichlet | 1=neumann |  2=peri‐
5599       odic | 3=mirror }
5600
5601           Expand selected images along the xy-axes.
5602
5603           Default value: 'boundary_conditions=0'.
5604
5605           Example:
5606             [#1] image.jpg expand_xy 30,0
5607
5608         expand_xyz:
5609             size>=0,_boundary_conditions={  0=dirichlet | 1=neumann | 2=peri‐
5610       odic | 3=mirror }
5611
5612           Expand selected images along the xyz-axes.
5613
5614           Default value: 'boundary_conditions=0'.
5615
5616         expand_y:
5617             size_y>=0,_boundary_conditions={ 0=dirichlet | 1=neumann |  2=pe‐
5618       riodic | 3=mirror }
5619
5620           Expand selected images along the y-axis.
5621
5622           Default value: 'boundary_conditions=0'.
5623
5624           Example:
5625             [#1] image.jpg expand_y 30,0
5626
5627         expand_z:
5628             size_z>=0,_boundary_conditions={  0=dirichlet | 1=neumann | 2=pe‐
5629       riodic | 3=mirror }
5630
5631           Expand selected images along the z-axis.
5632
5633           Default value: 'boundary_conditions=0'.
5634
5635         extract:
5636             "condition",_output_type={ 0=xyzc-coordinates | 1=xyz-coordinates
5637       | 2=scalar-values | 3=vector-values }
5638
5639           Extract a list of coordinates or values from selected image, where
5640           specified mathematical condition holds.
5641           For N coordinates matching, result is a 1xNx1x4 image.
5642
5643           Default values: 'output_type=0'.
5644
5645           Example:
5646             [#1] sp lena +extract "norm(I)>128",3
5647
5648         extract_region:
5649             [label_image],_extract_xyz_coordinates={    0    |    1    },_la‐
5650       bel_1,...,_label_M
5651
5652           Extract all pixels of selected images whose corresponding label  in
5653       '[label_image]' is equal to 'label_m',
5654           and output them as M column images.
5655
5656           Default value: 'extract_xyz_coordinates=0'.
5657
5658           Example:
5659             [#1] image.jpg +blur 3 quantize. 4,0 +extract_region[0] [1],0,1,3
5660
5661         montage:
5662             "_layout_code",_montage_mode={  0<=centering<=1  |  2<=scale+2<=3
5663       },_output_mode={ 0=single layer | 1=multiple layers },"_processing_com‐
5664       mand"
5665
5666           Create  a  single  image montage from selected images, according to
5667       specified layout code :
5668            * 'X' to assemble all images using an automatically estimated lay‐
5669       out.
5670            * 'H' to assemble all images horizontally.
5671            * 'V' to assemble all images vertically.
5672            * 'A' to assemble all images as an horizontal array.
5673            * 'B' to assemble all images as a vertical array.
5674            * 'Ha:b' to assemble two blocks 'a' and 'b' horizontally.
5675            * 'Va:b' to assemble two blocks 'a' and 'b' vertically.
5676            *  'Ra'  to  rotate a block 'a' by 90 deg. ('RRa' for 180 deg. and
5677       'RRRa' for 270 deg.).
5678            * 'Ma' to mirror a block 'a' along the X-axis ('MRRa' for  the  Y-
5679       axis).
5680           A  block  'a'  can  be  an  image index (treated periodically) or a
5681       nested layout expression 'Hb:c','Vb:c','Rb' or
5682           'Mb' itself.
5683           For example, layout code 'H0:V1:2' creates an image where image [0]
5684       is on the left, and images [1] and [2]
5685           vertically packed on the right.
5686
5687           Default  values: 'layout_code=X', 'montage_mode=2', output_mode='0'
5688       and 'processing_command=""'.
5689
5690           Example:
5691             [#1] image.jpg sample  ?  +plasma[0]  shape_cupid  256  normalize
5692       0,255  frame  3,3,0  frame  10,10,255  to_rgb  +montage A +montage[^-1]
5693       H1:V0:VH2:1H0:3
5694
5695         mirror (+):
5696             { x | y | z }...{ x | y | z }
5697
5698           Mirror selected images along specified axes.
5699
5700           Example:
5701             [#1] image.jpg +mirror y +mirror[0] c
5702             [#2] image.jpg +mirror x +mirror y append_tiles 2,2
5703
5704         permute (+):
5705             permutation_string
5706
5707           Permute selected image axes by specified permutation.
5708           'permutation' is a combination of the character set {x|y|z|c},
5709           e.g. 'xycz', 'cxyz', ...
5710
5711           Example:
5712             [#1] image.jpg permute yxzc
5713
5714         r (+):
5715             Shortcut for command 'resize'.
5716
5717         resize (+):
5718             {[image_w] | width>0[%]},_{[image_h] | height>0[%]},_{[image_d] |
5719       depth>0[%]},_{[image_s]  | spectrum>0[%]},_interpolation,_boundary_con‐
5720       ditions,_ax,_ay,_az,_ac
5721
5722           Resize selected images with specified geometry.
5723           (equivalent to shortcut command 'r').
5724
5725           'interpolation' can be  {  -1=none  (memory  content)  |  0=none  |
5726       1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }.
5727           'boundary_conditions' has different meanings, according to the cho‐
5728       sen 'interpolation' mode :
5729           . When 'interpolation=={ -1 | 1 | 2 | 4  }',  'boundary_conditions'
5730       is meaningless.
5731           . When 'interpolation==0', 'boundary_conditions' can be { 0=dirich‐
5732       let | 1=neumann | 2=periodic | 3=mirror }.
5733           . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be
5734       { 0=none | 1=neumann }.
5735           'ax,ay,az,ac'  set  the  centering along each axis when 'interpola‐
5736       tion=0 or 4'
5737           (set to '0' by default, must be defined in range [0,1]).
5738
5739           Default  values:  'interpolation=1',  'boundary_conditions=0'   and
5740       'ax=ay=az=ac=0'.
5741
5742           Example:
5743             [#1]     image.jpg    +resize[-1]    256,128,1,3,2    +resize[-1]
5744       120%,120%,1,3,0,1,0.5,0.5  +resize[-1]  120%,120%,1,3,0,0,0.2,0.2  +re‐
5745       size[-1] [0],[0],1,3,4
5746
5747         ri:
5748             Shortcut for command 'resize_as_image'.
5749
5750         resize_as_image:
5751             [reference],_interpolation,_boundary_conditions,_ax,_ay,_az,_ac
5752
5753           Resize selected images to the geometry of specified [reference] im‐
5754       age.
5755           (equivalent to shortcut command 'ri').
5756
5757           Default  values:  'interpolation=1',  'boundary_conditions=0'   and
5758       'ax=ay=az=ac=0'.
5759
5760           Example:
5761             [#1] image.jpg sample duck +resize_as_image[-1] [-2]
5762
5763         resize_mn:
5764             width[%]>=0,_height[%]>=0,_depth[%]>=0,_B_value,_C_value
5765
5766           Resize selected images with Mitchell-Netravali filter (cubic).
5767           For        details        about        the       method,       see:
5768       https://de.wikipedia.org/wiki/Mitchell-Netravali-Filter.
5769
5770           Default  values:  'height=100%',   'depth=100%',   'B=0.3333'   and
5771       'C=0.3333'.
5772
5773           Example:
5774             [#1] image.jpg resize2dx 32 resize_mn 800%,800%
5775
5776         resize_pow2:
5777             _interpolation,_boundary_conditions,_ax,_ay,_az,_ac
5778
5779           Resize selected images so that each dimension is a power of 2.
5780           'interpolation'  can  be  {  -1=none  (memory  content)  | 0=none |
5781       1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }.
5782           'boundary_conditions' has different meanings, according to the cho‐
5783       sen 'interpolation' mode :
5784           .  When  'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions'
5785       is meaningless.
5786           . When 'interpolation==0', 'boundary_conditions' can be { 0=dirich‐
5787       let | 1=neumann | 2=periodic | 3=mirror }.
5788           . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be
5789       { 0=none | 1=neumann }.
5790           'ax,ay,az,ac' set the centering along each  axis  when  'interpola‐
5791       tion=0'
5792           (set to '0' by default, must be defined in range [0,1]).
5793
5794           Default   values:  'interpolation=0',  'boundary_conditions=0'  and
5795       'ax=ay=az=ac=0'.
5796
5797           Example:
5798             [#1] image.jpg +resize_pow2[-1] 0
5799
5800         rr2d:
5801             Shortcut for command 'resize_ratio2d'.
5802
5803         resize_ratio2d:
5804             width>0,height>0,_mode={  0=inside   |   1=outside   |   2=padded
5805       },0=<_interpolation<=6
5806
5807           Resize selected images while preserving their aspect ratio.
5808           (equivalent to shortcut command 'rr2d').
5809
5810           Default values: 'mode=0' and 'interpolation=6'.
5811
5812         r2din:
5813             Shortcut for command 'resize2din'.
5814
5815         resize2din:
5816             width[%]>0,_height[%]>0,_interpolation,_boundary_condi‐
5817       tions,_ax,_ay,_az,_ac
5818
5819           Resize  selected  images  so  the   size   is   not   larger   than
5820       'width'x'height' while preserving 2D ratio.
5821           (equivalent to shortcut command 'r2din').
5822
5823           'interpolation'  can  be  {  -1=none  (memory  content)  | 0=none |
5824       1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }.
5825           'boundary_conditions' has different meanings, according to the cho‐
5826       sen 'interpolation' mode :
5827           .  When  'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions'
5828       is meaningless.
5829           . When 'interpolation==0', 'boundary_conditions' can be { 0=dirich‐
5830       let | 1=neumann | 2=periodic | 3=mirror }.
5831           . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be
5832       { 0=none | 1=neumann }.
5833           'ax,ay,az,ac' set the centering along each  axis  when  'interpola‐
5834       tion=0'
5835           (set to '0' by default, must be defined in range [0,1]).
5836
5837           Default  values: 'height=100%', 'interpolation=3', 'boundary_condi‐
5838       tions=0' and 'ax=ay=az=ac=0'.
5839
5840           Example:
5841             [#1] image.jpg +resize2din 100,100 append x
5842
5843         r3din:
5844             Shortcut for command 'resize3din'.
5845
5846         resize3din:
5847             width[%]>0,_height[%]>0,_depth[%]>0,_interpolation,_boundary_con‐
5848       ditions,_ax,_ay,_az,_ac
5849
5850           Resize   selected   images   so   the   size  is  not  larger  than
5851       'width'x'height'x'depth' while preserving 3D ratio.
5852           (equivalent to shortcut command 'r3din').
5853
5854           'interpolation' can be  {  -1=none  (memory  content)  |  0=none  |
5855       1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }.
5856           'boundary_conditions' has different meanings, according to the cho‐
5857       sen 'interpolation' mode :
5858           . When 'interpolation=={ -1 | 1 | 2 | 4  }',  'boundary_conditions'
5859       is meaningless.
5860           . When 'interpolation==0', 'boundary_conditions' can be { 0=dirich‐
5861       let | 1=neumann | 2=periodic | 3=mirror }.
5862           . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be
5863       { 0=none | 1=neumann }.
5864           'ax,ay,az,ac'  set  the  centering along each axis when 'interpola‐
5865       tion=0'
5866           (set to '0' by default, must be defined in range [0,1]).
5867
5868           Default  values:  'height=100%',  'depth=100%',  'interpolation=3',
5869       'boundary_conditions=0' and 'ax=ay=az=ac=0'.
5870
5871         r2dout:
5872             Shortcut for command 'resize2dout'.
5873
5874         resize2dout:
5875             width[%]>0,_height[%]>0,_interpolation,_boundary_condi‐
5876       tions,_ax,_ay,_az,_ac
5877
5878           Resize  selected  images  so  the  size   is   not   smaller   than
5879       'width'x'height' while preserving 2D ratio.
5880           (equivalent to shortcut command 'r2dout').
5881
5882           'interpolation'  can  be  {  -1=none  (memory  content)  | 0=none |
5883       1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }.
5884           'boundary_conditions' has different meanings, according to the cho‐
5885       sen 'interpolation' mode :
5886           .  When  'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions'
5887       is meaningless.
5888           . When 'interpolation==0', 'boundary_conditions' can be { 0=dirich‐
5889       let | 1=neumann | 2=periodic | 3=mirror }.
5890           . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be
5891       { 0=none | 1=neumann }.
5892           'ax,ay,az,ac' set the centering along each  axis  when  'interpola‐
5893       tion=0'
5894           (set to '0' by default, must be defined in range [0,1]).
5895
5896           Default  values: 'height=100%', 'interpolation=3', 'boundary_condi‐
5897       tions=0' and 'ax=ay=az=ac=0'.
5898
5899           Example:
5900             [#1] image.jpg +resize2dout 100,100 append x
5901
5902         r3dout:
5903             Shortcut for command 'resize3dout'.
5904
5905         resize3dout:
5906             width[%]>0,_height[%]>0,_depth[%]>0,_interpolation,_boundary_con‐
5907       ditions,_ax,_ay,_az,_ac
5908
5909           Resize   selected   images   so   the  size  is  not  smaller  than
5910       'width'x'height'x'depth' while preserving 3D ratio.
5911           (equivalent to shortcut command 'r3dout').
5912
5913           'interpolation' can be  {  -1=none  (memory  content)  |  0=none  |
5914       1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }.
5915           'boundary_conditions' has different meanings, according to the cho‐
5916       sen 'interpolation' mode :
5917           . When 'interpolation=={ -1 | 1 | 2 | 4  }',  'boundary_conditions'
5918       is meaningless.
5919           . When 'interpolation==0', 'boundary_conditions' can be { 0=dirich‐
5920       let | 1=neumann | 2=periodic | 3=mirror }.
5921           . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be
5922       { 0=none | 1=neumann }.
5923           'ax,ay,az,ac'  set  the  centering along each axis when 'interpola‐
5924       tion=0'
5925           (set to '0' by default, must be defined in range [0,1]).
5926
5927           Default  values:  'height=100%',  'depth=100%',  'interpolation=3',
5928       'boundary_conditions=0' and 'ax=ay=az=ac=0'.
5929
5930         r2dx:
5931             Shortcut for command 'resize2dx'.
5932
5933         resize2dx:
5934             width[%]>0,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac
5935
5936           Resize selected images along the x-axis, while preserving 2D ratio.
5937           (equivalent to shortcut command 'r2dx').
5938
5939           'interpolation'  can  be  {  -1=none  (memory  content)  | 0=none |
5940       1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }.
5941           'boundary_conditions' has different meanings, according to the cho‐
5942       sen 'interpolation' mode :
5943           .  When  'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions'
5944       is meaningless.
5945           . When 'interpolation==0', 'boundary_conditions' can be { 0=dirich‐
5946       let | 1=neumann | 2=periodic | 3=mirror }.
5947           . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be
5948       { 0=none | 1=neumann }.
5949           'ax,ay,az,ac' set the centering along each  axis  when  'interpola‐
5950       tion=0'
5951           (set to '0' by default, must be defined in range [0,1]).
5952
5953           Default   values:  'interpolation=3',  'boundary_conditions=0'  and
5954       'ax=ay=az=ac=0'.
5955
5956           Example:
5957             [#1] image.jpg +resize2dx 100,2 append x
5958
5959         r2dy:
5960             Shortcut for command 'resize2dy'.
5961
5962         resize2dy:
5963             height[%]>=0,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac
5964
5965           Resize selected images along the y-axis, while preserving 2D ratio.
5966           (equivalent to shortcut command 'r2dy').
5967
5968           'interpolation' can be  {  -1=none  (memory  content)  |  0=none  |
5969       1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }.
5970           'boundary_conditions' has different meanings, according to the cho‐
5971       sen 'interpolation' mode :
5972           . When 'interpolation=={ -1 | 1 | 2 | 4  }',  'boundary_conditions'
5973       is meaningless.
5974           . When 'interpolation==0', 'boundary_conditions' can be { 0=dirich‐
5975       let | 1=neumann | 2=periodic | 3=mirror }.
5976           . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be
5977       { 0=none | 1=neumann }.
5978           'ax,ay,az,ac'  set  the  centering along each axis when 'interpola‐
5979       tion=0'
5980           (set to '0' by default, must be defined in range [0,1]).
5981
5982           Default  values:  'interpolation=3',  'boundary_conditions=0'   and
5983       'ax=ay=az=ac=0'.
5984
5985           Example:
5986             [#1] image.jpg +resize2dy 100,2 append x
5987
5988         r3dx:
5989             Shortcut for command 'resize3dx'.
5990
5991         resize3dx:
5992             width[%]>0,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac
5993
5994           Resize selected images along the x-axis, while preserving 3D ratio.
5995           (equivalent to shortcut command 'r3dx').
5996
5997           'interpolation'  can  be  {  -1=none  (memory  content)  | 0=none |
5998       1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }.
5999           'boundary_conditions' has different meanings, according to the cho‐
6000       sen 'interpolation' mode :
6001           .  When  'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions'
6002       is meaningless.
6003           . When 'interpolation==0', 'boundary_conditions' can be { 0=dirich‐
6004       let | 1=neumann | 2=periodic | 3=mirror }.
6005           . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be
6006       { 0=none | 1=neumann }.
6007           'ax,ay,az,ac' set the centering along each  axis  when  'interpola‐
6008       tion=0'
6009           (set to '0' by default, must be defined in range [0,1]).
6010
6011           Default   values:  'interpolation=3',  'boundary_conditions=0'  and
6012       'ax=ay=az=ac=0'.
6013
6014         r3dy:
6015             Shortcut for command 'resize3dy'.
6016
6017         resize3dy:
6018             height[%]>0,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac
6019
6020           Resize selected images along the y-axis, while preserving 3D ratio.
6021           (equivalent to shortcut command 'r3dy').
6022
6023           'interpolation' can be  {  -1=none  (memory  content)  |  0=none  |
6024       1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }.
6025           'boundary_conditions' has different meanings, according to the cho‐
6026       sen 'interpolation' mode :
6027           . When 'interpolation=={ -1 | 1 | 2 | 4  }',  'boundary_conditions'
6028       is meaningless.
6029           . When 'interpolation==0', 'boundary_conditions' can be { 0=dirich‐
6030       let | 1=neumann | 2=periodic | 3=mirror }.
6031           . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be
6032       { 0=none | 1=neumann }.
6033           'ax,ay,az,ac'  set  the  centering along each axis when 'interpola‐
6034       tion=0'
6035           (set to '0' by default, must be defined in range [0,1]).
6036
6037           Default  values:  'interpolation=3',  'boundary_conditions=0'   and
6038       'ax=ay=az=ac=0'.
6039
6040         r3dz:
6041             Shortcut for command 'resize3dz'.
6042
6043         resize3dz:
6044             depth[%]>0,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac
6045
6046           Resize selected images along the z-axis, while preserving 3D ratio.
6047           (equivalent to shortcut command 'r3dz').
6048
6049           'interpolation'  can  be  {  -1=none  (memory  content)  | 0=none |
6050       1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }.
6051           'boundary_conditions' has different meanings, according to the cho‐
6052       sen 'interpolation' mode :
6053           .  When  'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions'
6054       is meaningless.
6055           . When 'interpolation==0', 'boundary_conditions' can be { 0=dirich‐
6056       let | 1=neumann | 2=periodic | 3=mirror }.
6057           . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be
6058       { 0=none | 1=neumann }.
6059           'ax,ay,az,ac' set the centering along each  axis  when  'interpola‐
6060       tion=0'
6061           (set to '0' by default, must be defined in range [0,1]).
6062
6063           Default   values:  'interpolation=3',  'boundary_conditions=0'  and
6064       'ax=ay=az=ac=0'.
6065
6066         rotate (+):
6067             angle,_interpolation,_boundary_conditions,_center_x[%],_cen‐
6068       ter_y[%] |
6069             u,v,w,angle,interpolation,boundary_conditions,_center_x[%],_cen‐
6070       ter_y[%],_center_z[%]
6071
6072           Rotate selected images with specified angle (in deg.), and  option‐
6073       ally 3D axis (u,v,w).
6074           'interpolation' can be { 0=none | 1=linear | 2=bicubic }.
6075           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
6076       | 3=mirror }.
6077           When a rotation center (cx,cy,_cz) is specified, the  size  of  the
6078       image is preserved.
6079
6080           Default   values:  'interpolation=1',  'boundary_conditions=0'  and
6081       'center_x=center_y=(undefined)'.
6082
6083           Example:
6084             [#1] image.jpg +rotate -25,1,2,50%,50% rotate[0] 25
6085
6086         rotate_tileable:
6087             angle,_max_size_factor>=0
6088
6089           Rotate selected images by specified angle and make them tileable.
6090           If resulting size of an image is too big, the image is replaced  by
6091       a 1x1 image.
6092
6093           Default values: 'max_size_factor=8'.
6094
6095         rows:
6096             y0[%],_y1[%]
6097
6098           Keep only specified rows of selected images.
6099           Dirichlet  boundary conditions are used when specified rows are out
6100       of range.
6101
6102           Default value: 'y1=y0'.
6103
6104           Example:
6105             [#1] image.jpg rows -25%,50%
6106
6107         scale2x:
6108
6109           Resize selected images using the Scale2x algorithm.
6110
6111           Example:
6112             [#1] image.jpg threshold 50% resize 50%,50% +scale2x
6113
6114         scale3x:
6115
6116           Resize selected images using the Scale3x algorithm.
6117
6118           Example:
6119             [#1] image.jpg threshold 50% resize 33%,33% +scale3x
6120
6121         scale_dcci2x:
6122             _edge_threshold>=0,_exponent>0,_extend_1px={ 0=false | 1=true }
6123
6124           Double image size using directional  cubic  convolution  interpola‐
6125       tion,
6126           as   described   in   https://en.wikipedia.org/wiki/Directional_Cu
6127       bic_Convolution_Interpolation.
6128
6129           Default  values:  'edge_threshold=1.15',  'exponent=5'   and   'ex‐
6130       tend_1px=0'.
6131
6132           Example:
6133             [#1] image.jpg +scale_dcci2x ,
6134
6135         seamcarve:
6136             _width[%]>=0,_height[%]>=0,_is_priority_channel={ 0 | 1 },_is_an‐
6137       tialiasing={ 0 | 1 },_maximum_seams[%]>=0
6138
6139           Resize selected images with specified 2D geometry, using the  seam-
6140       carving algorithm.
6141
6142           Default  values:  'height=100%',  'is_priority_channel=0',  'is_an‐
6143       tialiasing=1' and 'maximum_seams=25%'.
6144
6145           Example:
6146             [#1] image.jpg seamcarve 60%
6147
6148         shift (+):
6149             vx[%],_vy[%],_vz[%],_vc[%],_boundary_conditions,_interpolation={
6150       0=nearest_neighbor | 1=linear }
6151
6152           Shift selected images by specified displacement vector.
6153           Displacement  vector can be non-integer in which case linear inter‐
6154       polation should be chosen.
6155           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
6156       | 3=mirror }.
6157
6158           Default value: 'boundary_conditions=0' and 'interpolation=0'.
6159
6160           Example:
6161             [#1]  image.jpg  +shift[0]  50%,50%,0,0,0 +shift[0] 50%,50%,0,0,1
6162       +shift[0] 50%,50%,0,0,2
6163
6164         shrink_x:
6165             size_x>=0
6166
6167           Shrink selected images along the x-axis.
6168
6169           Example:
6170             [#1] image.jpg shrink_x 30
6171
6172         shrink_xy:
6173             size>=0
6174
6175           Shrink selected images along the xy-axes.
6176
6177           Example:
6178             [#1] image.jpg shrink_xy 30
6179
6180         shrink_xyz:
6181             size>=0
6182
6183           Shrink selected images along the xyz-axes.
6184
6185         shrink_y:
6186             size_y>=0
6187
6188           Shrink selected images along the y-axis.
6189
6190           Example:
6191             [#1] image.jpg shrink_y 30
6192
6193         shrink_z:
6194             size_z>=0
6195
6196           Shrink selected images along the z-axis.
6197
6198         slices:
6199             z0[%],_z1[%]
6200
6201           Keep only specified slices of selected images.
6202           Dirichlet boundary conditions are used when  specified  slices  are
6203       out of range.
6204
6205           Default value: 'z1=z0'.
6206
6207         sort (+):
6208             _ordering={ + | - },_axis={ x | y | z | c }
6209
6210           Sort pixel values of selected images.
6211           If  'axis'  is specified, the sorting is done according to the data
6212       of the first column/row/slice/channel
6213           of selected images.
6214
6215           Default values: 'ordering=+' and 'axis=(undefined)'.
6216
6217           Example:
6218             [#1] 64 rand 0,100 +sort display_graph 400,300,3
6219
6220         s (+):
6221             Shortcut for command 'split'.
6222
6223         split (+):
6224             { x | y | z | c }...{ x | y | z | c },_split_mode |
6225             keep_splitting_values={ + | - },_{ x | y | z | c }...{ x | y |  z
6226       | c },value1,_value2,... |
6227             (no arg)
6228
6229           Split  selected  images along specified axes, or regarding to a se‐
6230       quence of scalar values
6231           (optionally along specified axes too).
6232           (equivalent to shortcut command 's').
6233
6234           'split_mode' can be  {  0=split  according  to  constant  values  |
6235       >0=split in N parts | <0=split in parts of size -N }.
6236
6237           Default value: 'split_mode=-1'.
6238
6239           Example:
6240             [#1] image.jpg split c
6241             [#2] image.jpg split y,3
6242             [#3] image.jpg split x,-128
6243             [#4] 1,20,1,1,"1,2,3,4" +split -,2,3 append[1--1] y
6244             [#5] (1,2,2,3,3,3,4,4,4,4) +split x,0 append[1--1] y
6245
6246         split_tiles:
6247             M!=0,_N!=0,_is_homogeneous={ 0 | 1 }
6248
6249           Split selected images as a MxN array of tiles.
6250           If M or N is negative, it stands for the tile size instead.
6251
6252           Default values: 'N=M' and 'is_homogeneous=0'.
6253
6254           Example:
6255             [#1]  image.jpg  +local  split_tiles 5,4 blur 3,0 sharpen 700 ap‐
6256       pend_tiles 4,5 done
6257
6258         undistort:
6259             -1<=_amplitude<=1,_aspect_ratio,_zoom,_center_x[%],_cen‐
6260       ter_y[%],_boundary_conditions
6261
6262           Correct  barrel/pincushion  distortions  occurring  with wide-angle
6263       lens.
6264           References:
6265           [1] Zhang Z. (1999). Flexible camera calibration by viewing a plane
6266       from unknown orientation.
6267           [2]  Andrew W. Fitzgibbon (2001). Simultaneous linear estimation of
6268       multiple view geometry and lens distortion.
6269           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
6270       | 3=mirror }.
6271
6272           Default values: 'amplitude=0.25', 'aspect_ratio=0', 'zoom=0', 'cen‐
6273       ter_x=center_y=50%' and 'boundary_conditions=0'.
6274
6275         y (+):
6276             Shortcut for command 'unroll'.
6277
6278         unroll (+):
6279             _axis={ x | y | z | c }
6280
6281           Unroll selected images along specified axis.
6282           (equivalent to shortcut command 'y').
6283
6284           Default value: 'axis=y'.
6285
6286           Example:
6287             [#1] (1,2,3;4,5,6;7,8,9) +unroll y
6288
6289         upscale_smart:
6290             width[%],_height[%],_depth,_smoothness>=0,_anisot‐
6291       ropy=[0,1],sharpening>=0
6292
6293           Upscale selected images with an edge-preserving algorithm.
6294
6295           Default  values:  'height=100%', 'depth=100%', 'smoothness=2', 'an‐
6296       isotropy=0.4' and 'sharpening=10'.
6297
6298           Example:
6299             [#1] image.jpg resize2dy 100 +upscale_smart 500%,500% append x
6300
6301         warp (+):
6302             [warping_field],_mode,_interpolation,_boundary_condi‐
6303       tions,_nb_frames>0
6304
6305           Warp selected images with specified displacement field.
6306           'mode'  can be { 0=backward-absolute | 1=backward-relative | 2=for‐
6307       ward-absolute | 3=forward-relative }.
6308           'interpolation' can be { 0=nearest-neighbor | 1=linear | 2=cubic }.
6309           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
6310       | 3=mirror }.
6311
6312           Default   values:   'mode=0',  'interpolation=1',  'boundary_condi‐
6313       tions=0' and 'nb_frames=1'.
6314
6315           Example:
6316             [#1]                                                    image.jpg
6317       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,cos(4*A),sin(8*A))'
6318       warp[-2] [-1],1,1,0 quiver[-1] [-1],10,1,1,1,100
6319
6320           Tutorial: https://gmic.eu/oldtutorial/_warp
6321
6322         warp_patch:
6323             [warp‐
6324       ing_field],patch_width>=1,_patch_height>=1,_patch_depth>=1,_std_fac‐
6325       tor>0,_boundary_conditions.
6326
6327           Patch-warp selected images, with specified 2D  or  3D  displacement
6328       field (in backward-absolute mode).
6329           Argument  'std_factor' sets the std of the gaussian weights for the
6330       patch overlap,
6331           equal to 'std = std_factor*patch_size'.
6332           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
6333       | 3=mirror }.
6334
6335           Default values: 'std_factor=0.3' and 'boundary_conditions=3'.
6336
6337         warp_rbf:
6338             xs0[%],ys0[%],xt0[%],yt0[%],...,xsN[%],ysN[%],xtN[%],ytN[%]
6339
6340           Warp selected images using RBF-based interpolation.
6341           Each argument (xsk,ysk)-(xtk,ytk) corresponds to the coordinates of
6342       a keypoint
6343           respectively on the source and target images. The set of  all  key‐
6344       points define the overall image deformation.
6345
6346           Example:
6347             [#1]                      image.jpg                     +warp_rbf
6348       0,0,0,0,100%,0,100%,0,100%,100%,100%,100%,0,100%,0,100%,50%,50%,70%,50%,25%,25%,25%,75%
6349
6350         12.8. Filtering
6351               ---------
6352
6353         bandpass:
6354             _min_freq[%],_max_freq[%]
6355
6356           Apply bandpass filter to selected images.
6357
6358           Default values: 'min_freq=0' and 'max_freq=20%'.
6359
6360           Example:
6361             [#1] image.jpg bandpass 1%,3%
6362
6363           Tutorial: https://gmic.eu/oldtutorial/_bandpass
6364
6365         bilateral (+):
6366             [guide],std_deviation_s[%]>=0,std_deviation_r[%]>=0,_sam‐
6367       pling_s>=0,_sampling_r>=0 |
6368             std_deviation_s[%]>=0,std_deviation_r[%]>=0,_sampling_s>=0,_sam‐
6369       pling_r>=0
6370
6371           Blur selected images by anisotropic (eventually joint/cross) bilat‐
6372       eral filtering.
6373           If a guide image is provided, it is used for  drive  the  smoothing
6374       filter.
6375           A guide image must be of the same xyz-size as the selected images.
6376           Set 'sampling' arguments to '0' for automatic adjustment.
6377
6378           Example:
6379             [#1] image.jpg repeat 5 { bilateral 10,10 }
6380
6381         b (+):
6382             Shortcut for command 'blur'.
6383
6384         blur (+):
6385             std_deviation>=0[%],_boundary_conditions,_kernel |
6386             axes,std_deviation>=0[%],_boundary_conditions,_kernel
6387
6388           Blur selected images by a deriche or gaussian filter (recursive im‐
6389       plementation).
6390           (equivalent to shortcut command 'b').
6391
6392           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
6393       | 3=mirror }.
6394           'kernel' can be { 0=deriche | 1=gaussian }.
6395           When specified, argument 'axes' is a sequence of { x | y | z | c }.
6396           Specifying  one  axis  multiple  times apply also the blur multiple
6397       times.
6398
6399           Default values: 'boundary_conditions=1' and 'kernel=1'.
6400
6401           Example:
6402             [#1] image.jpg +blur 5,0 +blur[0] 5,1
6403             [#2] image.jpg +blur y,10%
6404
6405           Tutorial: https://gmic.eu/oldtutorial/_blur
6406
6407         blur_angular:
6408             amplitude[%],_center_x[%],_center_y[%]
6409
6410           Apply angular blur on selected images.
6411
6412           Default values: 'center_x=center_y=50%'.
6413
6414           Example:
6415             [#1] image.jpg blur_angular 2%
6416
6417           Tutorial: https://gmic.eu/oldtutorial/_blur_angular
6418
6419         blur_bloom:
6420             _amplitude>=0,_ratio>=0,_nb_iter>=0,_blend_operator={ + |  max  |
6421       min  },_kernel={  0=deriche  | 1=gaussian | 2=box | 3=triangle | 4=qua‐
6422       dratic },_normalize_scales={ 0 | 1 },_axes
6423
6424           Apply a bloom filter that blend multiple blur filters of  different
6425       radii,
6426           resulting in a larger but sharper glare than a simple blur.
6427           When specified, argument 'axes' is a sequence of { x | y | z | c }.
6428           Specifying  one  axis  multiple  times apply also the blur multiple
6429       times.
6430           Reference: Masaki Kawase, "Practical Implementation of High Dynamic
6431       Range Rendering", GDC 2004.
6432
6433           Default values: 'amplitude=1', 'ratio=2', 'nb_iter=5', 'blend_oper‐
6434       ator=+', 'kernel=1', 'normalize_scales=0' and 'axes=(all)'
6435
6436           Example:
6437             [#1] image.jpg blur_bloom ,
6438
6439         blur_linear:
6440             amplitude1[%],_amplitude2[%],_angle,_boundary_conditions={
6441       0=dirichlet | 1=neumann }
6442
6443           Apply  linear blur on selected images, with specified angle and am‐
6444       plitudes.
6445
6446           Default  values:  'amplitude2=0',  'angle=0'  and  'boundary_condi‐
6447       tions=1'.
6448
6449           Example:
6450             [#1] image.jpg blur_linear 10,0,45
6451
6452           Tutorial: https://gmic.eu/oldtutorial/_blur_linear
6453
6454         blur_radial:
6455             amplitude[%],_center_x[%],_center_y[%]
6456
6457           Apply radial blur on selected images.
6458
6459           Default values: 'center_x=center_y=50%'.
6460
6461           Example:
6462             [#1] image.jpg blur_radial 2%
6463
6464           Tutorial: https://gmic.eu/oldtutorial/_blur_radial
6465
6466         blur_selective:
6467             sigma>=0,_edges>0,_nb_scales>0
6468
6469           Blur selected images using selective gaussian scales.
6470
6471           Default values: 'sigma=5', 'edges=0.5' and 'nb_scales=5'.
6472
6473           Example:
6474             [#1]  image.jpg noise 20 cut 0,255 +local[-1] repeat 4 { blur_se‐
6475       lective , } done
6476
6477           Tutorial: https://gmic.eu/oldtutorial/_blur_selective
6478
6479         blur_x:
6480             amplitude[%]>=0,_boundary_conditions={ 0=dirichlet | 1=neumann  |
6481       2=periodic | 3=mirror }
6482
6483           Blur selected images along the x-axis.
6484
6485           Default value: 'boundary_conditions=1'.
6486
6487           Example:
6488             [#1] image.jpg +blur_x 6
6489
6490           Tutorial: https://gmic.eu/oldtutorial/_blur_x
6491
6492         blur_xy:
6493             amplitude_x[%],amplitude_y[%],_boundary_conditions={  0=dirichlet
6494       | 1=neumann | 2=periodic | 3=mirror }
6495
6496           Blur selected images along the X and Y axes.
6497
6498           Default value: 'boundary_conditions=1'.
6499
6500           Example:
6501             [#1] image.jpg +blur_xy 6
6502
6503           Tutorial: https://gmic.eu/oldtutorial/_blur_y
6504
6505         blur_xyz:
6506             amplitude_x[%],amplitude_y[%],amplitude_z,_boundary_conditions={
6507       0=dirichlet | 1=neumann | 2=periodic | 3=mirror }
6508
6509           Blur selected images along the X, Y and Z axes.
6510
6511           Default value: 'boundary_conditions=1'.
6512
6513           Tutorial: https://gmic.eu/oldtutorial/_blur_xyz
6514
6515         blur_y:
6516             amplitude[%]>=0,_boundary_conditions={  0=dirichlet | 1=neumann |
6517       2=periodic | 3=mirror }
6518
6519           Blur selected images along the y-axis.
6520
6521           Default value: 'boundary_conditions=1'.
6522
6523           Example:
6524             [#1] image.jpg +blur_y 6
6525
6526           Tutorial: https://gmic.eu/oldtutorial/_blur_y
6527
6528         blur_z:
6529             amplitude[%]>=0,_boundary_conditions={ 0=dirichlet | 1=neumann  |
6530       2=periodic | 3=mirror }
6531
6532           Blur selected images along the z-axis.
6533
6534           Default value: 'boundary_conditions=1'.
6535
6536           Tutorial: https://gmic.eu/oldtutorial/_blur_z
6537
6538         boxfilter (+):
6539             size>=0[%],_order,_boundary_conditions,_nb_iter>=0 |
6540             axes,size>=0[%],_order,_boundary_conditions,_nb_iter>=0
6541
6542           Blur selected images by a box filter of specified size (fast recur‐
6543       sive implementation).
6544           'order' can be { 0=smooth | 1=1st-derivative | 2=2nd-derivative }.
6545           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
6546       | 3=mirror }.
6547           When specified, argument 'axes' is a sequence of { x | y | z | c }.
6548           Specifying  one  axis  multiple  times apply also the blur multiple
6549       times.
6550
6551           Default values: 'order=0', 'boundary_conditions=1' and 'nb_iter=1'.
6552
6553           Example:
6554             [#1] image.jpg +boxfilter 5%
6555             [#2] image.jpg +boxfilter y,3,1
6556
6557         bump2normal:
6558
6559           Convert selected bumpmaps to normalmaps.
6560
6561           Example:
6562             [#1] 300,300 circle 50%,50%,128,1,1 blur 5% bump2normal
6563
6564         closing:
6565             size>=0 |
6566             size_x>=0,size_y>=0,_size_z>=0 |
6567             [kernel],_boundary_conditions,_is_real={ 0=binary-mode |  1=real-
6568       mode }
6569
6570           Apply morphological closing to selected images.
6571           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
6572       | 3=mirror }.
6573
6574           Default    values:    'size_z=1',    'boundary_conditions=1'    and
6575       'is_real=0'.
6576
6577           Example:
6578             [#1] image.jpg +closing 10
6579
6580         closing_circ:
6581             _size>=0,_is_real={ 0 | 1 }
6582
6583           Apply circular dilation of selected images by specified size.
6584
6585           Default values: 'boundary_conditions=1' and 'is_real=0'.
6586
6587           Example:
6588             [#1] image.jpg +closing_circ 7
6589
6590         compose_freq:
6591
6592           Compose selected low and high frequency parts into new images.
6593
6594           Example:
6595             [#1] image.jpg split_freq 2% mirror[-1] x compose_freq
6596
6597         convolve (+):
6598             [mask],_boundary_conditions,_is_normalized={   0   |  1  },_chan‐
6599       nel_mode,_xcenter,_ycenter,_zcenter,_xstart,_ystart,_zs‐
6600       tart,_xend,_yend,_zend,_xstride,_ystride,_zstride,_xdilation,
6601               _ydilation,_zdilation,interpolation_type
6602
6603           Convolve selected images by specified mask.
6604           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
6605       | 3=mirror }.
6606           'channel_mode' can be { 0=all | 1=one-for-one  |  2=partial  sum  |
6607       3=full sum }.
6608           'interpolation_type' can be { 0=nearest-neighbor | 1=linear }.
6609
6610           Default  values: 'boundary_conditions=1', 'is_normalized=0', 'chan‐
6611       nel_mode=1', 'xcenter=ycenter=zcenter=(undefined)',
6612            'xstart=ystart=zstart=0',      'xend=yend=zend=(max-coordinates)',
6613       'xstride=ystride=zstride=1', 'xdilation=ydilation=zdilation=1' and
6614            'interpolation_type=0'.
6615
6616           Example:
6617             [#1] image.jpg (0,1,0;1,-4,1;0,1,0) convolve[-2] [-1] keep[-2]
6618             [#2] image.jpg (0,1,0) resize[-1] 130,1,1,1,3 +convolve[0] [1]
6619
6620           Tutorial: https://gmic.eu/oldtutorial/_convolve
6621
6622         convolve_fft:
6623             [mask],_boundary_conditions
6624
6625           Convolve  selected  images  with specified mask, in the fourier do‐
6626       main.
6627           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
6628       | 3=mirror }.
6629
6630           Example:
6631             [#1]  image.jpg  100%,100%  gaussian[-1] 20,1,45 +convolve_fft[0]
6632       [1]
6633
6634         correlate (+):
6635             [mask],_boundary_conditions,_is_normalized={  0  |   1   },_chan‐
6636       nel_mode,_xcenter,_ycenter,_zcenter,_xstart,_ystart,_zs‐
6637       tart,_xend,_yend,_zend,_xstride,_ystride,_zstride,_xdilation,
6638               _ydilation,_zdilation,interpolation_type
6639
6640           Correlate selected images by specified mask.
6641           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
6642       | 3=mirror }.
6643           'channel_mode'  can  be  {  0=all | 1=one-for-one | 2=partial sum |
6644       3=full sum }.
6645           'interpolation_type' can be { 0=nearest-neighbor | 1=linear }.
6646
6647           Default values: 'boundary_conditions=1', 'is_normalized=0',  'chan‐
6648       nel_mode=1', 'xcenter=ycenter=zcenter=-1', 'xstart=ystart=zstart=0',
6649            'xend=yend=zend=(max-coordinates)',   'xstride=ystride=zstride=1',
6650       'xdilation=ydilation=zdilation=1' and 'interpolation_type=0'.
6651
6652           Example:
6653             [#1] image.jpg (0,1,0;1,-4,1;0,1,0) correlate[-2] [-1] keep[-2]
6654             [#2] image.jpg +crop 40%,40%,60%,60% +correlate[0] [-1],0,1
6655
6656         cross_correlation:
6657             [mask]
6658
6659           Compute cross-correlation of selected images with specified mask.
6660
6661           Example:
6662             [#1] image.jpg +shift -30,-20 +cross_correlation[0] [1]
6663
6664         curvature:
6665
6666           Compute isophote curvatures on selected images.
6667
6668           Example:
6669             [#1] image.jpg blur 10 curvature
6670
6671         dct:
6672             _{ x | y | z }...{ x | y | z } |
6673             (no arg)
6674
6675           Compute the discrete cosine transform of selected  images,  option‐
6676       ally along the specified axes only.
6677           Output  images  are always evenly sized, so this command may change
6678       the size of the selected images.
6679
6680           Default values: (no arg)
6681           See also: idct.
6682
6683           Example:
6684             [#1] image.jpg +dct +idct[-1] abs[-2] +[-2] 1 log[-2]
6685
6686           Tutorial: https://gmic.eu/oldtutorial/_dct-and-idct
6687
6688         deblur:
6689             amplitude[%]>=0,_nb_iter>=0,_dt>=0,_regul>=0,_regul_type={
6690       0=Tikhonov | 1=meancurv. | 2=TV }
6691
6692           Deblur image using a regularized Jansson-Van Cittert algorithm.
6693
6694           Default    values:    'nb_iter=10',    'dt=20',   'regul=0.7'   and
6695       'regul_type=1'.
6696
6697           Example:
6698             [#1] image.jpg blur 3 +deblur 3,40,20,0.01
6699
6700         deblur_goldmeinel:
6701             sigma>=0,_nb_iter>=0,_acceleration>=0,_kernel_type={ 0=deriche  |
6702       1=gaussian }.
6703
6704           Deblur selected images using Gold-Meinel algorithm
6705
6706           Default values: 'nb_iter=8', 'acceleration=1' and 'kernel_type=1'.
6707
6708           Example:
6709             [#1] image.jpg +blur 1 +deblur_goldmeinel[-1] 1
6710
6711         deblur_richardsonlucy:
6712             sigma>=0, nb_iter>=0, _kernel_type={ 0=deriche | 1=gaussian }.
6713
6714           Deblur selected images using Richardson-Lucy algorithm.
6715
6716           Default values: 'nb_iter=50' and 'kernel_type=1'.
6717
6718           Example:
6719             [#1] image.jpg +blur 1 +deblur_richardsonlucy[-1] 1
6720
6721         deconvolve_fft:
6722             [kernel],_regularization>=0
6723
6724           Deconvolve selected images by specified mask in the fourier space.
6725
6726           Default value: 'regularization>=0'.
6727
6728           Example:
6729             [#1]   image.jpg   +gaussian   5   +convolve_fft[0]  [1]  +decon‐
6730       volve_fft[-1] [1]
6731
6732         deinterlace:
6733             _method={ 0 | 1 }
6734
6735           Deinterlace selected images ('method' can be { 0=standard or  1=mo‐
6736       tion-compensated }).
6737
6738           Default value: 'method=0'.
6739
6740           Example:
6741             [#1]  image.jpg  +rotate  3,1,1,50%,50%  resize  100%,50%  resize
6742       100%,200%,1,3,4 shift[-1] 0,1 add +deinterlace 1
6743
6744         denoise (+):
6745             [guide],std_deviation_s[%]>=0,_std_devia‐
6746       tion_r[%]>=0,_patch_size>0,_lookup_size>0,_smoothness,_fast_approx={  0
6747       | 1 } |
6748             std_deviation_s[%]>=0,_std_devia‐
6749       tion_r[%]>=0,_patch_size>0,_lookup_size>0,_smoothness,_fast_approx={  0
6750       | 1 }
6751
6752           Denoise selected images by non-local patch averaging.
6753
6754           Default     values:      'std_deviation_p=10',      'patch_size=5',
6755       'lookup_size=6' and 'smoothness=1'.
6756
6757           Example:
6758             [#1] image.jpg +denoise 5,5,8
6759
6760         denoise_haar:
6761             _threshold>=0,_nb_scales>=0,_cycle_spinning>0
6762
6763           Denoise  selected images using haar-wavelet thresholding with cycle
6764       spinning.
6765           Set 'nb_scales==0' to automatically determine the optimal number of
6766       scales.
6767
6768           Default  values:  'threshold=1.4',  'nb_scale=0'  and  'cycle_spin‐
6769       ning=10'.
6770
6771           Example:
6772             [#1] image.jpg noise 20 cut 0,255 +denoise_haar[-1] 0.8
6773
6774         denoise_cnn:
6775             _noise_type={ 0=soft |  1=heavy  |  2=heavy  (faster)  |  3=pois‐
6776       son+gaussian | 4=poisson+gaussian2 },_patch_size>0
6777
6778           Denoise selected images using a convolutional neural network (CNN).
6779           Input value range should be [0,255]. Output value range is [0,255].
6780
6781           Default value: 'patch_size=64'.
6782
6783           Example:
6784             [#1] image.jpg noise 20 cut 0,255 +denoise_cnn
6785
6786         denoise_patchpca:
6787             _strength>=0,_patch_size>0,_lookup_size>0,_spatial_sampling>0
6788
6789           Denoise selected images using the patch-pca algorithm.
6790
6791           Default values: 'patch_size=7', 'lookup_size=11', 'details=1.8' and
6792       'spatial_sampling=5'.
6793
6794           Example:
6795             [#1] image.jpg +noise 20 cut[-1] 0,255 +denoise_patchpca[-1] ,
6796
6797         deriche (+):
6798             std_deviation>=0[%],order={ 0 | 1 | 2 },axis={ x |  y  |  z  |  c
6799       },_boundary_conditions
6800
6801           Apply  Deriche recursive filter on selected images, along specified
6802       axis and with
6803           specified standard deviation, order and boundary conditions.
6804           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
6805       | 3=mirror }.
6806
6807           Default value: 'boundary_conditions=1'.
6808
6809           Example:
6810             [#1] image.jpg deriche 3,1,x
6811             [#2] image.jpg +deriche 30,0,x deriche[-2] 30,0,y add
6812
6813           Tutorial: https://gmic.eu/oldtutorial/_deriche
6814
6815         dilate (+):
6816             size>=0 |
6817             size_x>=0,size_y>=0,size_z>=0 |
6818             [kernel],_boundary_conditions,_is_real={  0=binary-mode | 1=real-
6819       mode }
6820
6821           Dilate selected images by a rectangular or the specified  structur‐
6822       ing element.
6823           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
6824       | 3=mirror }.
6825
6826           Default    values:    'size_z=1',    'boundary_conditions=1'    and
6827       'is_real=0'.
6828
6829           Example:
6830             [#1] image.jpg +dilate 10
6831
6832         dilate_circ:
6833             _size>=0,_boundary_conditions,_is_real={ 0 | 1 }
6834
6835           Apply circular dilation of selected images by specified size.
6836           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
6837       | 3=mirror }.
6838
6839           Default values: 'boundary_conditions=1' and 'is_real=0'.
6840
6841           Example:
6842             [#1] image.jpg +dilate_circ 7
6843
6844         dilate_oct:
6845             _size>=0,_boundary_conditions,_is_real={ 0 | 1 }
6846
6847           Apply octagonal dilation of selected images by specified size.
6848
6849           Default values: 'boundary_conditions=1' and 'is_real=0'.
6850
6851           Example:
6852             [#1] image.jpg +dilate_oct 7
6853
6854         dilate_threshold:
6855             size_x>=1,size_y>=1,size_z>=1,_threshold>=0,_boundary_conditions
6856
6857           Dilate selected images in the (X,Y,Z,I) space.
6858           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
6859       | 3=mirror }.
6860
6861           Default  values:  'size_y=size_x',  'size_z=1', 'threshold=255' and
6862       'boundary_conditions=1'.
6863
6864         divergence:
6865
6866           Compute divergence of selected vector fields.
6867
6868           Example:
6869             [#1] image.jpg luminance +gradient append[-2,-1] c divergence[-1]
6870
6871         dog:
6872             _sigma1>=0[%],_sigma2>=0[%]
6873
6874           Compute difference of gaussian on selected images.
6875
6876           Default values: 'sigma1=2%' and 'sigma2=3%'.
6877
6878           Example:
6879             [#1] image.jpg dog 2,3
6880
6881         diffusiontensors:
6882             _sharpness>=0,0<=_anisotropy<=1,_alpha[%],_sigma[%],is_sqrt={ 0 |
6883       1 }
6884
6885           Compute  the diffusion tensors of selected images for edge-preserv‐
6886       ing smoothing algorithms.
6887
6888           Default  values:  'sharpness=0.7',  'anisotropy=0.3',  'alpha=0.6',
6889       'sigma=1.1' and 'is_sqrt=0'.
6890
6891           Example:
6892             [#1] image.jpg diffusiontensors 0.8 abs pow 0.2
6893
6894           Tutorial: https://gmic.eu/oldtutorial/_diffusiontensors
6895
6896         edges:
6897             _threshold[%]>=0
6898
6899           Estimate contours of selected images.
6900
6901           Default value: 'edges=15%'
6902
6903           Example:
6904             [#1] image.jpg +edges 15%
6905
6906         erode (+):
6907             size>=0 |
6908             size_x>=0,size_y>=0,_size_z>=0 |
6909             [kernel],_boundary_conditions,_is_real={  0=binary-mode | 1=real-
6910       mode }
6911
6912           Erode selected images by a rectangular or the specified structuring
6913       element.
6914           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
6915       | 3=mirror }.
6916
6917           Default    values:    'size_z=1',    'boundary_conditions=1'    and
6918       'is_real=0'.
6919
6920           Example:
6921             [#1] image.jpg +erode 10
6922
6923         erode_circ:
6924             _size>=0,_boundary_conditions,_is_real={ 0 | 1 }
6925
6926           Apply circular erosion of selected images by specified size.
6927           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
6928       | 3=mirror }.
6929
6930           Default values: 'boundary_conditions=1' and 'is_real=0'.
6931
6932           Example:
6933             [#1] image.jpg +erode_circ 7
6934
6935         erode_oct:
6936             _size>=0,_boundary_conditions,_is_real={ 0 | 1 }
6937
6938           Apply octagonal erosion of selected images by specified size.
6939
6940           Default values: 'boundary_conditions=1' and 'is_real=0'.
6941
6942           Example:
6943             [#1] image.jpg +erode_oct 7
6944
6945         erode_threshold:
6946             size_x>=1,size_y>=1,size_z>=1,_threshold>=0,_boundary_conditions
6947
6948           Erode selected images in the (X,Y,Z,I) space.
6949           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
6950       | 3=mirror }.
6951
6952           Default  values:  'size_y=size_x',  'size_z=1', 'threshold=255' and
6953       'boundary_conditions=1'.
6954
6955         fft (+):
6956             _{ x | y | z }...{ x | y | z }
6957
6958           Compute the direct fourier transform (real and imaginary parts)  of
6959       selected images,
6960           optionally along the specified axes only.
6961           See also: ifft.
6962
6963           Example:
6964             [#1]  image.jpg  luminance  +fft append[-2,-1] c norm[-1] log[-1]
6965       shift[-1] 50%,50%,0,0,2
6966             [#2] image.jpg w2:=int(w/2) h2:=int(h/2) fft shift  $w2,$h2,0,0,2
6967       ellipse $w2,$h2,30,30,0,1,0 shift -$w2,-$h2,0,0,2 ifft remove[-1]
6968
6969           Tutorial: https://gmic.eu/oldtutorial/_fft
6970
6971         g (+):
6972             Shortcut for command 'gradient'.
6973
6974         gradient:
6975             {  x  |  y | z | c }...{ x | y | z | c },_scheme,_boundary_condi‐
6976       tions |
6977             (no arg)
6978
6979           Compute the gradient components (first derivatives) of selected im‐
6980       ages, along specified axes.
6981           (equivalent to shortcut command 'g').
6982
6983           'scheme'  can be { -1=backward | 0=centered | 1=forward | 2=sobel |
6984       3=rotation-invariant (default) | 4=deriche | 5=vanvliet }.
6985           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
6986       | 3=mirror }.
6987           (no arg) compute all significant components.
6988
6989           Default values: 'scheme=0' and 'boundary_conditions=1'.
6990
6991           Example:
6992             [#1] image.jpg gradient
6993
6994           Tutorial: https://gmic.eu/oldtutorial/_gradient
6995
6996         gradient_norm:
6997
6998           Compute gradient norm of selected images.
6999
7000           Example:
7001             [#1] image.jpg gradient_norm equalize
7002
7003           Tutorial: https://gmic.eu/oldtutorial/_gradient_norm
7004
7005         gradient_orientation:
7006             _dimension={ 1 | 2 | 3 }
7007
7008           Compute N-d gradient orientation of selected images.
7009
7010           Default value: 'dimension=3'.
7011
7012           Example:
7013             [#1] image.jpg +gradient_orientation 2
7014
7015         guided (+):
7016             [guide],radius[%]>=0,regularization[%]>=0 |
7017             radius[%]>=0,regularization[%]>=0
7018
7019           Blur selected images by guided image filtering.
7020           If  a  guide  image  is provided, it is used to drive the smoothing
7021       process.
7022           A guide image must be of the same xyz-size as the selected images.
7023           This command implements the filtering algorithm described in:
7024           He, Kaiming; Sun, Jian; Tang, Xiaoou, "Guided Image Filtering",
7025           IEEE Transactions on Pattern  Analysis  and  Machine  Intelligence,
7026       vol.35, no.6, pp.1397,1409, June 2013
7027
7028           Example:
7029             [#1] image.jpg +guided 5,400
7030
7031         haar:
7032             scale>0
7033
7034           Compute  the  direct  haar multiscale wavelet transform of selected
7035       images.
7036           See also: ihaar.
7037
7038           Tutorial: https://gmic.eu/oldtutorial/_haar
7039
7040         heat_flow:
7041             _nb_iter>=0,_dt,_keep_sequence={ 0 | 1 }
7042
7043           Apply iterations of the heat flow on selected images.
7044
7045           Default values: 'nb_iter=10', 'dt=30' and 'keep_sequence=0'.
7046
7047           Example:
7048             [#1] image.jpg +heat_flow 20
7049
7050         hessian:
7051             { xx | xy | xz | yy | yz | zz }...{ xx | xy | xz | yy | yz  |  zz
7052       },_boundary_conditions |
7053             (no arg) :
7054
7055           Compute the hessian components (second derivatives) of selected im‐
7056       ages along specified axes.
7057           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
7058       | 3=mirror }.
7059           (no arg) compute all significant components.
7060
7061           Default value: 'boundary_conditions=1'.
7062
7063           Example:
7064             [#1] image.jpg hessian
7065
7066         idct:
7067             _{ x | y | z }...{ x | y | z } |
7068             (no arg)
7069
7070           Compute  the  inverse discrete cosine transform of selected images,
7071       optionally along the specified axes only.
7072           Output images are always evenly sized, so this command  may  change
7073       the size of the selected images.
7074           (dct  images  obtained with the 'dct' command are evenly sized any‐
7075       way).
7076
7077           Default values: (no arg)
7078           See also: dct.
7079
7080           Tutorial: https://gmic.eu/oldtutorial/_dct-and-idct
7081
7082         iee:
7083
7084           Compute gradient-orthogonal-directed 2nd derivative of image(s).
7085
7086           Example:
7087             [#1] image.jpg iee
7088
7089         ifft (+):
7090             _{ x | y | z }...{ x | y | z }
7091
7092           Compute the inverse fourier transform (real and imaginary parts) of
7093       selected images.
7094           optionally along the specified axes only.
7095           See also: fft.
7096
7097           Tutorial: https://gmic.eu/oldtutorial/_fft
7098
7099         ihaar:
7100             scale>0
7101
7102           Compute  the  inverse haar multiscale wavelet transform of selected
7103       images.
7104           See also: haar.
7105
7106           Tutorial: https://gmic.eu/oldtutorial/_haar
7107
7108         ilaplacian:
7109             { nb_iterations>0 | 0 },_[initial_estimate]
7110
7111           Invert selected Laplacian images.
7112           If given 'nb_iterations' is '0', inversion is done in Fourier space
7113       (single iteration),
7114           otherwise, by applying 'nb_iterations' of a Laplacian-inversion PDE
7115       flow.
7116           Note that the resulting inversions are just  estimation  of  possi‐
7117       ble/approximated solutions.
7118
7119           Default  values:  'nb_iterations=0' and '[initial_estimated]=(unde‐
7120       fined)'.
7121
7122           Example:
7123             [#1] image.jpg +laplacian +ilaplacian[-1] 0
7124
7125         inn:
7126
7127           Compute gradient-directed 2nd derivative of image(s).
7128
7129           Example:
7130             [#1] image.jpg inn
7131
7132         inpaint (+):
7133             [mask] |
7134             [mask],0,_fast_method |
7135             [mask],_patch_size>=1,_lookup_size>=1,_lookup_fac‐
7136       tor>=0,_lookup_increment!=0,_blend_size>=0,0<=_blend_thresh‐
7137       old<=1,_blend_decay>=0,_blend_scales>=1,_is_blend_outer={ 0 | 1 }
7138
7139           Inpaint selected images by specified mask.
7140           If no patch size (or 0) is specified, inpainting is  done  using  a
7141       fast average or median algorithm.
7142           Otherwise, it used a patch-based reconstruction method, that can be
7143       very time consuming.
7144           'fast_method' can be { 0=low-connectivity average |  1=high-connec‐
7145       tivity average | 2=low-connectivity median | 3=high-connectivity median
7146       }.
7147
7148           Default values: 'patch_size=0', 'fast_method=1',  'lookup_size=22',
7149       'lookup_factor=0.5', 'lookup_increment=1', 'blend_size=0',
7150            'blend_threshold=0',   'blend_decay=0.05',  'blend_scales=10'  and
7151       'is_blend_outer=1'.
7152
7153           Example:
7154             [#1] image.jpg 100%,100%  ellipse  50%,50%,30,30,0,1,255  ellipse
7155       20%,20%,30,10,0,1,255 +inpaint[-2] [-1] remove[-2]
7156             [#2]  image.jpg  100%,100%  circle  30%,30%,30,1,255,0,255 circle
7157       70%,70%,50,1,255,0,255 +inpaint[0] [1],5,15,0.5,1,9,0 remove[1]
7158
7159         inpaint_pde:
7160             [mask],_nb_scales[%]>=0,_diffusion_type={ 0=isotropic |  1=Delau‐
7161       nay-guided | 2=edge-guided | 3=mask-guided },_diffusion_iter>=0
7162
7163           Inpaint selected images by specified mask using a multiscale trans‐
7164       port-diffusion algorithm.
7165           If 'diffusion type==3', non-zero values of the mask  (e.g.  a  dis‐
7166       tance function) are used
7167           to guide the diffusion process.
7168
7169           Default  values:  'nb_scales=75%',  'diffusion_type=1'  and 'diffu‐
7170       sion_iter=20'.
7171
7172           Example:
7173             [#1] image.jpg 100%,100% ellipse[-1]  30%,30%,40,30,0,1,255  +in‐
7174       paint_pde[0] [1]
7175
7176         inpaint_flow:
7177             [mask],_nb_global_iter>=0,_nb_local_iter>=0,_dt>0,_al‐
7178       pha>=0,_sigma>=0
7179
7180           Apply iteration of the inpainting flow on selected images.
7181
7182           Default values: 'nb_global_iter=10',  'nb_local_iter=100',  'dt=5',
7183       'alpha=1' and 'sigma=3'.
7184
7185           Example:
7186             [#1]  image.jpg  100%,100%  ellipse[-1] 30%,30%,40,30,0,1,255 in‐
7187       paint_flow[0] [1]
7188
7189         inpaint_holes:
7190             maximal_area[%]>=0,_tolerance>=0,_is_high_connectivity={ 0 | 1 }
7191
7192           Inpaint all connected regions having an area  less  than  specified
7193       value.
7194
7195           Default  values:  'maximal_area=4', 'tolerance=0' and 'is_high_con‐
7196       nectivity=0'.
7197
7198           Example:
7199             [#1] image.jpg noise 5%,2 +inpaint_holes 8,40
7200
7201         inpaint_morpho:
7202             [mask]
7203
7204           Inpaint selected images by specified mask using morphological oper‐
7205       ators.
7206
7207           Example:
7208             [#1]  image.jpg  100%,100% ellipse[-1] 30%,30%,40,30,0,1,255 +in‐
7209       paint_morpho[0] [1]
7210
7211         inpaint_matchpatch:
7212             [mask],_nb_scales={  0=auto   |   >0   },_patch_size>0,_nb_itera‐
7213       tions_per_scale>0,_blend_size>=0,_allow_outer_blending={    0    |    1
7214       },_is_already_initialized={ 0 | 1 }
7215
7216           Inpaint selected images by specified binary mask,  using  a  multi-
7217       scale matchpatch algorithm.
7218
7219           Default    values:    'nb_scales=0',   'patch_size=9',   'nb_itera‐
7220       tions_per_scale=10', 'blend_size=5','allow_outer_blending=1' and
7221            'is_already_initialized=0'.
7222
7223           Example:
7224             [#1] image.jpg 100%,100% ellipse[-1]  30%,30%,40,30,0,1,255  +in‐
7225       paint_matchpatch[0] [1]
7226
7227         kuwahara:
7228             size>0
7229
7230           Apply Kuwahara filter of specified size on selected images.
7231
7232           Example:
7233             [#1] image.jpg kuwahara 9
7234
7235         laplacian:
7236
7237           Compute Laplacian of selected images.
7238
7239           Example:
7240             [#1] image.jpg laplacian
7241
7242         lic:
7243             _amplitude>0,_channels>0
7244
7245           Render LIC representation of selected vector fields.
7246
7247           Default values: 'amplitude=30' and 'channels=1'.
7248
7249           Example:
7250             [#1]  400,400,1,2,'if(c==0,x-w/2,y-h/2)'  +lic  200,3  quiver[-2]
7251       [-2],10,1,1,1,255
7252
7253         map_tones:
7254             _threshold>=0,_gamma>=0,_smoothness>=0,nb_iter>=0
7255
7256           Apply tone mapping operator on selected images,  based  on  Poisson
7257       equation.
7258
7259           Default  values: 'threshold=0.1', 'gamma=0.8', 'smoothness=0.5' and
7260       'nb_iter=30'.
7261
7262           Example:
7263             [#1] image.jpg +map_tones ,
7264
7265         map_tones_fast:
7266             _radius[%]>=0,_power>=0
7267
7268           Apply fast tone mapping operator on selected images.
7269
7270           Default values: 'radius=3%' and 'power=0.3'.
7271
7272           Example:
7273             [#1] image.jpg +map_tones_fast ,
7274
7275         meancurvature_flow:
7276             _nb_iter>=0,_dt,_keep_sequence={ 0 | 1 }
7277
7278           Apply iterations of the mean curvature flow on selected images.
7279
7280           Default values: 'nb_iter=10', 'dt=30' and 'keep_sequence=0'.
7281
7282           Example:
7283             [#1] image.jpg +meancurvature_flow 20
7284
7285         median (+):
7286             size>=0,_threshold>0
7287
7288           Apply (opt. thresholded) median  filter  on  selected  images  with
7289       structuring element size x size.
7290
7291           Example:
7292             [#1] image.jpg +median 5
7293
7294         nlmeans:
7295             [guide],_patch_radius>0,_spatial_bandwidth>0,_tonal_band‐
7296       width>0,_patch_measure_command |
7297             _patch_radius>0,_spatial_bandwidth>0,_tonal_band‐
7298       width>0,_patch_measure_command
7299
7300           Apply  non local means denoising of Buades et al, 2005. on selected
7301       images.
7302           The patch is a gaussian function of 'std_patch_radius'.
7303           The spatial kernel is a rectangle of radius 'spatial_bandwidth'.
7304           The tonal kernel is exponential ('exp(-d^2/_tonal_bandwidth^2)')
7305           with 'd' the euclidean distance between image patches.
7306
7307           Default    values:     'patch_radius=4',     'spatial_bandwidth=4',
7308       'tonal_bandwidth=10' and 'patch_measure_command=-norm'.
7309
7310           Example:
7311             [#1] image.jpg +noise 10 nlmeans[-1] 4,4,{0.6*${-std_noise}}
7312
7313         nlmeans_core:
7314             _reference_image,_scaling_map,_patch_radius>0,_spatial_band‐
7315       width>0
7316
7317           Apply non local means denoising using a image for weight and a  map
7318       for scaling
7319
7320         normalize_local:
7321             _amplitude>=0,_radius>0,_n_smooth>=0[%],_a_smooth>=0[%],_is_cut={
7322       0 | 1 },_min=0,_max=255
7323
7324           Normalize selected images locally.
7325
7326           Default   values:   'amplitude=3',   'radius=16',    'n_smooth=4%',
7327       'a_smooth=2%', 'is_cut=1', 'min=0' and 'max=255'.
7328
7329           Example:
7330             [#1] image.jpg normalize_local 8,10
7331
7332         normalized_cross_correlation:
7333             [mask]
7334
7335           Compute normalized cross-correlation of selected images with speci‐
7336       fied mask.
7337
7338           Example:
7339             [#1] image.jpg  +shift  -30,-20  +normalized_cross_correlation[0]
7340       [1]
7341
7342         opening:
7343             size>=0 |
7344             size_x>=0,size_y>=0,_size_z>=0 |
7345             [kernel],_boundary_conditions,_is_real={  0=binary-mode | 1=real-
7346       mode }
7347
7348           Apply morphological opening to selected images.
7349           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
7350       | 3=mirror }.
7351
7352           Default    values:    'size_z=1',    'boundary_conditions=1'    and
7353       'is_real=0'.
7354
7355           Example:
7356             [#1] image.jpg +opening 10
7357
7358         opening_circ:
7359             _size>=0,_is_real={ 0 | 1 }
7360
7361           Apply circular opening of selected images by specified size.
7362
7363           Default values: 'boundary_conditions=1' and 'is_real=0'.
7364
7365           Example:
7366             [#1] image.jpg +opening_circ 7
7367
7368         percentile:
7369             [mask],0<=_min_percentile[%]<=100,0<=_max_percentile[%]<=100.
7370
7371           Apply percentile averaging filter to selected images.
7372
7373           Default values: 'min_percentile=0' and 'max_percentile=100'.
7374
7375           Example:
7376             [#1] image.jpg shape_circle 11,11 +percentile[0] [1],25,75
7377
7378         peronamalik_flow:
7379             K_factor>0,_nb_iter>=0,_dt,_keep_sequence={ 0 | 1 }
7380
7381           Apply iterations of the Perona-Malik flow on selected images.
7382
7383           Default values: 'K_factor=20', 'nb_iter=5',  'dt=5'  and  'keep_se‐
7384       quence=0'.
7385
7386           Example:
7387             [#1] image.jpg +heat_flow 20
7388
7389         phase_correlation:
7390             [destination]
7391
7392           Estimate  translation  vector  between  selected  source images and
7393       specified destination.
7394
7395           Example:
7396             [#1]  image.jpg  +shift  -30,-20  +phase_correlation[0]  [1]  un‐
7397       roll[-1] y
7398
7399         pde_flow:
7400             _nb_iter>=0,_dt,_velocity_command,_keep_sequence={ 0 | 1 }
7401
7402           Apply iterations of a generic PDE flow on selected images.
7403
7404           Default values: 'nb_iter=10', 'dt=30', 'velocity_command=laplacian'
7405       and 'keep_sequence=0'.
7406
7407           Example:
7408             [#1] image.jpg +pde_flow 20
7409
7410         periodize_poisson:
7411
7412           Periodize selected images using a Poisson solver in Fourier space.
7413
7414           Example:
7415             [#1] image.jpg +periodize_poisson array 2,2,2
7416
7417         rbf:
7418             dx,_x0,_x1,_phi(r) |
7419             dx,dy,_x0,_y0,_x1,_y1,_phi(r) |
7420             dx,dy,dz,x0,y0,z0,x1,y1,z1,phi(r)
7421
7422           Reconstruct 1D/2D or 3D image from selected sets of  keypoints,  by
7423       RBF-interpolation.
7424           A  set  of keypoints is represented by a vector-valued image, where
7425       each pixel represents a single keypoint.
7426           Vector components of a keypoint have the following meaning:
7427              -  For 1D reconstruction: [ x_k, f1(k),...fN(k) ].
7428              -  For 2D reconstruction: [ x_k,y_k, f1(k),...,fN(k) ].
7429              -  For 3D reconstruction: [ x_k,y_k,z_k, f1(k),...,fN(k) ].
7430           Values 'x_k','y_k' and 'z_k' are the spatial  coordinates  of  key‐
7431       point 'k'.
7432           Values  'f1(k),..,fN(k)' are the 'N' components of the vector value
7433       of keypoint 'k'.
7434           The   command   reconstructs   an   image   with   specified   size
7435       'dx'x'dy'x'dz', with 'N' channels.
7436
7437           Default  values:  'x0=y0=z0=0',  'x1=dx-1',  'y1=dy-1',  'z1=dz-1',
7438       'phi(r)=r^2*log(1e-5+r)'.
7439
7440           Example:
7441             [#1]  sp  colorful  r2dx  400  100%,100%  noise_poissondisk.   10
7442       1,{is},1,5  eval[-2]  "begin(p=0);i?(I[#-1,p++]=[x,y,I(#0)])" to_rgb[1]
7443       mul[0,1] dilate_circ[0] 5 +rbf[-1] {0,[w,
7444              h]} c[-1] 0,255
7445             [#2] 32,1,1,5,u([400,400,255,255,255]) rbf 400,400 c 0,255
7446
7447         red_eye:
7448             0<=_threshold<=100,_smoothness>=0,0<=attenuation<=1
7449
7450           Attenuate red-eye effect in selected images.
7451
7452           Default  values:  'threshold=75',  'smoothness=3.5'  and  'attenua‐
7453       tion=0.1'.
7454
7455           Example:
7456             [#1] image.jpg +red_eye ,
7457
7458         remove_hotpixels:
7459             _mask_size>0, _threshold[%]>0
7460
7461           Remove hot pixels in selected images.
7462
7463           Default values: 'mask_size=3' and 'threshold=10%'.
7464
7465           Example:
7466             [#1] image.jpg noise 10,2 +remove_hotpixels ,
7467
7468         remove_pixels:
7469             number_of_pixels[%]>=0
7470
7471           Remove specified number of pixels (i.e. set them to 0) from the set
7472       of non-zero pixels in selected images.
7473
7474           Example:
7475             [#1] image.jpg +remove_pixels 50%
7476
7477         rolling_guidance:
7478             std_deviation_s[%]>=0,std_deviation_r[%]>=0,_precision>=0
7479
7480           Apply the rolling guidance filter on selected image.
7481           Rolling guidance filter is a fast  image  abstraction  filter,  de‐
7482       scribed in:
7483           "Rolling  Guidance  Filter",  Qi  Zhang Xiaoyong, Shen Li, Xu Jiaya
7484       Jia, ECCV'2014.
7485
7486           Default values: 'std_deviation_s=4', 'std_deviation_r=10' and 'pre‐
7487       cision=0.5'.
7488
7489           Example:
7490             [#1] image.jpg +rolling_guidance , +-
7491
7492         sharpen:
7493             amplitude>=0 |
7494             amplitude>=0,edge>=0,_alpha[%],_sigma[%]
7495
7496           Sharpen selected images by inverse diffusion or shock filters meth‐
7497       ods.
7498           'edge' must be specified to enable shock-filter method.
7499
7500           Default values: 'edge=0', 'alpha=0' and 'sigma=0'.
7501
7502           Example:
7503             [#1] image.jpg sharpen 300
7504             [#2] image.jpg blur 5 sharpen 300,1
7505
7506         smooth (+):
7507             amplitude[%]>=0,_sharpness>=0,0<=_anisotropy<=1,_al‐
7508       pha[%],_sigma[%],_dl>0,_da>0,_precision>0,_interpolation,_fast_approx={
7509       0 | 1 } |
7510             nb_iterations>=0,_sharpness>=0,_anisotropy,_alpha,_sigma,_dt>0,0
7511       |
7512             [tensor_field],_amplitude>=0,_dl>0,_da>0,_precision>0,_interpola‐
7513       tion,_fast_approx={ 0 | 1 } |
7514             [tensor_field],_nb_iters>=0,_dt>0,0
7515
7516           Smooth selected images anisotropically using diffusion PDE's,  with
7517       specified field of
7518           diffusion tensors.
7519           'interpolation' can be { 0=nearest | 1=linear | 2=runge-kutta }.
7520
7521           Default  values:  'sharpness=0.7',  'anisotropy=0.3',  'alpha=0.6',
7522       'sigma=1.1', 'dl=0.8', 'da=30', 'precision=2',
7523            'interpolation=0' and 'fast_approx=1'.
7524
7525           Example:
7526             [#1] image.jpg repeat 3 smooth 40,0,1,1,2 done
7527             [#2]  image.jpg  100%,100%,1,2   rand[-1]   -100,100   repeat   2
7528       smooth[-1] 100,0.2,1,4,4 done warp[0] [-1],1,1,1
7529
7530           Tutorial: https://gmic.eu/oldtutorial/_smooth
7531
7532         split_freq:
7533             smoothness>0[%]
7534
7535           Split selected images into low and high frequency parts.
7536
7537           Example:
7538             [#1] image.jpg split_freq 2%
7539
7540         solve_poisson:
7541             "laplacian_command",_nb_iterations>=0,_time_step>0,_nb_scales>=0
7542
7543           Solve  Poisson equation so that applying 'laplacian[n]' is close to
7544       the result of 'laplacian_command[n]'.
7545           Solving is performed using a  multi-scale  gradient  descent  algo‐
7546       rithm.
7547           If 'nb_scales=0', the number of scales is automatically determined.
7548
7549           Default values: 'nb_iterations=60', 'dt=5' and 'nb_scales=0'.
7550
7551           Example:
7552             [#1]  image.jpg  command  "foo  :  gradient x" +solve_poisson foo
7553       +foo[0] +laplacian[1]
7554
7555         split_details:
7556             _nb_scales>0,_base_scale[%]>=0,_detail_scale[%]>=0
7557
7558           Split selected images into 'nb_scales' detail scales.
7559           If 'base_scale''detail_scale'0, the  image  decomposition  is  done
7560       with 'a trous' wavelets.
7561           Otherwise,  it  uses laplacian pyramids with linear standard devia‐
7562       tions.
7563
7564           Default values: 'nb_scales=4', 'base_scale=0' and 'detail_scale=0'.
7565
7566           Example:
7567             [#1] image.jpg split_details ,
7568
7569         structuretensors:
7570             _scheme={ 0=centered | 1=forward/backward }
7571
7572           Compute the structure tensor field of selected images.
7573
7574           Default value: 'scheme=0'.
7575
7576           Example:
7577             [#1] image.jpg structuretensors abs pow 0.2
7578
7579           Tutorial: https://gmic.eu/oldtutorial/_structuretensors
7580
7581         solidify:
7582             _smoothness[%]>=0,_diffusion_type={  0=isotropic  |   1=Delaunay-
7583       guided | 2=edge-oriented },_diffusion_iter>=0
7584
7585           Solidify selected transparent images.
7586
7587           Default  values:  'smoothness=75%',  'diffusion_type=1' and 'diffu‐
7588       sion_iter=20'.
7589
7590           Example:
7591             [#1] image.jpg 100%,100% circle[-1]  50%,50%,25%,1,255  append  c
7592       +solidify , display_rgba
7593
7594         syntexturize:
7595             _width[%]>0,_height[%]>0
7596
7597           Resynthetize  'width'x'height'  versions of selected micro-textures
7598       by phase randomization.
7599           The texture synthesis algorithm is a straightforward implementation
7600       of the method described in :
7601           http://www.ipol.im/pub/art/2011/ggm_rpn/.
7602
7603           Default values: 'width=height=100%'.
7604
7605           Example:
7606             [#1] image.jpg crop 2,282,50,328 +syntexturize 320,320
7607
7608         syntexturize_matchpatch:
7609             _width[%]>0,_height[%]>0,_nb_scales>=0,_patch_size>0,_blend‐
7610       ing_size>=0,_precision>=0
7611
7612           Resynthetize 'width'x'height' versions of  selected  micro-textures
7613       using a patch-matching algorithm.
7614           If  'nbscales==0',  the number of scales used is estimated from the
7615       image size.
7616
7617           Default values: 'width=height=100%', 'nb_scales=0', 'patch_size=7',
7618       'blending_size=5' and 'precision=1'.
7619
7620           Example:
7621             [#1]   image.jpg   crop  25%,25%,75%,75%  syntexturize_matchpatch
7622       512,512
7623
7624         tv_flow:
7625             _nb_iter>=0,_dt,_keep_sequence={ 0 | 1 }
7626
7627           Apply iterations of the total variation flow on selected images.
7628
7629           Default values: 'nb_iter=10', 'dt=30' and 'keep_sequence=0'.
7630
7631           Example:
7632             [#1] image.jpg +tv_flow 40
7633
7634         unsharp:
7635             radius[%]>=0,_amount>=0,_threshold[%]>=0
7636
7637           Apply unsharp mask on selected images.
7638
7639           Default values: 'amount=2' and 'threshold=0'.
7640
7641           Example:
7642             [#1] image.jpg blur 3 +unsharp 1.5,15 cut 0,255
7643
7644         unsharp_octave:
7645             _nb_scales>0,_radius[%]>=0,_amount>=0,threshold[%]>=0
7646
7647           Apply octave sharpening on selected images.
7648
7649           Default values: 'nb_scales=4', 'radius=1', 'amount=2' and  'thresh‐
7650       old=0'.
7651
7652           Example:
7653             [#1] image.jpg blur 3 +unsharp_octave 4,5,15 cut 0,255
7654
7655         vanvliet (+):
7656             std_deviation>=0[%],order={  0 | 1 | 2 | 3 },axis={ x | y | z | c
7657       },_boundary_conditions
7658
7659           Apply Vanvliet recursive filter on selected images, along specified
7660       axis and with
7661           specified standard deviation, order and boundary conditions.
7662           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
7663       | 3=mirror }.
7664
7665           Default value: 'boundary_conditions=1'.
7666
7667           Example:
7668             [#1] image.jpg +vanvliet 3,1,x
7669             [#2] image.jpg +vanvliet 30,0,x vanvliet[-2] 30,0,y add
7670
7671         voronoi:
7672
7673           Compute the discrete Voronoi diagram of non-zero pixels in selected
7674       images.
7675
7676           Example:
7677             [#1]  400,400  noise  0.2,2  eq 1 +label_fg 0 voronoi[-1] +gradi‐
7678       ent[-1] xy,1 append[-2,-1] c norm[-1] ==[-1] 0 map[-2]  2,2  mul[-2,-1]
7679       normalize[-2] 0,255 dilate_circ[-2] 4
7680              reverse max
7681
7682         watermark_fourier:
7683             text,_size>0
7684
7685           Add a textual watermark in the frequency domain of selected images.
7686
7687           Default value: 'size=33'.
7688
7689           Example:
7690             [#1] image.jpg +watermark_fourier "Watermarked!" +display_fft re‐
7691       move[-3,-1] normalize 0,255 append[-4,-2] y append[-2,-1] y
7692
7693         watershed (+):
7694             [priority_image],_is_high_connectivity={ 0 | 1 }
7695
7696           Compute the watershed transform of selected images.
7697
7698           Default value: 'is_high_connectivity=1'.
7699
7700           Example:
7701             [#1] 400,400 noise 0.2,2 eq 1 +distance 1  mul[-1]  -1  label[-2]
7702       watershed[-2] [-1] mod[-2] 256 map[-2] 0 reverse
7703
7704         12.9. Features Extraction
7705               -------------------
7706
7707         area:
7708             tolerance>=0,is_high_connectivity={ 0 | 1 }
7709
7710           Compute area of connected components in selected images.
7711
7712           Default values: 'is_high_connectivity=0'.
7713
7714           Example:
7715             [#1] image.jpg luminance stencil[-1] 1 +area 0
7716
7717           Tutorial: https://gmic.eu/oldtutorial/_area
7718
7719         area_fg:
7720             tolerance>=0,is_high_connectivity={ 0 | 1 }
7721
7722           Compute  area  of  connected  components for non-zero values in se‐
7723       lected images.
7724           Similar to 'area' except that 0-valued pixels are not considered.
7725
7726           Default values: 'is_high_connectivity=0'.
7727
7728           Example:
7729             [#1] image.jpg luminance stencil[-1] 1 +area_fg 0
7730
7731         at_line:
7732             x0[%],y0[%],z0[%],x1[%],y1[%],z1[%]
7733
7734           Retrieve pixels of the selected images belonging to  the  specified
7735       line (x0,y0,z0)-(x1,y1,z1).
7736
7737           Example:
7738             [#1]     image.jpg     +at_line     0,0,0,100%,100%,0     line[0]
7739       0,0,100%,100%,1,0xFF00FF00,255,0,0
7740
7741         at_quadrangle:
7742             x0[%],y0[%],x1[%],y1[%],x2[%],y2[%],x3[%],y3[%],_interpola‐
7743       tion,_boundary_conditions |
7744             x0[%],y0[%],z0[%],x1[%],y1[%],z1[%],x2[%],y2[%],z2[%],x3[%],y3[%],z3[%],_in‐
7745       terpolation,_boundary_conditions
7746
7747           Retrieve pixels of the selected images belonging to  the  specified
7748       2D or 3D quadrangle.
7749           'interpolation' can be { 0=nearest-neighbor | 1=linear | 2=cubic }.
7750           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
7751       | 3=mirror }.
7752
7753           Example:
7754             [#1] image.jpg params=5%,5%,95%,5%,60%,95%,40%,95% +at_quadrangle
7755       $params polygon.. 4,$params,0.5,255
7756
7757         barycenter:
7758
7759           Compute the barycenter vector of pixel values.
7760
7761           Example:
7762             [#1]  256,256 ellipse 50%,50%,20%,20%,0,1,1 deform 20 +barycenter
7763       +ellipse[-2] {@0,1},5,5,0,10
7764
7765         betti:
7766
7767           Compute Betti numbers B0,B1 and B2 from selected 3D binary shapes.
7768           Values B0,B1 and B2 are returned in the status. When  multiple  im‐
7769       ages  are  selected, the B0,B1,B2 of each image are concatenated in the
7770       status.
7771           (see 'https://en.wikipedia.org/wiki/Betti_number' for details about
7772       Betti numbers).
7773
7774         delaunay:
7775             _output_type={ 0=image | 1=coordinates/triangles }
7776
7777           Generate  discrete  2D Delaunay triangulation of non-zero pixels in
7778       selected images.
7779           Input images must be scalar.
7780           Each pixel of the output image is a  triplet  (a,b,c)  meaning  the
7781       pixel belongs to
7782           the Delaunay triangle 'ABC' where 'a','b','c' are the labels of the
7783       pixels 'A','B','C'.
7784
7785           Example:
7786             [#1] 400,400 rand 32,255 100%,100% noise. 0.4,2 eq. 1 mul +delau‐
7787       nay
7788             [#2]  image.jpg  100%,100% noise. 2,2 eq. 1 delaunay. +blend sha‐
7789       peaverage0
7790
7791         detect_skin:
7792             0<=tolerance<=1,_skin_x,_skin_y,_skin_radius>=0
7793
7794           Detect skin in selected color images  and  output  an  appartenance
7795       probability map.
7796           Detection is performed using CbCr chromaticity data of skin pixels.
7797           If  arguments  'skin_x',  'skin_y'  and 'skin_radius' are provided,
7798       skin pixels are learnt
7799           from   the   sample   pixels   inside   the   circle   located   at
7800       ('skin_x','skin_y') with radius 'skin_radius'.
7801
7802           Default value: 'tolerance=0.5' and 'skin_x=skiny=radius=-1'.
7803
7804         displacement (+):
7805             [source_image],_smoothness,_precision>=0,_nb_scales>=0,_itera‐
7806       tion_max>=0,is_backward={ 0 | 1 },_[guide]
7807
7808           Estimate displacement field between specified source  and  selected
7809       target images.
7810           If  'smoothness>=0',  regularization type is set to isotropic, else
7811       to anisotropic.
7812           If 'nbscales==0', the number of scales used is estimated  from  the
7813       image size.
7814
7815           Default  values:  'smoothness=0.1',  'precision=5',  'nb_scales=0',
7816       'iteration_max=10000', 'is_backward=1' and '[guide]=(unused)'.
7817
7818           Example:
7819             [#1]  image.jpg  +rotate  3,1,0,50%,50%  +displacement[-1]   [-2]
7820       quiver[-1] [-1],15,1,1,1,{1.5*iM}
7821
7822         distance (+):
7823             isovalue[%],_metric |
7824             isovalue[%],[metric],_method
7825
7826           Compute  the unsigned distance function to specified isovalue, opt.
7827       according to a custom metric.
7828           'metric' can  be  {  0=chebyshev  |  1=manhattan  |  2=euclidean  |
7829       3=squared-euclidean }.
7830           'method'  can  be { 0=fast-marching | 1=low-connectivity dijkstra |
7831       2=high-connectivity dijkstra | 3=1+return path | 4=2+return path }.
7832
7833           Default value: 'metric=2' and 'method=0'.
7834
7835           Example:
7836             [#1] image.jpg threshold 20% distance 0 pow 0.3
7837             [#2] 400,400 set 1,50%,50% +distance[0] 1,2 +distance[0] 1,1 dis‐
7838       tance[0] 1,0 mod 32 threshold 16 append c
7839
7840           Tutorial: https://gmic.eu/oldtutorial/_distance
7841
7842         fftpolar:
7843
7844           Compute  fourier  transform  of selected images, as centered magni‐
7845       tude/phase images.
7846
7847           Example:
7848             [#1] image.jpg fftpolar ellipse 50%,50%,10,10,0,1,0 ifftpolar
7849
7850         histogram (+):
7851             nb_levels>0[%],_min_value[%],_max_value[%]
7852
7853           Compute the histogram of selected images.
7854           If value range is set, the histogram is estimated only  for  pixels
7855       in the specified
7856           value  range. Argument 'max_value' must be specified if 'min_value'
7857       is set.
7858
7859           Default values: 'min_value=0%' and 'max_value=100%'.
7860
7861           Example:
7862             [#1] image.jpg +histogram 64 display_graph[-1] 400,300,3
7863
7864         histogram_nd:
7865             nb_levels>0[%],_value0[%],_value1[%]
7866
7867           Compute the 1D,2D or 3D histogram of selected multi-channels images
7868       (having 1,2 or 3 channels).
7869           If  value  range is set, the histogram is estimated only for pixels
7870       in the specified
7871           value range.
7872
7873           Default values: 'value0=0%' and 'value1=100%'.
7874
7875           Example:
7876             [#1] image.jpg channels 0,1 +histogram_nd 256
7877
7878         histogram_cumul:
7879             _nb_levels>0,_is_normalized={ 0 | 1 },_val0[%],_val1[%]
7880
7881           Compute cumulative histogram of selected images.
7882
7883           Default values: 'nb_levels=256', 'is_normalized=0',  'val0=0%'  and
7884       'val1=100%'.
7885
7886           Example:
7887             [#1]   image.jpg   +histogram_cumul  256  histogram[0]  256  dis‐
7888       play_graph 400,300,3
7889
7890         histogram_pointwise:
7891             nb_levels>0[%],_value0[%],_value1[%]
7892
7893           Compute the histogram of each vector-valued point of  selected  im‐
7894       ages.
7895           If  value  range is set, the histogram is estimated only for values
7896       in the specified
7897           value range.
7898
7899           Default values: 'value0=0%' and 'value1=100%'.
7900
7901         hough:
7902             _width>0,_height>0,gradient_norm_voting={ 0 | 1 }
7903
7904           Compute hough transform (theta,rho) of selected images.
7905
7906           Default values: 'width=512', 'height=width' and 'gradient_norm_vot‐
7907       ing=1'.
7908
7909           Example:
7910             [#1] image.jpg +blur 1.5 hough[-1] 400,400 blur[-1] 0.5 add[-1] 1
7911       log[-1]
7912
7913         ifftpolar:
7914
7915           Compute inverse fourier transform of selected images, from centered
7916       magnitude/phase images.
7917
7918         img2patches:
7919             patch_size>0,_overlap[%]>0,_boundary_conditions
7920
7921           Decompose  selected  2D  images into (possibly overlapping) patches
7922       and stack them along the z-axis.
7923           'overlap' must be in range '[0,patch_size-1]'.
7924           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
7925       | 3=mirror }.
7926
7927           Default values: 'overlap=0' and 'boundary_conditions=0'.
7928           See also: patches2img.
7929
7930           Example:
7931             [#1] image.jpg img2patches 64
7932
7933         isophotes:
7934             _nb_levels>0
7935
7936           Render isophotes of selected images on a transparent background.
7937
7938           Default value: 'nb_levels=64'
7939
7940           Example:
7941             [#1] image.jpg blur 2 isophotes 6 dilate_circ 5 display_rgba
7942
7943         label (+):
7944             _tolerance>=0,is_high_connectivity={  0 | 1 },_is_L2_norm={ 0 | 1
7945       }
7946
7947           Label connected components in selected images.
7948
7949           Default   values:   'tolerance=0',   'is_high_connectivity=0'   and
7950       'is_L2_norm=1'.
7951
7952           Example:
7953             [#1]  image.jpg luminance threshold 60% label normalize 0,255 map
7954       0
7955             [#2] 400,400 set 1,50%,50% distance 1 mod 16  threshold  8  label
7956       mod 255 map 2
7957
7958           Tutorial: https://gmic.eu/oldtutorial/_label
7959
7960         label_fg:
7961             tolerance>=0,is_high_connectivity={ 0 | 1 }
7962
7963           Label  connected components for non-zero values (foreground) in se‐
7964       lected images.
7965           Similar to 'label' except that 0-valued pixels are not labeled.
7966
7967           Default value: 'is_high_connectivity=0'.
7968
7969         laar:
7970
7971           Extract the largest axis-aligned rectangle in non-zero areas of se‐
7972       lected images.
7973           Rectangle coordinates are returned in status, as a sequence of num‐
7974       bers x0,y0,x1,y1.
7975
7976           Example:
7977             [#1] shape_cupid 256 coords=${-laar} normalize 0,255 to_rgb  rec‐
7978       tangle $coords,0.5,0,128,0
7979
7980         max_patch:
7981             _patch_size>=1
7982
7983           Return  locations  of maximal values in local patch-based neighbor‐
7984       hood of given size for selected images.
7985
7986           Default value: 'patch_size=16'.
7987
7988           Example:
7989             [#1] image.jpg norm +max_patch 16
7990
7991         min_patch:
7992             _patch_size>=1
7993
7994           Return locations of minimal values in local  patch-based  neighbor‐
7995       hood of given size for selected images.
7996
7997           Default value: 'patch_size=16'.
7998
7999           Example:
8000             [#1] image.jpg norm +min_patch 16
8001
8002         minimal_path:
8003             x0[%]>=0,y0[%]>=0,z0[%]>=0,x1[%]>=0,y1[%]>=0,z1[%]>=0,_is_high_con‐
8004       nectivity={ 0 | 1 }
8005
8006           Compute minimal path between two points on selected potential maps.
8007
8008           Default value: 'is_high_connectivity=0'.
8009
8010           Example:
8011             [#1] image.jpg +gradient_norm fill[-1]  1/(1+i)  minimal_path[-1]
8012       0,0,0,100%,100%,0  pointcloud[-1]  0 *[-1] 280 to_rgb[-1] ri[-1] [-2],0
8013       or
8014
8015         mse:
8016             [reference]
8017
8018           Return the MSE (Mean-Squared Error)  between  selected  images  and
8019       specified reference image.
8020           This  command  does  not modify the images. It returns a value or a
8021       list of values in the status.
8022
8023         mse_matrix:
8024
8025           Compute MSE (Mean-Squared Error) matrix between selected images.
8026
8027           Example:
8028             [#1] image.jpg +noise 30 +noise[0] 35  +noise[0]  38  cut.  0,255
8029       +mse_matrix
8030
8031         patches2img:
8032             width>0,height>0,_overlap[%]>0,_overlap_std[%]
8033
8034           Recompose 2D images from their selected patch representations.
8035           'overlap' must be in range '[0,patch_size-1]' where 'patch_size' is
8036       the width/height of the selected image.
8037           'overlap_std' is the standard deviation  of  the  gaussian  weights
8038       used for reconstructing overlapping patches.
8039           If  'overlap_std'  is  set to '-1', uniform weights are used rather
8040       than gaussian.
8041
8042           Default value: 'overlap=0' and 'overlap_std=-1'.
8043           See also: img2patches.
8044
8045           Example:
8046             [#1] image.jpg +img2patches 32,0,3 mirror[-1] xy  patches2img[-1]
8047       {0,[w,h]}
8048
8049         patches:
8050             patch_width>0,patch_height>0,patch_depth>0,x0,y0,z0,_x1,_y1,_z1,...,_xN,_yN,_zN
8051
8052           Extract N+1 patches from selected images, centered at specified lo‐
8053       cations.
8054
8055           Example:
8056             [#1]                      image.jpg                      +patches
8057       64,64,1,153,124,0,184,240,0,217,126,0,275,38,0
8058
8059         matchpatch (+):
8060             [patch_im‐
8061       age],patch_width>=1,_patch_height>=1,_patch_depth>=1,_nb_itera‐
8062       tions>=0,_nb_randoms>=0,_patch_penalization,_output_score={   0   |   1
8063       },_[guide]
8064
8065           Estimate  correspondence  map between selected images and specified
8066       patch image, using
8067           a patch-matching algorithm.
8068           Each pixel of the returned correspondence map  gives  the  location
8069       (p,q) of the closest patch in
8070           the  specified  patch image. If 'output_score=1', the third channel
8071       also gives the corresponding
8072           matching score for each patch as well.
8073           If 'patch_penalization' is >=0, SSD is penalized with patch  occur‐
8074       rences.
8075           If  'patch_penalization'  is <0, SSD is inf-penalized when distance
8076       between patches are less than '-patch_penalization'.
8077
8078           Default   values:   'patch_height=patch_width',    'patch_depth=1',
8079       'nb_iterations=5', 'nb_randoms=5', 'patch_penalization=0',
8080            'output_score=0' and 'guide=(undefined)'.
8081
8082           Example:
8083             [#1]  image.jpg  sample  colorful  +matchpatch[0] [1],3 +warp[-2]
8084       [-1],0
8085
8086         plot2value:
8087
8088           Retrieve values from selected 2D graph plots.
8089
8090           Example:
8091             [#1]  400,300,1,1,'if(y>300*abs(cos(x/10+2*u)),1,0)'  +plot2value
8092       +display_graph[-1] 400,300
8093
8094         pointcloud:
8095             _type  =  {  -X=-X-opacity  | 0=binary | 1=cumulative | 2=label |
8096       3=retrieve coordinates },_width,_height>0,_depth>0
8097
8098           Render a set of point coordinates, as a point cloud in a  1D/2D  or
8099       3D binary image
8100           (or  do  the  reverse, i.e. retrieve coordinates of non-zero points
8101       from a rendered point cloud).
8102           Input point coordinates can be a NxMx1x1, Nx1x1xM or 1xNx1xM image,
8103       where 'N' is the number of points,
8104           and M the point coordinates.
8105           If 'M'>3, the 3-to-M components sets the (M-3)-dimensional color at
8106       each point.
8107           Parameters 'width','height' and 'depth' are related to the size  of
8108       the final image :
8109              -   If  set to 0, the size is automatically set along the speci‐
8110       fied axis.
8111              -  If set to N>0, the size along the specified axis is N.
8112              -  If set to N<0, the size along the specified axis is  at  most
8113       N.
8114           Points  with coordinates that are negative or higher than specified
8115       ('width','height','depth')
8116           are not plotted.
8117
8118           Default values: 'type=0' and 'max_width=max_height=max_depth=0'.
8119
8120           Example:
8121             [#1] 3000,2 rand 0,400 +pointcloud 0 dilate[-1] 3
8122             [#2] 3000,2 rand 0,400 {w} {w},3 rand[-1] 0,255 append y  +point‐
8123       cloud 0 dilate[-1] 3
8124
8125         psnr:
8126             [reference],_max_value>0
8127
8128           Return  PSNR  (Peak  Signal-to-Noise Ratio) between selected images
8129       and specified reference image.
8130           This command does not modify the images. It returns a  value  or  a
8131       list of values in the status.
8132
8133           Default value: 'max_value=255'.
8134
8135         psnr_matrix:
8136             _max_value>0
8137
8138           Compute  PSNR  (Peak Signal-to-Noise Ratio) matrix between selected
8139       images.
8140
8141           Default value: 'max_value=255'.
8142
8143           Example:
8144             [#1] image.jpg +noise 30 +noise[0] 35  +noise[0]  38  cut.  0,255
8145       +psnr_matrix
8146
8147         segment_watershed:
8148             _threshold>=0
8149
8150           Apply watershed segmentation on selected images.
8151
8152           Default values: 'threshold=2'.
8153
8154           Example:
8155             [#1] image.jpg segment_watershed 2
8156
8157         shape2bump:
8158             _resolution>=0,0<=_weight_std_max_avg<=1,_dilation,_smoothness>=0
8159
8160           Estimate bumpmap from binary shape in selected images.
8161
8162           Default   value:  'resolution=256',  'weight_std_max=0.75',  'dila‐
8163       tion=0' and 'smoothness=100'.
8164
8165         skeleton:
8166             _boundary_conditions={ 0=dirichlet | 1=neumann }
8167
8168           Compute skeleton of binary shapes using distance transform and con‐
8169       strained thinning.
8170
8171           Default value: 'boundary_conditions=1'.
8172
8173           Example:
8174             [#1] shape_cupid 320 +skeleton 0
8175
8176         slic:
8177             size>0,_regularity>=0,_nb_iterations>0
8178
8179           Segment  selected  2D images with superpixels, using the SLIC algo‐
8180       rithm (Simple Linear Iterative Clustering).
8181           Scalar images of increasingly labeled pixels are returned.
8182           Reference paper: Achanta, R., Shaji, A.,  Smith,  K.,  Lucchi,  A.,
8183       Fua,  P.,  &  Susstrunk,  S.  (2010).  SLIC  Superpixels  (No. EPFL-RE‐
8184       PORT-149300).
8185
8186           Default values: 'size=16', 'regularity=10' and 'nb_iterations=10'.
8187
8188           Example:
8189             [#1] image.jpg +srgb2lab slic[-1] 16  +blend  shapeaverage  f[-2]
8190       "j(1,0)==i && j(0,1)==i" *[-1] [-2]
8191
8192         ssd_patch:
8193             [patch],_use_fourier={ 0 | 1 },_boundary_conditions
8194
8195           Compute fields of SSD between selected images and specified patch.
8196           Argument 'boundary_conditions' is valid only when 'use_fourier=0'.
8197           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
8198       | 3=mirror }.
8199
8200           Default value: 'use_fourier=0' and 'boundary_conditions=0'.
8201
8202           Example:
8203             [#1] image.jpg +crop 20%,20%,35%,35% +ssd_patch[0] [1],0,0
8204
8205         ssim:
8206             [reference],_patch_size>0,_max_value>0
8207
8208           Compute the Structural Similarity Index Measure (SSIM) between  se‐
8209       lected images and specified reference image.
8210           This command does not modify the images, it just returns a value or
8211       a list of values in the status.
8212           When 'downsampling_factor' is specified  with  a  ending  '%',  its
8213       value is equal to '1+(patch_size-1)*spatial_factor%'.
8214
8215           SSIM is a measure introduced int the following paper:
8216           Wang,  Zhou, et al., "Image quality assessment: from error visibil‐
8217       ity to structural similarity.",
8218           in IEEE transactions on image processing 13.4 (2004): 600-612.
8219
8220           The implementation of this command is a direct translation  of  the
8221       reference code (in Matlab), found at :
8222           https://ece.uwaterloo.ca/~z70wang/research/ssim/
8223
8224           Default values: 'patch_size=11', and 'max_value=255'.
8225
8226         ssim_matrix:
8227             _patch_size>0,_max_value>0
8228
8229           Compute  SSIM  (Structural Similarity Index Measure) matrix between
8230       selected images.
8231
8232           Default values: 'patch_size=11', and 'max_value=255'.
8233
8234           Example:
8235             [#1] image.jpg +noise 30 +noise[0] 35  +noise[0]  38  cut.  0,255
8236       +ssim_matrix
8237
8238         thinning:
8239             _boundary_conditions={ 0=dirichlet | 1=neumann }
8240
8241           Compute skeleton of binary shapes using morphological thinning
8242           (beware, this is a quite slow iterative process)
8243
8244           Default value: 'boundary_conditions=1'.
8245
8246           Example:
8247             [#1] shape_cupid 320 +thinning
8248
8249         tones:
8250             N>0
8251
8252           Get N tones masks from selected images.
8253
8254           Example:
8255             [#1] image.jpg +tones 3
8256
8257         topographic_map:
8258             _nb_levels>0,_smoothness
8259
8260           Render selected images as topographic maps.
8261
8262           Default values: 'nb_levels=16' and 'smoothness=2'.
8263
8264           Example:
8265             [#1] image.jpg topographic_map 10
8266
8267         tsp:
8268             _precision>=0
8269
8270           Try to solve the 'travelling salesman' problem, using a combination
8271       of greedy search and 2-opt algorithms.
8272           Selected images must have dimensions Nx1x1xC to represent N  cities
8273       each with C-dimensional coordinates.
8274           This  command  re-order  the selected data along the x-axis so that
8275       the point sequence becomes a shortest path.
8276
8277           Default values: 'precision=256'.
8278
8279           Example:
8280             [#1] 256,1,1,2 rand 0,512 tsp , 512,512,1,3 repeat w#0 circle[-1]
8281       {0,I[$>]},2,1,255,255,255               line[-1]              {0,bound‐
8282       ary=2;[I[$>],I[$>+1]]},1,255,128,0 done keep[-1]
8283
8284         variance_patch:
8285             _patch_size>=1
8286
8287           Compute variance of each images patch centered  at  (x,y),  in  se‐
8288       lected images.
8289
8290           Default value: 'patch_size=16'
8291
8292           Example:
8293             [#1] image.jpg +variance_patch
8294
8295         12.10. Image Drawing
8296                -------------
8297
8298         arrow:
8299             x0[%],y0[%],x1[%],y1[%],_thick‐
8300       ness[%]>=0,_head_length[%]>=0,_head_thickness[%]>=0,_opacity,_pat‐
8301       tern,_color1,...
8302
8303           Draw specified arrow on selected images.
8304           'pattern'  is an hexadecimal number starting with '0x' which can be
8305       omitted
8306           even if a color is specified. If a pattern is specified, the  arrow
8307       is
8308           drawn outlined instead of filled.
8309
8310           Default  values:  'thickness=1%',  'head_length=10%',  'head_thick‐
8311       ness=3%', 'opacity=1', 'pattern=(undefined)' and 'color1=0'.
8312
8313           Example:
8314             [#1]         400,400,1,3         repeat         100         arrow
8315       50%,50%,{u(100)}%,{u(100)}%,3,20,10,0.3,${-rgb} done
8316
8317         axes:
8318             x0,x1,y0,y1,_font_height>=0,_opacity,_pattern,_color1,...
8319
8320           Draw xy-axes on selected images.
8321           'pattern'  is an hexadecimal number starting with '0x' which can be
8322       omitted
8323           even if a color is specified.
8324           To draw only one x-axis at row Y, set both 'y0' and 'y1' to Y.
8325           To draw only one y-axis at column X, set both 'x0' and 'x1' to X.
8326
8327           Default  values:  'font_height=14',  'opacity=1',   'pattern=(unde‐
8328       fined)' and 'color1=0'.
8329
8330           Example:
8331             [#1] 400,400,1,3,255 axes -1,1,1,-1
8332
8333         ball:
8334             _size>0,                _R,_G,_B,0<=_specular_light<=8,0<=_specu‐
8335       lar_size<=8,_shadow>=0
8336
8337           Input a 2D RGBA colored ball sprite.
8338
8339           Default  values:  'size=64',   'R=255',   'G=R',   'B=R',   'specu‐
8340       lar_light=0.8', 'specular_size=1' and 'shading=1.5'.
8341
8342           Example:
8343             [#1] repeat 9 { ball {1.5^($>+2)},${-rgb} } append x
8344
8345         chessboard:
8346             size1>0,_size2>0,_offset1,_offset2,_angle,_opac‐
8347       ity,_color1,...,_color2,...
8348
8349           Draw chessboard on selected images.
8350
8351           Default  values:  'size2=size1',  'offset1=offset2=0',   'angle=0',
8352       'opacity=1', 'color1=0' and 'color2=255'.
8353
8354           Example:
8355             [#1] image.jpg chessboard 32,32,0,0,25,0.3,255,128,0,0,128,255
8356
8357         cie1931:
8358
8359           Draw CIE-1931 chromaticity diagram on selected images.
8360
8361           Example:
8362             [#1] 500,400,1,3 cie1931
8363
8364         circle:
8365             x[%],y[%],R[%],_opacity,_pattern,_color1,...
8366
8367           Draw specified colored circle on selected images.
8368           A radius of '100%' stands for 'sqrt(width^2+height^2)'.
8369           'pattern'  is an hexadecimal number starting with '0x' which can be
8370       omitted
8371           even if a color is specified. If a pattern is specified, the circle
8372       is
8373           drawn outlined instead of filled.
8374
8375           Default values: 'opacity=1', 'pattern=(undefined)' and 'color1=0'.
8376
8377           Example:
8378             [#1]          image.jpg         repeat         300         circle
8379       {u(100)}%,{u(100)}%,{u(30)},0.3,${-rgb} done circle 50%,50%,100,0.7,255
8380
8381         close_binary:
8382             0<=_endpoint_rate<=100,_endpoint_connectivity>=0,_spline_dist‐
8383       max>=0,_segment_distmax>=0,0<=_spline_anglemax<=180,_spline_round‐
8384       ness>=0,_area_min>=0,_allow_self_intersection={
8385               0 | 1 }
8386
8387           Automatically close open shapes in binary  images  (defining  white
8388       strokes on black background).
8389
8390           Default   values:   'endpoint_rate=75',  'endpoint_connectivity=2',
8391       'spline_distmax=80', 'segment_distmax=20', 'spline_anglemax=90',
8392            'spline_roundness=1','area_min=100', 'allow_self_intersection=1'.
8393
8394         ellipse (+):
8395             x[%],y[%],R[%],r[%],_angle,_opacity,_pattern,_color1,...
8396
8397           Draw specified colored ellipse on selected images.
8398           A radius of '100%' stands for 'sqrt(width^2+height^2)'.
8399           'pattern' is an hexadecimal number starting with '0x' which can  be
8400       omitted
8401           even  if  a  color is specified. If a pattern is specified, the el‐
8402       lipse is
8403           drawn outlined instead of filled.
8404
8405           Default values: 'opacity=1', 'pattern=(undefined)' and 'color1=0'.
8406
8407           Example:
8408             [#1]         image.jpg         repeat         300         ellipse
8409       {u(100)}%,{u(100)}%,{u(30)},{u(30)},{u(180)},0.3,${-rgb}  done  ellipse
8410       50%,50%,100,100,0,0.7,255
8411
8412         flood (+):
8413             x[%],_y[%],_z[%],_tolerance>=0,_is_high_connectivity={  0   |   1
8414       },_opacity,_color1,...
8415
8416           Flood-fill selected images using specified value and tolerance.
8417
8418           Default  values:  'y=z=0', 'tolerance=0', 'is_high_connectivity=0',
8419       'opacity=1' and 'color1=0'.
8420
8421           Example:
8422             [#1]         image.jpg         repeat         1000          flood
8423       {u(100)}%,{u(100)}%,0,20,0,1,${-rgb} done
8424
8425         gaussian:
8426             _sigma1[%],_sigma2[%],_angle
8427
8428           Draw  a  centered gaussian on selected images, with specified stan‐
8429       dard deviations and orientation.
8430
8431           Default values: 'sigma1=3', 'sigma2=sigma1' and 'angle=0'.
8432
8433           Example:
8434             [#1] 400,400 gaussian 100,30,45
8435
8436           Tutorial: https://gmic.eu/oldtutorial/_gaussian
8437
8438         graph (+):
8439             [function_image],_plot_type,_vertex_type,_ymin,_ymax,_opac‐
8440       ity,_pattern,_color1,... |
8441             'formula',_resolution>=0,_plot_type,_ver‐
8442       tex_type,_xmin,xmax,_ymin,_ymax,_opacity,_pattern,_color1,...
8443
8444           Draw specified function graph on selected images.
8445           'plot_type' can be { 0=none | 1=lines | 2=splines | 3=bar }.
8446           'vertex_type' can be { 0=none | 1=points | 2,3=crosses  |  4,5=cir‐
8447       cles | 6,7=squares }.
8448           'pattern'  is an hexadecimal number starting with '0x' which can be
8449       omitted
8450           even if a color is specified.
8451
8452           Default  values:   'plot_type=1',   'vertex_type=1',   'ymin=ymax=0
8453       (auto)', 'opacity=1', 'pattern=(undefined)'
8454           and 'color1=0'.
8455
8456           Example:
8457             [#1]  image.jpg  +rows  50%  blur[-1]  3  split[-1]  c div[0] 1.5
8458       graph[0] [1],2,0,0,0,1,255,0,0 graph[0] [2],2,0,0,0,1,0,255,0  graph[0]
8459       [3],2,0,0,0,1,0,0,255 keep[0]
8460
8461         grid:
8462             size_x[%]>=0,size_y[%]>=0,_offset_x[%],_offset_y[%],_opac‐
8463       ity,_pattern,_color1,...
8464
8465           Draw xy-grid on selected images.
8466           'pattern' is an hexadecimal number starting with '0x' which can  be
8467       omitted
8468           even if a color is specified.
8469
8470           Default values: 'offset_x=offset_y=0', 'opacity=1', 'pattern=(unde‐
8471       fined)' and 'color1=0'.
8472
8473           Example:
8474             [#1] image.jpg grid 10%,10%,0,0,0.5,255
8475             [#2] 400,400,1,3,255 grid 10%,10%,0,0,0.3,0xCCCCCCCC,128,32,16
8476
8477         j (+):
8478             Shortcut for command 'image'.
8479
8480         image (+):
8481             [sprite],_x[%|~],_y[%|~],_z[%|~],_c[%|~],_opacity,_[opac‐
8482       ity_mask],_max_opacity_mask
8483
8484           Draw specified sprite image on selected images.
8485           (equivalent to shortcut command 'j').
8486
8487           If one of the x,y,z or c argument ends with a '~', its value is ex‐
8488       pected to be
8489           a centering ratio (in [0,1]) rather than a position.
8490           Usual centering ratio  are  {  0=left-justified  |  0.5=centered  |
8491       1=right-justified }.
8492
8493           Default   values:  'x=y=z=c=0',  'opacity=1',  'opacity_mask=(unde‐
8494       fined)' and 'max_opacity_mask=1'.
8495
8496           Example:
8497             [#1] image.jpg +crop 40%,40%,60%,60%  resize[-1]  200%,200%,1,3,5
8498       frame[-1] 2,2,0 image[0] [-1],30%,30% keep[0]
8499
8500         line (+):
8501             x0[%],y0[%],x1[%],y1[%],_opacity,_pattern,_color1,...
8502
8503           Draw specified colored line on selected images.
8504           'pattern'  is an hexadecimal number starting with '0x' which can be
8505       omitted
8506           even if a color is specified.
8507
8508           Default values: 'opacity=1', 'pattern=(undefined)' and 'color1=0'.
8509
8510           Example:
8511             [#1] image.jpg repeat 500 line  50%,50%,{u(w)},{u(h)},0.5,${-rgb}
8512       done  line 0,0,100%,100%,1,0xCCCCCCCC,255 line 100%,0,0,100%,1,0xCCCCC‐
8513       CCC,255
8514
8515         line_aa:
8516             x0[%],y0[%],x1[%],y1[%],_opacity,_color1,...
8517
8518           Draw specified antialiased colored line on selected images.
8519
8520           Default values: 'opacity=1' and 'color1=0'.
8521
8522           Example:
8523             [#1]        512,512,1,3        repeat         100         line_aa
8524       {round(u([w,h,w,h])-1)},1,${-RGB} done
8525
8526         thickline:
8527             x0[%],y0[%],x1[%],y1[%],_thickness,_opacity,_color1
8528
8529           Draw specified colored thick line on selected images.
8530
8531           Default values: 'thickness=2', 'opacity=1' and 'color1=0'.
8532
8533           Example:
8534             [#1]        400,400,1,3        repeat        100        thickline
8535       {u([w,h,w,h,5])},0.5,${-rgb} done
8536
8537         mandelbrot (+):
8538             z0r,z0i,z1r,z1i,_iteration_max>=0,_is_julia={     0      |      1
8539       },_c0r,_c0i,_opacity
8540
8541           Draw mandelbrot/julia fractal on selected images.
8542
8543           Default  values: 'iteration_max=100', 'is_julia=0', 'c0r=c0i=0' and
8544       'opacity=1'.
8545
8546           Example:
8547             [#1] 400,400 mandelbrot -2.5,-2,2,2,1024 map  0  +blur  2  eleva‐
8548       tion3d[-1] -0.2
8549
8550         marble:
8551             _image_weight,_pattern_weight,_angle,_amplitude,_sharp‐
8552       ness>=0,_anisotropy>=0,_alpha,_sigma,_cut_low>=0,_cut_high>=0
8553
8554           Render marble like pattern on selected images.
8555
8556           Default  values:  'image_weight=0.2',  'pattern_weight=0.1',   'an‐
8557       gle=45', 'amplitude=0', 'sharpness=0.4' and 'anisotropy=0.8',
8558           'alpha=0.6', 'sigma=1.1' and 'cut_low=cut_high=0'.
8559
8560           Example:
8561             [#1] image.jpg +marble ,
8562
8563         maze:
8564             _width>0,_height>0,_cell_size>0
8565
8566           Input maze with specified size.
8567
8568           Example:
8569             [#1] maze 30,20 negate normalize 0,255
8570
8571         maze_mask:
8572             _cellsize>0
8573
8574           Input maze according to size and shape of selected mask images.
8575           Mask may contain disconnected shapes.
8576
8577           Example:
8578             [#1]  0  text  "G'MIC",0,0,53,1,1 dilate 3 autocrop 0 frame 1,1,0
8579       maze_mask 8 dilate 3 negate mul 255
8580
8581         newton_fractal:
8582             z0r,z0i,z1r,z1i,_angle,0<=_descent_method<=2,_itera‐
8583       tion_max>=0,_convergence_preci‐
8584       sion>0,_expr_p(z),_expr_dp(z),_expr_d2p(z)
8585
8586           Draw newton fractal on selected  images,  for  complex  numbers  in
8587       range (z0r,z0i) - (z1r,z1i).
8588           Resulting  images  have  3  channels  whose  meaning  is [ last_zr,
8589       last_zi, nb_iter_used_for_convergence ].
8590           'descent_method' can be { 0=secant | 1=newton | 2=householder }.
8591
8592           Default values: 'angle=0', 'descent_method=1', 'iteration_max=200',
8593       'convergence_precision=0.01', 'expr_p(z)=z^^3-1',
8594            'expr_dp(z)=3*z^^2' and 'expr_d2z(z)=6*z'.
8595
8596           Example:
8597             [#1]  400,400 newton_fractal -1.5,-1.5,1.5,1.5,0,2,200,0.01,"z^^6
8598       +   z^^3   -   1","6*z^^5   +   3*z^^2","30*z^^4   +    6*z"    f    "[
8599       atan2(i1,i0)*90+20,1,cut(i2/30,0.2,0.7) ]" hsl2rgb
8600
8601         j3d (+):
8602             Shortcut for command 'object3d'.
8603
8604         object3d (+):
8605             [object3d],_x[%],_y[%],_z,_opacity,_rendering_mode,_is_dou‐
8606       ble_sided={    0    |    1    },_is_zbuffer={    0    |    1     },_fo‐
8607       cale,_light_x,_light_y,_light_z,_specular_lightness,_specular_shininess
8608
8609           Draw specified 3D object on selected images.
8610           (equivalent to shortcut command 'j3d').
8611
8612           'rendering_mode'  can  be { 0=dots | 1=wireframe | 2=flat | 3=flat-
8613       shaded | 4=gouraud-shaded | 5=phong-shaded }.
8614
8615           Default values:  'x=y=z=0',  'opacity=1'  and  'is_zbuffer=1'.  All
8616       other arguments take their default values
8617           from the 3D environment variables.
8618
8619           Example:
8620             [#1]  image.jpg  torus3d  100,10  cone3d 30,-120 add3d[-2,-1] ro‐
8621       tate3d. 1,1,0,60 object3d[0] [-1],50%,50% keep[0]
8622
8623         pack_sprites:
8624             _nb_scales>=0,0<=_min_scale<=100,_allow_rotation={  0=0  deg.   |
8625       1=180  deg.  |  2=90  deg.  | 3=any },_spacing,_precision>=0,max_itera‐
8626       tions>=0
8627
8628           Try to randomly pack as many sprites as possible onto  the  'empty'
8629       areas of an image.
8630           Sprites  can  be  eventually  rotated and scaled during the packing
8631       process.
8632           First selected image is the canvas that will  be  filled  with  the
8633       sprites.
8634           Its  last channel must be a binary mask whose zero values represent
8635       potential locations for drawing the sprites.
8636           All other selected images  represent  the  sprites  considered  for
8637       packing.
8638           Their last channel must be a binary mask that represents the sprite
8639       shape (i.e. a 8-connected component).
8640           The order of sprite packing follows the order of specified  sprites
8641       in the image list.
8642           Sprite packing is done on random locations and iteratively with de‐
8643       creasing scales.
8644           'nb_scales' sets the number of decreasing scales considered for all
8645       specified sprites to be packed.
8646           'min_scale'  (in  %)  sets  the minimal size considered for packing
8647       (specified as a percentage of the
8648           original sprite size).
8649           'spacing' can be positive or negative.
8650           'precision' tells about the desired number of failed trials  before
8651       ending the filling process.
8652
8653           Default  values: 'nb_scales=5', 'min_scale=25', 'allow_rotation=3',
8654       'spacing=1', 'precision=7' and 'max_iterations=256'.
8655
8656           Example:
8657             [#1]      512,512,1,3,"min(255,y*c/2)"      100%,100%      circle
8658       50%,50%,100,1,255   append   c   image.jpg   resize2dy[-1]  24  to_rgba
8659       pack_sprites 3,25
8660
8661         piechart:
8662             label_height>=0,label_R,label_G,label_B,"la‐
8663       bel1",value1,R1,G1,B1,...,"labelN",valueN,RN,GN,BN
8664
8665           Draw pie chart on selected (RGB) images.
8666
8667           Example:
8668             [#1]                      image.jpg                      piechart
8669       25,0,0,0,"Red",55,255,0,0,"Green",40,0,255,0,"Blue",30,128,128,255,"Other",5,128,128,128
8670
8671         plasma (+):
8672             _alpha,_beta,_scale>=0
8673
8674           Draw a random colored plasma fractal on selected images.
8675           This command implements the so-called 'Diamond-Square' algorithm.
8676
8677           Default values: 'alpha=1', 'beta=1' and 'scale=8'.
8678
8679           Example:
8680             [#1] 400,400,1,3 plasma
8681
8682           Tutorial: https://gmic.eu/oldtutorial/_plasma
8683
8684         point (+):
8685             x[%],_y[%],_z[%],_opacity,_color1,...
8686
8687           Set specified colored pixel on selected images.
8688
8689           Default values: 'z=0', 'opacity=1' and 'color1=0'.
8690
8691           Example:
8692             [#1] image.jpg repeat 10000 point {u(100)}%,{u(100)}%,0,1,${-rgb}
8693       done
8694
8695         polka_dots:
8696             diameter>=0,_density,_offset1,_offset2,_angle,_aliasing,_shad‐
8697       ing,_opacity,_color,...
8698
8699           Draw dots pattern on selected images.
8700
8701           Default   values:  'density=20',  'offset1=offset2=50',  'angle=0',
8702       'aliasing=10', 'shading=1', 'opacity=1' and 'color=255'.
8703
8704           Example:
8705             [#1] image.jpg polka_dots 10,15,0,0,20,10,1,0.5,0,128,255
8706
8707         polygon (+):
8708             N>=1,x1[%],y1[%],...,xN[%],yN[%],_opacity,_pattern,_color1,...
8709
8710           Draw specified colored N-vertices polygon on selected images.
8711           'pattern' is an hexadecimal number starting with '0x' which can  be
8712       omitted
8713           even  if a color is specified. If a pattern is specified, the poly‐
8714       gon is
8715           drawn outlined instead of filled.
8716
8717           Default values: 'opacity=1', 'pattern=(undefined)' and 'color1=0'.
8718
8719           Example:
8720             [#1]                      image.jpg                       polygon
8721       4,20%,20%,80%,30%,80%,70%,20%,80%,0.3,0,255,0                   polygon
8722       4,20%,20%,80%,30%,80%,70%,20%,80%,1,0xCCCCCCCC,255
8723             [#2]    image.jpg     2,16,1,1,'u(if(x,{h},{w}))'     polygon[-2]
8724       {h},{^},0.6,255,0,255 remove[-1]
8725
8726         quiver:
8727             [function_image],_sampling[%]>0,_factor>=0,_is_arrow={   0   |  1
8728       },_opacity,_color1,...
8729
8730           Draw specified 2D vector/orientation field on selected images.
8731
8732           Default values:  'sampling=5%',  'factor=1',  'is_arrow=1',  'opac‐
8733       ity=1', 'pattern=(undefined)'
8734           and 'color1=0'.
8735
8736           Example:
8737             [#1]      100,100,1,2,'if(c==0,x-w/2,y-h/2)'      500,500,1,3,255
8738       quiver[-1] [-2],10
8739             [#2] image.jpg +resize2dy 600 luminance[0] gradient[0] mul[1]  -1
8740       reverse[0,1]   append[0,1]   c   blur[0]   8  orientation[0]  quiver[1]
8741       [0],20,1,1,0.8,255
8742
8743         rectangle:
8744             x0[%],y0[%],x1[%],y1[%],_opacity,_pattern,_color1,...
8745
8746           Draw specified colored rectangle on selected images.
8747           'pattern' is an hexadecimal number starting with '0x' which can  be
8748       omitted
8749           even  if  a color is specified. If a pattern is specified, the rec‐
8750       tangle is
8751           drawn outlined instead of filled.
8752
8753           Default values: 'opacity=1', 'pattern=(undefined)' and 'color1=0'.
8754
8755           Example:
8756             [#1]      image.jpg       repeat       30       {       rectangle
8757       {u(100)}%,{u(100)}%,{u(100)}%,{u(100)}%,0.3,${-rgb} }
8758
8759         rorschach:
8760             'smoothness[%]>=0','mirroring={ 0=none | 1=x | 2=y | 3=xy }
8761
8762           Render rorschach-like inkblots on selected images.
8763
8764           Default values: 'smoothness=5%' and 'mirroring=1'.
8765
8766           Example:
8767             [#1] 400,400 rorschach 3%
8768
8769         sierpinski:
8770             recursion_level>=0
8771
8772           Draw Sierpinski triangle on selected images.
8773
8774           Default value: 'recursion_level=7'.
8775
8776           Example:
8777             [#1] image.jpg sierpinski 7
8778
8779         spiralbw:
8780             width>0,_height>0,_is_2dcoords={ 0 | 1 }
8781
8782           Input a 2D rectangular spiral image with specified size.
8783
8784           Default values: 'height=width' and 'is_2dcoords=0'.
8785
8786           Example:
8787             [#1] spiralbw 16
8788             [#2]  image.jpg  spiralbw  {[w,h]},1  +warp[0] [1],0,1,1 +warp[2]
8789       [1],2,1,1
8790
8791         spline:
8792             x0[%],y0[%],u0[%],v0[%],x1[%],y1[%],u1[%],v1[%],_opac‐
8793       ity,_color1,...
8794
8795           Draw  specified colored spline curve on selected images (cubic her‐
8796       mite spline).
8797
8798           Default values: 'opacity=1' and 'color1=0'.
8799
8800           Example:
8801             [#1]       image.jpg       repeat       30        {        spline
8802       {u(100)}%,{u(100)}%,{u(-600,600)},{u(-600,600)},{u(100)}%,{u(100)}%,{u(-600,600)},{u(-600,600)},0.6,255
8803       }
8804
8805         tetraedron_shade:
8806             x0,y0,z0,x1,y1,z1,x2,y2,z2,x3,y3,z3,R0,G0,B0,...,R1,G1,B1,...,R2,G2,B2,...,R3,G3,B3,...
8807
8808           Draw  tetraedron  with interpolated colors on selected (volumetric)
8809       images.
8810
8811         t (+):
8812             Shortcut for command 'text'.
8813
8814         text (+):
8815             text,_x[%|~],_y[%|~],_{ font_height[%]>=0 | custom_font  },_opac‐
8816       ity,_color1,...
8817
8818           Draw specified colored text string on selected images.
8819           (equivalent to shortcut command 't').
8820
8821           If  one  of  the  x or y argument ends with a '~', its value is ex‐
8822       pected to be a centering ratio (in [0,1]) rather than a position.
8823           Usual centering ratio  are  {  0=left-justified  |  0.5=centered  |
8824       1=right-justified }.
8825           Sizes  '13'  and  '128'  are special and correspond to binary fonts
8826       (no-antialiasing). Any other font size is rendered with anti-aliasing.
8827           Specifying an empty target image resizes it to new dimensions  such
8828       that the image contains the entire text string.
8829           A  custom  font  can be specified as a variable name that stores an
8830       image list of 256 or 512 items (512 for 256 character sprites + 256 as‐
8831       sociated opacities).
8832
8833           Default  values:  'x=y=0.01~',  'font_height=16',  'opacity=1'  and
8834       'color1=0'.
8835
8836           Example:
8837             [#1] image.jpg resize2dy 600 y=0 repeat 30 { text {2*$>}" :  This
8838       is a nice text, isn't it ?",10,$y,{2*$>},0.9,255 y+={2*$>} }
8839             [#2] 0 text "G'MIC",0,0,23,1,255
8840
8841         to:
8842             Shortcut for command 'text_outline'.
8843
8844         text_outline:
8845             text,_x[%|~],_y[%|~],_font_height[%]>0,_outline>=0,_opac‐
8846       ity,_color1,...
8847
8848           Draw specified colored and outlined text string on selected images.
8849           If one of the x or y argument ends with a '~',  its  value  is  ex‐
8850       pected to be
8851           a centering ratio (in [0,1]) rather than a position.
8852           Usual  centering  ratio  are  {  0=left-justified  | 0.5=centered |
8853       1=right-justified }.
8854
8855           Default  values:  'x=y=0.01~',   'font_height=7.5%',   'outline=2',
8856       'opacity=1', 'color1=color2=color3=255' and 'color4=255'.
8857
8858           Example:
8859             [#1] image.jpg text_outline "Hi there!",10,10,63,3
8860
8861         triangle_shade:
8862             x0,y0,x1,y1,x2,y2,R0,G0,B0,...,R1,G1,B1,...,R2,G2,B2,...
8863
8864           Draw triangle with interpolated colors on selected images.
8865
8866           Example:
8867             [#1]                   image.jpg                   triangle_shade
8868       20,20,400,100,120,200,255,0,0,0,255,0,0,0,255
8869
8870         truchet:
8871             _scale>0,_radius>=0,_pattern_type={ 0=straight | 1=curved }
8872
8873           Fill selected images with random truchet patterns.
8874
8875           Default values: 'scale=32', 'radius=5' and 'pattern_type=1'.
8876
8877           Example:
8878             [#1] 400,300 truchet ,
8879
8880         turbulence:
8881             _radius>0,_octaves={1,2,3...,12},_alpha>0,_differ‐
8882       ence={-10,10},_mode={0,1,2,3}
8883
8884           Render fractal noise or turbulence on selected images.
8885
8886           Default values: 'radius=32', 'octaves=6', 'alpha=3', 'difference=0'
8887       and 'mode=0'.
8888
8889           Example:
8890             [#1] 400,400,1,3 turbulence 16
8891
8892           Tutorial: https://gmic.eu/oldtutorial/_turbulence
8893
8894         yinyang:
8895
8896           Draw a yin-yang symbol on selected images.
8897
8898           Example:
8899             [#1] 400,400 yinyang
8900
8901         12.11. Matrix Computation
8902                ------------------
8903
8904         dijkstra (+):
8905             starting_node>=0,ending_node>=0
8906
8907           Compute minimal distances and paths from specified adjacency matri‐
8908       ces by the Dijkstra algorithm.
8909
8910         eigen (+):
8911
8912           Compute  the eigenvalues and eigenvectors of selected symmetric ma‐
8913       trices or matrix fields.
8914           If one selected image has 3 or 6 channels,  it  is  regarded  as  a
8915       field of 2x2 or 3x3 symmetric matrices,
8916           whose eigen elements are computed at each point of the field.
8917
8918           Example:
8919             [#1] (1,0,0;0,2,0;0,0,3) +eigen
8920             [#2] image.jpg structuretensors blur 2 eigen split[0] c
8921
8922           Tutorial: https://gmic.eu/oldtutorial/_eigen
8923
8924         eye:
8925             _size>0
8926
8927           Insert  an  identity  matrix  of given size at the end of the image
8928       list.
8929
8930           Example:
8931             [#1] eye 3 eye 7 eye 10
8932
8933         invert (+):
8934             _use_LU={ 0=SVD | 1=LU },_lambda>=0
8935
8936           Inverse selected matrices (or compute  Moore-Penrose  pseudoinverse
8937       for non-square matrices).
8938           SVD solver is slower but more precise than LU.
8939           'lambda'  is used only in the Moore-Penrose pseudoinverse, by esti‐
8940       mating A^t.(A^t.A + lambda.Id)^-1.
8941
8942           Default value: 'use_LU=0' and 'lambda=0'.
8943
8944           Example:
8945             [#1] (0,1,0;0,0,1;1,0,0) +invert
8946
8947         orthogonalize:
8948             _mode = { 0=orthogonalize | 1=orthonormalize }
8949
8950           Orthogonalize or orthonormalize selected matrices,  using  Modified
8951       Gram-Schmidt process.
8952
8953           Default value: 'mode=0'.
8954
8955         meigen:
8956             m>=1
8957
8958           Compute  an approximation of the 'm' largest eigenvalues and eigen‐
8959       vectors of selected symmetric matrices,
8960           using         the         Arnoldi         iteration          method
8961       (https://en.wikipedia.org/wiki/Arnoldi_iteration).
8962           A larger 'm' goes with better numerical precision.
8963
8964           Example:
8965             [#1] (1,0,0;0,2,0;0,0,3) +meigen 3
8966
8967         mproj (+):
8968             [dictionary],_method,_max_iter={ 0=auto | >0 },_max_residual>=0
8969
8970           Find best matching projection of selected matrices onto the span of
8971       an over-complete
8972           dictionary D, using the orthogonal projection or  Matching  Pursuit
8973       algorithm.
8974           Selected  images  are  2D-matrices in which each column represent a
8975       signal to project.
8976           '[dictionary]' is a matrix in which each column is  an  element  of
8977       the dictionary D.
8978           'method'  tells  what  projection algorithm must be applied. It can
8979       be:
8980              - 0 = orthogonal projection (least-squares  solution  using  LU-
8981       based solver).
8982              - 1 = matching pursuit.
8983              - 2 = matching pursuit, with a single orthogonal projection step
8984       at the end.
8985              - >=3 = orthogonal matching pursuit where an orthogonal  projec‐
8986       tion step is performed
8987                      every 'method-2' iterations.
8988           'max_iter'  sets  the  max  number of iterations processed for each
8989       signal.
8990           If set to '0' (default), 'max_iter' is equal to the number of  col‐
8991       umns in D.
8992           (only meaningful for matching pursuit and its variants).
8993           'max_residual'  gives a stopping criterion on signal reconstruction
8994       accuracy.
8995           (only meaningful for matching pursuit and its variants).
8996           For each selected image, the result is returned as a matrix W
8997           whose columns correspond to the weights associated to  each  column
8998       of D,
8999           such  that  the matrix product D*W is an approximation of the input
9000       matrix.
9001
9002           Default values: 'method=0', 'max_iter=0' and 'max_residual=1e-6'.
9003
9004         solve (+):
9005             [image],_use_LU={ 0=SVD | 1=LU }
9006
9007           Solve linear system AX = B for selected B-matrices and specified A-
9008       matrix.
9009           If the system is under- or over-determined, the least squares solu‐
9010       tion is returned.
9011
9012           Default value: 'use_LU=0'.
9013
9014           Example:
9015             [#1] (0,1,0;1,0,0;0,0,1) (1;2;3) +solve[-1] [-2]
9016
9017         svd (+):
9018
9019           Compute SVD decomposition of selected matrices.
9020
9021           Example:
9022             [#1] 10,10,1,1,'if(x==y,x+u(-0.2,0.2),0)' +svd
9023
9024         transpose:
9025
9026           Transpose selected matrices.
9027
9028           Example:
9029             [#1] image.jpg +transpose
9030
9031         trisolve (+):
9032             [image]
9033
9034           Solve tridiagonal system AX = B for selected B-vectors  and  speci‐
9035       fied tridiagonal A-matrix.
9036           Tridiagonal  matrix  must be stored as a 3 column vector, where 2nd
9037       column contains the
9038           diagonal coefficients, while 1st and 3rd columns contain  the  left
9039       and right coefficients.
9040
9041           Example:
9042             [#1] (0,0,1;1,0,0;0,1,0) (1;2;3) +trisolve[-1] [-2]
9043
9044         12.12. 3D Meshes
9045                ---------
9046
9047         +3d (+):
9048             Shortcut for command 'add3d'.
9049
9050         add3d (+):
9051             tx,_ty,_tz |
9052             [object3d] |
9053             (no arg)
9054
9055           Shift  selected  3D  objects with specified displacement vector, or
9056       merge them with specified
9057           3D object, or merge all selected 3D objects together.
9058           (equivalent to shortcut command '+3d').
9059
9060           Default values: 'ty=tz=0'.
9061
9062           Example:
9063             [#1]  sphere3d  10  repeat  5   {   +add3d[-1]   10,{u(-10,10)},0
9064       color3d[-1] ${-rgb} } add3d
9065             [#2] repeat 20 { torus3d 15,2 color3d[-1] ${-rgb} mul3d[-1] 0.5,1
9066       if $>%2  rotate3d[-1]  0,1,0,90  fi  add3d[-1]  70  add3d  rotate3d[-1]
9067       0,0,1,18 } double3d 0
9068
9069         animate3d:
9070             nb_frames>0,_step_angle_x,_step_angle_y,_step_angle_z,_zoom_fac‐
9071       tor,0<=_fake_shadow_level<=100,_[background]
9072
9073           Generate 3D animation frames of rotating 3D objects.
9074           Frames are stacked along the z-axis (volumetric image).
9075           Frame size is the same as the size of the '[background]' image  (or
9076       800x800 if no background specified).
9077
9078           Default   values:   'step_angle_x=0',  'step_angle_y=5',  'step_an‐
9079       gle_z=0', 'zoom_factor=1', 'fake_shadow_level=50' and
9080            'background=(undefined)'.
9081
9082         apply_camera3d:
9083             pos_x,pos_y,pos_z,target_x,target_y,target_z,up_x,up_y,up_z
9084
9085           Apply 3D camera matrix to selected 3D objects.
9086
9087           Default values: 'target_x=0', 'target_y=0', 'target_z=0', 'up_x=0',
9088       'up_y=-1' and 'up_z=0'.
9089
9090         apply_matrix3d:
9091             a11,a12,a13,...,a31,a32,a33
9092
9093           Apply specified 3D rotation matrix to selected 3D objects.
9094
9095           Example:
9096             [#1]            torus3d            10,1           +apply_matrix3d
9097       {mul(rot(1,0,1,-15°),[1,0,0,0,2,0,0,0,8],3)} double3d 0
9098
9099         array3d:
9100             size_x>=1,_size_y>=1,_size_z>=1,_offset_x[%],_offset_y[%],_off‐
9101       set_y[%]
9102
9103           Duplicate a 3D object along the X,Y and Z axes.
9104
9105           Default  values: 'size_y=1', 'size_z=1' and 'offset_x=offset_y=off‐
9106       set_z=100%'.
9107
9108           Example:
9109             [#1] torus3d 10,1 +array3d 5,5,5,110%,110%,300%
9110
9111         arrow3d:
9112             x0,y0,z0,x1,y1,z1,_radius[%]>=0,_head_length[%]>=0,_head_ra‐
9113       dius[%]>=0
9114
9115           Input 3D arrow with specified starting and ending 3D points.
9116
9117           Default   values:   'radius=5%',  'head_length=25%'  and  'head_ra‐
9118       dius=15%'.
9119
9120           Example:
9121             [#1]      repeat      10      {      a={$>*2*pi/10}       arrow3d
9122       0,0,0,{cos($a)},{sin($a)},-0.5 } +3d
9123
9124         axes3d:
9125             _size_x,_size_y,_size_z,_font_size>0,_label_x,_label_y,_la‐
9126       bel_z,_is_origin={ 0=no | 1=yes }
9127
9128           Input 3D axes with specified sizes along the  x,y  and  z  orienta‐
9129       tions.
9130
9131           Default   values:  'size_x=size_y=size_z=1',  'font_size=23',  'la‐
9132       bel_x=X', 'label_y=Y', 'label_z=Z' and 'is_origin=1'
9133
9134           Example:
9135             [#1] axes3d ,
9136
9137         boundingbox3d:
9138
9139           Replace selected 3D objects by their 3D bounding boxes.
9140
9141           Example:
9142             [#1] torus3d 100,30 +boundingbox3d +3d[-1] [-2]
9143
9144         box3d:
9145             _size_x,_size_y,_size_z
9146
9147           Input 3D box at (0,0,0), with specified geometry.
9148
9149           Default values: 'size_x=1' and 'size_z=size_y=size_x'.
9150
9151           Example:
9152             [#1] box3d 100,40,30 +primitives3d 1 color3d[-2] ${-rgb}
9153
9154         c3d:
9155             Shortcut for command 'center3d'.
9156
9157         center3d:
9158
9159           Center selected 3D objects at (0,0,0).
9160           (equivalent to shortcut command 'c3d').
9161
9162           Example:
9163             [#1] repeat 100 { circle3d {u(100)},{u(100)},{u(100)},2  }  add3d
9164       color3d[-1] 255,0,0 +center3d color3d[-1] 0,255,0 add3d
9165
9166         chainring3d:
9167             _nb_links>=3,_x_scale>0,_y_scale>0,_z_scale>0
9168
9169           Input 3D chain ring with specified geometry.
9170           'nb_links' should be preferably even.
9171
9172           Default   values:  'nb_links=16',  'x_scale=0.5',  'y_scale=1'  and
9173       'z_scale=1'.
9174
9175           Example:
9176             [#1] chainring3d
9177
9178         circle3d:
9179             _x0,_y0,_z0,_radius>=0
9180
9181           Input 3D circle at specified coordinates.
9182
9183           Default values: 'x0=y0=z0=0' and 'radius=1'.
9184
9185           Example:
9186             [#1]      repeat      500      {      a={$>*pi/250}      circle3d
9187       {cos(3*$a)},{sin(2*$a)},0,{$a/50} color3d[-1] ${-rgb},0.4 } add3d
9188
9189         circles3d:
9190             _radius>=0,_is_outlined={ 0 | 1 }
9191
9192           Convert  specified  3D objects to sets of 3D circles with specified
9193       radius.
9194
9195           Default values: 'radius=1' and 'is_outlined=1'.
9196
9197           Example:
9198             [#1] image.jpg luminance resize2dy 40 threshold 50% * 255  point‐
9199       cloud3d color3d[-1] 255,255,255 circles3d 0.7
9200
9201         col3d:
9202             Shortcut for command 'color3d'.
9203
9204         color3d:
9205             R,_G,_B,_opacity
9206
9207           Set color (and optionally opacity) of selected 3D objects.
9208           (equivalent to shortcut command 'col3d').
9209
9210           Default value: 'B=G=R' and 'opacity=(undefined)'.
9211
9212           Example:
9213             [#1]  torus3d 100,10 double3d 0 repeat 7 { +rotate3d[-1] 1,0,0,20
9214       color3d[-1] ${-rgb} } add3d
9215
9216         colorcube3d:
9217             _is_wireframe={ 0 | 1 }
9218
9219           Input 3D color cube.
9220
9221           Default value: 'is_wireframe=0'.
9222
9223           Example:
9224             [#1] colorcube3d mode3d 2 +primitives3d 1
9225
9226         cone3d:
9227             _radius,_height,_nb_subdivisions>0
9228
9229           Input 3D cone at (0,0,0), with specified geometry.
9230
9231           Default value: 'radius=1','height=1' and 'nb_subdivisions=24'.
9232
9233           Example:
9234             [#1] cone3d 10,40 +primitives3d 1 color3d[-2] ${-rgb}
9235
9236         cubes3d:
9237             _size>=0
9238
9239           Convert specified 3D objects to sets of  3D  cubes  with  specified
9240       size.
9241
9242           Default value: 'size=1'.
9243
9244           Example:
9245             [#1]  image.jpg luminance resize2dy 40 threshold 50% * 255 point‐
9246       cloud3d color3d[-1] 255,255,255 cubes3d 1
9247
9248         cup3d:
9249             _resolution>0
9250
9251           Input 3D cup object.
9252
9253           Default value: 'resolution=128'.
9254
9255           Example:
9256             [#1] cup3d ,
9257
9258         curve3d:
9259             _"x(t)",_"y(t)",_"z(t)",_"r(t)",_resolu‐
9260       tion>1,_tmin,_tmax,_nb_sides>=0,_is_closed_curve={ 0 | 1 }
9261
9262           Input 3D curve with specified parameterization.
9263           If  'r(t)==0'  or 'nb_sides<3', the generated 3D object is composed
9264       of segments only.
9265
9266           Default values: 'x(t)=cos(2*pi*t)',  'y(t)=sin(2*pi*t)',  'z(t)=t',
9267       'r(t)=0.025', 'resolution=128', 'tmin=0', 'tmax=1',
9268            'nb_sides=16' and 'is_closed_curve=0'.
9269
9270           Example:
9271             [#1] curve3d ,
9272
9273         cylinder3d:
9274             _radius,_height,_nb_subdivisions>0
9275
9276           Input 3D cylinder at (0,0,0), with specified geometry.
9277
9278           Default value: 'radius=1','height=1' and 'nb_subdivisions=24'.
9279
9280           Example:
9281             [#1] cylinder3d 10,40 +primitives3d 1 color3d[-2] ${-rgb}
9282
9283         delaunay3d:
9284
9285           Generate 3D Delaunay triangulations from selected images.
9286           One  assumes  that the selected input images are binary images con‐
9287       taining the set of points to mesh.
9288           The output 3D object is a mesh composed of non-oriented triangles.
9289
9290           Example:
9291             [#1] 500,500 noise 0.05,2  eq  1  *  255  +delaunay3d  color3d[1]
9292       255,128,0 dilate_circ[0] 5 to_rgb[0] +object3d[0] [1],0,0,0,1,1 max[-1]
9293       [0]
9294
9295         distribution3d:
9296
9297           Get 3D color distribution of selected images.
9298
9299           Example:
9300             [#1]  image.jpg  distribution3d  colorcube3d  primitives3d[-1]  1
9301       add3d
9302
9303         /3d (+):
9304             Shortcut for command 'div3d'.
9305
9306         div3d (+):
9307             factor |
9308             factor_x,factor_y,_factor_z
9309
9310           Scale  selected  3D  objects isotropically or anisotropically, with
9311       the inverse of specified
9312           factors.
9313           (equivalent to shortcut command '/3d').
9314
9315           Default value: 'factor_z=1'.
9316
9317           Example:
9318             [#1] torus3d 5,2 repeat  5  {  +add3d[-1]  12,0,0  div3d[-1]  1.2
9319       color3d[-1] ${-rgb} } add3d
9320
9321         db3d:
9322             Shortcut for command 'double3d'.
9323
9324         double3d:
9325             _is_double_sided={ 0 | 1 }
9326
9327           Enable/disable double-sided mode for 3D rendering.
9328           (equivalent to shortcut command 'db3d').
9329
9330           Default value: 'is_double_sided=1'.
9331
9332           Example:
9333             [#1]  mode3d  1  repeat  2 { torus3d 100,30 rotate3d[-1] 1,1,0,60
9334       double3d $> snapshot3d[-1] 400 }
9335
9336         elevation3d:
9337             { z-factor | [elevation_map] | 'formula' },base_height={ -1 | >=0
9338       } |
9339             (no arg)
9340
9341           Generate 3D elevation of selected images, opt. with a specified el‐
9342       evation map.
9343           When invoked with (no arg) or 'z-factor', the elevation map is com‐
9344       puted as the pointwise L2 norm of the
9345           pixel values. Otherwise, the elevation map is taken from the speci‐
9346       fied image or formula.
9347
9348           Example:
9349             [#1] image.jpg +blur 5 elevation3d. 0.75
9350             [#2] 128,128,1,3,u(255) plasma 10,3 blur 4 sharpen 10000 n  0,255
9351       elevation3d[-1]
9352       'X=(x-64)/6;Y=(y-64)/6;-100*exp(-(X^2+Y^2)/30)*abs(cos(X)*sin(Y))'
9353
9354         empty3d:
9355
9356           Input empty 3D object.
9357
9358           Example:
9359             [#1] empty3d
9360
9361         extract_textures3d:
9362
9363           Extract texture data from selected 3D objects.
9364
9365           Example:
9366             [#1] image.jpg imagesphere3d 10,10 +extract_textures3d
9367
9368         extrude3d:
9369             _depth>0,_resolution>0,_smoothness[%]>=0
9370
9371           Generate extruded 3D object from selected binary XY-profiles.
9372
9373           Default  values:   'depth=16',   'resolution=1024'   and   'smooth‐
9374       ness=0.5%'.
9375
9376           Example:
9377             [#1] image.jpg threshold 50% extrude3d 16
9378
9379         f3d:
9380             Shortcut for command 'focale3d'.
9381
9382         focale3d:
9383             focale
9384
9385           Set 3D focale.
9386           (equivalent to shortcut command 'f3d').
9387
9388           Set  'focale'  to  0 to enable parallel projection (instead of per‐
9389       spective).
9390           Set negative 'focale' will disable 3D sprite zooming.
9391
9392           Default value: 'focale=700'.
9393
9394           Example:
9395             [#1] repeat 5 { torus3d  100,30  rotate3d[-1]  1,1,0,60  focale3d
9396       {$<*90} snapshot3d[-1] 400 } remove[0]
9397
9398         fov3d:
9399             fov_angle>=0
9400
9401           Set  3D focale to match specified field of vision angle (in degree)
9402       for the latest of the selected image.
9403           Return corresponding focale in status.
9404
9405           Default value: 'fov_angle=30'
9406
9407         gaussians3d:
9408             _size>0,_opacity
9409
9410           Convert selected 3D objects into set of 3D gaussian-shaped sprites.
9411
9412           Example:
9413             [#1] image.jpg r2dy 32 distribution3d gaussians3d 20  colorcube3d
9414       primitives3d[-1] 1 +3d
9415
9416         gmic3d:
9417
9418           Input a 3D G'MIC logo.
9419
9420           Example:
9421             [#1] gmic3d +primitives3d 1
9422
9423         gyroid3d:
9424             _resolution>0,_zoom
9425
9426           Input 3D gyroid at (0,0,0), with specified resolution.
9427
9428           Default values: 'resolution=32' and 'zoom=5'.
9429
9430           Example:
9431             [#1] gyroid3d 48 +primitives3d 1
9432
9433         histogram3d:
9434
9435           Get 3D color histogram of selected images.
9436
9437           Example:
9438             [#1]  image.jpg  resize2dx  64 histogram3d circles3d 3 opacity3d.
9439       0.75 colorcube3d primitives3d[-1] 1 add3d
9440
9441         image6cube3d:
9442
9443           Generate 3D mapped cubes from 6-sets of selected images.
9444
9445           Example:
9446             [#1] image.jpg animate flower,"30,0","30,5",6 image6cube3d
9447
9448         imageblocks3d:
9449             _maximum_elevation,_smoothness[%]>=0
9450
9451           Generate 3D blocks from selected images.
9452           Transparency of selected images is taken into account.
9453
9454           Default values: 'maximum_elevation=10' and 'smoothness=0'.
9455
9456           Example:
9457             [#1] image.jpg resize2dy 32 imageblocks3d -20 mode3d 3
9458
9459         imagecube3d:
9460
9461           Generate 3D mapped cubes from selected images.
9462
9463           Example:
9464             [#1] image.jpg imagecube3d
9465
9466         imageplane3d:
9467
9468           Generate 3D mapped planes from selected images.
9469
9470           Example:
9471             [#1] image.jpg imageplane3d
9472
9473         imagepyramid3d:
9474
9475           Generate 3D mapped pyramids from selected images.
9476
9477           Example:
9478             [#1] image.jpg imagepyramid3d
9479
9480         imagerubik3d:
9481             _xy_tiles>=1,0<=xy_shift<=100,0<=z_shift<=100
9482
9483           Generate 3D mapped rubik's cubes from selected images.
9484
9485           Default values: 'xy_tiles=3', 'xy_shift=5' and 'z_shift=5'.
9486
9487           Example:
9488             [#1] image.jpg imagerubik3d ,
9489
9490         imagesphere3d:
9491             _resolution1>=3,_resolution2>=3
9492
9493           Generate 3D mapped sphere from selected images.
9494
9495           Default values: 'resolution1=32' and 'resolutions2=16'.
9496
9497           Example:
9498             [#1] image.jpg imagesphere3d 32,16
9499
9500         isoline3d (+):
9501             isovalue[%] |
9502             'formula',value,_x0,_y0,_x1,_y1,_size_x>0[%],_size_y>0[%]
9503
9504           Extract 3D isolines with specified value from  selected  images  or
9505       from specified formula.
9506
9507           Default values: 'x0=y0=-3', 'x1=y1=3' and 'size_x=size_y=256'.
9508
9509           Example:
9510             [#1] image.jpg blur 1 isoline3d 50%
9511             [#2] isoline3d 'X=x-w/2;Y=y-h/2;(X^2+Y^2)%20',10,-10,-10,10,10
9512
9513         isosurface3d (+):
9514             isovalue[%] |
9515             'for‐
9516       mula',value,_x0,_y0,_z0,_x1,_y1,_z1,_size_x>0[%],_size_y>0[%],_size_z>0[%]
9517
9518           Extract 3D isosurfaces with specified value from selected images or
9519       from specified formula.
9520
9521           Default      values:      'x0=y0=z0=-3',      'x1=y1=z1=3'      and
9522       'size_x=size_y=size_z=32'.
9523
9524           Example:
9525             [#1] image.jpg resize2dy 128 luminance threshold 50% expand_z 2,0
9526       blur 1 isosurface3d 50% mul3d 1,1,30
9527             [#2] isosurface3d 'x^2+y^2+abs(z)^abs(4*cos(x*y*z*3))',3
9528
9529         label3d:
9530             "text",font_height>=0,_opacity,_color1,...
9531
9532           Generate 3D text label.
9533
9534           Default     values:     'font_height=13',      'opacity=1'      and
9535       'color=255,255,255'.
9536
9537         label_points3d:
9538             _label_size>0,_opacity
9539
9540           Add a numbered label to all vertices of selected 3D objects.
9541
9542           Default values: 'label_size=13' and 'opacity=0.8'.
9543
9544           Example:
9545             [#1] torus3d 100,40,6,6 label_points3d 23,1 mode3d 1
9546
9547         lathe3d:
9548             _resolution>0,_smoothness[%]>=0,_max_angle>=0
9549
9550           Generate 3D object from selected binary XY-profiles.
9551
9552           Default  values:  'resolution=128',  'smoothness=0.5%' and 'max_an‐
9553       gle=361'.
9554
9555           Example:
9556             [#1] 300,300 rand -1,1 blur 40 sign normalize 0,255 lathe3d ,
9557
9558         l3d (+):
9559             Shortcut for command 'light3d'.
9560
9561         light3d (+):
9562             position_x,position_y,position_z |
9563             [texture] |
9564             (no arg)
9565
9566           Set the light coordinates or the light texture for 3D rendering.
9567           (equivalent to shortcut command 'l3d').
9568
9569           (no arg) resets the 3D light to default.
9570
9571           Example:
9572             [#1] torus3d 100,30 double3d 0 specs3d 1.2  repeat  5  {  light3d
9573       {$>*100},0,-300 +snapshot3d[0] 400 } remove[0]
9574
9575         line3d:
9576             x0,y0,z0,x1,y1,z1
9577
9578           Input 3D line at specified coordinates.
9579
9580           Example:
9581             [#1]       repeat       100       {      a={$>*pi/50}      line3d
9582       0,0,0,{cos(3*$a)},{sin(2*$a)},0 color3d. ${-rgb} } add3d
9583
9584         lissajous3d:
9585             resolution>1,a,A,b,B,c,C
9586
9587           Input     3D     lissajous      curves      'x(t)=sin(a*t+A*2*pi)',
9588       'y(t)=sin(b*t+B*2*pi)', 'z(t)=sin(c*t+C*2*pi)'.
9589
9590           Default  values:  'resolution=1024',  'a=2',  'A=0',  'b=1', 'B=0',
9591       'c=0' and 'C=0'.
9592
9593           Example:
9594             [#1] lissajous3d ,
9595
9596         m3d:
9597             Shortcut for command 'mode3d'.
9598
9599         mode3d:
9600             _mode
9601
9602           Set static 3D rendering mode.
9603           (equivalent to shortcut command 'm3d').
9604
9605           'mode' can be { -1=bounding-box | 0=dots | 1=wireframe |  2=flat  |
9606       3=flat-shaded | 4=gouraud-shaded | 5=phong-shaded }.");
9607           Bounding-box  mode  ('mode==-1') is active only for the interactive
9608       3D viewer.
9609
9610           Default value: 'mode=4'.
9611
9612           Example:
9613             [#1] (0,1,2,3,4,5) double3d 0  repeat  w  {  torus3d  100,30  ro‐
9614       tate3d[-1] 1,1,0,60 mode3d {0,@$>} snapshot3d[-1] 300 } remove[0]
9615
9616         md3d:
9617             Shortcut for command 'moded3d'.
9618
9619         moded3d:
9620             _mode
9621
9622           Set dynamic 3D rendering mode for interactive 3D viewer.
9623           (equivalent to shortcut command 'md3d').
9624
9625           'mode'  can  be { -1=bounding-box | 0=dots | 1=wireframe | 2=flat |
9626       3=flat-shaded | 4=gouraud-shaded | 5=phong-shaded }.
9627
9628           Default value: 'mode=-1'.
9629
9630         *3d (+):
9631             Shortcut for command 'mul3d'.
9632
9633         mul3d (+):
9634             factor |
9635             factor_x,factor_y,_factor_z
9636
9637           Scale selected 3D objects isotropically  or  anisotropically,  with
9638       specified factors.
9639           (equivalent to shortcut command '*3d').
9640
9641           Default value: 'factor_z=1'.
9642
9643           Example:
9644             [#1]  torus3d  5,2  repeat  5  {  +add3d[-1] 10,0,0 mul3d[-1] 1.2
9645       color3d[-1] ${-rgb} } add3d
9646
9647         n3d:
9648             Shortcut for command 'normalize3d'.
9649
9650         normalize3d:
9651
9652           Normalize selected 3D objects to unit size.
9653           (equivalent to shortcut command 'n3d').
9654
9655           Example:
9656             [#1] repeat  100  {  circle3d  {u(3)},{u(3)},{u(3)},0.1  }  add3d
9657       color3d[-1] 255,0,0 +normalize3d[-1] color3d[-1] 0,255,0 add3d
9658
9659         o3d:
9660             Shortcut for command 'opacity3d'.
9661
9662         opacity3d:
9663             opacity
9664
9665           Set opacity of selected 3D objects.
9666           (equivalent to shortcut command 'o3d').
9667
9668           Example:
9669             [#1]  torus3d 100,10 double3d 0 repeat 7 { +rotate3d[-1] 1,0,0,20
9670       opacity3d[-1] {u} } add3d
9671
9672         parametric3d:
9673             _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,_smooth‐
9674       ness>=0,_isovalue>=0
9675
9676           Input   3D  object  from  specified  parametric  surface  '(a,b)  ⟶
9677       (x(a,b),y(a,b),z(a,b))'.
9678
9679           Default   values:   'x=(2+cos(b))*sin(a)',   'y=(2+cos(b))*cos(a)',
9680       'c=sin(b)', 'amin=-pi', 'amax=pi', 'bmin=-pi', 'bmax=pi',
9681            'res_a=512',     'res_b=res_a',     'res_x=64',     'res_y=res_x',
9682       'res_z=res_y', 'smoothness=2%' and 'isovalue=10%'.
9683
9684           Example:
9685             [#1] parametric3d ,
9686
9687         pca_patch3d:
9688             _patch_size>0,_M>0,_N>0,_normalize_input={  0  |   1   },_normal‐
9689       ize_output={ 0 | 1 },_lambda_xy
9690
9691           Get 3D patch-pca representation of selected images.
9692           The  3D  patch-pca  is estimated from M patches on the input image,
9693       and displayed as a cloud of N 3D points.
9694
9695           Default values: 'patch_size=7', 'M=1000', 'N=3000',  'normalize_in‐
9696       put=1', 'normalize_output=0', and 'lambda_xy=0'.
9697
9698           Example:
9699             [#1] image.jpg pca_patch3d 7
9700
9701         plane3d:
9702             _size_x,_size_y,_nb_subdivisions_x>0,_nb_subdisivions_y>0
9703
9704           Input 3D plane at (0,0,0), with specified geometry.
9705
9706           Default   values:   'size_x=1',  'size_y=size_x'  and  'nb_subdivi‐
9707       sions_x=nb_subdivisions_y=24'.
9708
9709           Example:
9710             [#1] plane3d 50,30 +primitives3d 1 color3d[-2] ${-rgb}
9711
9712         point3d:
9713             x0,y0,z0
9714
9715           Input 3D point at specified coordinates.
9716
9717           Example:
9718             [#1]      repeat      1000      {      a={$>*pi/500}      point3d
9719       {cos(3*$a)},{sin(2*$a)},0 color3d[-1] ${-rgb} } add3d
9720
9721         pointcloud3d:
9722
9723           Convert selected planar or volumetric images to 3D point clouds.
9724
9725           Example:
9726             [#1]  image.jpg  luminance  resize2dy  100  threshold 50% mul 255
9727       pointcloud3d color3d[-1] 255,255,255
9728
9729         pose3d:
9730             p1,...,p12
9731
9732           Apply 3D pose matrix to selected 3D objects.
9733
9734           Example:
9735             [#1]              torus3d              100,20              pose3d
9736       0.152437,1.20666,-0.546366,0,-0.535962,0.559129,1.08531,0,1.21132,0.0955431,0.548966,0,0,0,-206,1
9737       snapshot3d 400
9738
9739         p3d:
9740             Shortcut for command 'primitives3d'.
9741
9742         primitives3d:
9743             mode
9744
9745           Convert primitives of selected 3D objects.
9746           (equivalent to shortcut command 'p3d').
9747
9748           'mode' can be { 0=points | 1=outlines | 2=non-textured }.
9749
9750           Example:
9751             [#1] sphere3d 30 primitives3d 1 torus3d 50,10 color3d[-1] ${-rgb}
9752       add3d
9753
9754         projections3d:
9755             _x[%],_y[%],_z[%],_is_bounding_box={ 0 | 1 }
9756
9757           Generate  3D  xy,xz,yz  projection planes from specified volumetric
9758       images.
9759
9760         pyramid3d:
9761             width,height
9762
9763           Input 3D pyramid at (0,0,0), with specified geometry.
9764
9765           Example:
9766             [#1] pyramid3d 100,-100 +primitives3d 1 color3d[-2] ${-rgb}
9767
9768         quadrangle3d:
9769             x0,y0,z0,x1,y1,z1,x2,y2,z2,x3,y3,z3
9770
9771           Input 3D quadrangle at specified coordinates.
9772
9773           Example:
9774             [#1] quadrangle3d -10,-10,10,10,-10,10,10,10,10,-10,10,10  repeat
9775       10 { +rotate3d[-1] 0,1,0,30 color3d[-1] ${-rgb},0.6 } add3d mode3d 2
9776
9777         random3d:
9778             nb_points>=0
9779
9780           Input random 3D point cloud in [0,1]^3.
9781
9782           Example:
9783             [#1] random3d 100 circles3d 0.1 opacity3d 0.5
9784
9785         rv3d:
9786             Shortcut for command 'reverse3d'.
9787
9788         reverse3d:
9789
9790           Reverse primitive orientations of selected 3D objects.
9791           (equivalent to shortcut command 'rv3d').
9792
9793           Example:
9794             [#1] torus3d 100,40 double3d 0 +reverse3d
9795
9796         r3d (+):
9797             Shortcut for command 'rotate3d'.
9798
9799         rotate3d (+):
9800             u,v,w,angle
9801
9802           Rotate selected 3D objects around specified axis with specified an‐
9803       gle (in deg.).
9804           (equivalent to shortcut command 'r3d').
9805
9806           Example:
9807             [#1] torus3d 100,10 double3d 0 repeat 7 { +rotate3d[-1]  1,0,0,20
9808       } add3d
9809
9810         rotation3d:
9811             u,v,w,angle
9812
9813           Input 3x3 rotation matrix with specified axis and angle (in deg).
9814
9815           Example:
9816             [#1] rotation3d 1,0,0,0 rotation3d 1,0,0,90 rotation3d 1,0,0,180
9817
9818         sierpinski3d:
9819             _recursion_level>=0,_width,_height
9820
9821           Input 3D Sierpinski pyramid.
9822
9823           Example:
9824             [#1] sierpinski3d 3,100,-100 +primitives3d 1 color3d[-2] ${-rgb}
9825
9826         size3d:
9827
9828           Return bounding box size of the last selected 3D object.
9829
9830         skeleton3d:
9831             _metric,_frame_type={ 0=squares | 1=diamonds | 2=circles | 3=auto
9832       },_skeleton_opacity,_frame_opacity,_is_frame_wireframe={ 0 | 1 }
9833
9834           Build 3D skeletal structure object from 2d binary shapes located in
9835       selected images.
9836           'metric' can be { 0=chebyshev | 1=manhattan | 2=euclidean }.
9837
9838           Default  values:  'metric=2',  'bones_type=3', 'skeleton_opacity=1'
9839       and 'frame_opacity=0.1'.
9840
9841           Example:
9842             [#1] shape_cupid 480 +skeleton3d ,
9843
9844         snapshot3d:
9845             _size>0,_zoom>=0,_backgroundR,_backgroundG,_backgroundB,_back‐
9846       groundA |
9847             [background_image],zoom>=0
9848
9849           Take 2D snapshots of selected 3D objects.
9850           Set 'zoom' to 0 to disable object auto-scaling.
9851
9852           Default  values:  'size=512', 'zoom=1' and '[background_image]=(de‐
9853       fault)'.
9854
9855           Example:
9856             [#1]    torus3d    100,20    rotate3d     1,1,0,60     snapshot3d
9857       400,1.2,128,64,32
9858             [#2]  torus3d  100,20  rotate3d  1,1,0,60 sample ? +snapshot3d[0]
9859       [1],1.2
9860
9861         sl3d:
9862             Shortcut for command 'specl3d'.
9863
9864         specl3d:
9865             value>=0
9866
9867           Set lightness of 3D specular light.
9868           (equivalent to shortcut command 'sl3d').
9869
9870           Default value: 'value=0.15'.
9871
9872           Example:
9873             [#1] (0,0.3,0.6,0.9,1.2) repeat w { torus3d  100,30  rotate3d[-1]
9874       1,1,0,60  color3d[-1]  255,0,0 specl3d {0,@$>} snapshot3d[-1] 400 } re‐
9875       move[0]
9876
9877         ss3d:
9878             Shortcut for command 'specs3d'.
9879
9880         specs3d:
9881             value>=0
9882
9883           Set shininess of 3D specular light.
9884           (equivalent to shortcut command 'ss3d').
9885
9886           Default value: 'value=0.8'.
9887
9888           Example:
9889             [#1] (0,0.3,0.6,0.9,1.2) repeat w { torus3d  100,30  rotate3d[-1]
9890       1,1,0,60  color3d[-1]  255,0,0 specs3d {0,@$>} snapshot3d[-1] 400 } re‐
9891       move[0]
9892
9893         sphere3d:
9894             radius,_nb_recursions!=0 |
9895             radius,_nb_phi>=3,_nb_theta>=3
9896
9897           Input 3D sphere at (0,0,0), with specified geometry.
9898            * If 2 arguments are specified:
9899              -  If 'nb_recursions>0', the sphere is generated using recursive
9900       subdivisions of an icosahedron.
9901              -  If 'nb_recursions<0', the sphere is generated using recursive
9902       subdividions of a cube.
9903            * If 3 arguments are specified,  the  sphere  is  generated  using
9904       spherical coordinates discretization.
9905
9906           Default value: 'nb_recursions=3'.
9907
9908           Example:
9909             [#1] sphere3d 100 +primitives3d 1 color3d[-2] ${-rgb}
9910
9911         spherical3d:
9912             "radius_function(phi,theta)",_nb_recursions!=0 |
9913             "radius_function(phi,theta)",_nb_phi>=3,_nb_theta>=3
9914
9915           Input 3D spherical object at (0,0,0), with specified geometry.
9916           Second and third arguments are the same as in command sphere3d.
9917
9918           Default values: 'nb_recursions=5'.
9919
9920           Example:
9921             [#1]   spherical3d  "abs(1+0.5*cos(3*phi)*sin(4*theta))"  +primi‐
9922       tives3d 1
9923
9924         spline3d:
9925             x0[%],y0[%],z0[%],u0[%],v0[%],w0[%],x1[%],y1[%],z1[%],u1[%],v1[%],w1[%],_nb_ver‐
9926       tices>=2
9927
9928           Input 3D spline with specified geometry.
9929
9930           Default values: 'nb_vertices=128'.
9931
9932           Example:
9933             [#1]           repeat           100           {          spline3d
9934       {u},{u},{u},{u},{u},{u},{u},{u},{u},{u},{u},{u},128 color3d[-1] ${-rgb}
9935       } box3d 1 primitives3d[-1] 1 add3d
9936
9937         s3d:
9938             Shortcut for command 'split3d'.
9939
9940         split3d:
9941
9942           Split selected 3D objects into feature vectors :
9943           { header, sizes, vertices, primitives, colors, opacities }.
9944           (equivalent to shortcut command 's3d').
9945
9946           To  recreate the 3D object, append all produced images along the y-
9947       axis (with command 'append y').
9948
9949           Example:
9950             [#1] box3d 100 +split3d
9951
9952         sprite3d:
9953
9954           Convert selected images as 3D sprites.
9955           Selected images with alpha channels are managed.
9956
9957           Example:
9958             [#1] image.jpg sprite3d
9959
9960         sprites3d:
9961             [sprite],_sprite_has_alpha_channel={ 0 | 1 }
9962
9963           Convert selected 3D objects as a sprite cloud.
9964           Set 'sprite_has_alpha_channel' to 1 to make the last channel of the
9965       selected sprite be a transparency mask.
9966
9967           Default value: 'mask_has_alpha_channel=0'.
9968
9969           Example:
9970             [#1]  torus3d  100,20 image.jpg resize2dy[-1] 64 100%,100% gauss‐
9971       ian[-1] 30%,30% *[-1] 255  append[-2,-1]  c  +sprites3d[0]  [1],1  dis‐
9972       play_rgba[-2]
9973
9974         star3d:
9975             _nb_branches>0,0<=_thickness<=1
9976
9977           Input 3D star at position '(0,0,0)', with specified geometry.
9978
9979           Default values: 'nb_branches=5' and 'thickness=0.38'.
9980
9981           Example:
9982             [#1] star3d , +primitives3d 1 color3d[-2] ${-rgb}
9983
9984         streamline3d (+):
9985             x[%],y[%],z[%],_L>=0,_dl>0,_interpolation,_is_backward={  0  |  1
9986       },_is_oriented={ 0 | 1 } |
9987             'formula',x,y,z,_L>=0,_dl>0,_interpolation,_is_backward={ 0  |  1
9988       },_is_oriented={ 0 | 1 }
9989
9990           Extract  3D  streamlines from selected vector fields or from speci‐
9991       fied formula.
9992           'interpolation' can be { 0=nearest integer | 1=1st-order  |  2=2nd-
9993       order | 3=4th-order }.
9994
9995           Default  values:  'dl=0.1',  'interpolation=2', 'is_backward=0' and
9996       'is_oriented=0'.
9997
9998           Example:
9999             [#1] 100,100,100,3 rand -10,10  blur  3  repeat  300  {  +stream‐
10000       line3d[0] {u(100)},{u(100)},{u(100)},1000,1,1 color3d[-1] ${-rgb} } re‐
10001       move[0] box3d 100 primitives3d[-1] 1 add3d
10002
10003         -3d (+):
10004             Shortcut for command 'sub3d'.
10005
10006         sub3d (+):
10007             tx,_ty,_tz
10008
10009           Shift selected 3D objects with the opposite of specified  displace‐
10010       ment vector.
10011           (equivalent to shortcut command '3d').
10012
10013           Default values: 'ty=tz=0'.
10014
10015           Example:
10016             [#1]   sphere3d   10   repeat  5  {  +sub3d[-1]  10,{u(-10,10)},0
10017       color3d[-1] ${-rgb} } add3d
10018
10019         subdivide3d:
10020
10021           Subdivide primitives of selected 3D objects.
10022
10023         superformula3d:
10024             resolution>1,m>=1,n1,n2,n3
10025
10026           Input 2D superformula curve as a 3D object.
10027
10028           Default  values:  'resolution=1024',  'm=8',  'n1=1',  'n2=5'   and
10029       'n3=8'.
10030
10031           Example:
10032             [#1] superformula3d ,
10033
10034         surfels3d:
10035             0<=_left_right_attenuation<=1,0<=_top_bottom_attenua‐
10036       tion<=1,0<=_closer_further_attenuation<=1
10037
10038           Convert selected images to 3D objects composed of 3D surfels (or 2D
10039       edgels for 2D images).
10040           The binary shape is composed of all non-zero voxels.
10041           The  resulting  3D  object is colored according to the color of non
10042       zero voxels.
10043
10044           Default  values:  'left_right_attenuation=1',  'top_bottom_attenua‐
10045       tion=1' and 'closer_further_attenuation=1'.
10046
10047           Example:
10048             [#1]  100,100,100  =  1,40%,40%,40% = 1,60%,60%,60% distance 1 lt
10049       30% blur 3 gt 50% surfels3d 0.5,0.75,1
10050
10051         tensors3d:
10052             _radius_factor>=0,_shape={ 0=box | >=N=ellipsoid },_radius_min>=0
10053
10054           Generate 3D tensor fields from selected images.
10055           when 'shape'>0, it gives the ellipsoid shape precision.
10056
10057           Default values: 'radius_factor=1', 'shape=2' and 'radius_min=0.05'.
10058
10059           Example:
10060             [#1] 6,6,6,9,"U = [x,y,z] - [w,h,d]/2; U/=norm(U);  mul(U,U,3)  +
10061       0.3*eye(3)" tensors3d 0.8
10062
10063         text_pointcloud3d:
10064             _"text1",_"text2",_smoothness
10065
10066           Input 3D text pointcloud from the two specified strings.
10067
10068           Default   values:  'text1="text1"',  'text2="text2"'  and  'smooth‐
10069       ness=1'.
10070
10071           Example:
10072             [#1] text_pointcloud3d "G'MIC","Rocks!"
10073
10074         text3d:
10075             text,_font_height>0,_depth>0,_smoothness
10076
10077           Input a 3D text object from specified text.
10078
10079           Default values: 'font_height=53', 'depth=10' and 'smoothness=1.5'.
10080
10081           Example:
10082             [#1] text3d "G'MIC as a0D logo!"
10083
10084         t3d:
10085             Shortcut for command 'texturize3d'.
10086
10087         texturize3d:
10088             [ind_texture],_[ind_coords]
10089
10090           Texturize selected 3D objects with specified  texture  and  coordi‐
10091       nates.
10092           (equivalent to shortcut command 't3d').
10093
10094           When  '[ind_coords]'  is  omitted, default XY texture projection is
10095       performed.
10096
10097           Default value: 'ind_coords=(undefined)'.
10098
10099           Example:
10100             [#1] image.jpg torus3d 100,30 texturize3d[-1] [-2] keep[-1]
10101
10102         torus3d:
10103             _radius1,_radius2,_nb_subdivisions1>2,_nb_subdivisions2>2
10104
10105           Input 3D torus at (0,0,0), with specified geometry.
10106
10107           Default values: 'radius1=1',  'radius2=0.3',  'nb_subdivisions1=24'
10108       and 'nb_subdivisions2=12'.
10109
10110           Example:
10111             [#1] torus3d 10,3 +primitives3d 1 color3d[-2] ${-rgb}
10112
10113         triangle3d:
10114             x0,y0,z0,x1,y1,z1,x2,y2,z2
10115
10116           Input 3D triangle at specified coordinates.
10117
10118           Example:
10119             [#1]      repeat      100      {      a={$>*pi/50}     triangle3d
10120       0,0,0,0,0,3,{cos(3*$a)},{sin(2*$a)},0 color3d[-1] ${-rgb} } add3d
10121
10122         volume3d:
10123
10124           Transform selected 3D volumetric images as 3D parallelepipedic  ob‐
10125       jects.
10126
10127           Example:
10128             [#1] image.jpg animate blur,0,5,30 append z volume3d
10129
10130         voxelize3d:
10131             _max_resolution>0,_fill_interior={ 0 | 1 },_preserve_colors={ 0 |
10132       1 }
10133
10134           Convert selected 3D objects as 3D volumetric images of binary  vox‐
10135       els, using 3D mesh rasterization.
10136
10137           Default  values:  'max_resolution=128', 'fill_interior=1' and 'pre‐
10138       serve_colors=0'.
10139
10140         weird3d:
10141             _resolution>0
10142
10143           Input 3D weird object at (0,0,0), with specified resolution.
10144
10145           Default value: 'resolution=32'.
10146
10147           Example:
10148             [#1] weird3d 48 +primitives3d 1 color3d[-2] ${-rgb}
10149
10150         12.13. Flow Control
10151                ------------
10152
10153         ap:
10154             Shortcut for command 'apply_parallel'.
10155
10156         apply_parallel:
10157             "command"
10158
10159           Apply specified command on each of the selected images,  by  paral‐
10160       lelizing it for all image of the list.
10161           (equivalent to shortcut command 'ap').
10162
10163           Example:
10164             [#1] image.jpg +mirror x +mirror y apply_parallel "blur 3"
10165
10166         apc:
10167             Shortcut for command 'apply_parallel_channels'.
10168
10169         apply_parallel_channels:
10170             "command"
10171
10172           Apply  specified  command on each of the selected images, by paral‐
10173       lelizing it for all channel
10174           of the images independently.
10175           (equivalent to shortcut command 'apc').
10176
10177           Example:
10178             [#1] image.jpg apply_parallel_channels "blur 3"
10179
10180         apo:
10181             Shortcut for command 'apply_parallel_overlap'.
10182
10183         apply_parallel_overlap:
10184             "command",overlap[%],nb_threads={ 0=auto | 1 | 2 | 4 | 8 | 16 }
10185
10186           Apply specified command on each of the selected images,  by  paral‐
10187       lelizing it on 'nb_threads'
10188           overlapped sub-images.
10189           (equivalent to shortcut command 'apo').
10190
10191           'nb_threads' must be a power of 2.
10192
10193           Default values: 'overlap=0','nb_threads=0'.
10194
10195           Example:
10196             [#1] image.jpg +apply_parallel_overlap "smooth 500,0,1",1
10197
10198         at:
10199             Shortcut for command 'apply_tiles'.
10200
10201         apply_tiles:
10202             "com‐
10203       mand",_tile_width[%]>0,_tile_height[%]>0,_tile_depth[%]>0,_over‐
10204       lap_width[%]>=0,_overlap_height[%]>=0,_overlap_depth[%]>=0,_bound‐
10205       ary_conditions={ 0=dirichlet | 1=neumann
10206               | 2=periodic | 3=mirror }
10207
10208           Apply specified command on each tile (neighborhood) of the selected
10209       images, eventually with overlapping tiles.
10210           (equivalent to shortcut command 'at').
10211
10212           Default    values:   'tile_width=tile_height=tile_depth=10%','over‐
10213       lap_width=overlap_height=overlap_depth=0' and 'boundary_conditions=1'.
10214
10215           Example:
10216             [#1]  image.jpg  +equalize[0]   256   +apply_tiles[0]   "equalize
10217       256",16,16,1,50%,50%
10218
10219         apply_timeout:
10220             "command",_timeout={ 0=no timeout | >0=with specified timeout (in
10221       seconds) }
10222
10223           Apply a command with a timeout.
10224           Set variable '$_is_timeout' to '1' if timeout occurred, '0'  other‐
10225       wise.
10226
10227           Default value: 'timeout=20'.
10228
10229         check (+):
10230             condition
10231
10232           Evaluate specified condition and display an error message if evalu‐
10233       ated to false.
10234
10235         check3d (+):
10236             _is_full_check={ 0 | 1 }
10237
10238           Check validity of selected 3D vector objects, and display an  error
10239       message
10240           if one of the selected images is not a valid 3D vector object.
10241           Full 3D object check is slower but more precise.
10242
10243           Default value: 'is_full_check=1'.
10244
10245         continue (+):
10246
10247           Go  to end of current 'do...while', 'for...done', 'foreach...done',
10248       'local...done' or 'repeat...done' block.
10249
10250           Example:
10251             [#1] image.jpg repeat 10 blur 1 if 1==1  continue  fi  deform  10
10252       done
10253
10254         break (+):
10255
10256           Break  current  'do...while',  'for...done', 'foreach...done', 'lo‐
10257       cal...done' or 'repeat...done' block.
10258
10259           Example:
10260             [#1] image.jpg repeat 10 blur 1 if 1==1 break fi deform 10 done
10261
10262         do (+):
10263
10264           Start a 'do...while' block.
10265
10266           Example:
10267             [#1] image.jpg luminance i={ia+2} do set  255,{u(100)}%,{u(100)}%
10268       while ia<$i
10269
10270         } (+):
10271
10272           Equivalent  to  'done' if it ends a 'for { .. }', 'foreach { .. }',
10273       'local { .. }' or a 'repeat { .. }' block.
10274           Otherwise, close the corresponding '{ .. }' code block.
10275
10276         done (+):
10277
10278           End a 'for/foreach/local/repeat...done' block, and go to associated
10279       'for/foreach/repeat' if iterations remain.
10280           (equivalent to shortcut command '}').
10281
10282         elif (+):
10283             condition
10284
10285           Start  a  'elif...[else]...fi' block if previous 'if' was not veri‐
10286       fied
10287           and test if specified condition holds
10288           'condition' is a mathematical expression, whose evaluation  is  in‐
10289       terpreted as { 0=false | other=true }..
10290
10291           Tutorial: https://gmic.eu/tutorial/iffi
10292
10293         else (+):
10294
10295           Execute  following  commands  if previous 'if' or 'elif' conditions
10296       failed.
10297
10298           Tutorial: https://gmic.eu/tutorial/iffi
10299
10300         fi (+):
10301
10302           End a 'if...[elif]...[else]...fi' block.
10303           (equivalent to shortcut command 'fi').
10304
10305           Tutorial: https://gmic.eu/tutorial/iffi
10306
10307         error (+):
10308             message
10309
10310           Print specified error message on the standard  error  (stderr)  and
10311       exit interpreter, except
10312           if error is caught by a 'onfail' command.
10313           Command  selection  (if any) stands for displayed call stack subset
10314       instead of image indices.
10315
10316         eval (+):
10317             expression
10318
10319           Evaluate specified math expression.
10320            * If no command selection is specified, the expression  is  evalu‐
10321       ated once and its result is set to status.
10322            * If command selection is specified, the evaluation is looped over
10323       selected images. Status is unchanged. In this case, 'eval'  is  similar
10324       to fill without
10325           assigning the image values.
10326
10327         x (+):
10328             Shortcut for command 'exec'.
10329
10330         exec (+):
10331             _is_verbose={ 0 | 1 },"command"
10332
10333           Execute external command using a system call.
10334           The status value is then set to the error code returned by the sys‐
10335       tem call.
10336           If 'is_verbose=1', the executed command is  allowed  to  output  on
10337       stdout/stderr.
10338           (equivalent to shortcut command 'x').
10339
10340           Default value: 'is_verbose=1'.
10341
10342         xo:
10343             Shortcut for command 'exec_out'.
10344
10345         exec_out:
10346             _mode,"command"
10347
10348           Execute  external command using a system call, and return resulting
10349       'stdout' and/or 'stderr'.
10350           'mode' can be { 0=stdout | 1=stderr | 2=stdout+stderr }.
10351
10352         for (+):
10353             condition
10354
10355           Start a 'for...done' block.
10356
10357           Example:
10358             [#1] image.jpg resize2dy 32 400,400,1,3 x=0 for  $x<400  image[1]
10359       [0],$x,$x x+=40 done
10360
10361         foreach (+):
10362
10363           Start  a  'foreach...done'  block, that iterates over all images in
10364       the selection, with a separate local environment for each one.
10365
10366           Example:
10367             [#1] sample colorful,earth,duck,dog foreach[^2] +blur 10 sub nor‐
10368       malize 0,255 done
10369
10370         if (+):
10371             condition
10372
10373           Start  a  'if...[elif]...[else]...fi'  block  and test if specified
10374       condition holds.
10375           'condition' is a mathematical expression, whose evaluation  is  in‐
10376       terpreted as { 0=false | other=true }.
10377
10378           Example:
10379             [#1]  image.jpg  if ia<64 add 50% elif ia<128 add 25% elif ia<192
10380       sub 25% else sub 50% fi cut 0,255
10381
10382           Tutorial: https://gmic.eu/tutorial/iffi
10383
10384         l (+):
10385             Shortcut for command 'local'.
10386
10387         local (+):
10388
10389           Start a 'local...[onfail]...done' block, with selected images.
10390           (equivalent to shortcut command 'l').
10391
10392           Example:
10393             [#1] image.jpg local[] 300,300,1,3 rand[0] 0,255 blur  4  sharpen
10394       1000 done
10395             [#2] image.jpg +local repeat 3 { deform 20 } done
10396
10397           Tutorial: https://gmic.eu/oldtutorial/_local
10398
10399         mutex (+):
10400             index,_action={ 0=unlock | 1=lock }
10401
10402           Lock or unlock specified mutex for multi-threaded programming.
10403           A locked mutex can be unlocked only by the same thread. All mutexes
10404       are unlocked by default.
10405           'index' designates the mutex index, in [0,255].
10406
10407           Default value: 'action=1'.
10408
10409         noarg (+):
10410
10411           Used in a custom command, 'noarg' tells the command that its  argu‐
10412       ment list have not been used
10413           finally,  and so they must be evaluated next in the G'MIC pipeline,
10414       just as if the custom
10415           command takes no arguments at all.
10416           Use this command to write a custom command which can decide  if  it
10417       takes arguments or not.
10418
10419         onfail (+):
10420
10421           Execute following commands when an error is encountered in the body
10422       of the 'local...done' block.
10423           The status value is set with the corresponding error message.
10424
10425           Example:
10426             [#1] image.jpg +local blur -3 onfail mirror x done
10427
10428         parallel (+):
10429             _wait_threads,"command1","command2",...
10430
10431           Execute specified commands in parallel, each in a different thread.
10432           Parallel threads share the list of images.
10433           'wait_threads' can be { 0=when current environment ends | 1=immedi‐
10434       ately }.
10435
10436           Default value: 'wait_threads=1'.
10437
10438           Example:
10439             [#1] image.jpg [0] parallel "blur[0] 3","mirror[1] c"
10440
10441         progress (+):
10442             0<=value<=100 |
10443             -1
10444
10445           Set the progress index of the current processing pipeline.
10446           This  command is useful only when G'MIC is used by an embedding ap‐
10447       plication.
10448
10449         q (+):
10450             Shortcut for command 'quit'.
10451
10452         quit (+):
10453
10454           Quit G'MIC interpreter.
10455           (equivalent to shortcut command 'q').
10456
10457         repeat (+):
10458             nb_iterations
10459
10460           Start 'nb_iterations' iterations of a 'repeat...done' block.
10461           'nb_iterations' is a mathematical expression that  will  be  evalu‐
10462       ated.
10463
10464           Example:
10465             [#1]  image.jpg  split y repeat $! n=$> shift[$n] $<,0,0,0,2 done
10466       append y
10467             [#2] image.jpg mode3d 2 repeat 4  imagecube3d  rotate3d  1,1,0,40
10468       snapshot3d 400,1.4 done
10469
10470           Tutorial: https://gmic.eu/oldtutorial/_repeat
10471
10472         return (+):
10473
10474           Return from current custom command.
10475
10476         rprogress:
10477             0<=value<=100           |           -1           |          "com‐
10478       mand",0<=value_min<=100,0<=value_max<=100
10479
10480           Set the progress index of the current  processing  pipeline  (rela‐
10481       tively to
10482           previously  defined progress bounds), or call the specified command
10483       with
10484           specified progress bounds.
10485
10486         run:
10487             "G'MIC pipeline"
10488
10489           Run specified G'MIC pipeline.
10490           This is only useful when used from a shell,  e.g.  to  avoid  shell
10491       substitutions to happen in argument.
10492
10493         skip (+):
10494             item
10495
10496           Do nothing but skip specified item.
10497
10498         u (+):
10499             Shortcut for command 'status'.
10500
10501         status (+):
10502             status_string
10503
10504           Set  the  current  status.  Used to define a returning value from a
10505       function.
10506           (equivalent to shortcut command 'u').
10507
10508           Example:
10509             [#1]  image.jpg  command  "foo   :   u0=Dark   u1=Bright   status
10510       ${u{ia>=128}}" text_outline ${-foo},2,2,23,2,1,255
10511
10512         while (+):
10513             condition
10514
10515           End  a  'do...while' block and go back to associated 'do' if speci‐
10516       fied condition holds.
10517           'condition' is a mathematical expression, whose evaluation  is  in‐
10518       terpreted as { 0=false | other=true }.
10519
10520         12.14. Neural Networks
10521                ---------------
10522
10523         nn_lib ::
10524
10525           Return  the  list of library functions that has to be included in a
10526       math expression,in order to use the neural network library.
10527
10528         nn_init:
10529
10530           Initialize a new network.
10531
10532         nn_check_layer:
10533             name
10534
10535           Check that the layer with specified name already exists in the net‐
10536       work.
10537
10538         nn_add:
10539             out,in0,_in1
10540
10541           Add an 'add' layer to the network.
10542
10543           Default value: 'in1=. (previous layer)'.
10544
10545         nn_append:
10546             out,in0,_in1
10547
10548           Add an 'append' layer to the network.
10549
10550           Default value: 'in1=. (previous layer)'.
10551
10552         nn_avgpool2d:
10553             out,_in,_patch_size>1
10554
10555           Add a 'avgpool2d' layer (2D average pooling) to the network.
10556
10557           Default value: 'in=. (previous layer)'.
10558
10559         nn_avgpool3d:
10560             out,_in,_patch_size>1
10561
10562           Add a 'avgpool3d' layer (3D average pooling) to the network.
10563
10564           Default value: 'in=. (previous layer)'.
10565
10566         nn_clone:
10567             name0,name1,_in
10568
10569           Add a 'clone' layer to the network.
10570
10571           Default value: 'in=. (previous layer)'.
10572
10573         nn_conv2d:
10574             out,in,nb_channels>0,_kernel_size>0,_stride>0,_dilation,_bor‐
10575       der_shrink>=0,_boundary_conditions,0<=_learning_mode<=3
10576
10577           Add a 'conv2d' layer (2D convolutional layer) to the network.
10578           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
10579       | 3=mirror }.
10580           'learning_mode'  can be { 0=no learning | 1=weights only | 2=biases
10581       only | 3=weights+biases }.
10582
10583           Default values: 'kernel_size=3',  'stride=1',  'dilation=1',  'bor‐
10584       der_shrink=0', 'boundary_conditions=1' and 'learning_mode=3'.
10585
10586         nn_conv2dnl:
10587             out,in,nb_channels>0,_kernel_size>0,_stride>0,_dilation>0,_bor‐
10588       der_shrink>=0,_boundary_conditions,_activation,0<=_learning_mode<=3
10589
10590           Add a 'conv2dnl' (2D convolutional layer followed by a  non-linear‐
10591       ity) to the network.
10592           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
10593       | 3=mirror }.
10594           'learning_mode' can be { 0=no learning | 1=weights only |  2=biases
10595       only | 3=weights+biases }.
10596
10597           Default  values:  'kernel_size=3',  'stride=1', 'dilation=1', 'bor‐
10598       der_shrink=0', 'boundary_conditions=1', 'activation=leakyrelu' and
10599            'learning_mode=3'.
10600
10601         nn_conv2dnnl:
10602             out,in,nb_channels>0,_kernel_size>0,_stride>0,_dilation>0,_bor‐
10603       der_shrink>=0,_boundary_conditions,_activation,0<=_learning_mode<=3
10604
10605           Add  a 'conv2dnnl' (2D convolutional layer followed by a normaliza‐
10606       tion layer, then a non-linearity) to the network.
10607           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
10608       | 3=mirror }.
10609           'learning_mode'  can be { 0=no learning | 1=weights only | 2=biases
10610       only | 3=weights+biases }.
10611
10612           Default values: 'kernel_size=3',  'stride=1',  'dilation=1',  'bor‐
10613       der_shrink=0', 'boundary_conditions=1', 'activation=leakyrelu' and
10614            'learning_mode=3'.
10615
10616         nn_conv3d:
10617             out,in,nb_channels>0,_kernel_size>0,_stride>0,_dilation,_bor‐
10618       der_shrink>=0,_boundary_conditions,0<=_learning_mode<=3
10619
10620           Add a 'conv3d' layer (3D convolutional layer) to the network.
10621           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
10622       | 3=mirror }.
10623           'learning_mode'  can be { 0=no learning | 1=weights only | 2=biases
10624       only | 3=weights+biases }.
10625
10626           Default values: 'kernel_size=3',  'stride=1',  'dilation=1',  'bor‐
10627       der_shrink=0', 'boundary_conditions=1' and 'learning_mode=3'.
10628
10629         nn_conv3dnl:
10630             out,in,nb_channels>0,_kernel_size>0,_stride>0,_dilation>0,_bor‐
10631       der_shrink>=0,_boundary_conditions,_activation,0<=_learning_mode<=3
10632
10633           Add a 'conv3dnl' (3D convolutional layer followed by a  non-linear‐
10634       ity) to the network.
10635           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
10636       | 3=mirror }.
10637           'learning_mode' can be { 0=no learning | 1=weights only |  2=biases
10638       only | 3=weights+biases }.
10639
10640           Default  values:  'kernel_size=3',  'stride=1', 'dilation=1', 'bor‐
10641       der_shrink=0', 'boundary_conditions=1', 'activation=leakyrelu' and
10642            'learning_mode=3'.
10643
10644         nn_conv3dnnl:
10645             out,in,nb_channels>0,_kernel_size>0,_stride>0,_dilation>0,_bor‐
10646       der_shrink>=0,_boundary_conditions,_activation,0<=_learning_mode<=3
10647
10648           Add  a 'conv3dnnl' (3D convolutional layer followed by a normaliza‐
10649       tion layer, then a non-linearity) to the network.
10650           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
10651       | 3=mirror }.
10652           'learning_mode'  can be { 0=no learning | 1=weights only | 2=biases
10653       only | 3=weights+biases }.
10654
10655           Default values: 'kernel_size=3',  'stride=1',  'dilation=1',  'bor‐
10656       der_shrink=0', 'boundary_conditions=1', 'activation=leakyrelu' and
10657            'learning_mode=3'.
10658
10659         nn_crop:
10660             out,in,x0,y0,z0,c0,x1,y1,z1,c1,_boundary_conditions
10661
10662           Add a 'crop' layer to the network.
10663           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
10664       | 3=mirror }.
10665
10666           Default value: 'boundary_conditions=0'.
10667
10668         nn_distance:
10669             out,in0,_in1,_metric={ 0=squared-L2 | p>0 = Lp-norm }
10670
10671           Add a 'distance' layer to the network (distance between two inputs,
10672       with specified metric).
10673
10674           Default value: 'in=. (previous layer)',
10675
10676         nn_dropout:
10677             out,in,0<=dropout_rate<1
10678
10679           Add a 'dropout' layer to the network.
10680
10681         nn_fc:
10682             out,in,nb_channels>0,0<=_learning_mode<=3
10683
10684           Add a 'fc' layer (fully connected layer) to the network.
10685           'learning_mode'  can be { 0=no learning | 1=weights only | 2=biases
10686       only | 3=weights+biases }.
10687
10688           Default value: 'learning_mode=3'.
10689
10690         nn_nlfc:
10691             out,in,nb_channels>0,_activation,0<=_learning_mode<=3
10692
10693           Add a 'nlfc' layer (nonlinear fully connected layer)  to  the  net‐
10694       work.
10695           'learning_mode'  can be { 0=no learning | 1=weights only | 2=biases
10696       only | 3=weights+biases }.
10697
10698           Default values: 'activation=leakyrelu' and 'learning_mode=3'.
10699
10700         nn_fcnl:
10701             out,in,nb_neurons>0,_activation,0<=_learning_mode<=3
10702
10703           Add a 'fcnl' layer (fully connected layer followed by a non-linear‐
10704       ity) to the network.
10705           'learning_mode'  can be { 0=no learning | 1=weights only | 2=biases
10706       only | 3=weights+biases }.
10707
10708           Default values: 'activation=leakyrelu' and 'learning_mode=3'.
10709
10710         nn_fcnnl:
10711             out,in,nb_neurons>0,_activation,0<=_learning_mode<=3
10712
10713           Add a 'fcnnl' layer (fully connected layer followed by a normaliza‐
10714       tion layer, then a non-linearity) to the network.
10715           'learning_mode'  can be { 0=no learning | 1=weights only | 2=biases
10716       only | 3=weights+biases }.
10717
10718           Default values: 'activation=leakyrelu' and 'learning_mode=3'.
10719
10720         nn_input:
10721             name,width,_height,_depth,_spectrum
10722
10723           Add a new 'input' to the network.
10724
10725           Default values: 'height=1', 'depth=1' and 'spectrum=1'.
10726
10727         nn_maxpool2d:
10728             out,_in,_patch_size>1
10729
10730           Add a 'maxpool2d' layer (2D max pooling) to the network.
10731
10732           Default values: 'in=. (previous layer)' and 'patch_size=2'.
10733
10734         nn_maxpool3d:
10735             out,_in,_patch_size>1
10736
10737           Add a 'maxpool3d' layer (3d max pooling) to the network.
10738
10739           Default values: 'in=. (previous layer)' and 'patch_size=2'.
10740
10741         nn_mul:
10742             out,in0,_in1
10743
10744           Add an 'mul' layer to the network.
10745
10746           Default value: 'in1=. (previous layer)'.
10747
10748         nn_nl:
10749             out,_in,_activation
10750
10751           Add a 'nl' (nonlinearity) layer to the network.
10752           'activation' can be { elu | gelu | leakyrelu | linear | relu | sig‐
10753       moid | sin | sinc | softmax | sqr | sqrt | swish | tanh }.
10754
10755           Default values: 'in=. (previous layer)' and 'activation=leakyrelu'.
10756
10757         nn_normalize:
10758             out,_in,_normalization_mode_,0<=_learning_mode<=3
10759
10760           Add a 'normalize' layer to the network.
10761           'normalization_mode'  can  be { 0=global parameters | 1=channel-by-
10762       channel parameters }
10763           'learning_mode' can be { 0=no learning | 1=alpha only | 2=beta only
10764       | 3=alpha+beta }
10765
10766           Default  values: 'in=. (previous layer)','normalization_mode=0' and
10767       'learning_mode=3'.
10768
10769         nn_patchdown2d:
10770             out,_in,_patch_size>1
10771
10772           Add a 'patchdown2d' (2D downscale by patch) layer to the network.
10773
10774           Default values: 'in=. (previous layer)' and 'patch_size=2'.
10775
10776         nn_patchdown3d:
10777             out,_in,_patch_size>1
10778
10779           Add a 'patchdown3d' (3D downscale by patch) layer to the network.
10780
10781           Default values: 'in=. (previous layer)' and 'patch_size=2'.
10782
10783         nn_patchup2d:
10784             out,_in,_patch_size>1
10785
10786           Add a 'patchup2d' (2D upscale by patch) layer to the network.
10787
10788           Default values: 'in=. (previous layer)' and 'patch_size=2'.
10789
10790         nn_patchup3d:
10791             out,_in,_patch_size>1
10792
10793           Add a 'patchup3d' (3D upscale by patch) layer to the network.
10794
10795           Default values: 'in=. (previous layer)' and 'patch_size=2'.
10796
10797         nn_rename:
10798             out,_in
10799
10800           Add a 'rename' layer to the network.
10801
10802           Default value: 'in=. (previous layer)'.
10803
10804         nn_resconv2d:
10805             out,_in,_kernel_size>0,_dilation>0,_boundary_condi‐
10806       tions,0<=_learning_mode<=3
10807
10808           Add a 'resconv2d' (residual 2D convolutional layer) to the network.
10809           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
10810       | 3=mirror }.
10811           'learning_mode' can be { 0=no learning | 1=weights only |  2=biases
10812       only | 3=weights+biases }.
10813
10814           Default  values:  'in=.  (previous layer)', 'kernel_size=3', 'dila‐
10815       tion=1', 'boundary_conditions=1' and 'learning_mode=3'.
10816
10817         nn_resconv2dnl:
10818             out,_in,_kernel_size>0,_dilation>0,_boundary_conditions,_activa‐
10819       tion,0<=_learning_mode<=3
10820
10821           Add  a 'resconv2dnl' (residual 2D convolutional layer followed by a
10822       non-linearity) to the network.
10823           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
10824       | 3=mirror }.
10825           'learning_mode'  can be { 0=no learning | 1=weights only | 2=biases
10826       only | 3=weights+biases }.
10827
10828           Default values: 'in=. (previous  layer)',  'kernel_size=3',  'dila‐
10829       tion=1', 'boundary_conditions=1', 'activation=leakyrelu' and
10830            'learning_mode=3'.
10831
10832         nn_resconv2dnnl:
10833             out,_in,_kernel_size>0,_dilation>0,_boundary_conditions,_activa‐
10834       tion,0<=_learning_mode<=3
10835
10836           Add a 'resconv2dnnl' (residual 2D convolutional layer followed by a
10837       normalization layer, then a non-linearity)to the network.
10838           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
10839       | 3=mirror }.
10840           'learning_mode' can be { 0=no learning | 1=weights only |  2=biases
10841       only | 3=weights+biases }.
10842
10843           Default  values:  'in=.  (previous layer)', 'kernel_size=3', 'dila‐
10844       tion=1', 'boundary_conditions=1', 'activation=leakyrelu' and
10845            'learning_mode=3'.
10846
10847         nn_resconv3d:
10848             out,_in,_kernel_size>0,_dilation>0,_boundary_condi‐
10849       tions,0<=_learning_mode<=3
10850
10851           Add a 'resconv3d' (residual 3D convolutional layer) to the network.
10852           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
10853       | 3=mirror }.
10854           'learning_mode' can be { 0=no learning | 1=weights only |  2=biases
10855       only | 3=weights+biases }.
10856
10857           Default  values:  'in=.  (previous layer)', 'kernel_size=3', 'dila‐
10858       tion=1', 'boundary_conditions=1' and 'learning_mode=3'.
10859
10860         nn_resconv3dnl:
10861             out,_in,_kernel_size>0,_dilation>0,_boundary_conditions,_activa‐
10862       tion,0<=_learning_mode<=3
10863
10864           Add  a 'resconv3dnl' (residual 3D convolutional layer followed by a
10865       non-linearity) to the network.
10866           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
10867       | 3=mirror }.
10868           'learning_mode'  can be { 0=no learning | 1=weights only | 2=biases
10869       only | 3=weights+biases }.
10870
10871           Default values: 'in=. (previous  layer)',  'kernel_size=3',  'dila‐
10872       tion=1',  'boundary_conditions=1',  activation='leakyrelu'  and 'learn‐
10873       ing_mode=3'.
10874
10875         nn_resconv3dnnl:
10876             out,_in,_kernel_size>0,_dilation>0,_boundary_conditions,_activa‐
10877       tion,0<=_learning_mode<=3
10878
10879           Add a 'resconv3dnnl' (residual 3D convolutional layer followed by a
10880       normalization layer, then a non-linearity)to the network.
10881           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
10882       | 3=mirror }.
10883           'learning_mode'  can be { 0=no learning | 1=weights only | 2=biases
10884       only | 3=weights+biases }.
10885
10886           Default values: 'in=. (previous  layer)',  'kernel_size=3',  'dila‐
10887       tion=1', 'boundary_conditions=1', 'activation=leakyrelu' and
10888            'learning_mode=3'.
10889
10890         nn_resfc:
10891             out,_in,0<=_learning_mode<=3
10892
10893           Add a 'resfc' (residual fully connecter layer) to the network.
10894           'learning_mode'  can be { 0=no learning | 1=weights only | 2=biases
10895       only | 3=weights+biases }.
10896
10897           Default values: 'in=. (previous layer)' and 'learning_mode=3'.
10898
10899         nn_resfcnl:
10900             out,_in,_activation,0<=_learning_mode<=3
10901
10902           Add a 'resfcnl' (residual fully connecter layer followed by a  non-
10903       linearity) to the network.
10904           'learning_mode'  can be { 0=no learning | 1=weights only | 2=biases
10905       only | 3=weights+biases }.
10906
10907           Default values: 'in=. (previous layer)', 'activation=leakyrelu' and
10908       'learning_mode=3'.
10909
10910         nn_resfcnnl:
10911             out,_in,_activation,0<=_learning_mode<=3
10912
10913           Add a 'resfcnnl' (residual fully connecter layer followed by a nor‐
10914       malization layer, then a non-linearity) to the network.
10915           'learning_mode' can be { 0=no learning | 1=weights only |  2=biases
10916       only | 3=weights+biases }.
10917
10918           Default values: 'in=. (previous layer)', 'activation=leakyrelu' and
10919       'learning_mode=3'.
10920
10921         nn_reshape:
10922             out,in,width>0,height>0,depth>0,spectrum>0
10923
10924           Add a 'reshape' layer to the network.
10925
10926         nn_resize:
10927             out,in,width[%]>0,_height[%]>0,_depth[%]>0,_spectrum[%]>0,_inter‐
10928       polation
10929
10930           Add a 'resize' layer to the network.
10931
10932           Default values: 'height=depth=spectrum=100%' and 'interpolation=3'.
10933
10934         nn_run:
10935             out,in,"command",_width[%]>0,_height[%]>0,_depth[%]>0,_spec‐
10936       trum[%]>0
10937
10938           Add a 'run' layer to the network.
10939
10940           Default values: 'width=height=depth=spectrum=100%'.
10941
10942         nn_split:
10943             name0,name1,in,nb_channels0
10944
10945           Add a 'split' layer to the network.
10946
10947         nn_loss_binary_crossentropy:
10948             out,in,ground_truth
10949
10950           Add a 'binary_crossentropy' loss to the network (binary  cross  en‐
10951       tropy).
10952
10953         nn_loss_crossentropy:
10954             out,in,ground_truth
10955
10956           Add a 'crossentropy' loss to the network (cross entropy).
10957
10958         nn_loss_mse:
10959             out,in,ground_truth
10960
10961           Add a 'mse' loss to the network (mean-squared error).
10962
10963         nn_loss_normp:
10964             out,in,ground_truth,_metric={ 0=squared-L2 | p>0 = Lp-norm }
10965
10966           Add a 'normp' loss to the network (||out - ground_truth||_p).
10967
10968           Default value: 'metric=1'.
10969
10970         nn_loss_softmax_crossentropy:
10971             out,in,ground_truth
10972
10973           Add  a 'softmax_crossentropy' loss to the network (softmax followed
10974       by cross entropy).
10975
10976         nn_print:
10977
10978           Print info on current neural network.
10979
10980         nn_trainer:
10981             name,_loss,_learning_rate>0,_optimizer,_scheduler
10982
10983           Add a network trainer to the network.
10984           'optimizer' can be { sgd | rmsprop | adam | adamax }.
10985           'scheduler' can be { constant | linear | exponential | adaptive }.
10986
10987           Default values:  'loss=.  (previous  loss)',  'learning_rate=2e-4',
10988       'optimizer=rmsprop' and 'scheduler=constant'.
10989
10990         nn_size:
10991
10992           Return  size  of the current network (i.e. number of stored parame‐
10993       ters).
10994
10995         nn_load:
10996             'filename.gmz',_include_trainer_data={ 0=no | 1=yes }
10997
10998           Load and initialize network saved as a .gmz file.
10999           Neural network files can be only loaded in .gmz format.
11000
11001           Default value: 'include_trainer_data=1'.
11002
11003         nn_save:
11004             'filename.gmz',_include_trainer_data={ 0=no | 1=yes }
11005
11006           Save current network as a .gmz file.
11007           '.gmz' is mandatory extension, specifying  another  file  extension
11008       will throw an error.
11009
11010           Default value: 'include_trainer_data=1'.
11011
11012         nn_store:
11013             'variable_name',_include_trainer_data={ 0=no | 1=yes }
11014
11015           Store current network into a variable.
11016
11017           Default value: 'include_trainer_data=1'.
11018
11019         12.15. Arrays, Tiles and Frames
11020                ------------------------
11021
11022         array:
11023             M>0,_N>0,_expand_type={ 0=min | 1=max | 2=all }
11024
11025           Create MxN array from selected images.
11026
11027           Default values: 'N=M' and 'expand_type=0'.
11028
11029           Example:
11030             [#1] image.jpg array 3,2,2
11031
11032         array_fade:
11033             M>0,_N>0,0<=_fade_start<=100,0<=_fade_end<=100,_ex‐
11034       pand_type={0=min | 1=max | 2=all}
11035
11036           Create MxN array from selected images.
11037
11038           Default values:  'N=M',  'fade_start=60',  'fade_end=90'  and  'ex‐
11039       pand_type=1'.
11040
11041           Example:
11042             [#1] image.jpg array_fade 3,2
11043
11044         array_mirror:
11045             N>=0,_dir={ 0=x | 1=y | 2=xy | 3=tri-xy },_expand_type={ 0 | 1 }
11046
11047           Create 2^Nx2^N array from selected images.
11048
11049           Default values: 'dir=2' and 'expand_type=0'.
11050
11051           Example:
11052             [#1] image.jpg array_mirror 2
11053
11054         array_random:
11055             Ms>0,_Ns>0,_Md>0,_Nd>0
11056
11057           Create MdxNd array of tiles from selected MsxNs source arrays.
11058
11059           Default values: 'Ns=Ms', 'Md=Ms' and 'Nd=Ns'.
11060
11061           Example:
11062             [#1] image.jpg +array_random 8,8,15,10
11063
11064         frame:
11065             Shortcut for command 'frame_xy'.
11066
11067         frame_blur:
11068             _sharpness>0,_size>=0,_smoothness,_shading,_blur
11069
11070           Draw RGBA-colored round frame in selected images.
11071
11072           Default  values:  'sharpness=10', 'size=30', 'smoothness=0', 'shad‐
11073       ing=1' and 'blur=3%'.
11074
11075           Example:
11076             [#1] image.jpg frame_blur 3,30,8,10%
11077
11078         frame_cube:
11079             _depth>=0,_centering_x,_centering_y,_left_side={0=normal | 1=mir‐
11080       ror-x | 2=mirror-y | 3=mirror-xy},_right_side,_lower_side,_upper_side
11081
11082           Insert 3D frames in selected images.
11083
11084           Default    values:   'depth=1',   'centering_x=centering_y=0'   and
11085       'left_side=right_side,lower_side=upper_side=0'.
11086
11087           Example:
11088             [#1] image.jpg frame_cube ,
11089
11090         frame_fuzzy:
11091             size_x[%]>=0,_size_y[%]>=0,_fuzzyness>=0,_smooth‐
11092       ness[%]>=0,_R,_G,_B,_A
11093
11094           Draw RGBA-colored fuzzy frame in selected images.
11095
11096           Default  values: 'size_y=size_x', 'fuzzyness=5', 'smoothness=1' and
11097       'R=G=B=A=255'.
11098
11099           Example:
11100             [#1] image.jpg frame_fuzzy 20
11101
11102         frame_painting:
11103             _size[%]>=0,0<=_contrast<=1,_profile_smooth‐
11104       ness[%]>=0,_R,_G,_B,_vignette_size[%]>=0,_vignette_contrast>=0,_de‐
11105       fects_contrast>=0,0<=_defects_density<=100,_defects_size>=0,
11106               _defects_smoothness[%]>=0,_serial_number
11107
11108           Add a painting frame to selected images.
11109
11110           Default  values:   'size=10%',   'contrast=0.4',   'profile_smooth‐
11111       ness=6%', 'R=225', 'G=200', 'B=120', 'vignette_size=2%',
11112            'vignette_contrast=400',    'defects_contrast=50',   'defects_den‐
11113       sity=10', 'defects_size=1', 'defects_smoothness=0.5%' and
11114            'serial_number=123456789'.
11115
11116           Example:
11117             [#1] image.jpg frame_painting ,
11118
11119         frame_pattern:
11120             M>=3,_constrain_size={ 0 | 1 } |
11121             M>=3,_[frame_image],_constrain_size={ 0 | 1 }
11122
11123           Insert selected pattern frame in selected images.
11124
11125           Default values: 'pattern=0' and 'constrain_size=0'.
11126
11127           Example:
11128             [#1] image.jpg frame_pattern 8
11129
11130         frame_round:
11131             frame_size[%]>=0,radius[%]>=0,_smoothness[%]>=0,_col1,...,_colN
11132
11133           Insert an inner round frame in selected images.
11134
11135           Default   values:   'size=1,   'radius=30%',   'smoothness=0'   and
11136       'col=0,0,0,255'.
11137
11138         frame_seamless:
11139             frame_size>=0,_patch_size>0,_blend_size>=0,_frame_direction={
11140       0=inner (preserve image size) | 1=outer }
11141
11142           Insert frame in selected images, so that tiling the resulting image
11143       makes less visible seams.
11144
11145           Default  values:  'patch_size=7',  'blend_size=5' and 'frame_direc‐
11146       tion=1'.
11147
11148           Example:
11149             [#1] image.jpg +frame_seamless 30 array 2,2
11150
11151         frame_x:
11152             size_x[%],_col1,...,_colN
11153
11154           Insert outer frame along the x-axis in selected images.
11155
11156           Default values: 'col1=col2=col3=255' and 'col4=255'.
11157
11158           Example:
11159             [#1] image.jpg frame_x 20,255,0,255
11160
11161         frame_xy:
11162             size_x[%],_size_y[%],_col1,...,_colN
11163
11164           Insert outer frame along the x-axis in selected images.
11165
11166           Default   values:   'size_y=size_x',    'col1=col2=col3=255'    and
11167       'col4=255'.
11168           (equivalent to shortcut command 'frame').
11169
11170           Example:
11171             [#1] image.jpg frame_xy 1,1,0 frame_xy 20,10,255,0,255
11172
11173         frame_xyz:
11174             size_x[%],_size_y[%],_size_z[%]_col1,...,_colN
11175
11176           Insert outer frame along the x-axis in selected images.
11177
11178           Default  values:  'size_y=size_x=size_z',  'col1=col2=col3=255' and
11179       'col4=255'.
11180
11181         frame_y:
11182             size_y[%],_col1,...,_colN
11183
11184           Insert outer frame along the y-axis in selected images.
11185
11186           Default values: 'col1=col2=col3=255' and 'col4=255'.
11187
11188           Example:
11189             [#1] image.jpg frame_y 20,255,0,255
11190
11191         img2ascii:
11192             _charset,_analysis_scale>0,_analysis_smoothness[%]>=0,_synthe‐
11193       sis_scale>0,_output_ascii_filename
11194
11195           Render selected images as binary ascii art.
11196           This  command  returns  the  corresponding  the  list of widths and
11197       heights (expressed as a number of characters)
11198           for each selected image.
11199
11200           Default  values:  'charset=[ascii  charset]',  'analysis_scale=16',
11201       'analysis_smoothness=20%', 'synthesis_scale=16' and
11202            '_output_ascii_filename=[undefined]'.
11203
11204           Example:
11205             [#1] image.jpg img2ascii ,
11206
11207         imagegrid:
11208             M>0,_N>0
11209
11210           Create MxN image grid from selected images.
11211
11212           Default value: 'N=M'.
11213
11214           Example:
11215             [#1] image.jpg imagegrid 16
11216
11217         imagegrid_hexagonal:
11218             _resolution>0,0<=_outline<=1
11219
11220           Create hexagonal grids from selected images.
11221
11222           Default   values:   'resolution=32',   'outline=0.1'   and  'is_an‐
11223       tialiased=1'.
11224
11225           Example:
11226             [#1] image.jpg imagegrid_hexagonal 24
11227
11228         imagegrid_triangular:
11229             pattern_width>=1,_pattern_height>=1,_pattern_type,0<=_out‐
11230       line_opacity<=1,_outline_color1,...
11231
11232           Create triangular grids from selected images.
11233           'pattern  type'  can  be  { 0=horizontal | 1=vertical | 2=crossed |
11234       3=cube | 4=decreasing | 5=increasing }.
11235
11236           Default values: 'pattern_width=24', 'pattern_height=pattern_width',
11237       'pattern_type=0', 'outline_opacity=0.1' and 'outline_color1=0'.
11238
11239           Example:
11240             [#1] image.jpg imagegrid_triangular 6,10,3,0.5
11241
11242         linearize_tiles:
11243             M>0,_N>0
11244
11245           Linearize MxN tiles on selected images.
11246
11247           Default value: 'N=M'.
11248
11249           Example:
11250             [#1] image.jpg +linearize_tiles 16
11251
11252         map_sprites:
11253             _nb_sprites>=1,_allow_rotation={  0=none | 1=90 deg. | 2=180 deg.
11254       }
11255
11256           Map set of sprites (defined as the 'nb_sprites'  latest  images  of
11257       the selection) to other selected images,
11258           according to the luminosity of their pixel values.
11259
11260           Example:
11261             [#1]  image.jpg  resize2dy  48  repeat  16  ball {8+2*$>},${-rgb}
11262       mul[-1] {(1+$>)/16} done map_sprites 16
11263
11264         pack:
11265             is_ratio_constraint={ 0 | 1 },_sort_criterion
11266
11267           Pack selected images into a single image.
11268           The returned status contains the list of new (x,y) offsets for each
11269       input image.
11270           Parameter  'is_ratio_constraint'  tells if the resulting image must
11271       tend to a square image.
11272
11273           Default   values:    'is_ratio_constraint=0'    and    'sort_crite‐
11274       rion=max(w,h)'.
11275
11276           Example:
11277             [#1]  image.jpg  repeat  10  +resize2dx[-1] 75% balance_gamma[-1]
11278       ${-rgb} done pack 0
11279
11280         puzzle:
11281             _width>0,_height>0,_M>=1,_N>=1,_curvature,_centering,_connec‐
11282       tors_variability,_resolution>=1
11283
11284           Input puzzle binary mask with specified size and geometry.
11285
11286           Default values: 'width=height=512', 'M=N=5', 'curvature=0.5', 'cen‐
11287       tering=0.5', 'connectors_variability=0.5' and 'resolution=64'.
11288
11289           Example:
11290             [#1] puzzle ,
11291
11292         quadratize_tiles:
11293             M>0,_N>0
11294
11295           Quadratize MxN tiles on selected images.
11296
11297           Default value: 'N=M'.
11298
11299           Example:
11300             [#1] image.jpg +quadratize_tiles 16
11301
11302         rotate_tiles:
11303             angle,_M>0,N>0
11304
11305           Apply MxN tiled-rotation effect on selected images.
11306
11307           Default values: 'M=8' and 'N=M'.
11308
11309           Example:
11310             [#1] image.jpg to_rgba rotate_tiles 10,8 drop_shadow  10,10  dis‐
11311       play_rgba
11312
11313         shift_tiles:
11314             M>0,_N>0,_amplitude
11315
11316           Apply MxN tiled-shift effect on selected images.
11317
11318           Default values: 'N=M' and 'amplitude=20'.
11319
11320           Example:
11321             [#1] image.jpg +shift_tiles 8,8,10
11322
11323         taquin:
11324             M>0,_N>0,_remove_tile={  0=none  |  1=first  |  2=last | 3=random
11325       },_relief,_border_thickness[%],_border_outline[%],_outline_color
11326
11327           Create MxN taquin puzzle from selected images.
11328
11329           Default  value:  'N=M',  'relief=50',  'border_thickness=5',  'bor‐
11330       der_outline=0' and 'remove_tile=0'.
11331
11332           Example:
11333             [#1] image.jpg +taquin 8
11334
11335         tunnel:
11336             _level>=0,_factor>0,_centering_x,_centering_y,_opacity,_angle
11337
11338           Apply tunnel effect on selected images.
11339
11340           Default   values:   'level=9',  'factor=80%',  'centering_x=center‐
11341       ing_y=0.5', 'opacity=1' and 'angle=0'
11342
11343           Example:
11344             [#1] image.jpg tunnel 20
11345
11346         12.16. Artistic
11347                --------
11348
11349         boxfitting:
11350             _min_box_size>=1,_max_box_size>=0,_initial_density>=0,_min_spac‐
11351       ing>0
11352
11353           Apply  box  fitting effect on selected images, as displayed the web
11354       page:
11355           http://www.complexification.net/gallery/machines/boxFittingImg/.
11356
11357           Default values: 'min_box_size=1',  'max_box_size=0',  'initial_den‐
11358       sity=0.25' and 'min_spacing=1'.
11359
11360           Example:
11361             [#1] image.jpg boxfitting ,
11362
11363         brushify:
11364             [brush],_brush_nb_sizes>=1,0<=_brush_min_size_fac‐
11365       tor<=1,_brush_nb_orienta‐
11366       tions>=1,_brush_light_type,0<=_brush_light_strength<=1,_brush_opac‐
11367       ity,_painting_density[%]>=0,
11368               0<=_painting_contours_coherence<=1,0<=_painting_orientation_co‐
11369       herence<=1,_painting_coherence_alpha[%]>=0,_painting_coher‐
11370       ence_sigma[%]>=0,_painting_primary_angle,
11371               0<=_painting_angle_dispersion<=1
11372
11373           Apply specified brush to create painterly versions of specified im‐
11374       ages.
11375           'brush_light_type'  can be { 0=none | 1=flat | 2=darken | 3=lighten
11376       | 4=full }.
11377
11378           Default values:  'brush_nb_sizes=3',  'brush_min_size_factor=0.66',
11379       'brush_nb_orientations=12', 'brush_light_type=0',
11380            'brush_light_strength=0.25',  'brush_opacity=0.8',  'painting_den‐
11381       sity=20%', 'painting_contours_coherence=0.9',
11382            'painting_orientation_coherence=0.9',      'painting_coherence_al‐
11383       pha=1', 'painting_coherence_sigma=1', 'painting_primary_angle=0',
11384            'painting_angle_dispersion=0.2'
11385
11386           Example:
11387             [#1]   image.jpg   40,40   gaussian[-1]   10,4   spread[-1]  10,0
11388       brushify[0] [1],1
11389
11390         cartoon:
11391             _smoothness,_sharpening,_threshold>=0,_thick‐
11392       ness>=0,_color>=0,quantization>0
11393
11394           Apply cartoon effect on selected images.
11395
11396           Default  values:  'smoothness=3', 'sharpening=150', 'threshold=20',
11397       'thickness=0.25', 'color=1.5' and 'quantization=8'.
11398
11399           Example:
11400             [#1] image.jpg cartoon 3,50,10,0.25,3,16
11401
11402         color_ellipses:
11403             _count>0,_radius>=0,_opacity>=0
11404
11405           Add random color ellipses to selected images.
11406
11407           Default values: 'count=400', 'radius=5' and 'opacity=0.1'.
11408
11409           Example:
11410             [#1] image.jpg +color_ellipses ,,0.15
11411
11412         cubism:
11413             _density>=0,0<=_thickness<=50,_max_angle,_opacity,_smoothness>=0
11414
11415           Apply cubism effect on selected images.
11416
11417           Default  values:  'density=50',   'thickness=10',   'max_angle=75',
11418       'opacity=0.7' and 'smoothness=0'.
11419
11420           Example:
11421             [#1] image.jpg cubism ,
11422
11423         draw_whirl:
11424             _amplitude>=0
11425
11426           Apply whirl drawing effect on selected images.
11427
11428           Default value: 'amplitude=100'.
11429
11430           Example:
11431             [#1] image.jpg draw_whirl ,
11432
11433         drawing:
11434             _amplitude>=0
11435
11436           Apply drawing effect on selected images.
11437
11438           Default value: 'amplitude=200'.
11439
11440           Example:
11441             [#1] image.jpg +drawing ,
11442
11443         drop_shadow:
11444             _offset_x[%],_offset_y[%],_smoothness[%]>=0,0<=_curvature<=1,_ex‐
11445       pand_size={ 0 | 1 }
11446
11447           Drop shadow behind selected images.
11448
11449           Default values: 'offset_x=20', 'offset_y=offset_x', 'smoothness=5',
11450       'curvature=0' and 'expand_size=1'.
11451
11452           Example:
11453             [#1]   image.jpg  drop_shadow  10,20,5,0.5  expand_xy  20,0  dis‐
11454       play_rgba
11455
11456         ellipsionism:
11457             _R>0[%],_r>0[%],_smoothness>=0[%],_opacity,_outline>0,_density>0
11458
11459           Apply ellipsionism filter to selected images.
11460
11461           Default  values:  'R=10',  'r=3',  'smoothness=1%',  'opacity=0.7',
11462       'outline=8' and 'density=0.6'.
11463
11464           Example:
11465             [#1] image.jpg ellipsionism ,
11466
11467         fire_edges:
11468             _edges>=0,0<=_attenuation<=1,_smoothness>=0,_thresh‐
11469       old>=0,_nb_frames>0,_starting_frame>=0,frame_skip>=0
11470
11471           Generate fire effect from edges of selected images.
11472
11473           Default values: 'edges=0.7', 'attenuation=0.25',  'smoothness=0.5',
11474       'threshold=25', 'nb_frames=1', 'starting_frame=20' and
11475            'frame_skip=0'.
11476
11477           Example:
11478             [#1] image.jpg fire_edges ,
11479
11480         fractalize:
11481             0<=detail_level<=1
11482
11483           Randomly fractalize selected images.
11484
11485           Default value: 'detail_level=0.8'
11486
11487           Example:
11488             [#1] image.jpg fractalize ,
11489
11490         glow:
11491             _amplitude>=0
11492
11493           Add soft glow on selected images.
11494
11495           Default value: 'amplitude=1%'.
11496
11497           Example:
11498             [#1] image.jpg glow ,
11499
11500         halftone:
11501             nb_levels>=2,_size_dark>=2,_size_bright>=2,_shape={   0=square  |
11502       1=diamond | 2=circle |  3=inv-square  |  4=inv-diamond  |  5=inv-circle
11503       },_smoothness[%]>=0
11504
11505           Apply halftone dithering to selected images.
11506
11507           Default   values:  'nb_levels=5',  'size_dark=8',  'size_bright=8',
11508       'shape=5' and 'smoothnesss=0'.
11509
11510           Example:
11511             [#1] image.jpg halftone ,
11512
11513         hardsketchbw:
11514             _amplitude>=0,_density>=0,_opacity,0<=_edge_thresh‐
11515       old<=100,_is_fast={ 0 | 1 }
11516
11517           Apply hard B&W sketch effect on selected images.
11518
11519           Default   values:  'amplitude=1000',  'sampling=3',  'opacity=0.1',
11520       'edge_threshold=20' and 'is_fast=0'.
11521
11522           Example:
11523             [#1] image.jpg +hardsketchbw 200,70,0.1,10  median[-1]  2  +local
11524       reverse blur[-1] 3 blend[-2,-1] overlay done
11525
11526         hearts:
11527             _density>=0
11528
11529           Apply heart effect on selected images.
11530
11531           Default value: 'density=10'.
11532
11533           Example:
11534             [#1] image.jpg hearts ,
11535
11536         houghsketchbw:
11537             _density>=0,_radius>0,0<=_threshold<=100,0<=_opacity<=1,_vote‐
11538       size[%]>0
11539
11540           Apply hough B&W sketch effect on selected images.
11541
11542           Default values: 'density=100', 'radius=3', 'threshold=100',  'opac‐
11543       ity=0.1' and 'votesize=100%'.
11544
11545           Example:
11546             [#1] image.jpg +houghsketchbw ,
11547
11548         lightrays:
11549             100<=_density<=0,_center_x[%],_cen‐
11550       ter_y[%],_ray_length>=0,_ray_attenuation>=0
11551
11552           Generate ray lights from the edges of selected images.
11553
11554           Default  values:  'density=50%',  'center_x=50%',   'center_y=50%',
11555       'ray_length=0.9' and 'ray_attenuation=0.5'.
11556
11557           Example:
11558             [#1] image.jpg +lightrays , + cut 0,255
11559
11560         light_relief:
11561             _ambient_light,_specular_lightness,_specular_size,_dark‐
11562       ness,_light_smoothness,_xl,_yl,_zl,_zscale,_opacity_is_heightmap={ 0  |
11563       1 }
11564
11565           Apply relief light to selected images.
11566           Default  values(s) : 'ambient_light=0.3', 'specular_lightness=0.5',
11567       'specular_size=0.2', 'darkness=0', 'xl=0.2', 'yl=zl=0.5',
11568           'zscale=1', 'opacity=1' and 'opacity_is_heightmap=0'.
11569
11570           Example:
11571             [#1] image.jpg blur 2 light_relief 0.3,4,0.1,0
11572
11573         linify:
11574             0<=_density<=100,_spreading>=0,_resolution[%]>0,_line_opac‐
11575       ity>=0,_line_precision>0,_mode={ 0=subtractive | 1=additive }
11576
11577           Apply linify effect on selected images.
11578           The  algorithm  is  inspired  from the one described on the webpage
11579       http://linify.me/about.
11580
11581           Default  values:  'density=50',  'spreading=2',   'resolution=40%',
11582       'line_opacity=10', 'line_precision=24' and 'mode=0'.
11583
11584           Example:
11585             [#1] image.jpg linify 60
11586
11587         mosaic:
11588             0<=_density<=100
11589
11590           Create random mosaic from selected images.
11591
11592           Default values: 'density=30'.
11593
11594           Example:
11595             [#1] image.jpg mosaic , +fill "I!=J(1) || I!=J(0,1)?[0,0,0]:I"
11596
11597         old_photo:
11598
11599           Apply old photo effect on selected images.
11600
11601           Example:
11602             [#1] image.jpg old_photo
11603
11604         pencilbw:
11605             _size>=0,_amplitude>=0
11606
11607           Apply B&W pencil effect on selected images.
11608
11609           Default values: 'size=0.3' and 'amplitude=60'.
11610
11611           Example:
11612             [#1] image.jpg pencilbw ,
11613
11614         pixelsort:
11615             _ordering={  + | - },_axis={ x | y | z | xy | yx },_[sorting_cri‐
11616       terion],_[mask]
11617
11618           Apply a 'pixel sorting' algorithm on selected images, as  described
11619       in the page :
11620           http://satyarth.me/articles/pixel-sorting/.
11621
11622           Default   values:   'ordering=+',   'axis=x'   and  'sorting_crite‐
11623       rion=mask=(undefined)'.
11624
11625           Example:
11626             [#1] image.jpg +norm +ge[-1] 30% +pixelsort[0] +,y,[1],[2]
11627
11628         polaroid:
11629             _size1>=0,_size2>=0
11630
11631           Create polaroid effect in selected images.
11632
11633           Default values: 'size1=10' and 'size2=20'.
11634
11635           Example:
11636             [#1] image.jpg to_rgba polaroid  5,30  rotate  20  drop_shadow  ,
11637       drgba
11638
11639         polygonize:
11640             _warp_amplitude>=0,_smoothness[%]>=0,_min_area[%]>=0,_resolu‐
11641       tion_x[%]>0,_resolution_y[%]>0
11642
11643           Apply polygon effect on selected images.
11644
11645           Default     values:     'warp_amplitude=300',      'smoothness=2%',
11646       'min_area=0.1%', 'resolution_x=resolution_y=10%'.
11647
11648           Example:
11649             [#1]  image.jpg  image.jpg  polygonize  100,10  +fill "I!=J(1) ||
11650       I!=J(0,1)?[0,0,0]:I"
11651
11652         poster_edges:
11653             0<=_edge_threshold<=100,0<=_edge_shade<=100,_edge_thick‐
11654       ness>=0,_edge_antialiasing>=0,0<=_posterization_level<=15,_posteriza‐
11655       tion_antialiasing>=0
11656
11657           Apply poster edges effect on selected images.
11658
11659           Default values: 'edge_threshold=40',  'edge_shade=5',  'edge_thick‐
11660       ness=0.5', 'edge_antialiasing=10', 'posterization_level=12' and
11661            'posterization_antialiasing=0'.
11662
11663           Example:
11664             [#1] image.jpg poster_edges ,
11665
11666         poster_hope:
11667             _smoothness>=0
11668
11669           Apply Hope stencil poster effect on selected images.
11670
11671           Default value: 'smoothness=3'.
11672
11673           Example:
11674             [#1] image.jpg poster_hope ,
11675
11676         rodilius:
11677             0<=_amplitude<=100,_0<=thickness<=100,_sharpness>=0,_nb_orienta‐
11678       tions>0,_offset,_color_mode={ 0=darker | 1=brighter }
11679
11680           Apply rodilius (fractalius-like) filter on selected images.
11681
11682           Default values:  'amplitude=10',  'thickness=10',  'sharpness=400',
11683       'nb_orientations=7', 'offset=0' and 'color_mode=1'.
11684
11685           Example:
11686             [#1] image.jpg rodilius 12,10,300,10 normalize_local 10,6
11687             [#2]  image.jpg normalize_local 10,16 rodilius 10,4,400,16 smooth
11688       60,0,1,1,4 normalize_local 10,16
11689
11690         sketchbw:
11691             _nb_angles>0,_start_angle,_angle_range>=0,_length>=0,_thresh‐
11692       old>=0,_opacity,_bgfactor>=0,_density>0,_sharpness>=0,_anisot‐
11693       ropy>=0,_smoothness>=0,_coherence>=0,_is_boost={ 0 |
11694               1 },_is_curved={ 0 | 1 }
11695
11696           Apply sketch effect to selected images.
11697
11698           Default values: 'nb_angles=2', 'start_angle=45', 'angle_range=180',
11699       'length=30', 'threshold=3', 'opacity=0.03', 'bgfactor=0',
11700            'density=0.6',    'sharpness=0.1',    'anisotropy=0.6',   'smooth‐
11701       ness=0.25', 'coherence=1', 'is_boost=0' and 'is_curved=1'.
11702
11703           Example:
11704             [#1] image.jpg +sketchbw 1 reverse blur[-1] 3 blend[-2,-1]  over‐
11705       lay
11706
11707         sponge:
11708             _size>0
11709
11710           Apply sponge effect on selected images.
11711
11712           Default value: 'size=13'.
11713
11714           Example:
11715             [#1] image.jpg sponge ,
11716
11717         stained_glass:
11718             _edges[%]>=0, shading>=0, is_thin_separators={ 0 | 1 }
11719
11720           Generate stained glass from selected images.
11721
11722           Default values: 'edges=40%', 'shading=0.2' and 'is_precise=0'.
11723
11724           Example:
11725             [#1] image.jpg stained_glass 20%,1 cut 0,20
11726
11727         stars:
11728             _density[%]>=0,_depth>=0,_size>0,_nb_branches>=1,0<=_thick‐
11729       ness<=1,_smoothness[%]>=0,_R,_G,_B,_opacity
11730
11731           Add random stars to selected images.
11732
11733           Default    values:     'density=10%',     'depth=1',     'size=32',
11734       'nb_branches=5', 'thickness=0.38', 'smoothness=0.5', 'R=G=B=200' and
11735            'opacity=1'.
11736
11737           Example:
11738             [#1] image.jpg stars ,
11739
11740         stencil:
11741             _radius[%]>=0,_smoothness>=0,_iterations>=0
11742
11743           Apply stencil filter on selected images.
11744
11745           Default values: 'radius=3', 'smoothness=1' and 'iterations=8'.
11746
11747           Example:
11748             [#1] image.jpg +norm stencil. 2,1,4 +mul rm[0]
11749
11750         stencilbw:
11751             _edges>=0,_smoothness>=0
11752
11753           Apply B&W stencil effect on selected images.
11754
11755           Default values: 'edges=15' and 'smoothness=10'.
11756
11757           Example:
11758             [#1] image.jpg +stencilbw 40,4
11759
11760         stylize:
11761             [style_image],_fidelity_finest,_fidelity_coarsest,_fi‐
11762       delity_smoothness_finest>=0,_fidelity_smoothnes_coarsest>=0,0<=_fi‐
11763       delity_chroma<=1,_init_type,_init_resolution>=0,
11764               init_max_gradient>=0,_patch_size_analysis>0,_patch_size_synthe‐
11765       sis>0,_patch_size_synthesis_fi‐
11766       nal>0,_nb_matches_finest>=0,_nb_matches_coarsest>=0,
11767               _penalize_repetitions>=0,_matching_precision>=0,_scale_fac‐
11768       tor>1,_skip_finest_scales>=0,_"image_matching_command"
11769
11770           Transfer colors and textures from specified style image to selected
11771       images, using a multi-scale patch-mathing algorithm.
11772           If instant display window[0] is opened, the steps of the image syn‐
11773       thesis are displayed on it.
11774           'init_type' can be { 0=best-match | 1=identity | 2=randomized }.
11775
11776           Default values: 'fidelity_finest=0.5', 'fidelity_coarsest=2',  'fi‐
11777       delity_smoothness_finest=3', 'fidelity_smoothness_coarsest=0.5',
11778            'fidelity_chroma=0.1',     'init_type=0',    'init_resolution=16',
11779       'init_max_gradient=0',   'patch_size_analysis=5',   'patch_size_synthe‐
11780       sis=5',
11781            'patch_size_synthesis_final=5',  'nb_matches_finest=2', 'nb_match‐
11782       esc_coarsest=30', 'penalize_repetitions=2', 'matching_precision=2',
11783            'scale_factor=1.85',  'skip_finest_scales=0'   and   'image_match‐
11784       ing_command'="s c,-3 match_pca[0] [2] b[0,2] xy,0.7 n[0,2] 0,255 n[1,2]
11785       0,200 a[0,1] c a[1,2] c"'.
11786
11787         tetris:
11788             _scale>0
11789
11790           Apply tetris effect on selected images.
11791
11792           Default value: 'scale=10'.
11793
11794           Example:
11795             [#1] image.jpg +tetris 10
11796
11797         warhol:
11798             _M>0,_N>0,_smoothness>=0,_color>=0
11799
11800           Create MxN Andy Warhol-like artwork from selected images.
11801
11802           Default values: 'M=3', 'N=M', 'smoothness=2' and 'color=20'.
11803
11804           Example:
11805             [#1] image.jpg warhol 3,3,3,40
11806
11807         weave:
11808             _density>=0,0<=_thickness<=100,0<=_shadow<=100,_shad‐
11809       ing>=0,_fibers_amplitude>=0,_fibers_smoothness>=0,_angle,-1<=_x_curva‐
11810       ture<=1,-1<=_y_curvature<=1
11811
11812           Apply weave effect to the selected images.
11813           'angle' can be { 0=0 deg. | 1=22.5 deg. | 2=45 deg. |  3=67.5  deg.
11814       }.
11815
11816           Default  values:  'density=6',  'thickness=65', 'shadow=40', 'shad‐
11817       ing=0.5', 'fibers_amplitude=0', _'fibers_smoothness=0', 'angle=0'
11818            and 'curvature_x=curvature_y=0'
11819
11820           Example:
11821             [#1] image.jpg weave ,
11822
11823         whirls:
11824             _texture>=0,_smoothness>=0,_darkness>=0,_lightness>=0
11825
11826           Add random whirl texture to selected images.
11827
11828           Default values:  'texture=3',  'smoothness=6',  'darkness=0.5'  and
11829       'lightness=1.8'.
11830
11831           Example:
11832             [#1] image.jpg whirls ,
11833
11834         12.17. Warpings
11835                --------
11836
11837         deform:
11838             _amplitude>=0,_interpolation
11839
11840           Apply random smooth deformation on selected images.
11841           'interpolation' can be { 0=none | 1=linear | 2=bicubic }.
11842
11843           Default value: 'amplitude=10'.
11844
11845           Example:
11846             [#1] image.jpg +deform[0] 10 +deform[0] 20
11847
11848         euclidean2polar:
11849             _center_x[%],_center_y[%],_stretch_factor>0,_boundary_condi‐
11850       tions={ 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }
11851
11852           Apply euclidean to polar transform on selected images.
11853
11854           Default  values:  'center_x=center_y=50%',  'stretch_factor=1'  and
11855       'boundary_conditions=3'.
11856
11857           Example:
11858             [#1] image.jpg +euclidean2polar ,
11859
11860         equirectangular2nadirzenith:
11861
11862           Transform selected equirectangular images to nadir/zenith rectilin‐
11863       ear projections.
11864
11865         fisheye:
11866             _center_x,_center_y,0<=_radius<=100,_amplitude>=0
11867
11868           Apply fish-eye deformation on selected images.
11869
11870           Default values: 'x=y=50', 'radius=50' and 'amplitude=1.2'.
11871
11872           Example:
11873             [#1] image.jpg +fisheye ,
11874
11875         flower:
11876             _amplitude,_frequency,_offset_r[%],_angle,_center_x[%],_cen‐
11877       ter_y[%],_boundary_conditions={  0=dirichlet | 1=neumann | 2=periodic |
11878       3=mirror}
11879
11880           Apply flower deformation on selected images.
11881
11882           Default values: 'amplitude=30', 'frequency=6',  'offset_r=0',  'an‐
11883       gle=0', 'center_x=center_y=50%' and 'boundary_conditions=3'.
11884
11885           Example:
11886             [#1] image.jpg +flower ,
11887
11888         kaleidoscope:
11889             _center_x[%],_center_y[%],_radius,_angle,_boundary_conditions={
11890       0=dirichlet | 1=neumann | 2=periodic | 3=mirror }
11891
11892           Create kaleidoscope effect from selected images.
11893
11894           Default values: 'center_x=center_y=50%',  'radius=100',  'angle=30'
11895       and 'boundary_conditions=3'.
11896
11897           Example:
11898             [#1] image.jpg kaleidoscope ,
11899
11900         map_sphere:
11901             _width>0,_height>0,_radius,_dilation>0,_fading>=0,_fad‐
11902       ing_power>=0
11903
11904           Map selected images on a sphere.
11905
11906           Default values: 'width=height=512',  'radius=100',  'dilation=0.5',
11907       'fading=0' and 'fading_power=0.5'.
11908
11909           Example:
11910             [#1] image.jpg map_sphere ,
11911
11912         nadirzenith2equirectangular:
11913
11914           Transform   selected   nadir/zenith   rectilinear   projections  to
11915       equirectangular images.
11916
11917         polar2euclidean:
11918             _center_x[%],_center_y[%],_stretch_factor>0,_boundary_condi‐
11919       tions={ 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }
11920
11921           Apply euclidean to polar transform on selected images.
11922
11923           Default  values:  'center_x=center_y=50%',  'stretch_factor=1'  and
11924       'boundary_conditions=3'.
11925
11926           Example:
11927             [#1] image.jpg +euclidean2polar ,
11928
11929         raindrops:
11930             _amplitude,_density>=0,_wavelength>=0,_merging_steps>=0
11931
11932           Apply raindrops deformation on selected images.
11933
11934           Default values:  'amplitude=80','density=0.1',  'wavelength=1'  and
11935       'merging_steps=0'.
11936
11937           Example:
11938             [#1] image.jpg +raindrops ,
11939
11940         ripple:
11941             _amplitude,_bandwidth,_shape={  0=block  |  1=triangle | 2=sine |
11942       3=sine+ | 4=random },_angle,_offset
11943
11944           Apply ripple deformation on selected images.
11945
11946           Default values:  'amplitude=10',  'bandwidth=10',  'shape=2',  'an‐
11947       gle=0' and 'offset=0'.
11948
11949           Example:
11950             [#1] image.jpg +ripple ,
11951
11952         rotoidoscope:
11953             _center_x[%],_center_y[%],_tiles>0,_smoothness[%]>=0,_bound‐
11954       ary_conditions={ 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }
11955
11956           Create rotational kaleidoscope effect from selected images.
11957
11958           Default values: 'center_x=center_y=50%', 'tiles=10', 'smoothness=1'
11959       and 'boundary_conditions=3'.
11960
11961           Example:
11962             [#1] image.jpg +rotoidoscope ,
11963
11964         spherize:
11965             _radius[%]>=0,_strength,_smoothness[%]>=0,_center_x[%],_cen‐
11966       ter_y[%],_ratio_x/y>0,_angle,_interpolation
11967
11968           Apply spherize effect on selected images.
11969
11970           Default values: 'radius=50%', 'strength=1',  'smoothness=0',  'cen‐
11971       ter_x=center_y=50%', 'ratio_x/y=1', 'angle=0' and
11972            'interpolation=1'.
11973
11974           Example:
11975             [#1] image.jpg grid 5%,5%,0,0,0.6,255 spherize ,
11976
11977         symmetrize:
11978             _x[%],_y[%],_angle,_boundary_conditions={ 0=dirichlet | 1=neumann
11979       | 2=periodic | 3=mirror },_is_antisymmetry={ 0 | 1 },_swap_sides={ 0  |
11980       1 }
11981
11982           Symmetrize selected images regarding specified axis.
11983
11984           Default  values:  'x=y=50%',  'angle=90',  'boundary_conditions=3',
11985       'is_antisymmetry=0' and 'swap_sides=0'.
11986
11987           Example:
11988             [#1] image.jpg +symmetrize 50%,50%,45 +symmetrize[-1] 50%,50%,-45
11989
11990         transform_polar:
11991             "expr_radius",_"expr_angle",_center_x[%],_center_y[%],_bound‐
11992       ary_conditions={ 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }
11993
11994           Apply  user-defined  transform  on polar representation of selected
11995       images.
11996
11997           Default values: 'expr_radius=R-r', 'expr_rangle=a',  'center_x=cen‐
11998       ter_y=50%' and 'boundary_conditions=3'.
11999
12000           Example:
12001             [#1]  image.jpg  +transform_polar[0]  R*(r/R)^2,a  +transform_po‐
12002       lar[0] r,2*a
12003
12004         twirl:
12005             _amplitude,_center_x[%],_center_y[%],_boundary_conditions={
12006       0=dirichlet | 1=neumann | 2=periodic | 3=mirror }
12007
12008           Apply twirl deformation on selected images.
12009
12010           Default  values: 'amplitude=1', 'center_x=center_y=50%' and 'bound‐
12011       ary_conditions=3'.
12012
12013           Example:
12014             [#1] image.jpg twirl 0.6
12015
12016         warp_perspective:
12017             _x-angle,_y-angle,_zoom>0,_x-center,_y-center,_boundary_condi‐
12018       tions={ 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }
12019
12020           Warp selected images with perspective deformation.
12021
12022           Default  values: 'x-angle=1.5', 'y-angle=0', 'zoom=1', 'x-center=y-
12023       center=50' and 'boundary_conditions=2'.
12024
12025           Example:
12026             [#1] image.jpg warp_perspective ,
12027
12028         water:
12029             _amplitude,_smoothness>=0,_angle
12030
12031           Apply water deformation on selected images.
12032
12033           Default values: 'amplitude=30', 'smoothness=1.5' and 'angle=45'.
12034
12035           Example:
12036             [#1] image.jpg water ,
12037
12038         wave:
12039             _amplitude>=0,_frequency>=0,_center_x,_center_y
12040
12041           Apply wave deformation on selected images.
12042
12043           Default values: 'amplitude=4', 'frequency=0.4'  and  'center_x=cen‐
12044       ter_y=50'.
12045
12046           Example:
12047             [#1] image.jpg wave ,
12048
12049         wind:
12050             _amplitude>=0,_angle,0<=_attenuation<=1,_threshold
12051
12052           Apply wind effect on selected images.
12053
12054           Default  values:  'amplitude=20',  'angle=0', 'attenuation=0.7' and
12055       'threshold=20'.
12056
12057           Example:
12058             [#1] image.jpg +wind ,
12059
12060         zoom:
12061             _factor,_cx,_cy,_cz,_boundary_conditions={ 0=dirichlet  |  1=neu‐
12062       mann | 2=periodic | 3=mirror }
12063
12064           Apply zoom factor to selected images.
12065
12066           Default  values:  'factor=1',  'cx=cy=cz=0.5'  and 'boundary_condi‐
12067       tions=0'.
12068
12069           Example:
12070             [#1] image.jpg +zoom[0] 0.6 +zoom[0] 1.5
12071
12072         12.18. Degradations
12073                ------------
12074
12075         cracks:
12076             0<=_density<=100,_is_relief={ 0 | 1 },_opacity,_color1,...
12077
12078           Draw random cracks on selected images with specified color.
12079
12080           Default  values:  'density=25',  'is_relief=0',   'opacity=1'   and
12081       'color1=0'.
12082
12083           Example:
12084             [#1] image.jpg +cracks ,
12085
12086         light_patch:
12087             _density>0,_darkness>=0,_lightness>=0
12088
12089           Add light patches to selected images.
12090
12091           Default values: 'density=10', 'darkness=0.9' and 'lightness=1.7'.
12092
12093           Example:
12094             [#1] image.jpg +light_patch 20,0.9,4
12095
12096         noise_hurl:
12097             _amplitude>=0
12098
12099           Add hurl noise to selected images.
12100
12101           Default value: 'amplitude=10'.
12102
12103           Example:
12104             [#1] image.jpg +noise_hurl ,
12105
12106         pixelize:
12107             _scale_x>0,_scale_y>0,_scale_z>0
12108
12109           Pixelize selected images with specified scales.
12110
12111           Default values: 'scale_x=20' and 'scale_y=scale_z=scale_x'.
12112
12113           Example:
12114             [#1] image.jpg +pixelize ,
12115
12116         scanlines:
12117             _amplitude,_bandwidth,_shape={  0=block  |  1=triangle | 2=sine |
12118       3=sine+ | 4=random },_angle,_offset
12119
12120           Apply ripple deformation on selected images.
12121
12122           Default values: 'amplitude=60', 'bandwidth=2', 'shape=0', 'angle=0'
12123       and 'offset=0'.
12124
12125           Example:
12126             [#1] image.jpg +scanlines ,
12127
12128         shade_stripes:
12129             _frequency>=0,_direction={  0=horizontal  |  1=vertical  },_dark‐
12130       ness>=0,_lightness>=0
12131
12132           Add shade stripes to selected images.
12133
12134           Default values: 'frequency=5',  'direction=1',  'darkness=0.8'  and
12135       'lightness=2'.
12136
12137           Example:
12138             [#1] image.jpg +shade_stripes 30
12139
12140         shadow_patch:
12141             _opacity>=0
12142
12143           Add shadow patches to selected images.
12144
12145           Default value: 'opacity=0.7'.
12146
12147           Example:
12148             [#1] image.jpg +shadow_patch 0.4
12149
12150         spread:
12151             _dx>=0,_dy>=0,_dz>=0
12152
12153           Spread pixel values of selected images randomly along x,y and z.
12154
12155           Default values: 'dx=3', 'dy=dx' and 'dz=0'.
12156
12157           Example:
12158             [#1] image.jpg +spread 3
12159
12160         stripes_y:
12161             _frequency>=0
12162
12163           Add vertical stripes to selected images.
12164
12165           Default value: 'frequency=10'.
12166
12167           Example:
12168             [#1] image.jpg +stripes_y ,
12169
12170         texturize_canvas:
12171             _amplitude>=0,_fibrousness>=0,_emboss_level>=0
12172
12173           Add paint canvas texture to selected images.
12174
12175           Default    values:   'amplitude=20',   'fibrousness=3'   and   'em‐
12176       boss_level=0.6'.
12177
12178           Example:
12179             [#1] image.jpg +texturize_canvas ,
12180
12181         texturize_paper:
12182
12183           Add paper texture to selected images.
12184
12185           Example:
12186             [#1] image.jpg +texturize_paper
12187
12188         vignette:
12189             _strength>=0,0<=_radius_min<=100,0<=_radius_max<=100
12190
12191           Add vignette effect to selected images.
12192
12193           Default   values:   'strength=100',   'radius_min=70'   and    'ra‐
12194       dius_max=90'.
12195
12196           Example:
12197             [#1] image.jpg vignette ,
12198
12199         watermark_visible:
12200             _text,0<_opacity<1,_size>0,_angle,_mode={    0=remove   |   1=add
12201       },_smoothness>=0
12202
12203           Add or remove a visible watermark on selected images  (value  range
12204       must be [0,255]).
12205
12206           Default  values:  'text=(c)  G'MIC', 'opacity=0.3', 'size=53', 'an‐
12207       gle=25', 'mode=1' and 'smoothness=0'.
12208
12209           Example:
12210             [#1] image.jpg watermark_visible ,0.7
12211
12212         12.19. Blending and Fading
12213                -------------------
12214
12215         blend:
12216             [layer],blending_mode,_opacity[%],_selection_is={ 0=base-layers |
12217       1=top-layers } |
12218             blending_mode,_opacity[%]
12219
12220           Blend  selected G,GA,RGB or RGBA images by specified layer or blend
12221       all selected images together,
12222           using specified blending mode.
12223           'blending_mode' can be { add | alpha | and | average | blue |  burn
12224       | darken | difference |
12225           divide | dodge | edges | exclusion | freeze | grainextract | grain‐
12226       merge | green | hardlight |
12227           hardmix | hue | interpolation | lchlightness | lighten |  lightness
12228       | linearburn | linearlight | luminance |
12229           multiply  |  negation  |  or | overlay | pinlight | red | reflect |
12230       saturation |
12231           screen | seamless | seamless_mixed | shapeareamax | shapeareamax0 |
12232       shapeareamin | shapeareamin0 |
12233           shapeaverage   |  shapeaverage0  |  shapemedian  |  shapemedian0  |
12234       shapemin | shapemin0 | shapemax | shapemax0 |
12235           shapeprevalent | softburn | softdodge | softlight |  stamp  |  sub‐
12236       tract | value | vividlight | xor }.
12237           'opacity' must be in range '[0,1]' (or '[0%,100%]').
12238
12239           Default  values:  'blending_mode=alpha',  'opacity=1'  and  'selec‐
12240       tion_is=0'.
12241
12242           Example:
12243             [#1] image.jpg +drop_shadow ,  resize2dy[-1]  200  rotate[-1]  20
12244       +blend alpha display_rgba[-2]
12245             [#2] image.jpg testimage2d {w},{h} blend overlay
12246             [#3]  command  "ex : $""=arg repeat $""# +blend[0,1] ${arg{$>+1}}
12247       text_outline[-1] Mode:
12248              and,average,blue,burn,darken
12249             [#4] command "ex : $""=arg repeat $""#  +blend[0,1]  ${arg{$>+1}}
12250       text_outline[-1] Mode:
12251              divide,dodge,exclusion,freeze,grainextract,grainmerge
12252             [#5]  command  "ex : $""=arg repeat $""# +blend[0,1] ${arg{$>+1}}
12253       text_outline[-1] Mode:
12254              hardlight,hardmix,hue,interpolation,lighten,lightness
12255             [#6] command "ex : $""=arg repeat $""#  +blend[0,1]  ${arg{$>+1}}
12256       text_outline[-1] Mode:
12257              linearlight,luminance,multiply,negation,or,overlay
12258             [#7]  command  "ex : $""=arg repeat $""# +blend[0,1] ${arg{$>+1}}
12259       text_outline[-1] Mode:
12260              reflect,saturation,screen,shapeaverage,softburn
12261             [#8] command "ex : $""=arg repeat $""#  +blend[0,1]  ${arg{$>+1}}
12262       text_outline[-1] Mode:
12263              softlight,stamp,subtract,value,vividlight,xor
12264
12265         blend_edges:
12266             smoothness[%]>=0
12267
12268           Blend selected images togethers using 'edges' mode.
12269
12270           Example:
12271             [#1] image.jpg testimage2d {w},{h} +blend_edges 0.8
12272
12273         blend_fade:
12274             [fading_shape]
12275
12276           Blend selected images together using specified fading shape.
12277
12278           Example:
12279             [#1] image.jpg testimage2d {w},{h} 100%,100%,1,1,'cos(y/10)' nor‐
12280       malize[-1] 0,1 +blend_fade[0,1] [2]
12281
12282         blend_median:
12283
12284           Blend selected images together using 'median' mode.
12285
12286           Example:
12287             [#1] image.jpg testimage2d {w},{h} +mirror[0] y +blend_median
12288
12289         blend_seamless:
12290             _is_mixed_mode={ 0 | 1 },_inner_fading[%]>=0,_outer_fading[%]>=0
12291
12292           Blend selected images using  a  seamless  blending  mode  (Poisson-
12293       based).
12294
12295           Default  values:  'is_mixed=0',  'inner_fading=0'  and  'outer_fad‐
12296       ing=100%'.
12297
12298         fade_diamond:
12299             0<=_start<=100,0<=_end<=100
12300
12301           Create diamond fading from selected images.
12302
12303           Default values: 'start=80' and 'end=90'.
12304
12305           Example:
12306             [#1] image.jpg testimage2d {w},{h} +fade_diamond 80,85
12307
12308         fade_linear:
12309             _angle,0<=_start<=100,0<=_end<=100
12310
12311           Create linear fading from selected images.
12312
12313           Default values: 'angle=45', 'start=30' and 'end=70'.
12314
12315           Example:
12316             [#1] image.jpg testimage2d {w},{h} +fade_linear 45,48,52
12317
12318         fade_radial:
12319             0<=_start<=100,0<=_end<=100
12320
12321           Create radial fading from selected images.
12322
12323           Default values: 'start=30' and 'end=70'.
12324
12325           Example:
12326             [#1] image.jpg testimage2d {w},{h} +fade_radial 30,70
12327
12328         fade_x:
12329             0<=_start<=100,0<=_end<=100
12330
12331           Create horizontal fading from selected images.
12332
12333           Default values: 'start=30' and 'end=70'.
12334
12335           Example:
12336             [#1] image.jpg testimage2d {w},{h} +fade_x 30,70
12337
12338         fade_y:
12339             0<=_start<=100,0<=_end<=100
12340
12341           Create vertical fading from selected images.
12342
12343           Default values: 'start=30' and 'end=70'.
12344
12345           Example:
12346             [#1] image.jpg testimage2d {w},{h} +fade_y 30,70
12347
12348         fade_z:
12349             0<=_start<=100,0<=_end<=100
12350
12351           Create transversal fading from selected images.
12352
12353           Default values: 'start=30' and 'end=70'.
12354
12355         sub_alpha:
12356             [base_image],_opacity_gain>=1
12357
12358           Compute the minimal alpha-channel  difference  (opposite  of  alpha
12359       blending) between the selected images
12360           and the specified base image.
12361           The  alpha  difference  A-B  is defined as the image having minimal
12362       opacity, such that alpha_blend(B,A-B) = A.
12363
12364           Default value: 'opacity_gain=1'.
12365
12366           Example:
12367             [#1] image.jpg testimage2d {w},{h} +sub_alpha[0] [1] display_rgba
12368
12369         12.20. Image Sequences and Videos
12370                --------------------------
12371
12372         animate:
12373             fil‐
12374       ter_name,"param1_start,...,paramN_start","param1_end,...,paramN_end",nb_frames>=0,_out‐
12375       put_frames={ 0 | 1 },_output_filename |
12376             delay>0,_back and forth={ 0 | 1 }
12377
12378           Animate filter from starting parameters to ending parameters or an‐
12379       imate selected images
12380           in a display window.
12381
12382           Default value: 'delay=30'.
12383
12384           Example:
12385             [#1] image.jpg animate flower,"0,3","20,8",9
12386
12387         apply_camera:
12388             _"command",_camera_index>=0,_skip_frames>=0,_output_filename
12389
12390           Apply  specified  command  on live camera stream, and display it on
12391       display window [0].
12392           This command requires features from the OpenCV library (not enabled
12393       in G'MIC by default).
12394
12395           Default  values:  'command=""',  'camera_index=0' (default camera),
12396       'skip_frames=0' and 'output_filename=""'.
12397
12398         apply_files:
12399             "filename_pattern",_"command",_first_frame>=0,_last_frame={ >=0 |
12400       -1=last },_frame_step>=1,_output_filename
12401
12402           Apply a G'MIC command on specified input image files, in a streamed
12403       way.
12404           If a display window is opened, rendered frames are displayed in  it
12405       during processing.
12406           The output filename may have extension '.avi' or '.mp4' (saved as a
12407       video), or any other usual image file
12408           extension (saved as a sequence of images).
12409
12410           Default     values:     'command=(undefined)',     'first_frame=0',
12411       'last_frame=-1', 'frame_step=1' and 'output_filename=(undefined)'.
12412
12413         apply_video:
12414             video_filename,_"command",_first_frame>=0,_last_frame={   >=0   |
12415       -1=last },_frame_step>=1,_output_filename
12416
12417           Apply a G'MIC command on all frames of the  specified  input  video
12418       file, in a streamed way.
12419           If  a display window is opened, rendered frames are displayed in it
12420       during processing.
12421           The output filename may have extension '.avi' or '.mp4' (saved as a
12422       video), or any other usual image
12423           file extension (saved as a sequence of images).
12424           This command requires features from the OpenCV library (not enabled
12425       in G'MIC by default).
12426
12427           Default values:  'first_frame=0',  'last_frame=-1',  'frame_step=1'
12428       and 'output_filename=(undefined)'.
12429
12430         average_files:
12431             "filename_pattern",_first_frame>=0,_last_frame={  >=0  |  -1=last
12432       },_frame_step>=1,_output_filename
12433
12434           Average specified input image files, in a streamed way.
12435           If a display window is opened, rendered frames are displayed in  it
12436       during processing.
12437           The output filename may have extension '.avi' or '.mp4' (saved as a
12438       video), or any other usual image
12439           file extension (saved as a sequence of images).
12440
12441           Default values:  'first_frame=0',  'last_frame=-1',  'frame_step=1'
12442       and 'output_filename=(undefined)'.
12443
12444         average_video:
12445             video_filename,_first_frame>=0,_last_frame={    >=0   |   -1=last
12446       },_frame_step>=1,_output_filename
12447
12448           Average frames of specified input video file, in a streamed way.
12449           If a display window is opened, rendered frames are displayed in  it
12450       during processing.
12451           The output filename may have extension '.avi' or '.mp4' (saved as a
12452       video), or any other usual image
12453           file extension (saved as a sequence of images).
12454           This command requires features from the OpenCV library (not enabled
12455       in G'MIC by default).
12456
12457           Default  values:  'first_frame=0',  'last_frame=-1', 'frame_step=1'
12458       and 'output_filename=(undefined)'.
12459
12460         fade_files:
12461             "filename_pattern",_nb_in‐
12462       ner_frames>0,_first_frame>=0,_last_frame={      >=0      |      -1=last
12463       },_frame_step>=1,_output_filename
12464
12465           Generate a temporal fading from specified input image files,  in  a
12466       streamed way.
12467           If  a display window is opened, rendered frames are displayed in it
12468       during processing.
12469           The output filename may have extension 'avi' or 'mp4' (saved  as  a
12470       video), or any other usual image
12471           file extension (saved as a sequence of images).
12472
12473           Default      values:     'nb_inner_frames=10',     'first_frame=0',
12474       'last_frame=-1', 'frame_step=1' and 'output_filename=(undefined)'.
12475
12476         fade_video:
12477             video_filename,_nb_inner_frames>0,_first_frame>=0,_last_frame={
12478       >=0 | -1=last },_frame_step>=1,_output_filename
12479
12480           Create  a temporal fading sequence from specified input video file,
12481       in a streamed way.
12482           If a display window is opened, rendered frames are displayed in  it
12483       during processing.
12484           This command requires features from the OpenCV library (not enabled
12485       in G'MIC by default).
12486
12487           Default     values:     'nb_inner_frames=10',      'first_frame=0',
12488       'last_frame=-1', 'frame_step=1' and 'output_filename=(undefined)'.
12489
12490         files2video:
12491             "filename_pattern",_output_filename,_fps>0,_codec
12492
12493           Convert several files into a single video file.
12494
12495           Default    values:   'output_filename=output.mp4',   'fps=25'   and
12496       'codec=mp4v'.
12497
12498         median_files:
12499             "filename_pattern",_first_frame>=0,_last_frame={  >=0  |  -1=last
12500       },_frame_step>=1,_frame_rows[%]>=1,_is_fast_approximation={ 0 | 1 }
12501
12502           Compute  the  median  frame  of  specified  input image files, in a
12503       streamed way.
12504           If a display window is opened, rendered frame is  displayed  in  it
12505       during processing.
12506
12507           Default  values:  'first_frame=0', 'last_frame=-1', 'frame_step=1',
12508       'frame_rows=20%' and 'is_fast_approximation=0'.
12509
12510         median_video:
12511             video_filename,_first_frame>=0,_last_frame={   >=0   |    -1=last
12512       },_frame_step>=1,_frame_rows[%]>=1,_is_fast_approximation={ 0 | 1 }
12513
12514           Compute  the  median  of  all  frames  of an input video file, in a
12515       streamed way.
12516           If a display window is opened, rendered frame is  displayed  in  it
12517       during processing.
12518           This command requires features from the OpenCV library (not enabled
12519       in G'MIC by default).
12520
12521           Default values: 'first_frame=0',  'last_frame=-1',  'frame_step=1',
12522       'frame_rows=100%' and 'is_fast_approximation=1'.
12523
12524         morph:
12525             nb_inner_frames>=1,_smoothness>=0,_precision>=0
12526
12527           Create morphing sequence between selected images.
12528
12529           Default values: 'smoothness=0.1' and 'precision=4'.
12530
12531           Example:
12532             [#1] image.jpg +rotate 20,1,1,50%,50% morph 9
12533
12534         morph_files:
12535             "filename_pattern",_nb_inner_frames>0,_smoothness>=0,_preci‐
12536       sion>=0,_first_frame>=0,_last_frame={       >=0        |        -1=last
12537       },_frame_step>=1,_output_filename
12538
12539           Generate a temporal morphing from specified input image files, in a
12540       streamed way.
12541           If a display window is opened, rendered frames are displayed in  it
12542       during processing.
12543           The output filename may have extension '.avi' or '.mp4' (saved as a
12544       video), or any other usual image
12545           file extension (saved as a sequence of images).
12546
12547           Default  values:  'nb_inner_frames=10',  'smoothness=0.1',  'preci‐
12548       sion=4', 'first_frame=0', 'last_frame=-1', 'frame_step=1' and
12549            'output_filename=(undefined)'.
12550
12551         morph_rbf:
12552             nb_in‐
12553       ner_frames>=1,xs0[%],ys0[%],xt0[%],yt0[%],...,xsN[%],ysN[%],xtN[%],ytN[%]
12554
12555           Create  morphing  sequence between selected images, using RBF-based
12556       interpolation.
12557           Each argument (xsk,ysk)-(xtk,ytk) corresponds to the coordinates of
12558       a keypoint
12559           respectively  on  the source and target images. The set of all key‐
12560       points define the overall image deformation.
12561
12562         morph_video:
12563             video_filename,_nb_inner_frames>0,_smoothness>=0,_preci‐
12564       sion>=0,_first_frame>=0,_last_frame={        >=0        |       -1=last
12565       },_frame_step>=1,_output_filename
12566
12567           Generate a temporal morphing from specified input video file, in  a
12568       streamed way.
12569           If  a display window is opened, rendered frames are displayed in it
12570       during processing.
12571           The output filename may have extension '.avi' or '.mp4' (saved as a
12572       video), or any other usual image
12573           file extension (saved as a sequence of images).
12574           This command requires features from the OpenCV library (not enabled
12575       in G'MIC by default).
12576
12577           Default  values:  'nb_inner_frames=10',  'smoothness=0.1',  'preci‐
12578       sion=4', 'first_frame=0', 'last_frame=-1', 'frame_step=1' and
12579            'output_filename=(undefined)'.
12580
12581         register_nonrigid:
12582             [destination],_smoothness>=0,_precision>0,_nb_scale>=0
12583
12584           Register  selected  source images with specified destination image,
12585       using non-rigid warp.
12586
12587           Default     values:     'smoothness=0.2',     'precision=6'     and
12588       'nb_scale=0(auto)'.
12589
12590           Example:
12591             [#1] image.jpg +rotate 20,1,1,50%,50% +register_nonrigid[0] [1]
12592
12593         register_rigid:
12594             [destination],_smoothness>=0,_boundary_conditions={ 0=dirichlet |
12595       1=neumann | 2=periodic | 3=mirror }
12596
12597           Register selected source images with specified  destination  image,
12598       using rigid warp (shift).
12599
12600           Default values: 'smoothness=0.1%' and 'boundary_conditions=0'.
12601
12602           Example:
12603             [#1] image.jpg +shift 30,20 +register_rigid[0] [1]
12604
12605         transition:
12606             [transition_shape],nb_added_frames>=0,100>=shading>=0,_sin‐
12607       gle_frame_only={ -1=disabled | >=0 }
12608
12609           Generate a transition sequence between selected images.
12610
12611           Default values: 'shading=0' and 'single_frame_only=-1'.
12612
12613           Example:
12614             [#1] image.jpg  +mirror  c  100%,100%  plasma[-1]  1,1,6  transi‐
12615       tion[0,1] [2],5
12616
12617         transition3d:
12618             _nb_frames>=2,_nb_xtiles>0,_nb_ytiles>0,_axis_x,_axis_y,_axis_z,_is_an‐
12619       tialias={ 0 | 1 }
12620
12621           Create 3D transition sequence between selected consecutive images.
12622           'axis_x', 'axis_y' and 'axis_z' can be set as mathematical  expres‐
12623       sions, depending on 'x' and 'y'.
12624
12625           Default     values:     'nb_frames=10',    'nb_xtiles=nb_ytiles=3',
12626       'axis_x=1', 'axis_y=1', 'axis_z=0' and 'is_antialias=1'.
12627
12628           Example:
12629             [#1] image.jpg +blur 5 transition3d 9 display_rgba
12630
12631         video2files:
12632             input_filename,_output_filename,_first_frame>=0,_last_frame={ >=0
12633       | -1=last },_frame_step>=1
12634
12635           Split  specified  input  video  file into image files, one for each
12636       frame.
12637           First and last frames as well as step between frames can be  speci‐
12638       fied.
12639
12640           Default   values:   'output_filename=frame.png',   'first_frame=0',
12641       'last_frame=-1' and 'frame_step=1'.
12642
12643         12.21. Convenience Functions
12644                ---------------------
12645
12646         alert:
12647             _title,_message,_label_button1,_label_button2,...
12648
12649           Display an alert box and wait for user's choice.
12650           If a single image is in the selection, it is used as  an  icon  for
12651       the alert box.
12652
12653           Default values: 'title=[G'MIC Alert]' and 'message=This is an alert
12654       box.'.
12655
12656         arg:
12657             n>=1,_arg1,...,_argN
12658
12659           Return the n-th argument of the specified argument list.
12660
12661         arg0:
12662             n>=0,_arg0,...,_argN
12663
12664           Return the n-th argument of the specified argument list (where  'n'
12665       starts from '0').
12666
12667         arg2img:
12668             argument_1,...,argument_N
12669
12670           Split  specified  list  of arguments and return each as a new image
12671       (as a null-terminated string).
12672
12673         arg2var:
12674             variable_name,argument_1,...,argument_N
12675
12676           For each i in [1...N], set 'variable_name$i=argument_i'.
12677           The variable name should be global  to  make  this  command  useful
12678       (i.e. starts by an underscore).
12679
12680         autocrop_coords:
12681             value1,value2,... | auto
12682
12683           Return  coordinates  (x0,y0,z0,x1,y1,z1) of the autocrop that could
12684       be performed on the latest
12685           of the selected images.
12686
12687           Default value: 'auto'
12688
12689         average_vectors:
12690
12691           Return the vector-valued average of the latest of the selected  im‐
12692       ages.
12693
12694         base642img:
12695             "base64_string"
12696
12697           Decode given base64-encoded string as a newly inserted image at the
12698       end of the list.
12699           The  argument  string  must  have  been  generated  using   command
12700       'img2base64'.
12701
12702         base642uint8:
12703             "base64_string"
12704
12705           Decode given base64-encoded string as a newly inserted 1-column im‐
12706       age at the end of the list.
12707           The  argument  string  must  have  been  generated  using   command
12708       'uint82base64'.
12709
12710         basename:
12711             file_path,_variable_name_for_folder
12712
12713           Return the basename of a file path, and opt. its folder location.
12714           When  specified 'variable_name_for_folder' must starts by an under‐
12715       score
12716           (global variable accessible from calling function).
12717
12718         bin:
12719             binary_int1,...
12720
12721           Print specified binary integers into their octal, decimal, hexadec‐
12722       imal and string representations.
12723
12724         bin2dec:
12725             binary_int1,...
12726
12727           Convert  specified  binary  integers into their decimal representa‐
12728       tions.
12729
12730         cat:
12731             filename,_display_line_numbers={ 0 | 1 },_line_selection,
12732
12733           Print specified line selection of given filename on stdout.
12734
12735           Default values: 'display_line_numbers=1' and 'line_selection=^'.
12736
12737         color2name:
12738             R,G,B
12739
12740           Return the name (as a string, in English)  that  most  matches  the
12741       specified color.
12742
12743         covariance_vectors:
12744             _avg_outvarname
12745
12746           Return  the  covariance  matrix  of the vector-valued colors in the
12747       latest of the selected images
12748           (for arbitrary number of channels).
12749           Parameter 'avg_outvarname' is used as a variable  name  that  takes
12750       the value of the average vector-value.
12751
12752         da_freeze:
12753
12754           Convert  each  of the selected dynamic arrays into a 1-column image
12755       whose height is the number of array elements.
12756
12757         dec:
12758             decimal_int1,...
12759
12760           Print specified decimal integers into their binary, octal, hexadec‐
12761       imal and string representations.
12762
12763         dec2str:
12764             decimal_int1,...
12765
12766           Convert specifial decimal integers into its string representation.
12767
12768         dec2bin:
12769             decimal_int1,...
12770
12771           Convert  specified  decimal  integers into their binary representa‐
12772       tions.
12773
12774         dec2hex:
12775             decimal_int1,...
12776
12777           Convert specified decimal integers into their hexadecimal represen‐
12778       tations.
12779
12780         dec2oct:
12781             decimal_int1,...
12782
12783           Convert  specified  decimal  integers  into their octal representa‐
12784       tions.
12785
12786         fibonacci:
12787             N>=0
12788
12789           Return the Nth number of the Fibonacci sequence.
12790
12791           Example:
12792             [#1] echo ${"fibonacci 10"}
12793
12794
12795             [gmic]-0./ Start G'MIC interpreter.
12796             [gmic]-0./ 55
12797             [gmic]-0./ End G'MIC interpreter.
12798
12799         file_mv:
12800             filename_src,filename_dest
12801
12802           Rename or move a file from a location $1 to another location $2.
12803
12804         filename:
12805             filename,_number1,_number2,...,_numberN
12806
12807           Return a filename numbered with specified indices.
12808
12809         filename_rand:
12810
12811           Return a random filename for storing temporary data.
12812
12813         filename_dated:
12814             filename
12815
12816           Convert specified filename to one stamped  with  the  current  date
12817       ('filename_YYYYMMDD_HHMMSS.ext').
12818
12819         files (+):
12820             _mode,path
12821
12822           Return the list of files and/or subfolders from specified path.
12823           'path' can be eventually a matching pattern.
12824           'mode'  can  be { 0=files only | 1=folders only | 2=files + folders
12825       }.
12826           Add '3' to 'mode' to return full paths instead of filenames only.
12827
12828           Default value: 'mode=5'.
12829
12830         files2img:
12831             _mode,path
12832
12833           Insert a new image where each vector-valued pixel is a  string  en‐
12834       coding the filenames returned by command files.
12835           Useful  to manage list of filenames containing characters that have
12836       a special meaning in the G'MIC language,such as spaces or commas.
12837
12838         fitratio_wh:
12839             min_width,min_height,ratio_wh
12840
12841           Return  a   2D   size   'width,height'   which   is   bigger   than
12842       'min_width,min_height' and has the specified w/h ratio.
12843
12844         fitscreen:
12845             width,height,_depth,_minimal_size[%],_maximal_size[%] |
12846             [image],_minimal_size[%],_maximal_size[%]
12847
12848           Return the 'ideal' size WxH for a window intended to display an im‐
12849       age of specified size on screen.
12850
12851           Default   values:   'depth=1',   'minimal_size=128'   and    'maxi‐
12852       mal_size=85%'.
12853
12854         fontchart:
12855
12856           Insert G'MIC font chart at the end of the image list.
12857
12858           Example:
12859             [#1] fontchart
12860
12861         fps:
12862
12863           Return the number of time this function is called per second, or -1
12864       if this info is not yet available.
12865           Useful to display the framerate when displaying animations.
12866
12867         gcd:
12868             a,b
12869
12870           Return the GCD (greatest common divisor) between a and b.
12871
12872         hex:
12873             hexadecimal_int1,...
12874
12875           Print specified hexadecimal integers into their binary, octal, dec‐
12876       imal and string representations.
12877
12878         hex2dec:
12879             hexadecimal_int1,...
12880
12881           Convert specified hexadecimal integers into their decimal represen‐
12882       tations.
12883
12884         hex2img:
12885             "hexadecimal_string"
12886
12887           Insert new image 1xN at the end of the list with  values  specified
12888       by the given hexadecimal-encoded string.
12889
12890         hex2str:
12891             hexadecimal_string
12892
12893           Convert specified hexadecimal string into a string.
12894           See also: str2hex.
12895
12896         img2base64:
12897             _encoding={ 0=base64 | 1=base64url },_store_names={ 0 | 1 }
12898
12899           Encode selected images as a base64-encoded string.
12900           The images can be then decoded using command 'base642img'.
12901
12902           Default values: 'encoding=0' and 'store_names=1'.
12903
12904         img2hex:
12905
12906           Return  representation  of  last  image  as  an hexadecimal-encoded
12907       string.
12908           Input image must have values that are integers in [0,255].
12909
12910         img2str:
12911
12912           Return the content of the latest of the selected images as  a  spe‐
12913       cial G'MIC input string.
12914
12915         img2text:
12916             _line_separator
12917
12918           Return text contained in a multi-line image.
12919
12920           Default value: 'line_separator= '.
12921
12922         img82hex:
12923
12924           Convert selected 8bits-valued vectors into their hexadecimal repre‐
12925       sentations (ascii-encoded).
12926
12927         hex2img8:
12928
12929           Convert selected hexadecimal representations  (ascii-encoded)  into
12930       8bits-valued vectors.
12931
12932         is_3d:
12933
12934           Return 1 if all of the selected images are 3D objects, 0 otherwise.
12935
12936         is_change:
12937             _value={ 0=false | 1=true }
12938
12939           Set or unset the 'is_change' flag associated to the image list.
12940           This  flag  tells  the  interpreter  whether  or not the image list
12941       should be displayed when the pipeline ends.
12942
12943           Default value: 'value=1'.
12944
12945         is_half:
12946
12947           Return 1 if the type of image pixels is limited to half-float.
12948
12949         is_ext:
12950             filename,_extension
12951
12952           Return 1 if specified filename has a given extensioin.
12953
12954         is_image_arg:
12955             string
12956
12957           Return 1 if specified string looks like '[ind]'.
12958
12959         is_pattern:
12960             string
12961
12962           Return  1  if  specified  string  looks  like  a  drawing   pattern
12963       '0x......'.
12964
12965         is_percent:
12966             string
12967
12968           Return 1 if specified string ends with a '%', 0 otherwise.
12969
12970         is_varname:
12971             string
12972
12973           Return  1 if specified string can be considered as a valid variable
12974       name.
12975
12976         is_videofilename:
12977             filename
12978
12979           Return 1 if extension of specified filename is typical  from  video
12980       files.
12981
12982         is_macos:
12983
12984           Return 1 if current computer OS is Darwin (MacOS), 0 otherwise.
12985
12986         is_windows:
12987
12988           Return 1 if current computer OS is Windows, 0 otherwise.
12989
12990         lof:
12991             feature
12992
12993           Return  the  list  of  specified features (separated by commas) for
12994       each selected images.
12995
12996         math_lib:
12997
12998           Return string that defines a set of several useful macros  for  the
12999       embedded math evaluator.
13000
13001         mad:
13002
13003           Return  the  MAD  (Maximum Absolute Deviation) of the last selected
13004       image.
13005           The MAD is defined as MAD = med_i|x_i-med_j(x_j)|
13006
13007         max_w:
13008
13009           Return the maximal width between selected images.
13010
13011         max_h:
13012
13013           Return the maximal height between selected images.
13014
13015         max_d:
13016
13017           Return the maximal depth between selected images.
13018
13019         max_s:
13020
13021           Return the maximal spectrum between selected images.
13022
13023         max_wh:
13024
13025           Return the maximal wxh size of selected images.
13026
13027         max_whd:
13028
13029           Return the maximal wxhxd size of selected images.
13030
13031         max_whds:
13032
13033           Return the maximal wxhxdxs size of selected images.
13034
13035         median_vectors:
13036
13037           Return the median vector value of the last selected  image  (median
13038       computed channel by channel)
13039
13040         min_w:
13041
13042           Return the minimal width between selected images.
13043
13044         min_h:
13045
13046           Return the minimal height between selected images.
13047
13048         min_d:
13049
13050           Return the minimal depth between selected images.
13051
13052         min_s:
13053
13054           Return the minimal s size of selected images.
13055
13056         min_wh:
13057
13058           Return the minimal wxh size of selected images.
13059
13060         min_whd:
13061
13062           Return the minimal wxhxd size of selected images.
13063
13064         min_whds:
13065
13066           Return the minimal wxhxdxs size of selected images.
13067
13068         name2color:
13069             name
13070
13071           Return the R,G,B color that matches the specified color name.
13072
13073         nmd (+):
13074             Shortcut for command 'named'.
13075
13076         named (+):
13077             _mode,"name1","name2",...
13078
13079           Return  the set of indices corresponding to images of the selection
13080       with specified names.
13081           After this command returns, the status contains a list  of  indices
13082       (unsigned integers),
13083           separated  by  commas  (or  an empty string if no images with those
13084       names have been found).
13085           (equivalent to shortcut command 'nmd').
13086
13087           'mode' can be { 0=all indices (default) | 1=lowest index |  2=high‐
13088       est index | 3 = all indices (case insensitive) | 4 = lowest index (case
13089       insensitive) | 5 = highest
13090           index (case insensitive)}
13091
13092         narg:
13093             arg1,arg2,...,argN
13094
13095           Return number of specified arguments.
13096
13097         normalize_filename:
13098             filename
13099
13100           Return a "normalized" version of the  specified  filename,  without
13101       spaces and capital letters.
13102
13103         oct:
13104             octal_int1,...
13105
13106           Print specified octal integers into their binary, decimal, hexadec‐
13107       imal and string representations.
13108
13109         oct2dec:
13110             octal_int1,...
13111
13112           Convert specified octal integers  into  their  decimal  representa‐
13113       tions.
13114
13115         padint:
13116             number,_size>0
13117
13118           Return  a  integer  with 'size' digits (eventually left-padded with
13119       '0').
13120
13121         path_cache:
13122
13123           Return a path to store G'MIC data files for one user  (whose  value
13124       is OS-dependent).
13125
13126         path_current:
13127
13128           Return current folder from where G'MIC has been run.
13129
13130         path_gimp:
13131
13132           Return a path to store GIMP configuration files for one user (whose
13133       value is OS-dependent).
13134
13135         path_tmp:
13136
13137           Return a path to store temporary files (whose  value  is  OS-depen‐
13138       dent).
13139
13140         remove_copymark:
13141
13142           Remove copymark suffix in names of selected images.
13143
13144         reset:
13145
13146           Reset global parameters of the interpreter environment.
13147
13148         rgb:
13149
13150           Return a random int-valued RGB color.
13151
13152         rgba:
13153
13154           Return a random int-valued RGBA color.
13155
13156         shell_cols:
13157
13158           Return the estimated number of columns of the current shell.
13159
13160         size_value:
13161
13162           Return the size (in bytes) of image values.
13163
13164         std_noise:
13165
13166           Return  the estimated noise standard deviation of the last selected
13167       image.
13168
13169         str:
13170             string
13171
13172           Print specified string into its binary, octal, decimal and hexadec‐
13173       imal representations.
13174
13175         str2hex:
13176             "string"
13177
13178           Convert  specified  string  argument into a sequence of hexadecimal
13179       values (returned as a string).
13180           See also: hex2str.
13181
13182           Example:
13183             [#1] hex=${"str2hex
13184
13185
13186             [gmic]-0./ Start G'MIC interpreter.
13187             [gmic]-0./ 48656c6c6f206d7920667269656e6473
13188             [gmic]-0./ End G'MIC interpreter.
13189
13190         strcapitalize:
13191             string
13192
13193           Capitalize specified string.
13194
13195         strcontains:
13196             string1,string2
13197
13198           Return 1 if the first string contains the second one.
13199
13200         strclut:
13201             "string"
13202
13203           Return simplified version of the specified string that can be  used
13204       as a CLUT name.
13205
13206         strlen:
13207             string1
13208
13209           Return the length of specified string argument.
13210
13211         strreplace:
13212             string,search,replace
13213
13214           Search and replace substrings in an input string.
13215
13216         strlowercase:
13217             string
13218
13219           Return a lower-case version of the specified string.
13220
13221         struppercase:
13222             string
13223
13224           Return an upper-case version of the specified string.
13225
13226         strvar:
13227             "string"
13228
13229           Return  a  simplified  version of the specified string, that can be
13230       used as a variable name.
13231           (version that creates  a  lowercase  result,  no  longer  than  128
13232       chars).
13233
13234         strcasevar:
13235             "string"
13236
13237           Return  a  simplified  version of the specified string, that can be
13238       used as a variable name.
13239           (version that keeps original case of specified  string,  no  longer
13240       than 128 chars).
13241
13242         strver:
13243             _version,_prerelease
13244
13245           Return  the specified version number of the G'MIC interpreter, as a
13246       string.
13247
13248           Default value: 'version=$_version' and 'prerelease='.
13249
13250         tic:
13251
13252           Initialize tic-toc timer.
13253           Use it in conjunction with 'toc'.
13254
13255         toc:
13256
13257           Display elapsed time of the tic-toc timer since the  last  call  to
13258       'tic'.
13259           This command returns the elapsed time in the status value.
13260           Use it in conjunction with 'tic'.
13261
13262         uint82base64:
13263             _encoding={ 0=base64 | 1=base64url }
13264
13265           Encode  the  values  of  the  latest  of  the  selected images as a
13266       base64-encoded string.
13267           The string can be decoded using command 'base642uint8'.
13268           Selected images must have values that are integers in [0,255].
13269
13270           Default values: 'encoding=0'.
13271
13272         12.22. Other Interactive Commands
13273                --------------------------
13274
13275         demos:
13276             _run_in_parallel={ 0=no | 1=yes | 2=auto }
13277
13278           Show a menu to select and view all G'MIC interactive demos.
13279
13280         tixy:
13281             "expression"
13282
13283           Animate specified mathematical expression with a 16x16 grid of cir‐
13284       cles, using the rules described at https://tixy.land.
13285
13286         x_2048:
13287
13288           Launch the 2048 game.
13289
13290         x_blobs:
13291
13292           Launch the blobs editor.
13293           ../img/x_blobs.jpg [image: 'x_blobs']
13294
13295         x_bouncing:
13296
13297           Launch the bouncing balls demo.
13298
13299         x_color_curves:
13300             _colorspace={  rgb  |  cmy | cmyk | hsi | hsl | hsv | lab | lch |
13301       ycbcr | last }
13302
13303           Apply color curves on selected RGB[A] images, using an  interactive
13304       window.
13305           Set 'colorspace' to 'last' to apply last defined color curves with‐
13306       out opening interactive windows.
13307
13308           Default value: 'colorspace=rgb'.
13309
13310         x_colorize:
13311             _is_lineart={ 0 | 1 },_max_resolution={ 0 |  >=128  },_multichan‐
13312       nels_output={ 0 | 1 },_[palette1],_[palette2],_[grabber1]
13313
13314           Colorized selected B&W images, using an interactive window.
13315           When  >0, argument 'max_resolution' defines the maximal image reso‐
13316       lution used in the interactive window.
13317
13318           Default values: 'is_lineart=1', 'max_resolution=1024'  and  'multi‐
13319       channels_output=0'.
13320
13321         x_connect4:
13322
13323           Launch the Connect Four game.
13324
13325         xz:
13326             Shortcut for command 'x_crop'.
13327
13328         x_crop:
13329
13330           Crop selected images interactively.
13331           (equivalent to shortcut command 'xz').
13332
13333         x_cut:
13334
13335           Cut selected images interactively.
13336
13337         x_fire:
13338
13339           Launch the fire effect demo.
13340
13341         x_fireworks:
13342
13343           Launch the fireworks demo.
13344
13345         x_fisheye:
13346
13347           Launch the fish-eye effect demo.
13348
13349         x_fourier:
13350
13351           Launch the fourier filtering demo.
13352
13353         x_grab_color:
13354             _variable_name
13355
13356           Open a color grabber widget from the first selected image.
13357           Argument  'variable_name'  specifies the variable that contains the
13358       selected color values at any time.
13359           Assigning '-1' to it forces the interactive window to close.
13360
13361           Default values: 'variable_name=xgc_variable'.
13362
13363         x_hanoi:
13364
13365           Launch the Tower of Hanoi game.
13366
13367         x_histogram:
13368
13369           Launch the histogram demo.
13370
13371         x_hough:
13372
13373           Launch the hough transform demo.
13374
13375         x_jawbreaker:
13376             0<_width<20,0<_height<20,0<_balls<=8
13377
13378           Launch the Jawbreaker game.
13379
13380         x_landscape:
13381
13382           Launch the virtual landscape demo.
13383
13384         x_life:
13385
13386           Launch the game of life.
13387
13388         x_light:
13389
13390           Launch the light effect demo.
13391
13392         x_mandelbrot:
13393             _julia={ 0 | 1 },_c0r,_c0i
13394
13395           Launch Mandelbrot/Julia explorer.
13396
13397         x_mask_color:
13398             _colorspace={ all | rgb | lrgb | ycbcr | lab | lch | hsv | hsi  |
13399       hsl | cmy | cmyk | yiq },_spatial_tolerance>=0,_color_tolerance>=0
13400
13401           Interactively  select  a color, and add an alpha channel containing
13402       the corresponding color mask.
13403           Argument 'colorspace' refers to the color metric  used  to  compute
13404       color similarities, and can be basically
13405           one  of  { rgb | lrgb | ycbcr | lab | lch | hsv | hsi | hsl | cmy |
13406       cmyk | yiq }.
13407           You can also select one one particular channel of this  colorspace,
13408       by setting 'colorspace' as
13409           'colorspace_channel' (e.g. 'hsv_h' for the hue).
13410
13411           Default   values:   'colorspace=all',   'spatial_tolerance=5'   and
13412       'color_tolerance=5'.
13413
13414         x_metaballs3d:
13415
13416           Launch the 3D metaballs demo.
13417
13418         x_minesweeper:
13419             8<=_width=<20,8<=_height<=20
13420
13421           Launch the Minesweeper game.
13422
13423         x_minimal_path:
13424
13425           Launch the minimal path demo.
13426
13427         x_morph:
13428             _nb_frames>=2,_preview_fidelity={ 0=coarsest | 1=coarse |  2=nor‐
13429       mal | 3=fine | 4=finest }
13430
13431           Launch the interactive image morpher.
13432
13433           Default values: 'nb_frames=16' and 'preview_fidelity=3'.
13434
13435         x_pacman:
13436
13437           Launch pacman game.
13438
13439         x_paint:
13440
13441           Launch the interactive painter.
13442
13443         x_plasma:
13444
13445           Launch the plasma effect demo.
13446
13447         x_quantize_rgb:
13448             _nbcolors>=2
13449
13450           Launch the RGB color quantization demo.
13451
13452         x_reflection3d:
13453
13454           Launch the 3D reflection demo.
13455
13456         x_rubber3d:
13457
13458           Launch the 3D rubber object demo.
13459
13460         x_segment:
13461             _max_resolution={ 0 | >=128 }
13462
13463           Segment  foreground  from background in selected opaque RGB images,
13464       interactively.
13465           Return RGBA images with binary alpha-channels.
13466
13467           Default value: 'max_resolution=1024'.
13468
13469         x_select_color:
13470             _variable_name
13471
13472           Display a RGB or RGBA color selector.
13473           Argument 'variable_name' specifies the variable that  contains  the
13474       selected color values (as R,G,B,[A])
13475           at any time.
13476           Its  value  specifies the initial selected color. Assigning '-1' to
13477       it forces the interactive window to close.
13478
13479           Default value: 'variable_name=xsc_variable'.
13480
13481         x_select_function1d:
13482             _variable_name,_background_curve_R,_background_curve_G,_back‐
13483       ground_curve_B
13484
13485           Open  an  interactive window, where the user can defined its own 1D
13486       function.
13487           If an image is selected, it is used to display additional  informa‐
13488       tion :
13489              -   The  first row defines the values of a background curve dis‐
13490       played on the window (e.g. an histogram).
13491              -  The 2nd, 3rd and 4th rows define the R,G,B  color  components
13492       displayed beside the X and Y axes.
13493           Argument  'variable_name'  specifies the variable that contains the
13494       selected function keypoints at any time.
13495           Assigning '-1' to it forces the interactive window to close.
13496
13497           Default      values:      'variable_name=xsf_variable',      'back‐
13498       ground_curve_R=220',       'background_curve_G=background_curve_B=back‐
13499       ground_curve_T'.
13500
13501         x_select_palette:
13502             _variable_name,_number_of_columns={ 0=auto | >0 }
13503
13504           Open a RGB or RGBA color selector widget from a palette.
13505           The palette is given as a selected image.
13506           Argument 'variable_name' specifies the variable that  contains  the
13507       selected color values (as R,G,B,[A])
13508           at any time.
13509           Assigning '-1' to it forces the interactive window to close.
13510
13511           Default  values:  'variable_name=xsp_variable'  and 'number_of_col‐
13512       umns=2'.
13513
13514         x_shadebobs:
13515
13516           Launch the shade bobs demo.
13517
13518         x_spline:
13519
13520           Launch spline curve editor.
13521
13522         x_starfield3d:
13523
13524           Launch the 3D starfield demo.
13525
13526         x_tetris:
13527
13528           Launch tetris game.
13529
13530         x_threshold:
13531
13532           Threshold selected images interactively.
13533
13534         x_tictactoe:
13535
13536           Launch tic-tac-toe game.
13537
13538         x_warp:
13539             _nb_keypoints_xgrid>=2,_nb_keypoints_ygrid>=2,_nb_keypoints_con‐
13540       tours>=0,_preview_fidelity={  0=coarsest | 1=coarse | 2=normal | 3=fine
13541       | 4=finest },_[background_image],
13542               0<=_background_opacity<=1
13543
13544           Launch the interactive image warper.
13545
13546           Default values: 'nb_keypoints_xgrid=nb_keypoints_ygrid=2', 'nb_key‐
13547       points_contours=0' and 'preview_fidelity=1'.
13548
13549         x_waves:
13550
13551           Launch the image waves demo.
13552
13553         x_whirl:
13554             _opacity>=0
13555
13556           Launch the fractal whirls demo.
13557
13558           Default values: 'opacity=0.2'.
13559
13560         13. Examples of Use
13561             ---------------
13562
13563         'gmic' is a generic image processing tool which can be used in a wide
13564       variety of situations. The few examples below illustrate possible  uses
13565       of this tool:
13566
13567         ### View a list of images:
13568
13569           $ gmic file1.bmp file2.jpeg
13570
13571         ### Convert an image file:
13572
13573           $ gmic input.bmp output output.jpg
13574
13575         ### Create a volumetric image from a movie sequence:
13576
13577           $ gmic input.mpg append z output output.hdr
13578
13579         ### Compute image gradient norm:
13580
13581           $ gmic input.bmp gradient_norm
13582
13583         ### Denoise a color image:
13584
13585           $ gmic image.jpg denoise 30,10 output denoised.jpg
13586
13587         ### Compose two images using overlay layer blending:
13588
13589           $ gmic image1.jpg image2.jpg blend overlay output blended.jpg
13590
13591         ### Evaluate a mathematical expression:
13592
13593           $ gmic echo "cos(pi/4)^2+sin(pi/4)^2={cos(pi/4)^2+sin(pi/4)^2}"
13594
13595         ### Plot a 2D function:
13596
13597           $                gmic                1000,1,1,2                fill
13598       "X=3*(x-500)/500;X^2*sin(3*X^2)+if(c==0,u(0,-1),cos(X*10))" plot
13599
13600                                                     ../img/example_plot.png
13601       [image: '']
13602
13603         ### Plot a 3D elevated function in random colors:
13604
13605           $  gmic  128,128,1,3,"u(0,255)"  plasma 10,3 blur 4 sharpen 10000 n
13606       0,255                                                   elevation3d[-1]
13607       "'X=(x-64)/6;Y=(y-64)/6;100*exp(-(X^2+Y^2)/30)*abs(cos(X)*sin(Y))'"
13608
13609                                                     1../img/example_eleva‐
13610       tion3d.png [image: '']
13611
13612         ### Plot the isosurface of a 3D volume:
13613
13614           $   gmic   mode3d   5   moded3d   5   double3d    0    isosurface3d
13615       "'x^2+y^2+abs(z)^abs(4*cos(x*y*z*3))'",3
13616
13617                                                     ,../img/example_isosur‐
13618       face3d.png [image: '']
13619
13620         ### Render a G'MIC 3D logo:
13621
13622           $ gmic 0 text G´MIC,0,0,53,1,1,1,1 expand_xy 10,0 blur 1  normalize
13623       0,100 +plasma 0.4 add blur 1 elevation3d -0.1 moded3d 4
13624
13625                                                     ,../img/example_logo.png
13626       [image: '']
13627
13628         ### Generate a 3D ring of torii:
13629
13630           $     gmic     repeat     20     torus3d      15,2      color3d[-1]
13631       "{u(60,255)},{u(60,255)},{u(60,255)}"  *3d[-1]  0.5,1  if  "{$>%2}" ro‐
13632       tate3d[-1] 0,1,0,90 fi add3d[-1] 70 add3d rotate3d 0,0,1,18
13633          done moded3d 3 mode3d 5 double3d 0
13634
13635                                                     ../img/example_torii.png
13636       [image: '']
13637
13638         ### Create a vase from a 3D isosurface:
13639
13640           $ gmic moded3d 4 isosurface3d "'x^2+2*abs(y/2)*sin(2*y)^2+z^2-3',0"
13641       sphere3d 1.5 sub3d[-1] 0,5 plane3d  15,15  rotate3d[-1]  1,0,0,90  cen‐
13642       ter3d[-1] add3d[-1] 0,3.2 color3d[-1]
13643          180,150,255 color3d[-2] 128,255,0 color3d[-3] 255,128,0 add3d
13644
13645                                                     ../img/example_vase.png
13646       [image: '']
13647
13648         ### Launch a set of interactive demos:
13649
13650           $ gmic demos
13651
13652
13653
13654         ** G'MIC comes  with  ABSOLUTELY  NO  WARRANTY;  for  details  visit:
13655       https://gmic.eu **
13656
13657
13658
13659                                                                      G'MIC(1)
Impressum