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

NAME

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

HELP

10         gmic: GREYC's Magic for Image Computing: command-line interface
11               Version 2.9.9
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 2.9.9.
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 regarded
103          as a 3D dataset of multi-spectral voxels. Most of the G'MIC commands
104       will stick
105          with  this  idea (e.g. command blur blurs images only along the spa‐
106       tial
107          '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-9:25%]': Apply command only on images '[0]' to
284          '[9]', with a step of 25% (i.e. on images '[0]', '[3]',
285          '[6]' and '[9]').
286            -  'command[0--1:2]': Apply command only on  images  of  the  list
287       with
288          even indices.
289            -  'command[0,2-4,50%--1]': Apply command on images '[0]',
290          '[2]', '[3]', '[4]' and on the second half of the image list.
291            -   'command[^0,1]':  Apply command on all images except the first
292       two.
293            -  'command[name1,name2]': Apply command on named images 'name1'
294          and 'name2'.
295
296          * Indices in selections are always sorted in increasing  order,  and
297       duplicate
298          indices  are  discarded.  For  instance,  selections '[3-1,1-3]' and
299       '[1,1,
300          1,3,2]' are both equivalent to '[1-3]'. If you want to repeat a sin‐
301       gle
302          command  multiple  times  on an image, use a 'repeat..done' loop in‐
303       stead.
304          Inverting the order of images for a command is achieved  by  explic‐
305       itly inverting
306          the  order  of  the images in the list, with command 'reverse[selec‐
307       tion]'.
308          * Command selections '[-1]', '[-2]' and '[-3]' are so often
309          used they have their own shortcuts, respectively '.', '..' and
310          '...'. For instance, command 'blur..' is equivalent to
311          'blur[-2]'. These shortcuts work also when specifying command  argu‐
312       ments.
313          *  G'MIC  commands  invoked without '[selection]' are applied on all
314       images
315          of the list, i.e. the default selection is '[0--1]' (except for com‐
316       mand
317          input whose default selection is '[-1]'').
318          * Prepending a single hyphen '-' to a G'MIC command is allowed. This
319       may
320          be useful to recognize command items  more  easily  in  a  one-liner
321       pipeline
322          (typically invoked from a shell).
323          * A G'MIC command prepended with a plus sign '+' does not act
324          in-place  but inserts its result as one or several new images at the
325       end
326          of the image list.
327          * There are two different types of commands that can be run  by  the
328       G'MIC
329          interpreter:
330            -  Built-in commands are the hard-coded functionalities in the
331          interpreter  core.  They  are  thus  compiled as binary code and run
332       fast, most of
333          the time. Omitting an argument when invoking a built-in  command  is
334       not
335          permitted,  except  if all following arguments are also omitted. For
336       instance,
337          invoking 'plasma 10,,5' is invalid but 'plasma 10' is correct.
338            -  Custom commands, are defined as G'MIC pipelines of built-in or
339          other custom commands. They are parsed by the G'MIC interpreter, and
340       thus run a
341          bit  slower than built-in commands. Omitting arguments when invoking
342       a custom
343          command is permitted. For instance, expressions  'flower  ,,,100,,2'
344       or
345          'flower ,' are correct.
346
347          *  Most  of  the  existing commands in G'MIC are actually defined as
348       custom
349          commands.
350          * A user can easily add its own custom commands to the G'MIC  inter‐
351       preter (see
352          section  Adding Custom Commands for more details). New built-in com‐
353       mands
354          cannot be added (unless you modify the G'MIC interpreter source code
355       and
356          recompile it).
357
358
359         7. Input/Output Properties
360            -----------------------
361
362          *  G'MIC is able to read/write most of the classical image file for‐
363       mats,
364          including:
365            -  2D grayscale/color files: '.png', '.jpeg', '.gif',
366          '.pnm', '.tif', '.bmp', ...
367            -  3D volumetric files: '.dcm', '.hdr', '.nii',
368          '.cube', '.pan', '.inr', '.pnk', ...
369            -  Video files: '.mpeg', '.avi', '.mp4', '.mov',
370          '.ogg', '.flv', ...
371            -  Generic text or binary data files: '.gmz', '.cimg',
372          '.cimgz', 'flo', 'ggr', 'gpl', '.dlm',
373          '.asc', '.pfm', '.raw', '.txt', '.h'.
374            -  3D mesh files: '.off', '.obj' (output only)
375
376          * When dealing with color images, G'MIC generally reads, writes  and
377       displays
378          data using the usual sRGB color space.
379          * When loading a '.png' and '.tiff' file, the bit-depth of the
380          input image(s) is returned to the status.
381          * G'MIC is able to manage 3D objects that may be read from files or
382          generated  by  G'MIC commands. A 3D object is stored as a one-column
383       scalar image
384          containing the object data, in the following order: {  magic_number;
385       sizes;
386          vertices;  primitives; colors; opacities }. These 3D representations
387       can be
388          then processed as regular images (see command split3d for  accessing
389       each
390          of these 3D object data separately).
391          *  Be  aware that usual file formats may be sometimes not adapted to
392       store all
393          the available image data, since G'MIC uses float-valued  image  buf‐
394       fers. For
395          instance,   saving   an   image  that  was  initially  loaded  as  a
396       16bits/channel image,
397          as a '.jpg' file will result in a loss of information. Use the
398          G'MIC-specific file extension '.gmz' to ensure that all data  preci‐
399       sion is
400          preserved when saving images.
401          * Sometimes, file options may/must be set for file formats:
402            -   Video  files:  Only  sub-frames  of  an  image sequence may be
403       loaded,
404          using the input expression 'filename.ext,[first_frame[,last_frame[,
405          step]]]'. Set 'last_frame==-1' to tell it must be the last frame of
406          the video. Set 'step' to '0' to force an opened video file to be
407          opened/closed. Output framerate and codec can be also set  by  using
408       the output
409          expression 'filename.avi,_fps,_codec,_keep_open' where 'keep_open'
410          can be { 0 | 1 }. 'codec' is a 4-char string (see
411          http://www.fourcc.org/codecs.php ) or '0' for the default codec.
412          'keep_open' tells if the output video file must be kept open for
413          appending new frames afterwards.
414            -  '.cimg[z]' files: Only crops and sub-images of .cimg files
415          can be loaded, using the input expressions 'filename.cimg,N0,N1',
416          'filename.cimg,N0,N1,x0,x1', 'filename.cimg,N0,N1,x0,y0,x1,y1',
417          'filename.cimg,N0,N1,x0,y0,z0,x1,y1,z1'           or          'file‐
418       name.cimg,N0,N1,x0,y0,
419          z0,c0,x1,y1,z1,c1'. Specifying '-1' for one coordinates  stands  for
420       the
421          maximum     possible     value.     Output     expression     'file‐
422       name.cimg[z][,datatype]'
423          can be used to force the output pixel type. 'datatype' can be { auto
424       |
425          bool | uchar | char | ushort | short | uint | int | uint64 | int64 |
426       float |
427          double }.
428            -  '.raw' binary files: Image dimensions and input pixel type
429          may be specified when loading '.raw' files with input expression
430          'filename.raw[,datatype][,width][,height[,depth[,dim[,offset]]]]]'.
431       If no
432          dimensions are specified, the resulting image is a one-column vector
433       with
434          maximum possible height. Pixel type can also be specified  with  the
435       output
436          expression 'filename.raw[,datatype]'. 'datatype' can be the same as
437          for '.cimg[z]' files.
438            -  '.yuv' files: Image dimensions must be specified when loading,
439           and  only  sub-frames of an image sequence may be loaded, using the
440       input
441          expression                'filename.yuv,width,height[,chroma_subsam‐
442       pling[,first_frame[,
443          last_frame[,step]]]'. 'chroma_subsampling' can be { 420 | 422 | 444
444          }. When saving, chroma subsampling mode can be specified with output
445          expression 'filename.yuv[,chroma_subsampling]'.
446            -  '.tiff' files: Only sub-images of multi-pages tiff files can
447          be     loaded,     using     the     input     expression     'file‐
448       name.tif,_first_frame,_last_frame,
449          _step'. Output expression 'filename.tiff,_datatype,_compression,
450          _force_multipage,_use_bigtiff' can be used  to  specify  the  output
451       pixel type,
452          as well as the compression method. 'datatype' can be the same as for
453          '.cimg[z]' files. 'compression' can be  { none (default) | lzw |
454          jpeg }. 'force_multipage' can be { 0=no (default) | 1=yes }.
455          'use_bigtiff' can be { 0=no | 1=yes (default) }.
456            -  '.pdf' files: When loading a file, the rendering resolution
457          can  be  specified  using the input expression 'filename.pdf,resolu‐
458       tion',
459          where 'resolution' is an unsigned integer value.
460            -  '.gif' files: Animated gif files can be saved, using the
461          input expression 'filename.gif,fps>0,nb_loops'. Specify
462          'nb_loops=0' to get an infinite number of animation loops  (this  is
463       the
464          default behavior).
465            -  '.jpeg' files: The output quality may be specified (in %),
466          using  the  output  expression 'filename.jpg,30' (here, to get a 30%
467       quality
468          output). '100' is the default.
469            -  '.mnc' files: The output header can set from another file,
470          using the output expression 'filename.mnc,header_template.mnc'.
471            -  '.pan', '.cpp', '.hpp', '.c' and '.h'
472          files: The output datatype can be selected with output expression
473          'filename[,datatype]'. 'datatype' can be the same as for
474          '.cimg[z]' files.
475            -  '.gmic' files: These filenames are assumed to be G'MIC custom
476          commands files. Loading such a file will add the commands it defines
477       to the
478          interpreter.  Debug information can be enabled/disabled by the input
479       expression
480          'filename.gmic[,add_debug_info' where 'debug_info' can be {
481          0=false | 1=true }.
482            -  Inserting 'ext:' on the beginning of a filename (e.g.
483          'jpg:filename') forces G'MIC to read/write the file as it would have
484       been
485          done if it had the specified extension '.ext'.
486
487          *  Some  input/output  formats and options may not be supported, de‐
488       pending on the
489          configuration flags that have been set during the build of the G'MIC
490       software.
491
492
493         8. Substitution Rules
494            ------------------
495
496          * G'MIC items containing '$' or '{}' are substituted before
497          being interpreted. Use these substituting expressions to access var‐
498       ious data
499          from the interpreter environment.
500          * '$name' and '${name}' are both substituted by the value of the
501          specified named variable (set previously by the item  'name=value').
502       If
503          this  variable  has  not been already set, the expression is substi‐
504       tuted by the
505          highest positive index of the named image '[name]'. If no image  has
506       this
507          name,  the expression is substituted by the value of the OS environ‐
508       ment variable
509          with same name (it may be thus an empty string  if  it  is  not  de‐
510       fined).
511          *  The  following reserved variables are predefined by the G'MIC in‐
512       terpreter:
513            -  '$!': The current number of images in the list.
514            -  '$>' and '$<': The increasing/decreasing index of the latest
515          (currently running) 'repeat...done' loop. '$>' goes from '0'
516          (first loop iteration) to 'nb_iterations - 1' (last iteration).
517          '$<' does the opposite.
518            -  '$/': The current call stack.  Stack  items  are  separated  by
519       slashes
520          '/'.
521            -  '$|': The current value (expressed in seconds) of a millisecond
522          precision timer.
523            -  '$^': The current verbosity level.
524            -  '$_cpus': The number of computation cores available on your ma‐
525       chine.
526            -  '$_flags': The list of enabled flags when G'MIC interpreter has
527          been compiled.
528            -  '$_host': A string telling about the host running the G'MIC
529          interpreter (e.g. 'cli' or 'gimp').
530            -  '$_os': A string describing the running operating system.
531            -  '$_path_rc': The path to the G'MIC folder used to store
532          configuration files (its value is OS-dependent).
533            -  '$_path_user': The path to the G'MIC user file '.gmic' or
534          'user.gmic' (its value is OS-dependent).
535            -  '$_path_commands': A list of all imported command files (stored
536       as
537          a list-valued variable).
538            -  '$_pid': The current process identifier, as an integer.
539            -  '$_pixeltype': The type of image pixels (default: 'float').
540            -   '$_prerelease':  For pre-releases, the date of the pre-release
541       as
542          'yymmdd'. For stable releases, this variable is set to '0'.
543            -  '$_version': A 3-digits number telling about the  current  ver‐
544       sion of
545          the G'MIC interpreter  (e.g. '299').
546            -  '$_vt100': Set to '1' if colored text output is allowed on
547          the console. Otherwise, set to '0'.
548
549          * '$$name' and '$${name}' are both substituted by the G'MIC script
550          code  of the specified named 'custom command', or by an empty string
551       if no
552          custom command with specified name exists.
553          * '${"-pipeline"}' is substituted by the status value after the
554          execution of the specified G'MIC pipeline (see command status).
555          Expression '${}' thus stands for the current status value.
556          * '{``string}' (starting with two backquotes) is substituted by a
557          double-quoted version of the specified string.
558          * '{/string}' is substituted by the escaped version of the specified
559          string.
560          * '{'string'[:delimiter]}' (between single quotes) is substituted by
561       the
562          sequence of character codes that composes the specified string, sep‐
563       arated by
564          specified delimiter. Possible delimiters are ',' (default), ';',
565          '/', '^' or ' '. For instance, item '{'foo'}' is substituted
566          by '102,111,111' and '{'foo':;}' by '102;111;111'.
567          * '{image,feature[:delimiter]}' is substituted by a specific feature
568       of
569          the image '[image]'. 'image' can be either an image number or an
570          image  name.  It  can  be also eluded, in which case, the last image
571       '[-1]'
572          of the list is considered for the requested feature. Specified 'fea‐
573       ture'
574          can be one of:
575            -   'b': The image basename (i.e. filename without the folder path
576       nor
577          extension).
578            -  'f': The image folder name.
579            -  'n': The image name or filename (if the  image  has  been  read
580       from a
581          file).
582            -   't': The text string from the image values regarded as charac‐
583       ter
584          codes.
585            -  'x': The image extension (i.e the characters after the last
586          '.' in the image name).
587            -  '^': The sequence of all image values, separated by commas ',
588          '.
589            -  '@subset': The sequence of image values corresponding to the
590          specified subset, and separated by commas ','.
591            -  Any other 'feature' is considered as a mathematical
592          expression associated to the image '[image]' and is  substituted  by
593       the
594          result  of  its  evaluation  (float value). For instance, expression
595       '{0,
596          w+h}' is substituted by the sum of the width and height of the first
597       image
598          (see section Mathematical Expressions for more details). If a
599          mathematical expression starts with an underscore '_', the resulting
600          value  is truncated to a readable format. For instance, item '{_pi}'
601       is
602          substituted by '3.14159' (while '{pi}' is substituted by
603          '3.141592653589793').
604            -  A 'feature' delimited by backquotes is  replaced  by  a  string
605       whose
606          character  codes correspond to the list of values resulting from the
607       evaluation
608          of  the  specified  mathematical  expression.  For  instance,   item
609       '{`[102,111,
610          111]`}' is substituted by 'foo' and item '{`vector8(65)`}' by
611          'AAAAAAAA'.
612
613          *  '{*}'  is substituted by the visibility state of the instant dis‐
614       play
615          window '#0' (can be { 0=closed | 1=visible }.
616          * '{*[index],feature1,...,featureN[:delimiter]}' is substituted by a
617          specific set of features of the instant display window '#0' (or
618          '#index', if specified). Requested 'features' can be:
619            -  'w': display width (i.e. width of the display area  managed  by
620       the
621          window).
622            -  'h': display height (i.e. height of the display area managed by
623       the
624          window).
625            -  'wh': display width x display height.
626            -  'd': window width (i.e. width of the window widget).
627            -  'e': window height (i.e. height of the window widget).
628            -  'de': window width x window height.
629            -  'u': screen width (actually independent on the window size).
630            -  'v': screen height (actually independent on the window size).
631            -  'uv': screen width x screen height.
632            -  'n': current normalization type of the instant display.
633            -  't': window title of the instant display.
634            -  'x': X-coordinate of the mouse position (or -1, if outside the
635          display area).
636            -  'y': Y-coordinate of the mouse position (or -1, if outside the
637          display area).
638            -  'b': state of the mouse buttons { 1=left-but. | 2=right-but. |
639          4=middle-but. }.
640            -  'o': state of the mouse wheel.
641            -  'k': decimal code of the pressed key if any, 0 otherwise.
642            -  'c': boolean (0 or 1) telling if the instant display has been
643          closed recently.
644            -  'r': boolean telling if the instant display has been resized
645          recently.
646            -  'm': boolean telling if the instant display has been moved  re‐
647       cently.
648            -   Any other 'feature' stands for a keycode name (in capital let‐
649       ters),
650          and is substituted by a boolean describing the current key  state  {
651       0=pressed
652          | 1=released }.
653            -  You can also prepend a hyphen '-' to a 'feature' (that
654          supports  it)  to  flush  the  corresponding event immediately after
655       reading its
656          state (works for keys, mouse and window events).
657
658          * Item substitution is  never  performed  in  items  between  double
659       quotes.
660          One  must  break  the quotes to enable substitution if needed, as in
661       '"3+8 kg =
662          "{3+8}" kg"'. Using double quotes is then a convenient way  to  dis‐
663       able the
664          substitutions mechanism in items, when necessary.
665          *  One  can also disable the substitution mechanism on items outside
666       double
667          quotes, by escaping the '{', '}' or '$' characters, as in
668          '3+4 doesn't evaluate'.
669
670
671         9. Mathematical Expressions
672            ------------------------
673
674          * G'MIC has an embedded mathematical parser, used to evaluate
675          (possibly complex) math expressions specified inside braces '{}', or
676          formulas in commands that may take one as an argument (e.g. fill or
677          eval).
678          * When the context allows it, a formula is evaluated for each  pixel
679       of
680          the selected images (e.g. fill or eval).
681          * A math expression may return a scalar or a vector-valued result
682          (with a fixed number of components).
683         The  mathematical  parser understands the following set of functions,
684       operators
685          and variables:
686
687         ## Usual operators:
688
689         '||' (logical or), '&&' (logical and), '|' (bitwise or),
690          '&' (bitwise and), '!=', '==', '<=', '>=',
691          '<', '>', '<<' (left bitwise shift), '>>' (right
692          bitwise shift), '-', '+', '*', '/', '%' (modulo),
693          '^' (power), '!' (logical not), '~' (bitwise not), '++',
694           '--', '+=', '-=', '*=', '/=', '%=',
695          '&=', '|=', '^=', '>>', '<<=' (in-place
696          operators).
697
698         ## Usual math functions:
699
700         'abs()', 'acos()', 'acosh()', 'arg()', 'arg0()',
701          'argkth()', 'argmax()', 'argmaxabs()', 'argmin()',
702          'argminabs()', 'asin()', 'asinh()', 'atan()',
703          'atan2()', 'atanh()', 'avg()', 'bool()', 'cbrt()',
704           'ceil()', 'cos()', 'cosh()', 'cut()',
705          'deg2rad()', 'erf()', 'erfinv()', 'exp()',
706          'fact()', 'fibo()', 'floor()', 'gauss()', 'gcd()',
707           'int()', 'isnan()', 'isnum()', 'isinf()',
708          'isint()', 'isbool()', 'isexpr()', 'isfile()',
709          'isdir()', 'isin()', 'kth()', 'log()', 'log2()',
710          'log10()', 'max()', 'maxabs()', 'med()', 'min()',
711          'minabs()', 'narg()', 'prod()', 'rad2deg()',
712          'rol()' (left bit rotation), 'ror()' (right bit rotation),
713          'round()', 'sign()', 'sin()', 'sinc()', 'sinh()',
714          'sqrt()', 'std()', 'srand(_seed)', 'sum()',
715          'tan()', 'tanh()', 'var()', 'xor()'.
716
717          * 'atan2(y,x)' is the version of 'atan()' with two arguments
718          'y' and 'x' (as in C/C++).
719          * 'permut(k,n,with_order)' computes the number of permutations of
720          'k' objects from a set of 'n' objects.
721          * 'gauss(x,_sigma,_is_normalized)' returns
722          'exp(-x^2/(2*s^2))/(is_normalized?sqrt(2*pi*sigma^2):1)'.
723          * 'cut(value,min,max)' returns 'value' if it is in range '[min,
724          max]', or 'min' or 'max' otherwise.
725          * 'narg(a_1,...,a_N)' returns  the  number  of  specified  arguments
726       (here,
727          'N').
728          * 'arg(i,a_1,..,a_N)' returns the 'i'-th argument 'a_i'.
729          * 'isnum()', 'isnan()', 'isinf()', 'isint()',
730          'isbool()'  test the type of the given number or expression, and re‐
731       turn
732          '0' (false) or '1' (true).
733          * 'isfile('path')' (resp. 'isdir('path')') returns '0'
734          (false) or '1' (true) whether its string argument is a path to an
735          existing file (resp. to a directory) or not.
736          * 'isin(v,a_1,...,a_n)' returns '0' (false) or '1' (true)
737          whether the first value 'v' appears in the set of other values
738          'a_i'.
739          * 'inrange(value,m,M,include_m,include_M)' returns '0' (false) or
740          '1' (true) whether the specified value lies in range '[m,M]' or not
741          ('include_m' and 'includeM' tells how boundaries 'm' and
742          'M' are considered).
743          * 'argkth()', 'argmin()', 'argmax()', 'argminabs()',
744          'argmaxabs()'', 'avg()', 'kth()', 'min()',
745          'max()', 'minabs()', 'maxabs()', 'med()',
746          'prod()', 'std()', 'sum()' and 'var()' can be called
747          with an arbitrary number of scalar/vector arguments.
748          * 'vargkth()', 'vargmin()', 'vargmax()',
749          'vargminabs()', 'vargmaxabs()', 'vavg()', 'vkth()',
750          'vmin()', 'vmax()', 'vminabs()', 'vmaxabs()',
751          'vmed()', 'vprod()', 'vstd()', 'vsum()' and
752          'vvar()' are the versions of the previous function with  vector-val‐
753       ued
754          arguments.
755          * 'round(value,rounding_value,direction)' returns a rounded value.
756          'direction' can be { -1=to-lowest | 0=to-nearest | 1=to-highest }.
757          * 'lerp(a,b,t)' returns 'a*(1-t)+b*t'.
758          * 'swap(a,b)' swaps the values of the given arguments.
759
760         ## Variable names:
761
762         Variable names below are pre-defined. They can be overridden.
763          * 'l': length of the associated list of images.
764          * 'k': index of the associated image, in '[0,l-1]'.
765          * 'w': width of the associated image, if any ('0' otherwise).
766          * 'h': height of the associated image, if any ('0' otherwise).
767          * 'd': depth of the associated image, if any ('0' otherwise).
768          * 's': spectrum of the associated image, if any ('0' otherwise).
769          * 'r': shared state of the associated image, if any ('0'
770          otherwise).
771          * 'wh': shortcut for width x height.
772          * 'whd': shortcut for width x height x depth.
773          *  'whds': shortcut for width x height x depth x spectrum (i.e. num‐
774       ber of
775          image values).
776          * 'im', 'iM', 'ia', 'iv', 'is', 'ip',
777          'ic', 'in': Respectively the minimum, maximum, average, variance,
778          sum, product, median value and L2-norm of the associated  image,  if
779       any
780          ('0' otherwise).
781          * 'xm', 'ym', 'zm', 'cm': The pixel coordinates of the
782          minimum value in the associated image, if any ('0' otherwise).
783          * 'xM', 'yM', 'zM', 'cM': The pixel coordinates of the
784          maximum value in the associated image, if any ('0' otherwise).
785          * All these variables are considered as constant values by the math
786          parser  (for optimization purposes) which is indeed the case most of
787       the time.
788          Anyway, this might not be the case, if function 'resize(#ind,..)' is
789       used
790          in  the  math  expression.  If  so,  it is safer to invoke functions
791       'l()',
792          'w(_#ind)', 'h(_#ind)', ... 's(_#ind)' and 'in(_#ind)'
793          instead of the corresponding named variables.
794          * 'i': current processed pixel value (i.e. value located at '(x,y,z,
795          c)') in the associated image, if any ('0' otherwise).
796          * 'iN': N-th channel value of current processed pixel (i.e. value
797          located at '(x,y,z,N)' in the associated image, if any ('0'
798          otherwise). 'N' must be an integer in range '[0,9]'.
799          * 'R', 'G', 'B' and 'A' are equivalent to 'i0',
800          'i1', 'i2' and 'i3' respectively.
801          * 'I': current vector-valued processed pixel in the  associated  im‐
802       age, if
803          any ('0' otherwise). The number of vector components is equal to the
804          number of image channels (e.g. 'I' = '[ R,G,B ]' for a 'RGB'
805          image).
806          *  You  may add '#ind' to any of the variable name above to retrieve
807       the
808          information for any numbered image '[ind]' of the  list  (when  this
809       makes
810          sense).  For  instance 'ia#0' denotes the average value of the first
811       image
812          of the list).
813          * 'x': current processed column of the associated image, if any
814          ('0' otherwise).
815          * 'y': current processed row of the associated image, if any ('0'
816          otherwise).
817          * 'z': current processed slice of the associated image, if any
818          ('0' otherwise).
819          * 'c': current processed channel of the associated image, if any
820          ('0' otherwise).
821          * 't': thread id when  an  expression  is  evaluated  with  multiple
822       threads
823          ('0' means master thread).
824          * 'n': maximum number of threads when expression is evaluated in
825          parallel (so that 't' goes from '0' to 'n-1').
826          * 'e': value of e, i.e. '2.71828...'.
827          * 'pi': value of pi, i.e. '3.1415926...'.
828          * 'u': a random value between '[0,1]', following a uniform
829          distribution.
830          * 'g': a random value, following a gaussian distribution of variance
831       1
832          (roughly in '[-6,6]').
833          * 'interpolation': value of the default interpolation mode used when
834          reading pixel values with the pixel access operators (i.e. when the
835          interpolation argument is not explicitly specified,  see  below  for
836       more details
837          on pixel access operators). Its initial default value is '0'.
838          *  'boundary':  value  of  the default boundary conditions used when
839       reading
840          pixel values with the pixel access operators (i.e. when the boundary
841       condition
842          argument  is not explicitly specified, see below for more details on
843       pixel
844          access operators). Its initial default value is '0'.
845          * The last image of the list is always associated to the evaluations
846       of
847          'expressions', e.g. G'MIC sequence
848
849           256,128 fill {w}
850
851          will create a 256x128 image filled with value 256.
852
853         ## Vector calculus:
854
855         Most operators are also able to work with vector-valued elements.
856          * '[a0,a1,...,aN-1]' defines a 'N'-dimensional vector with scalar
857          coefficients 'ak'.
858          * 'vectorN(a0,a1,,...,aN-1)' does the same, with the 'ak' being
859          repeated periodically if only a few are specified.
860          *  'vector(#N,a0,a1,,...,aN-1)'  does  the same, and can be used for
861       any
862          constant expression 'N'.
863          * In previous expressions, the 'ak' can be vectors themselves, to be
864          concatenated into a single vector.
865          * The scalar element 'ak' of a vector 'X' is retrieved by
866          'X[k]'.
867          * The sub-vector '[X[p],X[p+s]...X[p+s*(q-1)]]' (of size 'q') of a
868          vector 'X' is retrieved by 'X[p,q,s]'.
869          * 'expr(formula,_w,_h,_d,_s)' outputs a vector of size 'w*h*d*s'
870          with values generated from the specified formula,  as  if  one  were
871       filling an
872          image with dimensions '(w,h,d,s)'.
873          *  Equality/inequality  comparisons between two vectors is done with
874       operators
875          '==' and '!='.
876          * Some vector-specific functions  can  be  used  on  vector  values:
877       'cross(X,
878          Y)' (cross product), 'dot(X,Y)' (dot product), 'size(X)' (vector
879          dimension), 'sort(X,_is_increasing,_nb_elts,_size_elt)' (sorted val‐
880       ues),
881          'reverse(A)' (reverse order of components), 'shift(A,_length,
882          _boundary_conditions)' and 'same(A,B,_nb_vals,_is_case_sensitive)'
883          (vector equality test).
884          * Function 'normP(u1,...,un)' computes the LP-norm of the specified
885          vector ('P' being an 'unsigned integer' constant or 'inf').
886          If 'P' is omitted, the L2 norm is calculated.
887          * Function 'resize(A,size,_interpolation,_boundary_conditions)'  re‐
888       turns
889          a resized version of a vector 'A' with specified interpolation mode.
890          'interpolation' can be { -1=none (memory content) | 0=none | 1=near‐
891       est
892          | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }, and
893          'boundary_conditions' can be { 0=dirichlet | 1=neumann |  2=periodic
894       |
895          3=mirror }.
896          *  Function 'find(A,B,_starting_index,_search_step)' returns the in‐
897       dex
898          where sub-vector 'B' appears in vector 'A', (or '-1' if
899          'B' is not contained in 'A'). Argument 'A' can be also
900          replaced by an image index '#ind'.
901          * A '2'-dimensional vector may be seen as a complex number and  used
902       in
903          those particular functions/operators: '**' (complex multiplication),
904          '//' (complex division), '^^' (complex exponentiation), '**='
905          (complex self-multiplication), '//=' (complex self-division), '^^='
906          (complex self-exponentiation), 'cabs()' (complex modulus), 'carg()'
907          (complex argument), 'cconj()' (complex conjugate), 'cexp()'
908          (complex exponential), 'clog()' (complex logarithm),  'ccos()'
909          (complex cosine), 'csin()' (complex sine), 'ctan()' (complex
910          tangent), 'ccosh()' (complex hyperpolic cosine), 'csinh()' (complex
911          hyperbolic sine) and 'ctanh()' (complex hyperbolic tangent).
912          * A 'MN'-dimensional vector may be seen as a 'M' x 'N'
913          matrix and used in those particular functions/operators: '*'
914          (matrix-vector multiplication), 'det(A)' (determinant), 'diag(V)'
915          (diagonal  matrix  from  a  vector), 'eig(A)' (eigenvalues/eigenvec‐
916       tors),
917          'eye(n)' (n x n identity matrix), 'invert(A,_solver)' (matrix
918          inverse), 'mul(A,B,_nb_colsB)' (matrix-matrix multiplication),
919          'pseudoinvert(A,_nb_colsA,_solver)', 'rot(u,v,w,angle)' (3D
920          rotation matrix), 'rot(angle)' (2D rotation matrix), 'solve(A,B,
921          _nb_colsB)' (solver of linear system A.X = B), 'svd(A,_nb_colsA)'
922          (singular value decomposition), 'trace(A)' (matrix trace) and
923          'transpose(A,nb_colsA)' (matrix transpose). Argument 'nb_colsB' may
924          be omitted if it is equal to '1'.
925          *        'mproj(S,nb_colsS,D,nb_colsD,method,max_iter,max_residual)'
926       projects a
927          matrix 'S' onto a dictionary (matrix) 'D'. Equivalent to command
928          mproj but inside the math evaluator.
929          *  Specifying  a  vector-valued  math expression as an argument of a
930       command that
931          operates on image values (e.g. 'fill') modifies the  whole  spectrum
932       range
933          of  the  processed image(s), for each spatial coordinates '(x,y,z)'.
934       The
935          command does not loop over the 'c'-axis in this case.
936
937         ## String manipulation:
938
939         Character strings are defined and managed as vectors  objects.  Dedi‐
940       cated
941          functions and initializers to manage strings are:
942          * '['string']' and ''string'' define a vector whose values are the
943          character codes of the specified 'character string' (e.g. ''foo''
944          is equal to '[ 102,111,111 ]').
945          * '_'character'' returns the (scalar) byte code of the specified
946          character (e.g. '_'A'' is equal to '65').
947          *  A  special case happens for empty strings: Values of both expres‐
948       sions
949          '['']' and '''' are '0'.
950          * Functions 'lowercase()' and 'uppercase()' return string with all
951          string characters lowercased or uppercased.
952          * Function 'stov(str,_starting_index,_is_strict)' parses specified
953          string 'str' and returns the value contained in it.
954          * Function 'vtos(expr,_nb_digits,_siz)' returns a vector of size
955          'siz' which contains the  character  representation  of  values  de‐
956       scribed by
957          expression 'expr'. 'nb_digits' can be { -1=auto-reduced | 0=all
958          | >0=max number of digits }.
959          *  Function  'echo(str1,str2,...,strN)'  prints the concatenation of
960       given
961          string arguments on the console.
962          * Function 'string(_#siz,str1,str2,...,strN)' generates a vector
963          corresponding to the concatenation of given string/number arguments.
964
965         ## Special operators:
966
967          * ';': expression separator. The returned value is always the last
968          encountered expression. For instance expression '1;2;pi'  is  evalu‐
969       ated as
970          'pi'.
971          *  '=':  variable  assignment.  Variables in mathematical parser can
972       only
973          refer to numerical values (vectors or scalars). Variable names are
974          case-sensitive. Use this operator in conjunction with ';' to  define
975       more
976          complex evaluable expressions, such as
977
978           t = cos(x); 3*t^2 + 2*t + 1
979
980         These variables remain local to the mathematical parser and cannot be
981          accessed outside the evaluated expression.
982          * Variables defined in math parser may have a constant property, by
983          specifying keyword 'const' before the variable name (e.g. 'const foo
984       =
985          pi/4;'). The value set to such a variable must be indeed a constant
986          scalar. Constant variables allows certain types of optimizations  in
987       the math
988          JIT compiler.
989
990         ## Specific functions:
991
992          *  'addr(expr)': return the pointer address to the specified expres‐
993       sion
994          'expr'.
995          * 'fill(target,expr)' or 'fill(target,index_name,expr)' fill the
996          content of the specified target (often vector-valued) using a  given
997       expression,
998          e.g.  'V  = vector16(); fill(V,k,k^2 + k + 1);'. For a vector-valued
999       target,
1000           it is basically equivalent to: 'for (index_name = 0,
1001          index_name<size(target), ++index_name, target[index_name] = expr);'.
1002          * 'u(max)' or 'u(min,max)': return a random value between '[0,
1003          max]' or '[min,max]', following a uniform distribution.
1004          * 'f2ui(value)' and 'ui2f(value)': Convert a large unsigned
1005          integer as a negative floating point value (and vice-versa), so that
1006       32bits
1007          floats  can  be used to store large integers while keeping a unitary
1008       precision.
1009          * 'i(_a,_b,_c,_d,_interpolation_type,_boundary_conditions)':  return
1010       the
1011          value of the pixel located at position '(a,b,c,d)' in the associated
1012          image, if any ('0' otherwise). 'interpolation_type' can be {
1013          0=nearest neighbor | 1=linear | 2=cubic }. 'boundary_conditions' can
1014          be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. Omitted
1015          coordinates  are  replaced by their default values which are respec‐
1016       tively
1017          'x', 'y', 'z', 'c', 'interpolation' and
1018          'boundary'. For instance command
1019
1020           fill 0.5*(i(x+1)-i(x-1))
1021
1022          will estimate the X-derivative of an image with a  classical  finite
1023       difference
1024          scheme.
1025          * 'j(_dx,_dy,_dz,_dc,_interpolation_type,_boundary_conditions)' does
1026       the
1027          same for  the  pixel  located  at  position  '(x+dx,y+dy,z+dz,c+dc)'
1028       (pixel
1029          access relative to the current coordinates).
1030          * 'i[offset,_boundary_conditions]' returns the value of the pixel
1031          located at specified 'offset' in the associated image buffer (or
1032          '0' if offset is out-of-bounds).
1033          * 'j[offset,_boundary_conditions]' does the same for an offset rela‐
1034       tive
1035          to the current pixel coordinates '(x,y,z,c)'.
1036          *         'i(#ind,_x,_y,_z,_c,_interpolation,_boundary_conditions)',
1037       'j(#ind,
1038          _dx,_dy,_dz,_dc,_interpolation,_boundary_conditions)',  'i[#ind,off‐
1039       set,
1040          _boundary_conditions]' and 'i[offset,_boundary_conditions]' are
1041          similar expressions used to access pixel values for any numbered im‐
1042       age
1043          '[ind]' of the list.
1044          * 'I/J[offset,_boundary_conditions]' and 'I/J(#ind,_x,_y,_z,
1045          _interpolation,_boundary_conditions)' do the same as 'i/j[offset,
1046          _boundary_conditions]' and 'i/j(#ind,_x,_y,_z,_c,_interpolation,
1047          _boundary_conditions)' but return a vector instead of a scalar (e.g.
1048       a
1049          vector '[ R,G,B ]' for a pixel at '(a,b,c)' in a color image).
1050          * 'crop(_#ind,_x,_y,_z,_c,_dx,_dy,_dz,_dc,_boundary_conditions)' re‐
1051       turns
1052          a  vector whose values come from the cropped region of image '[ind]'
1053       (or
1054          from default image selected if 'ind' is not specified). Cropped  re‐
1055       gion
1056          starts from point '(x,y,z,c)' and has a size of 'dx x dy x dz x
1057          dc'.  Arguments for coordinates and sizes can be omitted if they are
1058       not
1059          ambiguous (e.g. 'crop(#ind,x,y,dx,dy)' is a valid invocation of this
1060          function).
1061          * 'draw(_#ind,S,x,y,z,c,dx,_dy,_dz,_dc,_opacity,_M,_max_M)' draws a
1062          sprite 'S' in image '[ind]' (or in default image selected if
1063          'ind' is not specified) at coordinates '(x,y,z,c)'. The size of the
1064          sprite 'dx x dy x dz x dc' must be specified. You can also specify a
1065          corresponding opacity mask 'M' if its size matches 'S'.
1066          * 'polygon(_#ind,nb_vertices,coords,_opacity,_color)' draws a filled
1067          polygon in image '[ind]' (or in default image selected if 'ind' is
1068          not specified) at specified coordinates. It draws a single line if
1069          'nb_vertices' is set to 2.
1070          *      'polygon(_#ind,-nb_vertices,coords,_opacity,_pattern,_color)'
1071       draws a
1072          outlined polygon in image '[ind]' (or in default image selected if
1073          'ind'  is not specified) at specified coordinates and with specified
1074       line
1075          pattern. It draws a single line if 'nb_vertices' is set to 2.
1076          *     'ellipse(_#ind,xc,yc,radius1,_radius2,_angle,_opacity,_color)'
1077       draws a
1078          filled ellipse in image '[ind]' (or in default image selected if
1079          'ind' is not specified) with specified coordinates.
1080          * 'ellipse(_#ind,xc,yc,-radius1,-_radius2,_angle,_opacity,_pattern,
1081          _color)' draws an outlined ellipse in image '[ind]' (or in default
1082          image selected if 'ind' is not specified).
1083          *                   'resize(#ind,w,_h,_d,_s,_interp,_boundary_condi‐
1084       tions,_cx,_cy,_cz,_cc)'
1085          resizes an image of the associated list with specified dimension and
1086          interpolation method. When using this function, you should  consider
1087       retrieving
1088          the (non-constant) image dimensions using the dynamic functions
1089          'w(_#ind)', 'h(_#ind)', 'd(_#ind)', 's(_#ind)',
1090          'wh(_#ind)', 'whd(_#ind)' and 'whds(_#ind)' instead of the
1091          corresponding constant variables.
1092          * 'if(condition,expr_then,_expr_else)': return value of
1093          'expr_then' or 'expr_else', depending on the value of
1094          'condition' { 0=false | other=true }. 'expr_else' can be
1095          omitted  in  which  case  '0'  is returned if the condition does not
1096       hold.
1097          Using the ternary operator  'condition?expr_then[:expr_else]'  gives
1098       an
1099          equivalent expression. For instance, G'MIC commands
1100
1101           fill if(x%10==0,255,i)
1102
1103          and
1104
1105           fill x%10?i:255
1106
1107          both draw blank vertical lines on every 10th column of an image.
1108          * 'do(expression,_condition)' repeats the evaluation of
1109          'expression' until 'condition' vanishes (or until
1110          'expression' vanishes if no 'condition' is specified). For instance,
1111           the expression:
1112
1113           if(N<2,N,n=N-1;F0=0;F1=1;do(F2=F0+F1;F0=F1;F1=F2,n=n-1))
1114
1115          returns the N-th value of the Fibonacci sequence, for 'N>=0' (e.g.,
1116          '46368' for 'N=24'). 'do(expression,condition)' always
1117          evaluates the specified expression at least once, then check for the
1118       loop
1119          condition. When done, it returns the last value of 'expression'.
1120          * 'for(init,condition,_procedure,body)' first evaluates the  expres‐
1121       sion
1122          'init', then iteratively evaluates 'body' (followed by
1123          'procedure' if specified) while 'condition' holds (i.e. not zero).
1124          It  may  happen that no iterations are done, in which case the func‐
1125       tion returns
1126          'nan'. Otherwise, it returns the last value of 'body'. For instance,
1127           the expression:
1128
1129           if(N<2,N,for(n=N;F0=0;F1=1,n=n-1,F2=F0+F1;F0=F1;F1=F2))
1130
1131          returns the 'N'-th value of the Fibonacci sequence, for 'N>=0'
1132          (e.g., '46368' for 'N=24').
1133          * 'while(condition,expression)' is exactly the same as 'for(init,
1134          condition,expression)' without the specification of an initializing
1135          expression.
1136          * 'repeat(nb_iters,expr)' or 'fill(nb_iters,iter_name,expr)' run
1137          'nb_iters' iterations of the specified expression 'expr', e.g.
1138          'V = vector16(); repeat(16,k,V[k] = k^2 + k + 1);'. It is basically
1139          equivalent to: 'for (iter_name = 0, iter_name<nb_iters, ++iter_name,
1140          expr);'.
1141          * 'break()' and 'continue()' respectively breaks and continues the
1142          current running bloc (loop, init or main environment).
1143          * 'fsize('filename')' returns the size of the specified 'filename'
1144          (or '-1' if file does not exist).
1145          * 'date(attr,'path')' returns the date attribute for the given
1146          'path' (file or directory), with 'attr' being { 0=year | 1=month
1147          | 2=day | 3=day of week | 4=hour | 5=minute | 6=second }, or a  vec‐
1148       tor of
1149          those values.
1150          * 'date(_attr)' returns the specified attribute for the current (lo‐
1151       cale)
1152          date (attributes being { 0...6=same meaning as above  |  7=millisec‐
1153       onds }).
1154          * 'print(expr1,expr2,...)' or 'print(#ind)' prints the value of
1155          the specified expressions (or image information) on the console, and
1156       returns
1157          the value of the last expression (or 'nan' in  case  of  an  image).
1158       Function
1159          'prints(expr)'  also  prints  the  string  composed of the character
1160       codes
1161          defined by the vector-valued expression (e.g. 'prints('Hello')').
1162          * 'debug(expression)' prints detailed debug info about the  sequence
1163       of
1164          operations  done  by the math parser to evaluate the expression (and
1165       returns its
1166          value).
1167          * 'display(_X,_w,_h,_d,_s)' or 'display(#ind)' display the
1168          contents of the vector 'X' (or specified image) and  wait  for  user
1169       events.
1170          if  no  arguments are provided, a memory snapshot of the math parser
1171       environment
1172          is displayed instead.
1173          * 'begin(expression)' and 'end(expression)' evaluates the
1174          specified expressions only once, respectively at the  beginning  and
1175       end of the
1176          evaluation  procedure,  and this, even when multiple evaluations are
1177       required
1178          (e.g. in 'fill ">begin(foo = 0); ++foo"').
1179          * 'copy(dest,src,_nb_elts,_inc_d,_inc_s,_opacity)' copies an entire
1180          memory block of 'nb_elts' elements starting from a source value
1181          'src' to a specified destination 'dest', with increments defined by
1182          'inc_d' and 'inc_s' respectively for the destination and source
1183          pointers.
1184          * 'stats(_#ind)' returns the statistics vector of the running image
1185          '[ind]', i.e the vector '[ im,iM,ia,iv,xm,ym,zm,cm,xM,yM,zM,cM,is,ip
1186          ]' (14 values).
1187          * 'ref(expr,a)' references specified expression 'expr' as variable
1188          name 'a'.
1189          * 'unref(a,b,...)' destroys references to the named  variable  given
1190       as
1191          arguments.
1192          *  'breakpoint()' inserts a possible computation breakpoint (useless
1193       with
1194          the cli interface).
1195          * '_(comment) expr' just returns expression 'expr' (useful  for  in‐
1196       serting
1197          inline comments in math expressions).
1198          *  'run('pipeline')'  executes the specified G'MIC pipeline as if it
1199       was
1200          called outside the currently evaluated expression.
1201          * 'set(A,'variable_name')' set the G'MIC variable '$variable_name'
1202          with the value of expression 'A'. If 'A' is a vector-valued
1203          variable, it is assumed to encode a string.
1204          *  'store(A,'variable_name',_w,_h,_d,_s,_is_compressed)'   transfers
1205       the
1206          data of vector 'A' as a 'w x h x d x s' image to the G'MIC variable
1207          '$variable_name'. Thus, the data becomes available outside the math
1208          expression  (that  is equivalent to using the regular command store,
1209       but
1210          directly in the math expression).
1211          * 'get('variable_name',_size,_return_as_string)' returns  the  value
1212       of
1213          the specified variable, as a vector of 'size' values, or as a scalar
1214       (if
1215          'size' is zero or not specified).
1216          * 'name(_#ind,size)' returns a vector of size 'size', whose values
1217          are the characters codes of the name of image  '[ind]'  (or  default
1218       image
1219          selected if 'ind' is not specified).
1220          * 'correlate(I,wI,hI,dI,sI,K,wK,hK,dK,sK,_boundary_conditions,
1221          _is_normalized,_channel_mode,_xcenter,_ycenter,_zcenter,_xstart,_ys‐
1222       tart,_zstart,
1223          _xend,_yend,_zend,_xstride,_ystride,_zstride,_xdilation,_ydila‐
1224       tion,_zdilation,
1225          _interpolation_type)' returns the correlation, unrolled as a vector,
1226       of the
1227          'wI x hI x dI x sI'-sized image 'I' with the 'wK x hK x dK x
1228          sK'-sized kernel 'K' (the meaning of the  other  arguments  are  the
1229       same
1230          as in command 'correlate'). Similar function 'convolve(...)' is
1231          also defined for computing the convolution between 'I' and 'K'.
1232
1233         ## User-defined macros:
1234
1235          *  Custom macro functions can be defined in a math expression, using
1236       the
1237          assignment operator '=', e.g.
1238
1239           foo(x,y) = cos(x + y); result = foo(1,2) + foo(2,3)
1240
1241          * Trying to override a built-in function (e.g. 'abs()') has  no  ef‐
1242       fect.
1243          * Overloading macros with different number of arguments is possible.
1244          Re-defining a previously defined macro with the same number of argu‐
1245       ments
1246          discards its previous definition.
1247          * Macro functions are indeed processed as macros by the mathematical
1248          evaluator. You should avoid invoking them with  arguments  that  are
1249       themselves
1250          results of assignments or self-operations. For instance,
1251
1252           foo(x) = x + x; z = 0; foo(++z)
1253
1254          returns '4' rather than expected value '2'.
1255          *  When  substituted, macro arguments are placed inside parentheses,
1256       except if a
1257          number sign '#' is located just before or after the  argument  name.
1258       For
1259          instance, expression
1260
1261           foo(x,y) = x*y; foo(1+2,3)
1262
1263          returns '9' (being substituted as '(1+2)*(3)'), while expression
1264
1265           foo(x,y) = x#*y#; foo(1+2,3)
1266
1267          returns '7' (being substituted as '1+2*3').
1268          *  Number  signs appearing between macro arguments function actually
1269       count for
1270          empty separators. They may be used  to  force  the  substitution  of
1271       macro
1272          arguments in unusual places, e.g. as in
1273
1274           str(N) = ['I like N#'];
1275
1276         ## Multi-threaded and in-place evaluation:
1277
1278          *  If  your  image  data  are large enough and you have several CPUs
1279       available, it
1280          is likely that the math expression passed to a 'fill', 'eval' or
1281          'input' commands is evaluated in parallel, using  multiple  computa‐
1282       tion
1283          threads.
1284          * Starting an expression with ':' or '*' forces the evaluations
1285          required  for  an image to be run in parallel, even if the amount of
1286       data to
1287          process is small (beware, it may  be  slower  to  evaluate  in  this
1288       case!). Specify
1289          ':' (rather than '*') to avoid possible image copy done before
1290          evaluating  the  expression  (this saves memory, but do this only if
1291       you are sure
1292          this step is not required!)
1293          * If the specified expression starts with '>' or '<', the pixel
1294          access operators 'i()', 'i[]', 'j()' and 'j[]' return
1295          values of the image being currently modified, in forward ('>') or
1296          backward ('<') order. The multi-threading evaluation of the  expres‐
1297       sion is
1298          disabled in this case.
1299          *  Function  'critical(expr)'  forces the execution of the given ex‐
1300       pression
1301          in a single thread at a time.
1302          * 'begin_t(expr)' and 'end_t(expr)' evaluates the specified
1303          expression once for each running thread (so possibly several  times)
1304       at the
1305          beginning and the end of the evaluation procedure.
1306          * 'merge(variable,operator)' tells to merge the local variable value
1307          computed  by  threads, with the specified operator, when all threads
1308       have
1309          finished computing.
1310          * Expressions 'i(_#ind,x,_y,_z,_c)=value', 'j(_#ind,x,_y,_z,
1311          _c)=value', 'i[_#ind,offset]=value' and 'j[_#ind,offset]=value'
1312          set a pixel value at a different location than the  running  one  in
1313       the image
1314          '[ind]' (or in the associated image if argument '#ind' is omitted),
1315          either with global coordinates/offsets (with 'i(...)' and 'i[...]'),
1316           or relatively to the current position '(x,y,z,c)' (with 'j(...)'
1317          and 'j[...]'). These expressions always return 'value'.
1318
1319
1320         10. Image and Data Viewers
1321             ----------------------
1322
1323          * G'MIC has some very handy embedded visualization modules, for 1D
1324          signals (command plot), 1D/2D/3D images (command display) and 3D
1325          vector  objects (command display3d). It manages interactive views of
1326       the
1327          selected image data.
1328          * The following actions are available in the interactive viewers:
1329            -  '(mousewheel)': Zoom in/out.
1330            -  'ESC': Close window.
1331            -  'CTRL+D': Increase window size.
1332            -  'CTRL+C': Decrease window size.
1333            -  'CTRL+R': Reset window size.
1334            -  'CTRL+F': Toggle fullscreen mode.
1335            -  'CTRL+S': Save current view as a numbered file
1336          'gmic_xxxx.ext'.
1337            -  'CTRL+O': Save copy of the viewed data, as a numbered file
1338          'gmic_xxxx.ext'.
1339
1340          * Actions specific to the 1D/2D image viewer (command display) are:
1341            -  'Left mouse button': Create an image selection  and  zoom  into
1342       it.
1343            -  'Middle mouse button', or 'CTRL+left mouse button': Move
1344          image.
1345            -  'Mouse wheel' or 'PADD+/-': Zoom in/out.
1346            -  'Arrow keys': Move image left/right/up/down.
1347            -  'CTRL+A': Enable/disable transparency (show alpha channel).
1348            -  'CTRL+N': Change normalization mode (can be { none | normal |
1349          channel-by-channel }).
1350            -  'CTRL+SPACE': Reset view.
1351            -  'CTRL+X': Show/hide axes.
1352            -  'CTRL+Z': Hold/release aspect ratio.
1353
1354          * Actions specific to the 3D volumetric image viewer (command
1355          display) are:
1356            -  'CTRL+P': Play z-stack of frames as a movie.
1357            -  'CTRL+V': Show/hide 3D view on bottom right zone.
1358            -  'CTRL+X': Show/hide axes.
1359            -  'CTRL+(mousewheel)': Go up/down.
1360            -  'SHIFT+(mousewheel)': Go left/right.
1361            -  'Numeric PAD': Zoom in/out ('+'/'-') and move through
1362          zoomed image (digits).
1363            -  'BACKSPACE': Reset zoom scale.
1364
1365          * Actions specific to the 3D object viewer (command display3d) are:
1366            -  '(mouse)+(left mouse button)': Rotate 3D object.
1367            -  '(mouse)+(right mouse button)': Zoom 3D object.
1368            -  '(mouse)+(middle mouse button)': Shift 3D object.
1369            -  'F1 ... F6': Toggle between different 3D rendering modes.
1370            -  'F7/F8': Decrease/increase focale.
1371            -  'F9': Select animation mode.
1372            -  'F10': Select animation speed.
1373            -  'SPACE': Start/stop animation.
1374            -  'CTRL+A': Show/hide 3D axes.
1375            -  'CTRL+B': Switch between available background.
1376            -  'CTRL+G': Save 3D object, as numbered file 'gmic_xxxx.obj'.
1377            -  'CTRL+L': Show/hide outline.
1378            -  'CTRL+P': Print current 3D pose on stderr.
1379            -  'CTRL+T': Switch between single/double-sided 3D modes.
1380            -  'CTRL+V': Start animation with video output.
1381            -  'CTRL+X': Show/hide 3D bounding box.
1382            -  'CTRL+Z': Enable/disable z-buffered rendering.
1383
1384
1385         11. Adding Custom Commands
1386             ----------------------
1387
1388          *  New  custom commands can be added by the user, through the use of
1389       G'MIC
1390          custom commands files.
1391          * A command file is a simple text file, where each line  starts  ei‐
1392       ther by
1393
1394           command_name: command_definition
1395
1396          or
1397
1398           command_definition (continuation)
1399
1400          * At startup, G'MIC automatically includes user's command file
1401          '$HOME/.gmic' (on Unix) or '%APPDATA%/user.gmic' (on
1402          Windows). The CLI tool 'gmic' automatically runs the command
1403          'cli_start' if defined.
1404          *  Custom  command  names  must use character set '[a-zA-Z0-9_]' and
1405       cannot
1406          start with a number.
1407          * Any '# comment' expression found in a custom commands file is
1408          discarded by the G'MIC parser, wherever it is located in a line.
1409          * In a custom command, the following '$-expressions' are  recognized
1410       and
1411          substituted:
1412            -   '$*' is substituted by a copy of the specified string of argu‐
1413       ments.
1414            -  '$"*"' is substituted by a copy of the specified string of
1415          arguments, each being double-quoted.
1416            -  '$#' is substituted by the maximum  index  of  known  arguments
1417       (either
1418          specified  by  the user or set to a default value in the custom com‐
1419       mand).
1420            -  '$[]' is substituted by the list of selected image indices that
1421          have been specified in the command invocation.
1422            -  '$?' is substituted by a printable version of '$[]' to be
1423          used in command descriptions.
1424            -  '$i' and '${i}' are both substituted by the 'i'-th
1425          specified argument. Negative indices such as '${-j}' are allowed and
1426          refer to the 'j'-th latest argument. '$0' is substituted by the
1427          custom command name.
1428            -  '${i=default}' is substituted by the value of '$i' (if
1429          defined) or by its new value set to 'default' otherwise ('default'
1430          may be a '$-expression' as well).
1431            -  '${subset}' is substituted by the argument values (separated by
1432          commas ',') of a specified argument subset. For instance expression
1433          '${2--2}' is substituted by all specified command  arguments  except
1434       the
1435          first  and  the  last one. Expression '${^0}' is then substituted by
1436       all
1437          arguments of the invoked command (eq. to '$*' if all arguments  have
1438       been
1439          indeed specified).
1440            -  '$=var' is substituted by the set of instructions that will as‐
1441       sign
1442          each argument '$i' to the named variable 'var$i' (for i in
1443          '[0...$#]'. This is particularly useful when a custom  command  want
1444       to
1445          manage variable numbers of arguments. Variables names must use char‐
1446       acter set
1447          '[a-zA-Z0-9_]' and cannot start with a number.
1448
1449          * These particular '$-expressions' for custom commands are always
1450          substituted, even in double-quoted items or when the dollar sign '$'
1451          is escaped with a backslash '$'. To  avoid  substitution,  place  an
1452       empty
1453          double quoted string just after the '$' (as in '$""1').
1454          *  Specifying  arguments  may be skipped when invoking a custom com‐
1455       mand, by
1456          replacing them by commas ',' as in expression
1457
1458           flower ,,3
1459
1460          Omitted arguments are set to their default  values,  which  must  be
1461       thus
1462          explicitly  defined  in the code of the corresponding custom command
1463       (using
1464          default argument expressions as '${1=default}').
1465          * If one numbered argument required by a  custom  command  misses  a
1466       value, an
1467          error is thrown by the G'MIC interpreter.
1468          * It is possible to specialize the invokation of a '+command' by
1469          defining it as
1470
1471           +command_name: command_definition
1472
1473          * A +-specialization takes priority over the regular command defini‐
1474       tion when
1475          the command is invoked with a prepended '+'.
1476          * When only a +-specialization of a command is defined, invoking
1477          'command' is actually equivalent to '+command'.
1478
1479
1480         12. List of Commands
1481             ----------------
1482
1483         All available G'MIC commands are listed below, by categories. An  ar‐
1484       gument
1485          specified between '[]' or starting by '_' is optional except when
1486          standing for an existing image '[image]', where 'image' can be
1487          either an index number or an image name. In this case, the '[]'
1488          characters are mandatory when writing the item. Note that all images
1489       that serve
1490          as illustrations in this reference documentation are  normalized  in
1491       range '[0,
1492          255]'  before  being  displayed.  You may need to do this explicitly
1493       (command
1494          'normalize 0,255') if you want to save and view images with the same
1495       aspect
1496          than those illustrated in the example codes.
1497
1498         12.1. Global Options
1499               --------------
1500
1501         debug (+):
1502
1503           Activate debug mode.
1504           When activated, the G'MIC interpreter becomes very verbose and out‐
1505       puts additional log
1506           messages about its internal state on the standard output (stdout).
1507           This option is useful for developers or to report possible bugs  of
1508       the interpreter.
1509
1510         h:
1511             Shortcut for command 'help'.
1512
1513         help:
1514             command |
1515             (no arg)
1516
1517           Display help (optionally for specified command only) and exit.
1518           (equivalent to shortcut command 'h').
1519
1520         version:
1521
1522           Display current version number on stdout.
1523
1524         12.2. Input / Output
1525               --------------
1526
1527         camera (+):
1528             _camera_index>=0,_nb_frames>0,_skip_frames>=0,_cap‐
1529       ture_width>=0,_capture_height>=0
1530
1531           Insert one or several frames from specified camera.
1532           When 'nb_frames==0', the camera stream is released instead of  cap‐
1533       turing new images.
1534           This command requires features from the OpenCV library (not enabled
1535       in G'MIC by default).
1536
1537           Default values: 'camera_index=0' (default  camera),  'nb_frames=1',
1538       'skip_frames=0' and 'capture_width=capture_height=0' (default size).
1539
1540         clut:
1541             "clut_name",_resolution>0,_cut_and_round={ 0=no | 1=yes }
1542
1543           Insert  one  of  the  958 pre-defined CLUTs at the end of the image
1544       list.
1545
1546           'clut_name'  can  be  {  2-strip-process  |  60s  |   60s_faded   |
1547       60s_faded_alt  |  7drk_21  | action_magenta_01 | action_red_01 | adven‐
1548       ture_1453 | agfa_apx_100 | agfa_apx_25 | agfa_precisa_100 |
1549            agfa_ultra_color_100 | agfa_vista_200 |  agressive_highligjtes_re‐
1550       covery_5  |  alberto_street  | alien_green | amstragram | amstragram+ |
1551       analog_film_1 | analogfx_anno_1870_color |
1552            analogfx_old_style_i       |        analogfx_old_style_ii        |
1553       analogfx_old_style_iii | analogfx_sepia_color | analogfx_soft_sepia_i |
1554       analogfx_soft_sepia_ii | anime | apocalypse_this_very_moment | aqua |
1555            aqua_and_orange_dark | arabica_12 | atomic_pink | autumn | ava_614
1556       |  avalanche  |  azrael_93  | bboyz_2 | bc_darkum | beach_aqua_orange |
1557       beach_faded_analog | berlin_sky | black_and_white |
1558            black_star | black_white_01 | black_white_02  |  black_white_03  |
1559       black_white_04  |  black_white_05  |  black_white_06  |  blade_runner |
1560       bleach_bypass | bleachbypass_1 | bleachbypass_2 |
1561            bleachbypass_3 | bleachbypass_4 | bleech_bypass_green | bleech_by‐
1562       pass_yellow_01  |  blue_cold_fade | blue_dark | blue_house | blue_ice |
1563       blue_mono | blue_shadows_01 | blues | bob_ford |
1564            bourbon_64 | bright_green_01 | bright_teal_orange | bright_warm  |
1565       brightgreen  | brown_mobster | brownbm | brownish | bw_1 | bw_10 | bw_2
1566       | bw_3 | bw_4 | bw_5 | bw_6 | bw_7 | bw_8 | bw_9 |
1567            bw_but_yellow | byers_11 | candlelight | caribe |  chemical_168  |
1568       chrome_01  | cineblue | cinebm_4k | cinema | cinema_2 | cinema_3 | cin‐
1569       ema_4 | cinema_5 | cinema_noir | cinematic-1 |
1570            cinematic-10 | cinematic-2 | cinematic-3  |  cinematic-4  |  cine‐
1571       matic-5 | cinematic-6 | cinematic-7 | cinematic-8 | cinematic-9 | cine‐
1572       matic_01 | cinematic_02 | cinematic_03 | cinematic_for_flog
1573            | cinematic_forest | cinematic_lady_bird | cinematic_mexico | city
1574       |  city_7  |  city_dust  |  classic_films_01 | classic_films_02 | clas‐
1575       sic_films_03 | classic_films_04 | classic_films_05 |
1576            classic_teal_and_orange   |   clayton_33   |   clear_teal_fade   |
1577       clouseau_54  | cobi_3 | coffee_44 | cold_clear_blue | cold_clear_blue_1
1578       | cold_ice | cold_simplicity_2 | color_rich | colorful_0209 |
1579            colornegative | conflict_01 |  contrail_35  |  contrast_with_high‐
1580       lights_protection  |  contrasty_afternoon  | contrasty_green | crispro‐
1581       mance | crispwarm | crispwinter | cross_process_cp_130 |
1582            cross_process_cp_14 | cross_process_cp_15 | cross_process_cp_16  |
1583       cross_process_cp_18   |   cross_process_cp_3   |  cross_process_cp_4  |
1584       cross_process_cp_6 | crushin | cubicle_99 | d_o_1 |
1585            dark_blues_in_sunlight | dark_green_02 | dark_green_1 | dark_man_x
1586       |  dark_orange_teal  | dark_place_01 | darkness | date_39 | day_4nite |
1587       day_for_night | day_to_night_kings_blue | deep |
1588            deep_blue | deep_dark_warm | deep_high_contrast | deep_teal_fade |
1589       deep_warm_fade | deepskintones_2 | deepskintones_3 | delicatessen | de‐
1590       noiser_simple_40 | desert_gold_37 | dimension |
1591            directions_23 | django_25 | domingo_145 |  dream_1  |  dream_85  |
1592       drop_green_tint_14  | dropblues | duotone_blue_red | earth_tone_boost |
1593       edgyember | elegance_38 | enchanted | eterna_for_flog |
1594            expired_69 | expired_fade | expired_polaroid | extreme  |  fade  |
1595       fade_to_green | faded | faded_47 | faded_alt | faded_analog | faded_ex‐
1596       treme | faded_green | faded_pink-ish | faded_print |
1597            faded_retro_01 | faded_retro_02 | faded_vivid | fadedlook |  fall‐
1598       colors | faux_infrared | faux_infrared_bw_1 | faux_infrared_color_p_2 |
1599       faux_infrared_color_p_3 | faux_infrared_color_r_0a |
1600            faux_infrared_color_r_0b | faux_infrared_color_yp_1 |  fgcinebasic
1601       |  fgcinebright  |  fgcinecold  |  fgcinedrama  |  fgcinetealorange_1 |
1602       fgcinetealorange_2 | fgcinevibrant | fgcinewarm | film_0987
1603            | film_9879 | film_gb-19 | film_high_contrast  |  film_print_01  |
1604       film_print_02 | filmic | flat_30 | flat_blue_moon | flavin | foggynight
1605       | folger_50 | formula_b | french_comedy | frosted |
1606            frostedbeachpicnic | fuji_160c  |  fuji_160c_+  |  fuji_160c_++  |
1607       fuji_160c_-    |    fuji_3510_constlclip    |   fuji_3510_constlmap   |
1608       fuji_3510_cuspclip | fuji_3513_constlclip | fuji_3513_constlmap |
1609            fuji_3513_cuspclip | fuji_400h  |  fuji_400h_+  |  fuji_400h_++  |
1610       fuji_400h_-  |  fuji_800z  | fuji_800z_+ | fuji_800z_++ | fuji_800z_- |
1611       fuji_astia_100_generic | fuji_astia_100f | fuji_fp-100c |
1612            fuji_fp-100c_+   |   fuji_fp-100c_++    |    fuji_fp-100c_+++    |
1613       fuji_fp-100c_++_alt    |    fuji_fp-100c_-    |    fuji_fp-100c_--    |
1614       fuji_fp-100c_alt | fuji_fp-100c_cool | fuji_fp-100c_cool_+ |
1615            fuji_fp-100c_cool_++ | fuji_fp-100c_cool_- |  fuji_fp-100c_cool_--
1616       |  fuji_fp-100c_negative | fuji_fp-100c_negative_+ | fuji_fp-100c_nega‐
1617       tive_++ | fuji_fp-100c_negative_+++ |
1618            fuji_fp-100c_negative_++_alt    |    fuji_fp-100c_negative_-     |
1619       fuji_fp-100c_negative_--    |   fuji_fp-3000b   |   fuji_fp-3000b_+   |
1620       fuji_fp-3000b_++    |    fuji_fp-3000b_+++    |    fuji_fp-3000b_-    |
1621       fuji_fp-3000b_--
1622            |  fuji_fp-3000b_hc | fuji_fp-3000b_negative | fuji_fp-3000b_nega‐
1623       tive_+  |  fuji_fp-3000b_negative_++  |  fuji_fp-3000b_negative_+++   |
1624       fuji_fp-3000b_negative_- | fuji_fp-3000b_negative_-- |
1625            fuji_fp-3000b_negative_early   |   fuji_fp_100c   |   fuji_hdr   |
1626       fuji_neopan_1600   |   fuji_neopan_1600_+   |   fuji_neopan_1600_++   |
1627       fuji_neopan_1600_- | fuji_neopan_acros_100 | fuji_provia_100_generic |
1628            fuji_provia_100f | fuji_provia_400f | fuji_provia_400x | fuji_sen‐
1629       sia_100 | fuji_superia_100 | fuji_superia_100_+ | fuji_superia_100_++ |
1630       fuji_superia_100_- | fuji_superia_1600 |
1631            fuji_superia_1600_+ | fuji_superia_1600_++ | fuji_superia_1600_- |
1632       fuji_superia_200 | fuji_superia_200_xpro | fuji_superia_400 |  fuji_su‐
1633       peria_400_+ | fuji_superia_400_++ | fuji_superia_400_-
1634            |  fuji_superia_800  |  fuji_superia_800_+ | fuji_superia_800_++ |
1635       fuji_superia_800_- | fuji_superia_hg_1600  |  fuji_superia_reala_100  |
1636       fuji_superia_x-tra_800 | fuji_velvia_100_generic |
1637            fuji_velvia_50 | fuji_xtrans_iii_acros | fuji_xtrans_iii_acros+g |
1638       fuji_xtrans_iii_acros+r       |       fuji_xtrans_iii_acros+ye        |
1639       fuji_xtrans_iii_astia | fuji_xtrans_iii_classic_chrome |
1640            fuji_xtrans_iii_mono        |       fuji_xtrans_iii_mono+g       |
1641       fuji_xtrans_iii_mono+r        |        fuji_xtrans_iii_mono+ye        |
1642       fuji_xtrans_iii_pro_neg_hi      |     fuji_xtrans_iii_pro_neg_std     |
1643       fuji_xtrans_iii_provia |
1644            fuji_xtrans_iii_sepia | fuji_xtrans_iii_velvia | fusion_88  |  fu‐
1645       turisticbleak_1  |  futuristicbleak_2  |  futuristicbleak_3  | futuris‐
1646       ticbleak_4 | going_for_a_walk | golden | golden_bright |
1647            golden_fade   |   golden_mono    |    golden_night_softner_43    |
1648       golden_sony_37   |   golden_vibrant   |   goldengate   |  goldentime  |
1649       goldfx_bright_spring_breeze | goldfx_bright_summer_heat |
1650            goldfx_hot_summer_heat | goldfx_perfect_sunset_01min | goldfx_per‐
1651       fect_sunset_05min  | goldfx_perfect_sunset_10min | goldfx_spring_breeze
1652       | goldfx_summer_heat | good_morning | green_15 |
1653            green_2025 | green_action | green_afternoon |  green_and_orange  |
1654       green_blues | green_conflict | green_day_01 | green_day_02 | green_g_09
1655       | green_indoor | green_light | green_mono |
1656            green_yellow  |  greenish_contrasty  |  greenish_fade   |   green‐
1657       ish_fade_1  |  gremerta  | hackmanite | hallowen_dark | happyness_133 |
1658       hard_teal_orange | harsh_day | harsh_sunset | helios | herderite
1659            | heulandite | hiddenite | highlights_protection | hilutite | hit‐
1660       man | hlg_1_1 | honey_light | hong_kong | horrorblue | howlite | hydra‐
1661       core | hyla_68 | hypersthene | hypnosis | hypressen |
1662            ilford_delta_100 | ilford_delta_3200 | ilford_delta_3200_+  |  il‐
1663       ford_delta_3200_++  |  ilford_delta_3200_-  |  ilford_delta_400  |  il‐
1664       ford_fp_4_plus_125 | ilford_hp_5 | ilford_hp_5_+ |
1665            ilford_hp_5_++  |  ilford_hp_5_-  |  ilford_hp_5_plus_400  |   il‐
1666       ford_hps_800  |  ilford_pan_f_plus_50 | ilford_xp_2 | indoor_blue | in‐
1667       dustrial_33 | infrared_-_dust_pink | instantc | justpeachy |
1668            jwick_21 | k_tone_vintage_kodachrome | kh_1 | kh_10 | kh_2 |  kh_3
1669       |  kh_4  |  kh_5  |  kh_6  |  kh_7  |  kh_8  |  kh_9 | killstreak | ko‐
1670       dak_2383_constlclip | kodak_2383_constlmap | kodak_2383_cuspclip |
1671            kodak_2393_constlclip | kodak_2393_constlmap | kodak_2393_cuspclip
1672       |   kodak_bw_400_cn   |   kodak_e-100_gx_ektachrome_100   |   kodak_ek‐
1673       tachrome_100_vs | kodak_ektachrome_100_vs_generic |
1674            kodak_ektar_100 | kodak_elite_100_xpro | kodak_elite_chrome_200  |
1675       kodak_elite_chrome_400  | kodak_elite_color_200 | kodak_elite_color_400
1676       | kodak_elite_extracolor_100 | kodak_hie_hs_infra |
1677            kodak_kodachrome_200 | kodak_kodachrome_25 | kodak_kodachrome_64 |
1678       kodak_kodachrome_64_generic  |  kodak_portra_160 | kodak_portra_160_+ |
1679       kodak_portra_160_++ | kodak_portra_160_- |
1680            kodak_portra_160_nc   |   kodak_portra_160_nc_+    |    kodak_por‐
1681       tra_160_nc_++  |  kodak_portra_160_nc_-  |  kodak_portra_160_vc  |  ko‐
1682       dak_portra_160_vc_+ | kodak_portra_160_vc_++ | kodak_portra_160_vc_- |
1683            kodak_portra_400 | kodak_portra_400_+ | kodak_portra_400_++ |  ko‐
1684       dak_portra_400_-  |  kodak_portra_400_nc  | kodak_portra_400_nc_+ | ko‐
1685       dak_portra_400_nc_++ | kodak_portra_400_nc_- |
1686            kodak_portra_400_uc   |   kodak_portra_400_uc_+    |    kodak_por‐
1687       tra_400_uc_++  |  kodak_portra_400_uc_-  |  kodak_portra_400_vc  |  ko‐
1688       dak_portra_400_vc_+ | kodak_portra_400_vc_++ | kodak_portra_400_vc_- |
1689            kodak_portra_800 | kodak_portra_800_+ | kodak_portra_800_++ |  ko‐
1690       dak_portra_800_-  |  kodak_portra_800_hc  |  kodak_t-max_100 | kodak_t-
1691       max_3200 | kodak_t-max_400 | kodak_tmax_3200 |
1692            kodak_tmax_3200_+ | kodak_tmax_3200_++ | kodak_tmax_3200_-  |  ko‐
1693       dak_tmax_3200_alt  |  kodak_tri-x_400  | kodak_tri-x_400_+ | kodak_tri-
1694       x_400_++ | kodak_tri-x_400_- | kodak_tri-x_400_alt |
1695            korben_214 | landscape_01 | landscape_02 |  landscape_03  |  land‐
1696       scape_04  |  landscape_05  | landscape_1 | landscape_10 | landscape_2 |
1697       landscape_3 | landscape_4 | landscape_5 | landscape_6 |
1698            landscape_7 | landscape_8 | landscape_9 |  lateafternoonwanderlust
1699       | latesunset | lc_1 | lc_10 | lc_2 | lc_3 | lc_4 | lc_5 | lc_6 | lc_7 |
1700       lc_8 | lc_9 | lenox_340 | life_giving_tree |
1701            light_blown  |  lomo  |  lomography_redscale_100  |  lomography_x-
1702       pro_slide_200   |   london_nights   |  louetta  |  low_contrast_blue  |
1703       low_key_01 | lucky_64 | lushgreensummer | magenta_day |
1704            magenta_day_01 | magenta_dream | magenta_yellow | magentacoffee  |
1705       matrix  | mckinnon_75 | memories | metropolis | milo_5 | minimalistcaf‐
1706       feination | modern_film | modern_films_01 |
1707            modern_films_02  |  modern_films_03  |  modern_films_04   |   mod‐
1708       ern_films_05  | modern_films_06 | modern_films_07 | mono_tinted | mono‐
1709       chrome | monochrome_1 | monochrome_2 | moody_1 | moody_10 |
1710            moody_2 | moody_3 | moody_4  |  moody_5  |  moody_6  |  moody_7  |
1711       moody_8  |  moody_9 | moonlight | moonlight_01 | moonrise | morning_6 |
1712       morroco_16 | mostly_blue | moviz_1 | moviz_10 | moviz_11 |
1713            moviz_12 | moviz_13 | moviz_14 | moviz_15 | moviz_16 | moviz_17  |
1714       moviz_18  |  moviz_19  |  moviz_2  |  moviz_20  | moviz_21 | moviz_22 |
1715       moviz_23 | moviz_24 | moviz_25 | moviz_26 | moviz_27 |
1716            moviz_28 | moviz_29 | moviz_3 | moviz_30 | moviz_31 |  moviz_32  |
1717       moviz_33  |  moviz_34  |  moviz_35  |  moviz_36 | moviz_37 | moviz_38 |
1718       moviz_39 | moviz_4 | moviz_40 | moviz_41 | moviz_42 |
1719            moviz_43 | moviz_44 | moviz_45 | moviz_46 | moviz_47 | moviz_48  |
1720       moviz_5 | moviz_6 | moviz_7 | moviz_8 | moviz_9 | mute_shift | muted_01
1721       | muted_fade | mysticpurplesunset | nah |
1722            natural_vivid  |  nemesis  |  neon_770  |  neutral_pump   |   neu‐
1723       tral_teal_orange   |   neutral_warm_fade   |  newspaper  |  night_01  |
1724       night_blade_4 | night_king_141 | night_spy | nightfromday | nightlife |
1725            nostalgiahoney | nostalgic | nw-1 | nw-10 | nw-2 | nw-3 |  nw-4  |
1726       nw-5  |  nw-6  |  nw-7  |  nw-8  | nw-9 | old_west | once_upon_a_time |
1727       only_red | only_red_and_blue | operation_yellow |
1728            orange_dark_4 | orange_dark_7 | orange_dark_look |  orange_tone  |
1729       orange_underexposed  | oranges | paladin | paladin_1875 | pasadena_21 |
1730       passing_by | pink_fade | pitaya_15 | pmcinematic_01 |
1731            pmcinematic_02 | pmcinematic_03 | pmcinematic_04 |  pmcinematic_05
1732       |  pmcinematic_06  |  pmcinematic_07  |  pmnight_01  | pmnight_02 | pm‐
1733       night_03 | pmnight_04 | pmnight_05 | polaroid_664 |
1734            polaroid_665 | polaroid_665_+ | polaroid_665_++ | polaroid_665_- |
1735       polaroid_665_-- | polaroid_665_negative | polaroid_665_negative_+ | po‐
1736       laroid_665_negative_- | polaroid_665_negative_hc |
1737            polaroid_667 | polaroid_669 | polaroid_669_+ |  polaroid_669_++  |
1738       polaroid_669_+++ | polaroid_669_- | polaroid_669_-- | polaroid_669_cold
1739       | polaroid_669_cold_+ | polaroid_669_cold_- |
1740            polaroid_669_cold_--  |  polaroid_672   |   polaroid_690   |   po‐
1741       laroid_690_+ | polaroid_690_++ | polaroid_690_- | polaroid_690_-- | po‐
1742       laroid_690_cold | polaroid_690_cold_+ | polaroid_690_cold_++ |
1743            polaroid_690_cold_- | polaroid_690_cold_-- |  polaroid_690_warm  |
1744       polaroid_690_warm_+  | polaroid_690_warm_++ | polaroid_690_warm_- | po‐
1745       laroid_690_warm_-- | polaroid_polachrome |
1746            polaroid_px-100uv+_cold   |   polaroid_px-100uv+_cold_+   |    po‐
1747       laroid_px-100uv+_cold_++    |    polaroid_px-100uv+_cold_+++    |   po‐
1748       laroid_px-100uv+_cold_- | polaroid_px-100uv+_cold_-- |
1749            polaroid_px-100uv+_warm   |   polaroid_px-100uv+_warm_+   |    po‐
1750       laroid_px-100uv+_warm_++    |    polaroid_px-100uv+_warm_+++    |   po‐
1751       laroid_px-100uv+_warm_- | polaroid_px-100uv+_warm_-- |  polaroid_px-680
1752       |
1753            polaroid_px-680_+  |  polaroid_px-680_++ | polaroid_px-680_- | po‐
1754       laroid_px-680_-- | polaroid_px-680_cold | polaroid_px-680_cold_+ |  po‐
1755       laroid_px-680_cold_++ | polaroid_px-680_cold_++_alt |
1756            polaroid_px-680_cold_-    |    polaroid_px-680_cold_--    |    po‐
1757       laroid_px-680_warm | polaroid_px-680_warm_+ | polaroid_px-680_warm_++ |
1758       polaroid_px-680_warm_- | polaroid_px-680_warm_-- | polaroid_px-70
1759            |  polaroid_px-70_+ | polaroid_px-70_++ | polaroid_px-70_+++ | po‐
1760       laroid_px-70_-  |  polaroid_px-70_--  |   polaroid_px-70_cold   |   po‐
1761       laroid_px-70_cold_+ | polaroid_px-70_cold_++ |
1762            polaroid_px-70_cold_-     |     polaroid_px-70_cold_--    |    po‐
1763       laroid_px-70_warm | polaroid_px-70_warm_+  |  polaroid_px-70_warm_++  |
1764       polaroid_px-70_warm_- | polaroid_px-70_warm_-- |
1765            polaroid_time_zero_expired  |  polaroid_time_zero_expired_+  | po‐
1766       laroid_time_zero_expired_++  |   polaroid_time_zero_expired_-   |   po‐
1767       laroid_time_zero_expired_-- | polaroid_time_zero_expired_--- |
1768            polaroid_time_zero_expired_cold      |      polaroid_time_zero_ex‐
1769       pired_cold_-     |     polaroid_time_zero_expired_cold_--     |     po‐
1770       laroid_time_zero_expired_cold_---  |  portrait_1  |  portrait_10 | por‐
1771       trait_2 |
1772            portrait_3 | portrait_4 | portrait_5 | portrait_6 |  portrait_7  |
1773       portrait_8  |  portrait_9  | progressen | protect_highlights_01 | prus‐
1774       sian_blue | pseudogrey | purple | purple_2 |
1775            red_afternoon_01 | red_day_01 |  red_dream_01  |  redblueyellow  |
1776       reds  |  reds_oranges_yellows  | reeve_38 | remy_24 | rest_33 | retro |
1777       retro_brown_01 | retro_magenta_01 | retro_summer_3 |
1778            retro_yellow_01    |    rollei_ir_400    |    rollei_ortho_25    |
1779       rollei_retro_100_tonal  |  rollei_retro_80s | rotate_muted | rotate_vi‐
1780       brant | rotated | rotated_crush | saturated_blue | saving_private_damon
1781            | science_fiction | sea | serenity | seringe_4 | serpent |  seven‐
1782       ties_magazine  |  sevsuz  |  shade_kings_ink | shadow_king_39 | shine |
1783       skin_tones | smart_contrast | smokey | smooth_clear |
1784            smooth_cromeish | smooth_fade | smooth_green_orange | smooth_sail‐
1785       ing  | smooth_teal_orange | soft_fade | softwarming | solarized_color |
1786       solarized_color_2 | springmorning | sprocket_231 |
1787            spy_29 | street | studio_skin_tone_shaper  |  subtle_blue  |  sub‐
1788       tle_green  | subtle_yellow | summer | summer_alt | sunlightlove | sunny
1789       | sunny_alt | sunny_rich | sunny_warm | sunset_aqua_orange
1790            | sunset_intense_violet_blue | sunset_violet_mood |  super_warm  |
1791       super_warm_rich  | sutro_fx | sweet_bubblegum | sweet_gelatto | taiga |
1792       tarraco | teal_fade | teal_moonlight | tealmagentagold
1793            | tealorange | tealorange_1 | tealorange_2 | tealorange_3 |  tech‐
1794       nicalfx_backlight_filter  | teigen_28 | tensiongreen_1 | tensiongreen_2
1795       | tensiongreen_3 | tensiongreen_4 | terra_4 |
1796            the_matrices | thriller_2 | toastedgarden | trent_18  |  true_col‐
1797       ors_8  |  turkiest_42  |  tweed_71 | ultra_water | undeniable | undeni‐
1798       able_2 | unknown | urban_01 | urban_02 | urban_03 | urban_04 |
1799            urban_05  |  urban_cowboy  |  uzbek_bukhara  |  uzbek_marriage   |
1800       uzbek_samarcande  |  velvetia | very_warm_greenish | vfb_21 | vibrant |
1801       vibrant_alien | vibrant_contrast | vibrant_cromeish | victory
1802            | vintage | vintage_01 | vintage_02 | vintage_03  |  vintage_04  |
1803       vintage_05  |  vintage_163  |  vintage_alt  |  vintage_brighter  | vin‐
1804       tage_chrome | vintage_mob | vintage_warmth_1 | violet_taste |
1805            vireo_37 | warm | warm_dark_contrasty | warm_fade | warm_fade_1  |
1806       warm_highlight | warm_neutral | warm_sunset_red | warm_teal | warm_vin‐
1807       tage | warm_yellow | well_see | western | westernlut_2
1808            | whiter_whites | winterlighthouse | wipe | wooden_gold_20 |  yel‐
1809       low_55b  |  yellow_film_01  |  yellowstone  |  you_can_do_it | zed_32 |
1810       zeke_39 | zilverfx_bw_solarization | zilverfx_infrared |
1811            zilverfx_vintage_bw  }  :  Default  values:  'resolution=33'   and
1812       'cut_and_round=1'.
1813
1814           Example:
1815             [#1] clut summer clut alien_green,17 clut orange_dark4,48
1816
1817         m (+):
1818             Shortcut for command 'command'.
1819
1820         command (+):
1821             _add_debug_info={ 0 | 1 },{ filename | http[s]://URL | "string" }
1822
1823           Import G'MIC custom commands from specified file, URL or string.
1824           (equivalent to shortcut command 'm').
1825
1826           Imported  commands are available directly after the 'command' invo‐
1827       cation.
1828
1829           Default value: 'add_debug_info=1'.
1830
1831           Example:
1832             [#1] image.jpg command "foo : mirror y  deform  $""1"  +foo[0]  5
1833       +foo[0] 15
1834
1835         cursor (+):
1836             _mode = { 0=hide | 1=show }
1837
1838           Show or hide mouse cursor for selected instant display windows.
1839           Command  selection  (if  any) stands for instant display window in‐
1840       dices instead of image indices.
1841
1842           Default value: 'mode=1'.
1843
1844         delete (+):
1845             filename1[,filename2,...]
1846
1847           Delete specified filenames on disk. Multiple filenames must be sep‐
1848       arated by commas.
1849
1850         d (+):
1851             Shortcut for command 'display'.
1852
1853         display (+):
1854             _X[%]>=0,_Y[%]>=0,_Z[%]>=0,_exit_on_anykey={ 0 | 1 }
1855
1856           Display  selected  images in an interactive viewer (use the instant
1857       display window [0] if opened).
1858           (equivalent to shortcut command 'd').
1859
1860           Arguments 'X','Y','Z' determine the initial selection view, for  3D
1861       volumetric images.
1862
1863           Default value: 'X=Y=Z=0' and 'exit_on_anykey=0'.
1864
1865           Tutorial: https://gmic.eu/oldtutorial/_display
1866
1867         d0:
1868             Shortcut for command 'display0'.
1869
1870         display0:
1871
1872           Display selected images without value normalization.
1873           (equivalent to shortcut command 'd0').
1874
1875         d2d:
1876             Shortcut for command 'display2d'.
1877
1878         display2d:
1879
1880           Display selected 2d images in an interactive window.
1881           (equivalent to shortcut command 'd2d').
1882
1883           This  command is used by default by command 'display' when display‐
1884       ing 2d images.
1885           If selected image is a volumetric image, each slice is displayed on
1886       a separate display
1887           window  (up to 10 images can be displayed simultaneously this way),
1888       with synchronized moves.
1889           When interactive window is opened, the following actions are possi‐
1890       ble:
1891            * Left mouse button: Create an image selection and zoom into it.
1892            * Middle mouse button, or CTRL+left mouse button: Move image.
1893            * Mouse wheel or PADD+/-: Zoom in/out.
1894            * Arrow keys: Move image left/right/up/down.
1895            *  'CTRL  + A': Enable/disable transparency (show/hide alpha chan‐
1896       nel).
1897            * 'CTRL + C': Decrease window size.
1898            * 'CTRL + D': Increase window size.
1899            * 'CTRL + F': Toggle fullscreen mode.
1900            * 'CTRL + N': Change normalization mode (can be { none | normal  |
1901       channel-by-channel }).
1902            *  'CTRL  + O': Save a copy of the input image, as a numbered file
1903       'gmic_xxxxxx.gmz'.
1904            * 'CTRL + R': Reset both window size and view.
1905            * 'CTRL + S': Save a screenshot of the current view, as a numbered
1906       file 'gmic_xxxxxx.png'.
1907            * 'CTRL + SPACE': Reset view.
1908            * 'CTRL + X': Show/hide axes.
1909            * 'CTRL + Z': Hold/release aspect ratio.
1910
1911         d3d:
1912             Shortcut for command 'display3d'.
1913
1914         display3d:
1915             _[background_image],_exit_on_anykey={ 0 | 1 } |
1916             _exit_on_anykey={ 0 | 1 }
1917
1918           Display  selected  3D objects in an interactive viewer (use the in‐
1919       stant display window [0] if opened).
1920           (equivalent to shortcut command 'd3d').
1921
1922           Default      values:       '[background_image]=(default)'       and
1923       'exit_on_anykey=0'.
1924
1925         da:
1926             Shortcut for command 'display_array'.
1927
1928         display_array:
1929             _width>0,_height>0
1930
1931           Display images in interactive windows where pixel neighborhoods can
1932       be explored.
1933
1934           Default values: 'width=13' and 'height=width'.
1935
1936         dc:
1937             Shortcut for command 'display_camera'.
1938
1939         display_camera:
1940
1941           Open camera viewer.
1942           This command requires features from the OpenCV library (not enabled
1943       in G'MIC by default).
1944
1945         dfft:
1946             Shortcut for command 'display_fft'.
1947
1948         display_fft:
1949
1950           Display  fourier  transform  of selected images, with centered log-
1951       module and argument.
1952           (equivalent to shortcut command 'dfft').
1953
1954           Example:
1955             [#1] image.jpg +display_fft
1956
1957         dg:
1958             Shortcut for command 'display_graph'.
1959
1960         display_graph:
1961             _width>=0,_height>=0,_plot_type,_ver‐
1962       tex_type,_xmin,_xmax,_ymin,_ymax,_xlabel,_ylabel
1963
1964           Render graph plot from selected image data.
1965           'plot_type' can be { 0=none | 1=lines | 2=splines | 3=bar }.
1966           'vertex_type'  can  be { 0=none | 1=points | 2,3=crosses | 4,5=cir‐
1967       cles | 6,7=squares }.
1968           'xmin','xmax','ymin','ymax' set the coordinates  of  the  displayed
1969       xy-axes.
1970           if  specified 'width' or 'height' is '0', then image size is set to
1971       half the screen size.
1972
1973           Default  values:  'width=0',   'height=0',   'plot_type=1',   'ver‐
1974       tex_type=1',   'xmin=xmax=ymin=ymax=0  (auto)',  'xlabel="x-axis"'  and
1975       'ylabel="y-axis"'.
1976
1977           Example:
1978             [#1] 128,1,1,1,'cos(x/10+u)' +display_graph 400,300,3
1979
1980         dh:
1981             Shortcut for command 'display_histogram'.
1982
1983         display_histogram:
1984             _width>=0,_height>=0,_clus‐
1985       ters>0,_min_value[%],_max_value[%],_show_axes={ 0 | 1 },_expression.
1986
1987           Render a channel-by-channel histogram.
1988           If  selected images have several slices, the rendering is performed
1989       for all input slices.
1990           'expression' is a mathematical expression  used  to  transform  the
1991       histogram data for visualization purpose.
1992           (equivalent to shortcut command 'dh').
1993
1994           if  specified 'width' or 'height' is '0', then image size is set to
1995       half the screen size.
1996
1997           Default    values:    'width=0',    'height=0',     'clusters=256',
1998       'min_value=0%', 'max_value=100%', 'show_axes=1' and 'expression=i'.
1999
2000           Example:
2001             [#1] image.jpg +display_histogram 512,300
2002
2003         display_parametric:
2004             _width>0,_height>0,_outline_opacity,_vertex_radius>=0,_is_an‐
2005       tialiased={ 0 | 1 },_is_decorated={ 0 | 1 },_xlabel,_ylabel
2006
2007           Render 2D or 3D parametric curve or point clouds from selected  im‐
2008       age data.
2009           Curve points are defined as pixels of a 2 or 3-channel image.
2010           If  the point image contains more than 3 channels, additional chan‐
2011       nels define the (R,G,B) color for each vertex.
2012           If 'outline_opacity>1', the outline is  colored  according  to  the
2013       specified vertex colors and
2014           'outline_opacity-1' is used as the actual drawing opacity.
2015
2016           Default  values:  'width=512', 'height=width', 'outline_opacity=3',
2017       'vertex_radius=0',   'is_antialiased=1','is_decorated=1',   'xlabel="x-
2018       axis"' and
2019            'ylabel="y-axis"'.
2020
2021           Example:
2022             [#1]
2023       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)'
2024       display_parametric 512,512
2025             [#2]  1000,1,1,2,u(-100,100)  quantize  4,1 noise 12 channels 0,2
2026       +normalize 0,255 append c display_parametric 512,512,0.1,8
2027
2028         dp:
2029             Shortcut for command 'display_parallel'.
2030
2031         display_parallel:
2032
2033           Display each selected image in a separate interactive display  win‐
2034       dow.
2035           (equivalent to shortcut command 'dp').
2036
2037         dp0:
2038             Shortcut for command 'display_parallel0'.
2039
2040         display_parallel0:
2041
2042           Display  each selected image in a separate interactive display win‐
2043       dow, without value normalization.
2044           (equivalent to shortcut command 'dp0').
2045
2046         display_polar:
2047             _width>32,_height>32,_out‐
2048       line_type,_fill_R,_fill_G,_fill_B,_theta_start,_theta_end,_xlabel,_yla‐
2049       bel
2050
2051           Render polar curve from selected image data.
2052           'outline_type' can be { r<0=dots with radius -r |  0=no  outline  |
2053       r>0=lines+dots with radius r }.
2054           'fill_color'  can be { -1=no fill | R,G,B=fill with specified color
2055       }.
2056
2057           Default  values:  'width=500',  'height=width',   'outline_type=1',
2058       'fill_R=fill_G=fill_B=200',   'theta_start=0',  'theta_end=360',  'xla‐
2059       bel="x-axis"' and
2060            'ylabel="y-axis"'.
2061
2062           Example:
2063             [#1]   300,1,1,1,'0.3+abs(cos(10*pi*x/w))+u(0.4)'   display_polar
2064       512,512,4,200,255,200
2065             [#2]              3000,1,1,1,'x^3/1e10'             display_polar
2066       400,400,1,-1,,,0,{15*360}
2067
2068         dq:
2069             Shortcut for command 'display_quiver'.
2070
2071         display_quiver:
2072             _size_factor>0,_arrow_size>=0,_color_mode={    0=monochrome     |
2073       1=grayscale | 2=color }
2074
2075           Render selected images of 2D vectors as a field of 2D arrows.
2076           (equivalent to shortcut command 'dq').
2077
2078           Default     values:    'size_factor=16',    'arrow_size=1.5'    and
2079       'color_mode=1'.
2080
2081           Example:
2082             [#1] image.jpg +luminance  gradient[-1]  xy  rv[-2,-1]  *[-2]  -1
2083       a[-2,-1] c crop 60,10,90,30 +display_quiver[1] ,
2084
2085         drgba:
2086             Shortcut for command 'display_rgba'.
2087
2088         display_rgba:
2089             _background_RGB_color
2090
2091           Render  selected  RGBA  images over a checkerboard or colored back‐
2092       ground.
2093           (equivalent to shortcut command 'drgba').
2094
2095           Default values: 'background_RGB_color=undefined' (checkerboard).
2096
2097           Example:
2098             [#1] image.jpg +norm threshold[-1] 40% blur[-1]  3  normalize[-1]
2099       0,255 append c display_rgba
2100
2101         dt:
2102             Shortcut for command 'display_tensors'.
2103
2104         display_tensors:
2105             _size_factor>0,_ellipse_size>=0,_color_mode={    0=monochrome   |
2106       1=grayscale | 2=color },_outline>=0
2107
2108           Render selected images of tensors as a field of 2D ellipses.
2109           (equivalent to shortcut command 'dt').
2110
2111           Default     values:      'size_factor=16',      'ellipse_size=1.5',
2112       'color_mode=2' and 'outline=2'.
2113
2114           Example:
2115             [#1]  image.jpg  +diffusiontensors  0.1,0.9  resize2dx.  32 +dis‐
2116       play_tensors. 64,2
2117
2118           Tutorial: https://gmic.eu/oldtutorial/_display_tensors
2119
2120         dw:
2121             Shortcut for command 'display_warp'.
2122
2123         display_warp:
2124             _cell_size>0
2125
2126           Render selected 2D warping fields.
2127           (equivalent to shortcut command 'dw').
2128
2129           Default value: 'cell_size=15'.
2130
2131           Example:
2132             [#1]                                    400,400,1,2,'x=x-w/2;y=y-
2133       h/2;r=sqrt(x*x+y*y);a=atan2(y,x);5*sin(r/10)*[cos(a),sin(a)]'     +dis‐
2134       play_warp 10
2135
2136         e (+):
2137             Shortcut for command 'echo'.
2138
2139         echo (+):
2140             message
2141
2142           Output specified message on the error output.
2143           (equivalent to shortcut command 'e').
2144
2145           Command selection (if any) stands for displayed call  stack  subset
2146       instead of image indices.
2147           When  invoked  with a '+' prefix (i.e. '+echo'), the command output
2148       its message on stdout rather than stderr.
2149
2150         echo_file:
2151             filename,message
2152
2153           Output specified message, appending it to specified output file.
2154           (similar to 'echo' for specified output file stream).
2155
2156         function1d:
2157             0<=smoothness<=1,x0>=0,y0,x1>=0,y1,...,xn>=0,yn
2158
2159           Insert continuous 1D function  from  specified  list  of  keypoints
2160       (xk,yk)
2161           in range [0,max(xk)] (xk are positive integers).
2162
2163           Default values: 'smoothness=1' and 'x0=y0=0'.
2164
2165           Example:
2166             [#1]   function1d   1,0,0,10,30,40,20,70,30,80,0   +display_graph
2167       400,300
2168
2169         i (+):
2170             Shortcut for command 'input'.
2171
2172         input (+):
2173             [type:]filename |
2174             [type:]http://URL |
2175             [selection]x_nb_copies>0 |
2176             {  width>0[%]  |  [image_w]  },{  _height>0[%]  |  [image_h]  },{
2177       _depth>0[%]   |   [image_d]   },{   _spectrum>0[%]   |  [image_s]  },_{
2178       value1,_value2,... | 'formula' } |
2179             (value1{,|;|/|^}value2{,|;|/|^}...[:{x|y|z|c|,|;|/|^}]) |
2180             0
2181
2182           Insert a new image taken from a filename or from a copy of  an  ex‐
2183       isting image [index],
2184           or  insert  new  image with specified dimensions and values. Single
2185       quotes may be omitted in
2186           'formula'. Specifying argument '0' inserts an 'empty' image.
2187           (equivalent to shortcut command 'i').
2188
2189           Default  values:   'nb_copies=1',   'height=depth=spectrum=1'   and
2190       'value1=0'.
2191
2192           Example:
2193             [#1] input image.jpg
2194             [#2] input (1,2,3;4,5,6;7,8,9^9,8,7;6,5,4;3,2,1)
2195             [#3]       image.jpg       (1,2,3;4,5,6;7,8,9)       (255^128^64)
2196       400,400,1,3,'if(x>w/2,x,y)*c'
2197
2198           Tutorial: https://gmic.eu/tutorial/input
2199
2200         input_565:
2201             filename,width>0,height>0,reverse_endianness={ 0 | 1 }
2202
2203           Insert image data from a raw RGB-565 file, at the end of the list.
2204
2205           Default value: 'reverse_endianness=0'.
2206
2207         input_csv:
2208             "filename",_read_data_as={ 0=numbers | 1=strings | _variable_name
2209       }
2210
2211           Insert number of string array from specified .csv file.
2212           If  'variable_name'  is provided, the string of each cell is stored
2213       in a numbered variable '_variable_name_x_y', where 'x' and 'y' are  the
2214       indices of the cell column and row
2215           respectively (starting from '0').
2216           Otherwise,  a  'WxH' image is inserted at the end of the list, with
2217       each vector-valued pixel 'I(x,y)' encoding the number or the string  of
2218       each cell.
2219           This  command returns the 'W,H' dimension of the read array, as the
2220       status.
2221
2222           Default value: 'read_data_as=1'.
2223
2224         input_cube:
2225             "filename",_convert_1d_cluts_to_3d={ 0 | 1 }.
2226
2227           Insert CLUT data from a .cube filename (Adobe CLUT file format).
2228
2229           Default value: 'convert_1d_cluts_to_3d=1'.
2230
2231         input_flo:
2232             "filename"
2233
2234           Insert optical flow  data  from  a  .flo  filename  (vision.middle‐
2235       bury.edu file format).
2236
2237         ig:
2238             Shortcut for command 'input_glob'.
2239
2240         input_glob:
2241             pattern
2242
2243           Insert  new  images from several filenames that match the specified
2244       glob pattern.
2245           (equivalent to shortcut command 'ig').
2246
2247         input_gpl:
2248             filename
2249
2250           Input specified filename as a .gpl palette data file.
2251
2252         it:
2253             Shortcut for command 'input_text'.
2254
2255         input_text:
2256             filename
2257
2258           Input specified text-data filename as a new image.
2259           (equivalent to shortcut command 'it').
2260
2261         network (+):
2262             mode={ -1=disabled | 0=enabled w/o timeout | >0=enabled w/ speci‐
2263       fied timeout in seconds }
2264
2265           Enable/disable load-from-network and set corresponding timeout.
2266           (Default mode is 'enabled w/o timeout').
2267
2268         o (+):
2269             Shortcut for command 'output'.
2270
2271         output (+):
2272             [type:]filename,_format_options
2273
2274           Output selected images as one or several numbered file(s).
2275           (equivalent to shortcut command 'o').
2276
2277           Default value: 'format_options'=(undefined).
2278
2279         output_565:
2280             "filename",reverse_endianness={ 0=false | 1=true }
2281
2282           Output selected images as raw RGB-565 files.
2283
2284           Default value: 'reverse_endianness=0'.
2285
2286         output_cube:
2287             "filename"
2288
2289           Output selected CLUTs as a .cube file (Adobe CLUT format).
2290
2291         output_flo:
2292             "filename"
2293
2294           Output  selected optical flow as a .flo file (vision.middlebury.edu
2295       file format).
2296
2297         output_ggr:
2298             filename,_gradient_name
2299
2300           Output selected images as .ggr gradient files (GIMP).
2301           If no gradient name is specified, it is deduced from the filename.
2302
2303         output_gmz:
2304             filename,_datatype
2305
2306           Output selected images as .gmz files (G'MIC native file format).
2307           'datatype' can be { bool | uchar | char | ushort | short |  uint  |
2308       int | uint64 | int64 | float | double }.
2309
2310         output_obj:
2311             filename,_save_materials={ 0=no | 1=yes }
2312
2313           Output selected 3D objects as Wavefront 3D object files.
2314           Set  'save_materials'  to  '1'  to produce a corresponding material
2315       file ('.mtl') and eventually texture files.
2316           Beware, the export to '.obj' files may be quite slow for  large  3D
2317       objects.
2318
2319           Default value: 'save_materials=1'.
2320
2321         ot:
2322             Shortcut for command 'output_text'.
2323
2324         output_text:
2325             filename
2326
2327           Output selected images as text-data filenames.
2328           (equivalent to shortcut command 'ot').
2329
2330         on:
2331             Shortcut for command 'outputn'.
2332
2333         outputn:
2334             filename,_index
2335
2336           Output  selected  images as automatically numbered filenames in re‐
2337       peat...done loops.
2338           (equivalent to shortcut command 'on').
2339
2340         op:
2341             Shortcut for command 'outputp'.
2342
2343         outputp:
2344             prefix
2345
2346           Output selected images as prefixed versions of their original file‐
2347       names.
2348           (equivalent to shortcut command 'op').
2349
2350           Default value: 'prefix=_'.
2351
2352         ow:
2353             Shortcut for command 'outputw'.
2354
2355         outputw:
2356
2357           Output selected images by overwriting their original location.
2358           (equivalent to shortcut command 'ow').
2359
2360         ox:
2361             Shortcut for command 'outputx'.
2362
2363         outputx:
2364             extension1,_extension2,_...,_extensionN,_output_at_same_loca‐
2365       tion={ 0 | 1 }
2366
2367           Output selected images with same base filenames but for N different
2368       extensions.
2369           (equivalent to shortcut command 'ox').
2370
2371           Default value: 'output_at_same_location=0'.
2372
2373         parse_cli:
2374             _output_mode,_{ * | command_name }
2375
2376           Parse  definition  of  ''-documented commands and output info about
2377       them in specified output mode.
2378           'output_mode' can be { ascii | bashcompletion |  html  |  images  |
2379       print }.
2380
2381           Default values: 'output_mode=print' and 'command_name=*'.
2382
2383         parse_gmd:
2384
2385           Parse  and tokenize selected images, viewed as text strings format‐
2386       ted with the G'MIC markdown syntax.
2387
2388         gmd2html:
2389             _include_default_header_footer={ 0=none | 1=Reference  |  2=Tuto‐
2390       rial | 3=News } |
2391             (no arg)
2392
2393           Convert selected gmd-formatted text images to html format.
2394
2395           Default values: 'include_default_header_footer=1'.
2396
2397         gmd2ascii:
2398             _max_line_length>0,_indent_forced_newlines>=0 |
2399             (no arg)
2400
2401           Convert selected gmd-formatted text images to ascii format.
2402
2403           Default values: 'max_line_length=80' and 'indent_forced_newline=0'.
2404
2405         parse_gui:
2406             _outputmode,_{ * | filter_name}
2407
2408           Parse  selected  filter definitions and generate info about filters
2409       in selected output mode.
2410           'outputmode' can be { json | list | print | strings | update | zart
2411       }.
2412           It  is possible to define a custom output mode, by implementing the
2413       following commands
2414           ('outputmode' must be replaced by the name of the custom user  out‐
2415       put mode):
2416           .  'parse_gui_outputmode'  : A command that outputs the parsing in‐
2417       formation with a custom format.
2418           . 'parse_gui_parseparams_outputmode' (optional): A  simple  command
2419       that returns 0 or 1. It tells the parser whether parameters of matching
2420       filter must be analyzed (slower) or not.
2421           . 'parse_gui_trigger_outputmode'  (optional):  A  command  that  is
2422       called  by the parser just before parsing the set of each matching fil‐
2423       ters.
2424           Here is the list of global variables set by the parser,  accessible
2425       in command 'parse_gui_outputmode':
2426           '$_nbfilters': Number of matching filters.
2427           '$_nongui'  (stored as an image): All merged lines in the file that
2428       do not correspond to '#@gui' lines.
2429           For each filter '     * '$_fF_name' : Filter name.
2430            * '$_fF_path' : Full path.
2431            * '$_fF_locale' : Filter locale (empty, if not specified).
2432            * '$_fF_command' : Filter command.
2433            * '$_fF_commandpreview' : Filter preview command  (empty,  if  not
2434       specified).
2435            *  '$_fF_zoomfactor'  :  Default zoom factor (empty, if not speci‐
2436       fied).
2437            * '$_fF_zoomaccurate' : Is preview accurate when  zoom  changes  ?
2438       (can be { 0=false | 1=true }).
2439            *  '$_fF_inputmode'  : Default preferred input mode (empty, if not
2440       specified).
2441            * '$_fF_hide' : Path of filter hid by current filter  (for  local‐
2442       ized filters, empty if not specified).
2443            * '$_fF_nbparams' : Number of parameters.
2444           For each parameter '     * '$_fF_pP_name' : Parameter name.
2445            * '$_fF_pP_type' : Parameter type.
2446            *  '$_fF_pP_responsivity' : Parameter responsivity (can be { 0 | 1
2447       }).
2448            * '$_fF_pP_visibility' : Parameter visibility.
2449            * '$_fF_pP_propagation' : Propagation of the parameter visibility.
2450            * '$_fF_pP_nbargs' : Number of parameter arguments.
2451           For each argument '     * '$_fF_pP_aA' : Argument value
2452           Default parameters: 'filter_name=*' and 'output_format=print'.
2453
2454         pass (+):
2455             _shared_state={ -1=status only | 0=non-shared (copy) | 1=shared |
2456       2=adaptive }
2457
2458           Insert  images  from  parent context of a custom command or a local
2459       environment.
2460           Command selection (if any) stands for a selection of images in  the
2461       parent context.
2462           By default (adaptive shared state), selected images are inserted in
2463       a shared state if they do not belong
2464           to the context (selection) of the current custom command  or  local
2465       environment as well.
2466           Typical  use  of  command 'pass' concerns the design of custom com‐
2467       mands that take images as arguments.
2468           This commands return the list of corresponding indices in the  sta‐
2469       tus.
2470
2471           Default value: 'shared_state=2'.
2472
2473           Example:
2474             [#1]  command "average : pass$""1 add[^-1] [-1] remove[-1] div 2"
2475       sample ? +mirror y +average[0] [1]
2476
2477         plot (+):
2478             _plot_type,_vertex_type,_xmin,_xmax,_ymin,_ymax,_exit_on_anykey={
2479       0 | 1 } |
2480             'formula',_resolution>=0,_plot_type,_ver‐
2481       tex_type,_xmin,xmax,_ymin,_ymax,_exit_on_anykey={ 0 | 1 }
2482
2483           Display selected images or formula in an  interactive  viewer  (use
2484       the instant display window [0] if opened).
2485           'plot_type' can be { 0=none | 1=lines | 2=splines | 3=bar }.
2486           'vertex_type'  can  be { 0=none | 1=points | 2,3=crosses | 4,5=cir‐
2487       cles | 6,7=squares }.
2488           'xmin', 'xmax', 'ymin', 'ymax' set the coordinates of the displayed
2489       xy-axes.
2490
2491           Default        values:        'plot_type=1',       'vertex_type=1',
2492       'xmin=xmax=ymin=ymax=0 (auto)' and 'exit_on_anykey=0'.
2493
2494         p (+):
2495             Shortcut for command 'print'.
2496
2497         print (+):
2498
2499           Output information  on  selected  images,  on  the  standard  error
2500       (stderr).
2501           (equivalent to shortcut command 'p').
2502
2503           When  invoked with a '+' prefix (i.e. '+print'), the command output
2504       its message on stdout rather than stderr.
2505
2506         random_pattern:
2507             _width>0,_height>0,_min_detail_level>=0
2508
2509           Insert a new RGB image of specified size at the end  of  the  image
2510       list, rendered with a random pattern.
2511
2512           Default values: 'width=height=512' and 'min_detail_level=2'.
2513
2514           Example:
2515             [#1] repeat 6 random_pattern 256 done
2516
2517         screen (+):
2518             _x0[%],_y0[%],_x1[%],_y1[%]
2519
2520           Take screenshot, optionally grabbed with specified coordinates, and
2521       insert it
2522           at the end of the image list.
2523
2524         select (+):
2525             feature_type,_X[%]>=0,_Y[%]>=0,_Z[%]>=0,_exit_on_anykey={ 0  |  1
2526       },_is_deep_selection={ 0 | 1 }
2527
2528           Interactively  select  a  feature from selected images (use the in‐
2529       stant display window [0] if opened).
2530           'feature_type' can be { 0=point | 1=segment | 2=rectangle  |  3=el‐
2531       lipse }.
2532           Arguments  'X','Y','Z' determine the initial selection view, for 3D
2533       volumetric images.
2534           The retrieved  feature  is  returned  as  a  3D  vector  (if  'fea‐
2535       ture_type==0') or as a 6d vector
2536           (if 'feature_type!=0') containing the feature coordinates.
2537
2538           Default   values:   'X=Y=Z=(undefined)',   'exit_on_anykey=0'   and
2539       'is_deep_selection=0'.
2540
2541         serialize (+):
2542             _datatype,_is_compressed={ 0 | 1 },_store_names={ 0 | 1 }
2543
2544           Serialize selected list of images into a single image,  optionnally
2545       in a compressed form.
2546           'datatype'  can  be { auto | uchar | char | ushort | short | uint |
2547       int | uint64 | int64 | float | double }.
2548           Specify 'datatype' if all selected images have a  range  of  values
2549       constrained to a particular datatype,
2550           in order to minimize the memory footprint.
2551           The  resulting  image  has  only integers values in [0,255] and can
2552       then be saved as a raw image of
2553           unsigned chars (doing so will  output  a  valid  .cimg[z]  or  .gmz
2554       file).
2555           If  'store_names' is set to '1', serialization uses the .gmz format
2556       to store data in memory
2557           (otherwise the .cimg[z] format).
2558
2559           Default    values:    'datatype=auto',    'is_compressed=1'     and
2560       'store_names=1'.
2561
2562           Example:
2563             [#1] image.jpg +serialize uchar +unserialize[-1]
2564
2565         shape_circle:
2566             _size>=0
2567
2568           Input a 2D circle binary shape with specified size.
2569
2570           Default value: 'size=512'.
2571
2572           Example:
2573             [#1] shape_circle ,
2574
2575         shape_cupid:
2576             _size>=0
2577
2578           Input a 2D cupid binary shape with specified size.
2579
2580           Default value: 'size=512'.
2581
2582           Example:
2583             [#1] shape_cupid ,
2584
2585         shape_diamond:
2586             _size>=0
2587
2588           Input a 2D diamond binary shape with specified size.
2589
2590           Default value: 'size=512'.
2591
2592           Example:
2593             [#1] shape_diamond ,
2594
2595         shape_dragon:
2596             _size>=0,_recursion_level>=0,_angle
2597
2598           Input a 2D Dragon curve with specified size.
2599
2600           Default value: 'size=512', 'recursion_level=18' and 'angle=0'.
2601
2602           Example:
2603             [#1] shape_dragon ,
2604
2605         shape_fern:
2606             _size>=0,_density[%]>=0,_angle,0<=_opacity<=1,_type={ 0=Asplenium
2607       adiantum-nigrum | 1=Thelypteridaceae }
2608
2609           Input a 2D Barnsley fern with specified size.
2610
2611           Default value: 'size=512', 'density=50%', 'angle=30', 'opacity=0.3'
2612       and 'type=0'.
2613
2614           Example:
2615             [#1] shape_fern ,
2616
2617         shape_gear:
2618             _size>=0,_nb_teeth>0,0<=_height_teeth<=100,0<=_off‐
2619       set_teeth<=100,0<=_inner_radius<=100
2620
2621           Input a 2D gear binary shape with specified size.
2622
2623           Default value: 'size=512', 'nb_teeth=12', 'height_teeth=20',  'off‐
2624       set_teeth=0' and 'inner_radius=40'.
2625
2626           Example:
2627             [#1] shape_gear ,
2628
2629         shape_heart:
2630             _size>=0
2631
2632           Input a 2D heart binary shape with specified size.
2633
2634           Default value: 'size=512'.
2635
2636           Example:
2637             [#1] shape_heart ,
2638
2639         shape_polygon:
2640             _size>=0,_nb_vertices>=3,_angle
2641
2642           Input a 2D polygonal binary shape with specified geometry.
2643
2644           Default value: 'size=512', 'nb_vertices=5' and 'angle=0'.
2645
2646           Example:
2647             [#1] repeat 6 shape_polygon 256,{3+$>} done
2648
2649         shape_snowflake:
2650             size>=0,0<=_nb_recursions<=6
2651
2652           Input a 2D snowflake binary shape with specified size.
2653
2654           Default values: 'size=512' and 'nb_recursions=5'.
2655
2656           Example:
2657             [#1] repeat 6 shape_snowflake 256,$> done
2658
2659         shape_star:
2660             _size>=0,_nb_branches>0,0<=_thickness<=1
2661
2662           Input a 2D star binary shape with specified size.
2663
2664           Default values: 'size=512', 'nb_branches=5' and 'thickness=0.38'.
2665
2666           Example:
2667             [#1] repeat 9 shape_star 256,{$>+2} done
2668
2669         sh (+):
2670             Shortcut for command 'shared'.
2671
2672         shared (+):
2673             x0[%],x1[%],y[%],z[%],c[%] |
2674             y0[%],y1[%],z[%],c[%] |
2675             z0[%],z1[%],c[%] |
2676             c0[%],c1[%] |
2677             c0[%] |
2678             (no arg)
2679
2680           Insert  shared  buffers  from (opt. points/rows/planes/channels of)
2681       selected images.
2682           Shared buffers cannot be returned by a command, nor a  local  envi‐
2683       ronment.
2684           (equivalent to shortcut command 'sh').
2685
2686           Example:
2687             [#1] image.jpg shared 1 blur[-1] 3 remove[-1]
2688             [#2]  image.jpg  repeat  s  shared  25%,75%,0,$> mirror[-1] x re‐
2689       move[-1] done
2690
2691           Tutorial: https://gmic.eu/oldtutorial/_shared
2692
2693         sp:
2694             Shortcut for command 'sample'.
2695
2696         sample:
2697             _name1={ ? | apples | balloons | barbara | boats | bottles | but‐
2698       terfly | cameraman | car | cat | cliff | chick | colorful | david | dog
2699       | duck | eagle | elephant | earth | flower | fruits |
2700               gmicky | gmicky_mahvin | gmicky_wilber | greece | gummy | house
2701       |  inside | landscape | leaf | lena | leno | lion | mandrill | monalisa
2702       | monkey | parrots | pencils | peppers | portrait0 |
2703               portrait1 | portrait2 | portrait3 |  portrait4  |  portrait5  |
2704       portrait6  | portrait7 | portrait8 | portrait9 | roddy | rooster | rose
2705       | square | swan | teddy | tiger | tulips | wall |
2706               waterfall | zelda },_name2,...,_nameN,_width={ >=0 |  0  (auto)
2707       },_height = { >=0 | 0 (auto) } |
2708             (no arg)
2709
2710           Input a new sample RGB image (opt. with specified size).
2711           (equivalent to shortcut command 'sp').
2712
2713           Argument  'name'  can  be  replaced by an integer which serves as a
2714       sample index.
2715
2716           Example:
2717             [#1] repeat 6 sample done
2718
2719         srand (+):
2720             value |
2721             (no arg)
2722
2723           Set random generator seed.
2724           If no argument is specified, a random value is used as  the  random
2725       generator seed.
2726
2727         store (+):
2728             _is_compressed={ 0 | 1 },variable_name1,_variable_name2,...
2729
2730           Store selected images into one or several named variables.
2731           Selected  images  are  transferred to the variables, and are so re‐
2732       moved from the image list.
2733           (except if the prepended variant of the command '+store[selection]'
2734       is used).
2735           If a single variable name is specified, all images of the selection
2736       are assigned
2737           to the named variable. Otherwise, there must be  as  many  variable
2738       names as images
2739           in the selection, and each selected image is assigned to each spec‐
2740       ified named variable.
2741           Use command 'input $variable_name' to bring the stored images  back
2742       in the list.
2743
2744           Default value: 'is_compressed=0'.
2745
2746           Example:
2747             [#1] sample eagle,earth store img1,img2 input $img2 $img1
2748
2749           Tutorial: https://gmic.eu/tutorial/store
2750
2751         testimage2d:
2752             _width>0,_height>0,_spectrum>0
2753
2754           Input a 2D synthetic image.
2755
2756           Default values: 'width=512', 'height=width' and 'spectrum=3'.
2757
2758           Example:
2759             [#1] testimage2d 512
2760
2761         um:
2762             Shortcut for command 'uncommand'.
2763
2764         uncommand (+):
2765             command_name[,_command_name2,...] |
2766             *
2767
2768           Discard definition of specified custom commands.
2769           Set argument to '*' for discarding all existing custom commands.
2770           (equivalent to shortcut command 'um').
2771
2772         uniform_distribution:
2773             nb_levels>=1,spectrum>=1
2774
2775           Input set of uniformly distributed spectrum-d points in [0,1]^spec‐
2776       trum.
2777
2778           Example:
2779             [#1]  uniform_distribution  64,3  *  255   +distribution3d   cir‐
2780       cles3d[-1] 10
2781
2782         unserialize (+):
2783
2784           Recreate  lists  of  images from serialized image buffers, obtained
2785       with command 'serialize'.
2786
2787         up:
2788             Shortcut for command 'update'.
2789
2790         update:
2791
2792           Update commands from  the  latest  definition  file  on  the  G'MIC
2793       server.
2794           (equivalent to shortcut command 'up').
2795
2796         v (+):
2797             Shortcut for command 'verbose'.
2798
2799         verbose (+):
2800             level |
2801             { + | - }
2802
2803           Set or increment/decrement the verbosity level. Default level is 0.
2804           (equivalent to shortcut command 'v').
2805
2806           When  'level'>0,  G'MIC  log messages are displayed on the standard
2807       error (stderr).
2808
2809           Default value: 'level=1'.
2810
2811         wait (+):
2812             delay |
2813             (no arg)
2814
2815           Wait for a given delay (in ms), optionally since the last  call  to
2816       'wait'.
2817           or  wait for a user event occurring on the selected instant display
2818       windows.
2819           'delay' can be { <0=delay+flush events | 0=event | >0=delay }.
2820           Command selection (if any) stands for instant  display  window  in‐
2821       dices instead of image indices.
2822           If  no window indices are specified and if 'delay' is positive, the
2823       command results
2824           in a 'hard' sleep during specified delay.
2825
2826           Default value: 'delay=0'.
2827
2828         warn (+):
2829             _force_visible={ 0 | 1 },_message
2830
2831           Print specified warning message, on the standard error (stderr).
2832           Command selection (if any) stands for displayed call  stack  subset
2833       instead of image indices.
2834
2835         w (+):
2836             Shortcut for command 'window'.
2837
2838         window (+):
2839             _width[%]>=-1,_height[%]>=-1,_normaliza‐
2840       tion,_fullscreen,_pos_x[%],_pos_y[%],_title
2841
2842           Display selected images into an instant display window with  speci‐
2843       fied size, normalization type,
2844           fullscreen mode and title.
2845           (equivalent to shortcut command 'w').
2846
2847           If 'width' or 'height' is set to -1, the corresponding dimension is
2848       adjusted to the window
2849           or image size.
2850           Specify 'pos_x' and 'pos_y' arguments only if the window has to  be
2851       moved to the specified
2852           coordinates. Otherwise, they can be avoided.
2853           'width'=0 or 'height'=0 closes the instant display window.
2854           'normalization'  can be { -1=keep same | 0=none | 1=always | 2=1st-
2855       time | 3=auto }.
2856           'fullscreen' can be { -1=keep same | 0=no | 1=yes }.
2857           You can manage up to 10 different instant display windows by  using
2858       the numbered variants
2859           'w0' (default, eq. to 'w'),'w1',...,'w9' of the command 'w'.
2860           Invoke 'window' with no selection to make the window visible, if it
2861       has been closed by the user.
2862
2863           Default values: 'width=height=normalization=fullscreen=-1' and 'ti‐
2864       tle=(undefined)'.
2865
2866         12.3. List Manipulation
2867               -----------------
2868
2869         k (+):
2870             Shortcut for command 'keep'.
2871
2872         keep (+):
2873
2874           Keep only selected images.
2875           (equivalent to shortcut command 'k').
2876
2877           Example:
2878             [#1] image.jpg split x keep[0-50%:2] append x
2879             [#2] image.jpg split x keep[^30%-70%] append x
2880
2881         mv (+):
2882             Shortcut for command 'move'.
2883
2884         move (+):
2885             position[%]
2886
2887           Move selected images at specified position.
2888           (equivalent to shortcut command 'mv').
2889
2890           Example:
2891             [#1] image.jpg split x,3 move[1] 0
2892             [#2] image.jpg split x move[50%--1:2] 0 append x
2893
2894         nm (+):
2895             Shortcut for command 'name'.
2896
2897         name (+):
2898             "name1","name2",...
2899
2900           Set names of selected images.
2901            * If the selection contains a single image, then it is assumed the
2902       command has a single name
2903            argument (possibly containing multiple comas).
2904            * If the selection contains more than one image, each command  ar‐
2905       gument defines a single image
2906            name for each image of the selection.
2907           (equivalent to shortcut command 'nm').
2908
2909           Example:
2910             [#1] image.jpg name image blur[image] 2
2911
2912           Tutorial: https://gmic.eu/tutorial/name
2913
2914         rm (+):
2915             Shortcut for command 'remove'.
2916
2917         remove (+):
2918
2919           Remove selected images.
2920           (equivalent to shortcut command 'rm').
2921
2922           Example:
2923             [#1] image.jpg split x remove[30%-70%] append x
2924             [#2] image.jpg split x remove[0-50%:2] append x
2925
2926         remove_duplicates:
2927
2928           Remove duplicates images in the selected images list.
2929
2930           Example:
2931             [#1] (1,2,3,4,2,4,3,1,3,4,2,1) split x remove_duplicates append x
2932
2933         remove_empty:
2934
2935           Remove empty images in the selected image list.
2936
2937         rmn:
2938             Shortcut for command 'remove_named'.
2939
2940         remove_named:
2941             "name1","name2",...
2942
2943           Remove all images with specified names from the list of images.
2944           Does nothing if no images with those names exist.
2945           (equivalent to shortcut command 'rmn').
2946
2947         rv (+):
2948             Shortcut for command 'reverse'.
2949
2950         reverse (+):
2951
2952           Reverse positions of selected images.
2953           (equivalent to shortcut command 'rv').
2954
2955           Example:
2956             [#1] image.jpg split x,3 reverse[-2,-1]
2957             [#2] image.jpg split x,-16 reverse[50%-100%] append x
2958
2959         sort_list:
2960             _ordering={ + | - },_criterion
2961
2962           Sort  list of selected images according to the specified image cri‐
2963       terion.
2964
2965           Default values: 'ordering=+', 'criterion=i'.
2966
2967           Example:
2968             [#1] (1;4;7;3;9;2;4;7;6;3;9;1;0;3;3;2) split y sort_list +,i  ap‐
2969       pend y
2970
2971         12.4. Mathematical Operators
2972               ----------------------
2973
2974         abs (+):
2975
2976           Compute the pointwise absolute values of selected images.
2977
2978           Example:
2979             [#1] image.jpg +sub {ia} abs[-1]
2980             [#2] 300,1,1,1,'cos(20*x/w)' +abs display_graph 400,300
2981
2982         acos (+):
2983
2984           Compute the pointwise arccosine of selected images.
2985
2986           Example:
2987             [#1] image.jpg +normalize -1,1 acos[-1]
2988             [#2] 300,1,1,1,'cut(x/w+0.1*u,0,1)' +acos display_graph 400,300
2989
2990           Tutorial:      https://gmic.eu/oldtutorial/trigometric-and-inverse-
2991       trigometric-commands
2992
2993         acosh (+):
2994
2995           Compute the pointwise hyperbolic arccosine of selected images.
2996
2997         + (+):
2998             Shortcut for command 'add'.
2999
3000         add (+):
3001             value[%] |
3002             [image] |
3003             'formula' |
3004             (no arg)
3005
3006           Add specified value, image or mathematical expression  to  selected
3007       images, or compute the pointwise sum of selected images.
3008           (equivalent to shortcut command '+').
3009
3010           Example:
3011             [#1] image.jpg +add 30% cut 0,255
3012             [#2] image.jpg +blur 5 normalize 0,255 add[1] [0]
3013             [#3] image.jpg add '80*cos(80*(x/w-0.5)*(y/w-0.5)+c)' cut 0,255
3014             [#4]  image.jpg  repeat 9 +rotate[0] {$>*36},1,0,50%,50% done add
3015       div 10
3016
3017         & (+):
3018             Shortcut for command 'and'.
3019
3020         and (+):
3021             value[%] |
3022             [image] |
3023             'formula' |
3024             (no arg)
3025
3026           Compute the bitwise AND of selected images  with  specified  value,
3027       image  or  mathematical expression, or compute the pointwise sequential
3028       bitwise AND of selected images.
3029           (equivalent to shortcut command '&').
3030
3031           Example:
3032             [#1] image.jpg and {128+64}
3033             [#2] image.jpg +mirror x and
3034
3035         argmax:
3036
3037           Compute the argmax of selected images. Returns a single image
3038           with each pixel value being the index of the input image with maxi‐
3039       mal value.
3040
3041           Example:
3042             [#1] image.jpg sample lena,lion,square +argmax
3043
3044         argmaxabs:
3045
3046           Compute the argmaxabs of selected images. Returns a single image
3047           with  each pixel value being the index of the input image with max‐
3048       abs value.
3049
3050         argmin:
3051
3052           Compute the argmin of selected images. Returns a single image
3053           with each pixel value being the index of the input image with mini‐
3054       mal value.
3055
3056           Example:
3057             [#1] image.jpg sample lena,lion,square +argmin
3058
3059         argminabs:
3060
3061           Compute the argminabs of selected images. Returns a single image
3062           with  each  pixel  value  being  the  index of the input image with
3063       minabs value.
3064
3065         asin (+):
3066
3067           Compute the pointwise arcsine of selected images.
3068
3069           Example:
3070             [#1] image.jpg +normalize -1,1 asin[-1]
3071             [#2] 300,1,1,1,'cut(x/w+0.1*u,0,1)' +asin display_graph 400,300
3072
3073           Tutorial:      https://gmic.eu/oldtutorial/trigometric-and-inverse-
3074       trigometric-commands
3075
3076         asinh (+):
3077
3078           Compute the pointwise hyperbolic arcsine of selected images.
3079
3080         atan (+):
3081
3082           Compute the pointwise arctangent of selected images.
3083
3084           Example:
3085             [#1] image.jpg +normalize 0,8 atan[-1]
3086             [#2] 300,1,1,1,'4*x/w+u' +atan display_graph 400,300
3087
3088           Tutorial:      https://gmic.eu/oldtutorial/trigometric-and-inverse-
3089       trigometric-commands
3090
3091         atan2 (+):
3092             [x_argument]
3093
3094           Compute the pointwise oriented arctangent of selected images.
3095           Each selected image is regarded as the y-argument of the arctangent
3096       function, while the
3097           specified image gives the corresponding x-argument.
3098
3099           Example:
3100             [#1]  (-1,1) (-1;1) resize 400,400,1,1,3 atan2[1] [0] keep[1] mod
3101       {pi/8}
3102
3103           Tutorial:      https://gmic.eu/oldtutorial/trigometric-and-inverse-
3104       trigometric-commands
3105
3106         atanh (+):
3107
3108           Compute the pointwise hyperbolic arctangent of selected images.
3109
3110         << (+):
3111             Shortcut for command 'bsl'.
3112
3113         bsl (+):
3114             value[%] |
3115             [image] |
3116             'formula' |
3117             (no arg)
3118
3119           Compute  the  bitwise  left shift of selected images with specified
3120       value, image or mathematical expression, or compute the  pointwise  se‐
3121       quential bitwise left shift of selected images.
3122           (equivalent to shortcut command '<<').
3123
3124           Example:
3125             [#1] image.jpg bsl 'round(3*x/w,0)' cut 0,255
3126
3127         >> (+):
3128             Shortcut for command 'bsr'.
3129
3130         bsr (+):
3131             value[%] |
3132             [image] |
3133             'formula' |
3134             (no arg)
3135
3136           Compute  the  bitwise right shift of selected images with specified
3137       value, image or mathematical expression, or compute the  pointwise  se‐
3138       quential bitwise right shift of selected images.
3139           (equivalent to shortcut command '>>').
3140
3141           Example:
3142             [#1] image.jpg bsr 'round(3*x/w,0)' cut 0,255
3143
3144         cos (+):
3145
3146           Compute the pointwise cosine of selected images.
3147
3148           Example:
3149             [#1] image.jpg +normalize 0,{2*pi} cos[-1]
3150             [#2] 300,1,1,1,'20*x/w+u' +cos display_graph 400,300
3151
3152           Tutorial:      https://gmic.eu/oldtutorial/trigometric-and-inverse-
3153       trigometric-commands
3154
3155         cosh (+):
3156
3157           Compute the pointwise hyperbolic cosine of selected images.
3158
3159           Example:
3160             [#1] image.jpg +normalize -3,3 cosh[-1]
3161             [#2] 300,1,1,1,'4*x/w+u' +cosh display_graph 400,300
3162
3163         deg2rad:
3164
3165           Convert pointwise angle values of selected images, from degrees  to
3166       radians (apply 'i*pi/180').
3167
3168         / (+):
3169             Shortcut for command 'div'.
3170
3171         div (+):
3172             value[%] |
3173             [image] |
3174             'formula' |
3175             (no arg)
3176
3177           Divide  selected  images  by specified value, image or mathematical
3178       expression, or compute the pointwise quotient of selected images.
3179           (equivalent to shortcut command '/').
3180
3181           Example:
3182             [#1] image.jpg div '1+abs(cos(x/10)*sin(y/10))'
3183             [#2] image.jpg +norm add[-1] 1 +div
3184
3185         div_complex:
3186             [divider_real,divider_imag],_epsilon>=0
3187
3188           Perform division of the selected complex pairs (real1,imag1,...,re‐
3189       alN,imagN) of images by
3190           specified complex pair of images (divider_real,divider_imag).
3191           In  complex pairs, the real image must be always located before the
3192       imaginary image in the image list.
3193
3194           Default value: 'epsilon=1e-8'.
3195
3196         == (+):
3197             Shortcut for command 'eq'.
3198
3199         eq (+):
3200             value[%] |
3201             [image] |
3202             'formula' |
3203             (no arg)
3204
3205           Compute the boolean equality  of  selected  images  with  specified
3206       value,  image or mathematical expression, or compute the boolean equal‐
3207       ity of selected images.
3208           (equivalent to shortcut command '==').
3209
3210           Example:
3211             [#1] image.jpg round 40 eq {round(ia,40)}
3212             [#2] image.jpg +mirror x eq
3213
3214         erf (+):
3215
3216           Compute the pointwise error function of selected images.
3217
3218           Example:
3219             [#1] image.jpg +normalize 0,2 erf[-1]
3220             [#2] 300,1,1,1,'7*x/w-3.5+u' +erf display_graph 400,300
3221
3222         exp (+):
3223
3224           Compute the pointwise exponential of selected images.
3225
3226           Example:
3227             [#1] image.jpg +normalize 0,2 exp[-1]
3228             [#2] 300,1,1,1,'7*x/w+u' +exp display_graph 400,300
3229
3230         >= (+):
3231             Shortcut for command 'ge'.
3232
3233         ge (+):
3234             value[%] |
3235             [image] |
3236             'formula' |
3237             (no arg)
3238
3239           Compute the boolean 'greater or equal than' of selected images with
3240       specified value, image
3241           or  mathematical  expression,  or  compute  the boolean 'greater or
3242       equal than' of selected images.
3243           (equivalent to shortcut command '>=').
3244
3245           Example:
3246             [#1] image.jpg ge {ia}
3247             [#2] image.jpg +mirror x ge
3248
3249         > (+):
3250             Shortcut for command 'gt'.
3251
3252         gt (+):
3253             value[%] |
3254             [image] |
3255             'formula' |
3256             (no arg)
3257
3258           Compute the boolean 'greater than' of selected images  with  speci‐
3259       fied  value,  image  or mathematical expression, or compute the boolean
3260       'greater than' of selected images.
3261           (equivalent to shortcut command '>').
3262
3263           Example:
3264             [#1] image.jpg gt {ia}
3265             [#2] image.jpg +mirror x gt
3266
3267         <= (+):
3268             Shortcut for command 'le'.
3269
3270         le (+):
3271             value[%] |
3272             [image] |
3273             'formula' |
3274             (no arg)
3275
3276           Compute the boolean 'less or equal than' of  selected  images  with
3277       specified value, image or mathematical expression, or compute the bool‐
3278       ean 'less or equal than' of selected images.
3279           (equivalent to shortcut command '<=').
3280
3281           Example:
3282             [#1] image.jpg le {ia}
3283             [#2] image.jpg +mirror x le
3284
3285         < (+):
3286             Shortcut for command 'lt'.
3287
3288         lt (+):
3289             value[%] |
3290             [image] |
3291             'formula' |
3292             (no arg)
3293
3294           Compute the boolean 'less than' of selected images  with  specified
3295       value,  image  or mathematical expression, or compute the boolean 'less
3296       than' of selected images.
3297           (equivalent to shortcut command '<').
3298
3299           Example:
3300             [#1] image.jpg lt {ia}
3301             [#2] image.jpg +mirror x lt
3302
3303         log (+):
3304
3305           Compute the pointwise base-e logarithm of selected images.
3306
3307           Example:
3308             [#1] image.jpg +add 1 log[-1]
3309             [#2] 300,1,1,1,'7*x/w+u' +log display_graph 400,300
3310
3311         log10 (+):
3312
3313           Compute the pointwise base-10 logarithm of selected images.
3314
3315           Example:
3316             [#1] image.jpg +add 1 log10[-1]
3317             [#2] 300,1,1,1,'7*x/w+u' +log10 display_graph 400,300
3318
3319         log2 (+):
3320
3321           Compute the pointwise base-2 logarithm of selected images
3322
3323           Example:
3324             [#1] image.jpg +add 1 log2[-1]
3325             [#2] 300,1,1,1,'7*x/w+u' +log2 display_graph 400,300
3326
3327         max (+):
3328             value[%] |
3329             [image] |
3330             'formula' |
3331             (no arg)
3332
3333           Compute the maximum between selected images  and  specified  value,
3334       image  or  mathematical expression, or compute the pointwise maxima be‐
3335       tween selected images.
3336
3337           Example:
3338             [#1] image.jpg +mirror x max
3339             [#2] image.jpg max 'R=((x/w-0.5)^2+(y/h-0.5)^2)^0.5;255*R'
3340
3341         maxabs (+):
3342             value[%] |
3343             [image] |
3344             'formula' |
3345             (no arg)
3346
3347           Compute the maxabs between selected images and specified value, im‐
3348       age or mathematical expression, or compute the pointwise maxabs between
3349       selected images.
3350
3351         m/ (+):
3352             Shortcut for command 'mdiv'.
3353
3354         mdiv (+):
3355             value[%] |
3356             [image] |
3357             'formula' |
3358             (no arg)
3359
3360           Compute the matrix division of selected matrices/vectors by  speci‐
3361       fied value, image or mathematical expression, or compute the matrix di‐
3362       vision of selected images.
3363           (equivalent to shortcut command 'm/').
3364
3365         med:
3366
3367           Compute the median of selected images.
3368
3369           Example:
3370             [#1] image.jpg sample lena,lion,square +med
3371
3372         min (+):
3373             value[%] |
3374             [image] |
3375             'formula' |
3376             (no arg)
3377
3378           Compute the minimum between selected images  and  specified  value,
3379       image  or  mathematical expression, or compute the pointwise minima be‐
3380       tween selected images.
3381
3382           Example:
3383             [#1] image.jpg +mirror x min
3384             [#2] image.jpg min 'R=((x/w-0.5)^2+(y/h-0.5)^2)^0.5;255*R'
3385
3386         minabs (+):
3387             value[%] |
3388             [image] |
3389             'formula' |
3390             (no arg)
3391
3392           Compute the minabs between selected images and specified value, im‐
3393       age or mathematical expression, or compute the pointwise minabs between
3394       selected images.
3395
3396         % (+):
3397             Shortcut for command 'mod'.
3398
3399         mod (+):
3400             value[%] |
3401             [image] |
3402             'formula' |
3403             (no arg)
3404
3405           Compute the modulo of selected images with specified  value,  image
3406       or  mathematical expression, or compute the pointwise sequential modulo
3407       of selected images.
3408           (equivalent to shortcut command '%').
3409
3410           Example:
3411             [#1] image.jpg +mirror x mod
3412             [#2] image.jpg mod 'R=((x/w-0.5)^2+(y/h-0.5)^2)^0.5;255*R'
3413
3414         m* (+):
3415             Shortcut for command 'mmul'.
3416
3417         mmul (+):
3418             value[%] |
3419             [image] |
3420             'formula' |
3421             (no arg)
3422
3423           Compute the matrix right multiplication of  selected  matrices/vec‐
3424       tors  by  specified value, image or mathematical expression, or compute
3425       the matrix right multiplication of selected images.
3426           (equivalent to shortcut command 'm*').
3427
3428           Example:
3429             [#1] (0,1,0;0,0,1;1,0,0) (1;2;3) +mmul
3430
3431         * (+):
3432             Shortcut for command 'mul'.
3433
3434         mul (+):
3435             value[%] |
3436             [image] |
3437             'formula' |
3438             (no arg)
3439
3440           Multiply selected images by specified value, image or  mathematical
3441       expression, or compute the pointwise product of selected images.
3442           (equivalent to shortcut command '*').
3443
3444           See also: add, sub, div.
3445
3446           Example:
3447             [#1] image.jpg +mul 2 cut 0,255
3448             [#2] image.jpg (1,2,3,4,5,6,7,8) ri[-1] [0] mul[0] [-1]
3449             [#3] image.jpg mul '1-3*abs(x/w-0.5)' cut 0,255
3450             [#4] image.jpg +luminance negate[-1] +mul
3451
3452         mul_channels:
3453             value1,_value2,...,_valueN
3454
3455           Multiply  channels of selected images by specified sequence of val‐
3456       ues.
3457
3458           Example:
3459             [#1] image.jpg +mul_channels 1,0.5,0.8
3460
3461         mul_complex:
3462             [multiplier_real,multiplier_imag]
3463
3464           Perform   multiplication   of   the    selected    complex    pairs
3465       (real1,imag1,...,realN,imagN) of images by
3466           specified complex pair of images (multiplier_real,multiplier_imag).
3467           In  complex pairs, the real image must be always located before the
3468       imaginary image in the image list.
3469
3470         != (+):
3471             Shortcut for command 'neq'.
3472
3473         neq (+):
3474             value[%] |
3475             [image] |
3476             'formula' |
3477             (no arg)
3478
3479           Compute the boolean inequality of selected  images  with  specified
3480       value,  image  or  mathematical  expression, or compute the boolean in‐
3481       equality of selected images.
3482           (equivalent to shortcut command '!=').
3483
3484           Example:
3485             [#1] image.jpg round 40 neq {round(ia,40)}
3486
3487         | (+):
3488             Shortcut for command 'or'.
3489
3490         or (+):
3491             value[%] |
3492             [image] |
3493             'formula' |
3494             (no arg)
3495
3496           Compute the bitwise OR of selected images with specified value, im‐
3497       age  or  mathematical  expression,  or compute the pointwise sequential
3498       bitwise OR of selected images.
3499           (equivalent to shortcut command '|').
3500
3501           Example:
3502             [#1] image.jpg or 128
3503             [#2] image.jpg +mirror x or
3504
3505         ^ (+):
3506             Shortcut for command 'pow'.
3507
3508         pow (+):
3509             value[%] |
3510             [image] |
3511             'formula' |
3512             (no arg)
3513
3514           Raise selected images to the power of  specified  value,  image  or
3515       mathematical  expression, or compute the pointwise sequential powers of
3516       selected images.
3517           (equivalent to shortcut command '^').
3518
3519           Example:
3520             [#1] image.jpg div 255 +pow 0.5 mul 255
3521             [#2] image.jpg gradient pow 2 add pow 0.2
3522
3523         rad2deg:
3524
3525           Convert pointwise angle values of selected images, from radians  to
3526       degrees (apply 'i*180/pi').
3527
3528         rol (+):
3529             value[%] |
3530             [image] |
3531             'formula' |
3532             (no arg)
3533
3534           Compute the bitwise left rotation of selected images with specified
3535       value, image or mathematical expression, or compute the  pointwise  se‐
3536       quential bitwise left rotation of selected images.
3537
3538           Example:
3539             [#1] image.jpg rol 'round(3*x/w,0)' cut 0,255
3540
3541         ror (+):
3542             value[%] |
3543             [image] |
3544             'formula' |
3545             (no arg)
3546
3547           Compute  the  bitwise right rotation of selected images with speci‐
3548       fied value, image or mathematical expression, or compute the  pointwise
3549       sequential bitwise right rotation of selected images.
3550
3551           Example:
3552             [#1] image.jpg ror 'round(3*x/w,0)' cut 0,255
3553
3554         sign (+):
3555
3556           Compute the pointwise sign of selected images.
3557
3558           Example:
3559             [#1] image.jpg +sub {ia} sign[-1]
3560             [#2] 300,1,1,1,'cos(20*x/w+u)' +sign display_graph 400,300
3561
3562         sin (+):
3563
3564           Compute the pointwise sine of selected images.
3565
3566           Example:
3567             [#1] image.jpg +normalize 0,{2*pi} sin[-1]
3568             [#2] 300,1,1,1,'20*x/w+u' +sin display_graph 400,300
3569
3570           Tutorial:      https://gmic.eu/oldtutorial/trigometric-and-inverse-
3571       trigometric-commands
3572
3573         sinc (+):
3574
3575           Compute the pointwise sinc function of selected images.
3576
3577           Example:
3578             [#1] image.jpg +normalize {-2*pi},{2*pi} sinc[-1]
3579             [#2] 300,1,1,1,'20*x/w+u' +sinc display_graph 400,300
3580
3581         sinh (+):
3582
3583           Compute the pointwise hyperbolic sine of selected images.
3584
3585           Example:
3586             [#1] image.jpg +normalize -3,3 sinh[-1]
3587             [#2] 300,1,1,1,'4*x/w+u' +sinh display_graph 400,300
3588
3589         sqr (+):
3590
3591           Compute the pointwise square function of selected images.
3592
3593           Example:
3594             [#1] image.jpg +sqr
3595             [#2] 300,1,1,1,'40*x/w+u' +sqr display_graph 400,300
3596
3597         sqrt (+):
3598
3599           Compute the pointwise square root of selected images.
3600
3601           Example:
3602             [#1] image.jpg +sqrt
3603             [#2] 300,1,1,1,'40*x/w+u' +sqrt display_graph 400,300
3604
3605         - (+):
3606             Shortcut for command 'sub'.
3607
3608         sub (+):
3609             value[%] |
3610             [image] |
3611             'formula' |
3612             (no arg)
3613
3614           Subtract specified value, image or mathematical expression  to  se‐
3615       lected images, or compute the pointwise difference of selected images.
3616           (equivalent to shortcut command '-').
3617
3618           Example:
3619             [#1] image.jpg +sub 30% cut 0,255
3620             [#2] image.jpg +mirror x sub[-1] [0]
3621             [#3] image.jpg sub 'i(w/2+0.9*(x-w/2),y)'
3622             [#4] image.jpg +mirror x sub
3623
3624         tan (+):
3625
3626           Compute the pointwise tangent of selected images.
3627
3628           Example:
3629             [#1] image.jpg +normalize {-0.47*pi},{0.47*pi} tan[-1]
3630             [#2] 300,1,1,1,'20*x/w+u' +tan display_graph 400,300
3631
3632           Tutorial:      https://gmic.eu/oldtutorial/trigometric-and-inverse-
3633       trigometric-commands
3634
3635         tanh (+):
3636
3637           Compute the pointwise hyperbolic tangent of selected images.
3638
3639           Example:
3640             [#1] image.jpg +normalize -3,3 tanh[-1]
3641             [#2] 300,1,1,1,'4*x/w+u' +tanh display_graph 400,300
3642
3643         xor (+):
3644             value[%] |
3645             [image] |
3646             'formula' |
3647             (no arg)
3648
3649           Compute the bitwise XOR of selected images  with  specified  value,
3650       image  or  mathematical expression, or compute the pointwise sequential
3651       bitwise XOR of selected images.
3652
3653           Example:
3654             [#1] image.jpg xor 128
3655             [#2] image.jpg +mirror x xor
3656
3657         12.5. Values Manipulation
3658               -------------------
3659
3660         apply_curve:
3661             0<=smoothness<=1,x0,y0,x1,y1,x2,y2,...,xN,yN
3662
3663           Apply curve transformation to image values.
3664
3665           Default values: 'smoothness=1', 'x0=0', 'y0=100'.
3666
3667           Example:
3668             [#1] image.jpg +apply_curve 1,0,0,128,255,255,0
3669
3670         apply_gamma:
3671             gamma>=0
3672
3673           Apply gamma correction to selected images.
3674
3675           Example:
3676             [#1] image.jpg +apply_gamma 2
3677
3678         balance_gamma:
3679             _ref_color1,...
3680
3681           Compute gamma-corrected color balance of selected image,  with  re‐
3682       spect to specified reference color.
3683
3684           Default value: 'ref_color1=128'.
3685
3686           Example:
3687             [#1] image.jpg +balance_gamma 128,64,64
3688
3689         cast:
3690             datatype_source,datatype_target
3691
3692           Cast  datatype of image buffer from specified source type to speci‐
3693       fied target type.
3694           'datatype_source' and 'datatype_target' can be {  uchar  |  char  |
3695       ushort | short | uint | int | uint64 | int64 | float | double }.
3696
3697         complex2polar:
3698
3699           Compute complex to polar transforms of selected images.
3700
3701           Example:
3702             [#1]   image.jpg   +fft  complex2polar[-2,-1]  log[-2]  shift[-2]
3703       50%,50%,0,0,2 remove[-1]
3704
3705         compress_clut:
3706             _max_error>0,_avg_error>0,_max_nbpoints>=8 |  0  (unlimited),_er‐
3707       ror_metric={  0=L2-norm  | 1=deltaE_1976 | 2=deltaE_2000 },_reconstruc‐
3708       tion_colorspace={ 0=srgb | 1=rgb | 2=lab },_try_rbf_first={ 0 | 1
3709               }
3710
3711           Compress selected color LUTs as sequences of colored keypoints.
3712
3713           Default      values:       'max_error=1.5',       'avg_error=0.75',
3714       'max_nb_points=2048',  'error_metric=2',  'reconstruction_colorspace=0'
3715       and 'try_rbf_first=1'.
3716
3717         compress_rle:
3718             _is_binary_data={ 0 | 1 },_maximum_sequence_length>=0
3719
3720           Compress selected images as 2xN data matrices, using RLE algorithm.
3721           Set 'maximum_sequence_length=0'  to  disable  maximum  length  con‐
3722       straint.
3723
3724           Default values: 'is_binary_data=0' and 'maximum_sequence_length=0'.
3725
3726           Example:
3727             [#1]  image.jpg  resize2dy  100  quantize 4 round +compress_rle ,
3728       +decompress_rle[-1]
3729
3730         cumulate (+):
3731             { x | y | z | c }...{ x | y | z | c } |
3732             (no arg)
3733
3734           Compute the cumulative function of specified image data, optionally
3735       along the specified axes.
3736
3737           Example:
3738             [#1]  image.jpg +histogram 256 +cumulate[-1] display_graph[-2,-1]
3739       400,300,3
3740
3741         c (+):
3742             Shortcut for command 'cut'.
3743
3744         cut (+):
3745             { value0[%] | [image0] },{ value1[%] | [image1] } |
3746             [image]
3747
3748           Cut values of selected images in specified range.
3749           (equivalent to shortcut command 'c').
3750
3751           Example:
3752             [#1] image.jpg +add 30% cut[-1] 0,255
3753             [#2] image.jpg +cut 25%,75%
3754
3755         decompress_clut:
3756             _width>0,_height>0,_depth>0,_reconstruction_colorspace={ 0=srgb |
3757       1=rgb | 2=lab }
3758
3759           Decompress  selected colored keypoints into 3D CLUTs, using a mixed
3760       RBF/PDE approach.
3761
3762           Default values:  'width=height=depth=33'  and  'reconstruction_col‐
3763       orspace=0'.
3764
3765         decompress_clut_rbf:
3766             _width>0,_height>0,_depth>0,_reconstruction_colorspace={ 0=srgb |
3767       1=rgb | 2=lab }
3768
3769           Decompress selected colored keypoints into 3D CLUTs, using RBF thin
3770       plate spline interpolation.
3771
3772           Default  value:  'width=height=depth=33'  and  'reconstruction_col‐
3773       orspace=0'.
3774
3775         decompress_clut_pde:
3776             _width>0,_height>0,_depth>0,_reconstruction_colorspace={ 0=srgb |
3777       1=rgb | 2=lab }
3778
3779           Decompress  selected  colored keypoints into 3D CLUTs, using multi‐
3780       scale diffusion PDE's.
3781
3782           Default values:  'width=height=depth=33'  and  'reconstruction_col‐
3783       orspace=0'.
3784
3785         decompress_rle:
3786
3787           Decompress selected data vectors, using RLE algorithm.
3788
3789         discard (+):
3790             _value1,_value2,... |
3791             { x | y | z | c}...{ x | y | z | c},_value1,_value2,... |
3792             (no arg)
3793
3794           Discard  specified values in selected images or discard neighboring
3795       duplicate values,
3796           optionally only for the values along the first of a specified axis.
3797           If no arguments are specified,  neighboring  duplicate  values  are
3798       discarded.
3799           If  all pixels of a selected image are discarded, an empty image is
3800       returned.
3801
3802           Example:
3803             [#1] (1;2;3;4;3;2;1) +discard 2
3804             [#2] (1,2,2,3,3,3,4,4,4,4) +discard x
3805
3806         eigen2tensor:
3807
3808           Recompose selected pairs of eigenvalues/eigenvectors as 2x2 or  3x3
3809       tensor fields.
3810
3811           Tutorial: https://gmic.eu/tutorial/eigen2tensor
3812
3813         endian (+):
3814             _datatype
3815
3816           Reverse  data endianness of selected images, eventually considering
3817       the pixel being of the specified datatype.
3818           'datatype' can be { bool | uchar | char | ushort | short |  uint  |
3819       int | uint64 | int64 | float | double }.
3820           This command does nothing for 'bool', 'uchar' and 'char' datatypes.
3821
3822         equalize (+):
3823             _nb_levels>0[%],_value_min[%],_value_max[%]
3824
3825           Equalize histograms of selected images.
3826           If value range is specified, the equalization is done only for pix‐
3827       els in the specified
3828           value range.
3829
3830           Default     values:     'nb_levels=256',     'value_min=0%'     and
3831       'value_max=100%'.
3832
3833           Example:
3834             [#1] image.jpg +equalize
3835             [#2] image.jpg +equalize 4,0,128
3836
3837         f (+):
3838             Shortcut for command 'fill'.
3839
3840         fill (+):
3841             value1,_value2,... |
3842             [image] |
3843             'formula'
3844
3845           Fill  selected  images  with  values  read from the specified value
3846       list, existing image
3847           or mathematical expression. Single quotes may be omitted  in  'for‐
3848       mula'.
3849           (equivalent to shortcut command 'f').
3850
3851           Example:
3852             [#1] 4,4 fill 1,2,3,4,5,6,7
3853             [#2] 4,4 (1,2,3,4,5,6,7) fill[-2] [-1]
3854             [#3]   400,400,1,3   fill   "X=x-w/2;  Y=y-h/2;  R=sqrt(X^2+Y^2);
3855       a=atan2(Y,X);
3856       if(R<=180,255*abs(cos(c+200*(x/w-0.5)*(y/h-0.5))),850*(a%(0.1*(c+1))))"
3857
3858           Tutorial: https://gmic.eu/tutorial/fill
3859
3860         index (+):
3861             {  [palette] | palette_name },0<=_dithering<=1,_map_palette={ 0 |
3862       1 }
3863
3864           Index selected vector-valued images by specified vector-valued pal‐
3865       ette.
3866           'palette_name'  can be { default | hsv | lines | hot | cool | jet |
3867       flag | cube | rainbow | algae | amp |balance | curl | deep  |  delta  |
3868       dense | diff | haline | ice | matter | oxy | phase
3869           |  rain  |  solar | speed | tarn |tempo | thermal | topo | turbid |
3870       aurora | hocuspocus | srb2 | uzebox }
3871
3872           Default values: 'dithering=0' and 'map_palette=0'.
3873
3874           Example:
3875             [#1] image.jpg +index 1,1,1
3876             [#2] image.jpg (0;255;255^0;128;255^0;0;255) +index[-2] [-1],1,1
3877
3878           Tutorial: https://gmic.eu/tutorial/gindex
3879
3880         ir:
3881             Shortcut for command 'inrange'.
3882
3883         inrange:
3884             min[%],max[%],_include_min_boundary={   0=no   |   1=yes   },_in‐
3885       clude_max_boundary={ 0=no | 1=yes }
3886
3887           Detect  pixels  whose values are in specified range '[min,max]', in
3888       selected images.
3889           (equivalent to shortcut command 'ir').
3890
3891           Default value: 'include_min_boundary=include_max_boundary=1'.
3892
3893           Example:
3894             [#1] image.jpg +inrange 25%,75%
3895
3896         map (+):
3897             [palette],_boundary_conditions |
3898             palette_name,_boundary_conditions
3899
3900           Map specified vector-valued palette to selected indexed scalar  im‐
3901       ages.
3902           'palette_name'  can be { default | hsv | lines | hot | cool | jet |
3903       flag | cube | rainbow | algae | amp | balance | curl | deep |  delta  |
3904       dense | diff | gray | haline | ice | matter | oxy
3905           |  phase  |  rain | solar | speed | tarn | tempo | thermal | topo |
3906       turbid | aurora | hocuspocus | srb2 | uzebox }
3907           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
3908       | 3=mirror }.
3909
3910           Default value: 'boundary_conditions=0'.
3911
3912           Example:
3913             [#1] image.jpg +luminance map[-1] 3
3914             [#2]   image.jpg  +rgb2ycbcr  split[-1]  c  (0,255,0)  resize[-1]
3915       256,1,1,1,3 map[-4] [-1] remove[-1] append[-3--1] c ycbcr2rgb[-1]
3916
3917           Tutorial: https://gmic.eu/tutorial/map
3918
3919         mix_channels:
3920             (a00,...,aMN) |
3921             [matrix]
3922
3923           Apply specified matrix to channels of selected images.
3924
3925           Example:
3926             [#1] image.jpg +mix_channels (0,1,0;1,0,0;0,0,1)
3927
3928         negate:
3929             base_value |
3930             (no arg)
3931
3932           Negate image values.
3933
3934           Default value: 'base_value=(undefined)'.
3935
3936           Example:
3937             [#1] image.jpg +negate
3938
3939         noise (+):
3940             std_deviation>=0[%],_noise_type
3941
3942           Add random noise to selected images.
3943           'noise_type' can be { 0=gaussian  |  1=uniform  |  2=salt&pepper  |
3944       3=poisson | 4=rice }.
3945
3946           Default value: 'noise_type=0'.
3947
3948           Example:
3949             [#1]  image.jpg  +noise[0] 50,0 +noise[0] 50,1 +noise[0] 10,2 cut
3950       0,255
3951             [#2] 300,300,1,3 [0] noise[0] 20,0 noise[1] 20,1  +histogram  100
3952       display_graph[-2,-1] 400,300,3
3953
3954         noise_perlin:
3955             _scale_x[%]>0,_scale_y[%]>0,_scale_z[%]>0,_seed_x,_seed_y,_seed_z
3956
3957           Render 2D or 3D Perlin noise on selected images, from specified co‐
3958       ordinates.
3959           The Perlin noise is a specific type of smooth noise,
3960           described here : https://en.wikipedia.org/wiki/Perlin_noise.
3961
3962           Default       values:       'scale_x=scale_y=scale_z=16'        and
3963       'seed_x=seed_y=seed_z=0'.
3964
3965           Example:
3966             [#1] 500,500,1,3 noise_perlin ,
3967
3968         noise_poissondisk:
3969             _radius[%]>0,_max_sample_attempts>0
3970
3971           Add poisson disk sampling noise to selected images.
3972           Implements  the  algorithm from the article "Fast Poisson Disk Sam‐
3973       pling in Arbitrary Dimensions",
3974           by Robert Bridson (SIGGRAPH'2007).
3975
3976           Default values: 'radius=8' and 'max_sample_attempts=30'.
3977
3978           Example:
3979             [#1] 300,300 noise_poissondisk 8
3980
3981         normp:
3982             p>=0
3983
3984           Compute the pointwise Lp-norm norm of vector-valued pixels  in  se‐
3985       lected images.
3986
3987           Default value: 'p=2'.
3988
3989           Example:
3990             [#1] image.jpg +normp[0] 0 +normp[0] 1 +normp[0] 2 +normp[0] inf
3991
3992         norm:
3993
3994           Compute the pointwise euclidean norm of vector-valued pixels in se‐
3995       lected images.
3996
3997           Example:
3998             [#1] image.jpg +norm
3999
4000           Tutorial: https://gmic.eu/tutorial/norm
4001
4002         n (+):
4003             Shortcut for command 'normalize'.
4004
4005         normalize (+):
4006             {  value0[%]  |  [image0]  },{  value1[%]  |   [image1]   },_con‐
4007       stant_case_ratio |
4008             [image]
4009
4010           Linearly normalize values of selected images in specified range.
4011           (equivalent to shortcut command 'n').
4012
4013           Example:
4014             [#1] image.jpg split x,2 normalize[-1] 64,196 append x
4015
4016           Tutorial: https://gmic.eu/tutorial/normalize
4017
4018         normalize_l2:
4019
4020           Normalize selected images such that they have a unit L2 norm.
4021
4022         normalize_sum:
4023
4024           Normalize selected images such that they have a unit sum.
4025
4026           Example:
4027             [#1] image.jpg +histogram 256 normalize_sum[-1] display_graph[-1]
4028       400,300
4029
4030         not:
4031
4032           Apply boolean not operation on selected images.
4033
4034           Example:
4035             [#1] image.jpg +ge 50% +not[-1]
4036
4037         orientation:
4038
4039           Compute the pointwise orientation of vector-valued  pixels  in  se‐
4040       lected images.
4041
4042           Example:
4043             [#1] image.jpg +orientation +norm[-2] negate[-1] mul[-2] [-1] re‐
4044       verse[-2,-1]
4045
4046           Tutorial: https://gmic.eu/tutorial/orientation
4047
4048         oneminus:
4049
4050           For each selected image, compute one minus image.
4051
4052           Example:
4053             [#1] image.jpg normalize 0,1 +oneminus
4054
4055         otsu:
4056             _nb_levels>0
4057
4058           Hard-threshold selected images using Otsu's method.
4059           The computed thresholds are returned as a list  of  values  in  the
4060       status.
4061
4062           Default value: 'nb_levels=256'.
4063
4064           Example:
4065             [#1] image.jpg luminance +otsu ,
4066
4067         polar2complex:
4068
4069           Compute polar to complex transforms of selected images.
4070
4071         quantize:
4072             nb_levels>=1,_keep_values={  0  | 1 },_quantization_type={ -1=me‐
4073       dian-cut | 0=k-means | 1=uniform }
4074
4075           Quantize selected images.
4076
4077           Default value: 'keep_values=1' and 'quantization_type=0'.
4078
4079           Example:
4080             [#1] image.jpg luminance +quantize 3
4081             [#2]  200,200,1,1,'cos(x/10)*sin(y/10)'  +quantize[0]  6   +quan‐
4082       tize[0] 4 +quantize[0] 3 +quantize[0] 2
4083
4084         quantize_area:
4085             _min_area>0
4086
4087           Quantize  selected  images  such  that each flat region has an area
4088       greater or equal to 'min_area'.
4089
4090           Default value: 'min_area=10'.
4091
4092           Example:
4093             [#1] image.jpg quantize 3 +blur 1 round[-1] +quantize_area[-1] 2
4094
4095         rand (+):
4096             { value0[%] | [image0] },_{ value1[%] | [image1] } |
4097             [image]
4098
4099           Fill selected images with random values  uniformly  distributed  in
4100       the specified range.
4101
4102           Example:
4103             [#1] 400,400,1,3 rand -10,10 +blur 10 sign[-1]
4104
4105         replace:
4106             source,target
4107
4108           Replace pixel values in selected images.
4109
4110           Example:
4111             [#1] (1;2;3;4) +replace 2,3
4112
4113         replace_inf:
4114             _expression
4115
4116           Replace all infinite values in selected images by specified expres‐
4117       sion.
4118
4119           Example:
4120             [#1] (0;1;2) log +replace_inf 2
4121
4122         replace_nan:
4123             _expression
4124
4125           Replace all NaN values in selected images by specified expression.
4126
4127           Example:
4128             [#1] (-1;0;2) sqrt +replace_nan 2
4129
4130         replace_naninf:
4131             _expression
4132
4133           Replace all NaN and infinite values in selected images by specified
4134       expression.
4135
4136         replace_seq:
4137             "search_seq","replace_seq"
4138
4139           Search and replace a sequence of values in selected images.
4140
4141           Example:
4142             [#1] (1;2;3;4;5) +replace_seq "2,3,4","7,8"
4143
4144         replace_str:
4145             "search_str","replace_str"
4146
4147           Search  and replace a string in selected images (viewed as strings,
4148       i.e. sequences of character codes).
4149
4150           Example:
4151             [#1]  ('"Hello  there,  how  are  you  ?"')  +replace_str  "Hello
4152       there","Hi David"
4153
4154         round (+):
4155             rounding_value>=0,_rounding_type |
4156             (no arg)
4157
4158           Round values of selected images.
4159           'rounding_type' can be { -1=backward | 0=nearest | 1=forward }.
4160
4161           Default value: 'rounding_type=0'.
4162
4163           Example:
4164             [#1] image.jpg +round 100
4165             [#2] image.jpg mul {pi/180} sin +round
4166
4167         roundify:
4168             gamma>=0
4169
4170           Apply  roundify transformation on float-valued data, with specified
4171       gamma.
4172
4173           Default value: 'gamma=0'.
4174
4175           Example:
4176             [#1] 1000 fill '4*x/w' repeat 5 +roundify[0] {$>*0.2} done append
4177       c display_graph 400,300
4178
4179         = (+):
4180             Shortcut for command 'set'.
4181
4182         set (+):
4183             value,_x[%],_y[%],_z[%],_c[%]
4184
4185           Set pixel value in selected images, at specified coordinates.
4186           (equivalent to shortcut command '=').
4187
4188           If specified coordinates are outside the image bounds, no action is
4189       performed.
4190
4191           Default values: 'x=y=z=c=0'.
4192
4193           Example:
4194             [#1] 2,2 set 1,0,0 set 2,1,0 set 3,0,1 set 4,1,1
4195             [#2]         image.jpg         repeat          10000          set
4196       255,{u(100)}%,{u(100)}%,0,{u(100)}% done
4197
4198         threshold:
4199             value[%],_is_soft={ 0 | 1 } :
4200
4201           Threshold values of selected images.
4202           'soft' can be { 0=hard-thresholding | 1=soft-thresholding }.
4203
4204           Default value: 'is_soft=0'.
4205
4206           Example:
4207             [#1] image.jpg +threshold[0] 50% +threshold[0] 50%,1
4208
4209           Tutorial: https://gmic.eu/tutorial/threshold
4210
4211         vector2tensor:
4212
4213           Convert selected vector fields to corresponding tensor fields.
4214
4215         12.6. Colors
4216               ------
4217
4218         adjust_colors:
4219             -100<=_brightness<=100,-100<=_con‐
4220       trast<=100,-100<=_gamma<=100,-100<=_hue_shift<=100,-100<=_satura‐
4221       tion<=100,_value_min,_value_max
4222
4223           Perform a global adjustment of colors on selected images.
4224           Range   of   correct   image   values   are  considered  to  be  in
4225       [value_min,value_max] (e.g. [0,255]).
4226           If 'value_min==value_max==0', value range is estimated from min/max
4227       values of selected images.
4228           Processed    images    have    pixel    values    constrained    in
4229       [value_min,value_max].
4230
4231           Default   values:    'brightness=0',    'contrast=0',    'gamma=0',
4232       'hue_shift=0', 'saturation=0', 'value_min=value_max=0'.
4233
4234           Example:
4235             [#1] image.jpg +adjust_colors 0,30,0,0,30
4236
4237         ac:
4238             Shortcut for command 'apply_channels'.
4239
4240         apply_channels:
4241             "command",color_channels,_value_action={  0=none | 1=cut | 2=nor‐
4242       malize }
4243
4244           Apply specified command on the chosen color channel(s) of each  se‐
4245       lected images.
4246           (equivalent to shortcut command 'ac').
4247
4248           Argument  'color_channels' refers to a colorspace, and can be basi‐
4249       cally one of
4250           { all | rgba | [s]rgb | ryb | lrgb | ycbcr | lab | lch | hsv |  hsi
4251       | hsl | cmy | cmyk | yiq }.
4252           You can also make the processing focus on a few particular channels
4253       of this colorspace,
4254           by setting 'color_channels' as 'colorspace_channel'  (e.g.  'hsv_h'
4255       for the hue).
4256           All  channel  values  are  considered to be provided in the [0,255]
4257       range.
4258
4259           Default value: 'value_action=0'.
4260
4261           Example:
4262             [#1] image.jpg +apply_channels "equalize blur 2",ycbcr_cbcr
4263
4264         autoindex:
4265             nb_colors>0,0<=_dithering<=1,_method={ 0=median-cut | 1=k-means }
4266
4267           Index selected vector-valued images by adapted colormaps.
4268
4269           Default values: 'dithering=0' and 'method=1'.
4270
4271           Example:
4272             [#1] image.jpg +autoindex[0] 4 +autoindex[0] 8 +autoindex[0] 16
4273
4274         bayer2rgb:
4275             _GM_smoothness,_RB_smoothness1,_RB_smoothness2
4276
4277           Transform selected RGB-Bayer sampled images to color images.
4278
4279           Default  values:  'GM_smoothness=RB_smoothness=1'  and  'RB_smooth‐
4280       ness2=0.5'.
4281
4282           Example:
4283             [#1] image.jpg rgb2bayer 0 +bayer2rgb 1,1,0.5
4284
4285         deltaE:
4286             [image],_metric={  0=deltaE_1976  | 1=deltaE_2000 },"_to_Lab_com‐
4287       mand"
4288
4289           Compute the CIE DeltaE color difference between selected images and
4290       specified [image].
4291           Argument  'to_Lab_command'  is  a command able to convert colors of
4292       [image] into a Lab representation.
4293
4294           Default values: 'metric=1' and 'to_Lab_command="srgb2lab"'.
4295
4296           Example:
4297             [#1] image.jpg +blur 2 +deltaE[0] [1],1,srgb2lab
4298
4299         cmy2rgb:
4300
4301           Convert color representation of selected images from CMY to RGB.
4302
4303         cmyk2rgb:
4304
4305           Convert color representation of selected images from CMYK to RGB.
4306
4307         colorblind:
4308             type={ 0=protanopia | 1=protanomaly | 2=deuteranopia | 3=deutera‐
4309       nomaly  |  4=tritanopia  |  5=tritanomaly  | 6=achromatopsia | 7=achro‐
4310       matomaly }
4311
4312           Simulate color blindness vision.
4313
4314           Example:
4315             [#1] image.jpg +colorblind 0
4316
4317         colormap:
4318             nb_levels>=0,_method={ 0=median-cut | 1=k-means },_sort_vectors
4319
4320           Estimate best-fitting colormap with 'nb_colors' entries,  to  index
4321       selected images.
4322           Set 'nb_levels==0' to extract all existing colors of an image.
4323           'sort_vectors'  can  be  { 0=unsorted | 1=by increasing norm | 2=by
4324       decreasing occurrence }.
4325
4326           Default value: 'method=1' and 'sort_vectors=1'.
4327
4328           Example:
4329             [#1] image.jpg +colormap[0] 4 +colormap[0] 8 +colormap[0] 16
4330
4331           Tutorial: https://gmic.eu/oldtutorial/_colormap
4332
4333         compose_channels:
4334
4335           Compose all channels of each selected image, using specified arith‐
4336       metic operator (+,-,or,min,...).
4337
4338           Default value: '1=+'.
4339
4340           Example:
4341             [#1] image.jpg +compose_channels and
4342
4343           Tutorial: https://gmic.eu/tutorial/compose_channels
4344
4345         direction2rgb:
4346
4347           Compute RGB representation of selected 2D direction fields.
4348
4349           Example:
4350             [#1]  image.jpg  luminance  gradient  append c blur 2 orientation
4351       +direction2rgb
4352
4353         ditheredbw:
4354
4355           Create dithered B&W version of selected images.
4356
4357           Example:
4358             [#1] image.jpg +equalize ditheredbw[-1]
4359
4360         fc:
4361             Shortcut for command 'fill_color'.
4362
4363         fill_color:
4364             col1,...,colN
4365
4366           Fill selected images with specified color.
4367           (equivalent to shortcut command 'fc').
4368
4369           Example:
4370             [#1] image.jpg +fill_color 255,0,255
4371
4372           Tutorial: https://gmic.eu/oldtutorial/_fill_color
4373
4374         gradient2rgb:
4375             _is_orientation={ 0 | 1 }
4376
4377           Compute RGB representation of 2D gradient of selected images.
4378
4379           Default value: 'is_orientation=0'.
4380
4381           Example:
4382             [#1] image.jpg +gradient2rgb 0 equalize[-1]
4383
4384         hcy2rgb:
4385
4386           Convert color representation of selected images from HCY to RGB.
4387
4388         hsi2rgb:
4389
4390           Convert color representation of selected images from HSI to RGB.
4391
4392         hsi82rgb:
4393
4394           Convert color representation of selected images from HSI8 to RGB.
4395
4396         hsl2rgb:
4397
4398           Convert color representation of selected images from HSL to RGB.
4399
4400         hsl82rgb:
4401
4402           Convert color representation of selected images from HSL8 to RGB.
4403
4404         hsv2rgb:
4405
4406           Convert color representation of selected images from HSV to RGB.
4407
4408           Example:
4409             [#1] (0,360;0,360^0,0;1,1^1,1;1,1) resize 400,400,1,3,3 hsv2rgb
4410
4411         hsv82rgb:
4412
4413           Convert color representation of selected images from HSV8 to RGB.
4414
4415         int2rgb:
4416
4417           Convert color representation of selected images from INT24 to RGB.
4418
4419         jzazbz2rgb:
4420             illuminant={ 0=D50 | 1=D65 | 2=E } |
4421             (no arg)
4422
4423           Convert color representation of selected images from RGB to Jzazbz.
4424
4425           Default value: 'illuminant=2'.
4426
4427         jzazbz2xyz:
4428
4429           Convert color representation of selected images from RGB to XYZ.
4430
4431         lab2lch:
4432
4433           Convert color representation of selected images from Lab to Lch.
4434
4435         lab2rgb:
4436             illuminant={ 0=D50 | 1=D65 | 2=E } |
4437             (no arg)
4438
4439           Convert color representation of selected images from Lab to RGB.
4440
4441           Default value: 'illuminant=2'.
4442
4443           Example:
4444             [#1]   (50,50;50,50^-3,3;-3,3^-3,-3;3,3)   resize   400,400,1,3,3
4445       lab2rgb
4446
4447         lab2srgb:
4448             illuminant={ 0=D50 | 1=D65 | 2=E } |
4449             (no arg)
4450
4451           Convert color representation of selected images from Lab to sRGB.
4452
4453           Default value: 'illuminant=2'.
4454
4455           Example:
4456             [#1]   (50,50;50,50^-3,3;-3,3^-3,-3;3,3)   resize   400,400,1,3,3
4457       lab2rgb
4458
4459         lab82srgb:
4460             illuminant={ 0=D50 | 1=D65 | 2=E } |
4461             (no arg)
4462
4463           Convert color representation of selected images from Lab8 to sRGB.
4464
4465           Default value: 'illuminant=2'.
4466
4467           Example:
4468             [#1]   (50,50;50,50^-3,3;-3,3^-3,-3;3,3)   resize   400,400,1,3,3
4469       lab2rgb
4470
4471         lab2xyz:
4472             illuminant={ 0=D50 | 1=D65 | 2=E } |
4473             (no arg)
4474
4475           Convert color representation of selected images from Lab to XYZ.
4476
4477           Default value: 'illuminant=2'.
4478
4479         lab82rgb:
4480             illuminant={ 0=D50 | 1=D65 | 2=E } |
4481             (no arg)
4482
4483           Convert color representation of selected images from Lab8 to RGB.
4484
4485           Default value: 'illuminant=2'.
4486
4487         lch2lab:
4488
4489           Convert color representation of selected images from Lch to Lab.
4490
4491         lch2rgb:
4492             illuminant={ 0=D50 | 1=D65 | 2=E } |
4493             (no arg)
4494
4495           Convert color representation of selected images from Lch to RGB.
4496
4497           Default value: 'illuminant=2'.
4498
4499         lch82rgb:
4500             illuminant={ 0=D50 | 1=D65 | 2=E } |
4501             (no arg)
4502
4503           Convert color representation of selected images from Lch8 to RGB.
4504
4505           Default value: 'illuminant=2'.
4506
4507         luminance:
4508
4509           Compute luminance of selected sRGB images.
4510
4511           Example:
4512             [#1] image.jpg +luminance
4513
4514           Tutorial: https://gmic.eu/tutorial/luminance
4515
4516         lightness:
4517
4518           Compute lightness of selected sRGB images.
4519
4520           Example:
4521             [#1] image.jpg +lightness
4522
4523         lut_contrast:
4524             _nb_colors>1,_min_rgb_value
4525
4526           Generate  a  RGB  colormap  where consecutive colors have high con‐
4527       trast.
4528           This function performs a specific score  maximization  to  generate
4529       the result, so
4530           it may take some time when 'nb_colors' is high.
4531
4532           Default values: 'nb_colors=256' and 'min_rgb_value=64'.
4533
4534         map_clut:
4535             [clut] | "clut_name"
4536
4537           Map specified RGB color LUT to selected images.
4538
4539           Example:
4540             [#1]   image.jpg   uniform_distribution   {2^6},3   mirror[-1]  x
4541       +map_clut[0] [1]
4542
4543         mix_rgb:
4544             a11,a12,a13,a21,a22,a23,a31,a32,a33
4545
4546           Apply 3x3 specified matrix to RGB colors of selected images.
4547
4548           Default values: 'a11=1', 'a12=a13=a21=0', 'a22=1',  'a23=a31=a32=0'
4549       and 'a33=1'.
4550
4551           Example:
4552             [#1] image.jpg +mix_rgb 0,1,0,1,0,0,0,0,1
4553
4554           Tutorial: https://gmic.eu/tutorial/mix_rgb
4555
4556         oklab2rgb:
4557
4558           Convert color representation of selected images from OKlab to RGB.
4559           (see       colorspace      definition      at:      https://bottos
4560       son.github.io/posts/oklab/ ).
4561           See also: rgb2oklab.
4562
4563         palette:
4564             palette_name | palette_number
4565
4566           Input specified color palette at the end of the image list.
4567           'palette_name' can be { default | hsv | lines | hot | cool | jet  |
4568       flag  |  cube  | rainbow | parula | spring | summer | autumn | winter |
4569       bone | copper | pink | vga | algae | amp | balance
4570           | curl | deep | delta | dense | diff | gray | haline | ice | matter
4571       |  oxy | phase | rain | solar | speed | tarn | tempo | thermal | topo |
4572       turbid | aurora | hocuspocus | srb2 | uzebox | amiga7800
4573           | amiga7800mess | fornaxvoid1 }
4574
4575           Example:
4576             [#1] palette hsv
4577
4578         pseudogray:
4579             _max_increment>=0,_JND_threshold>=0,_bits_depth>0
4580
4581           Generate pseudogray colormap with specified increment  and  percep‐
4582       tual threshold.
4583           If 'JND_threshold' is 0, no perceptual constraints are applied.
4584
4585           Default    values:   'max_increment=5',   'JND_threshold=2.3'   and
4586       'bits_depth=8'.
4587
4588           Example:
4589             [#1] pseudogray 5
4590
4591         replace_color:
4592             tolerance[%]>=0,smoothness[%]>=0,src1,src2,...,dest1,dest2,...
4593
4594           Replace pixels from/to specified colors in selected images.
4595
4596           Example:
4597             [#1] image.jpg +replace_color 40,3,204,153,110,255,0,0
4598
4599         retinex:
4600             _value_offset>0,_colorspace={ hsi | hsv | lab  |  lrgb  |  rgb  |
4601       ycbcr
4602       },0<=_min_cut<=100,0<=_max_cut<=100,_sigma_low>0,_sigma_mid>0,_sigma_high>0
4603
4604           Apply  multi-scale  retinex algorithm on selected images to improve
4605       color consistency.
4606           (as described in the page http://www.ipol.im/pub/art/2014/107/).
4607
4608           Default   values:   'offset=1',   'colorspace=hsv',    'min_cut=1',
4609       'max_cut=1', 'sigma_low=15','sigma_mid=80' and 'sigma_high=250'.
4610
4611         rgb2bayer:
4612             _start_pattern=0,_color_grid=0
4613
4614           Transform selected color images to RGB-Bayer sampled images.
4615
4616           Default values: 'start_pattern=0' and 'color_grid=0'.
4617
4618           Example:
4619             [#1] image.jpg +rgb2bayer 0
4620
4621         rgb2cmy:
4622
4623           Convert color representation of selected images from RGB to CMY.
4624
4625           Example:
4626             [#1] image.jpg rgb2cmy split c
4627
4628         rgb2cmyk:
4629
4630           Convert color representation of selected images from RGB to CMYK.
4631
4632           Example:
4633             [#1] image.jpg rgb2cmyk split c
4634             [#2] image.jpg rgb2cmyk split c fill[3] 0 append c cmyk2rgb
4635
4636         rgb2hcy:
4637
4638           Convert color representation of selected images from RGB to HCY.
4639
4640           Example:
4641             [#1] image.jpg rgb2hcy split c
4642
4643         rgb2hsi:
4644
4645           Convert color representation of selected images from RGB to HSI.
4646
4647           Example:
4648             [#1] image.jpg rgb2hsi split c
4649
4650         rgb2hsi8:
4651
4652           Convert color representation of selected images from RGB to HSI8.
4653
4654           Example:
4655             [#1] image.jpg rgb2hsi8 split c
4656
4657         rgb2hsl:
4658
4659           Convert color representation of selected images from RGB to HSL.
4660
4661           Example:
4662             [#1] image.jpg rgb2hsl split c
4663             [#2]  image.jpg  rgb2hsl  +split  c  add[-3]  100 mod[-3] 360 ap‐
4664       pend[-3--1] c hsl2rgb
4665
4666         rgb2hsl8:
4667
4668           Convert color representation of selected images from RGB to HSL8.
4669
4670           Example:
4671             [#1] image.jpg rgb2hsl8 split c
4672
4673         rgb2hsv:
4674
4675           Convert color representation of selected images from RGB to HSV.
4676
4677           Example:
4678             [#1] image.jpg rgb2hsv split c
4679             [#2] image.jpg rgb2hsv +split  c  add[-2]  0.3  cut[-2]  0,1  ap‐
4680       pend[-3--1] c hsv2rgb
4681
4682         rgb2hsv8:
4683
4684           Convert color representation of selected images from RGB to HSV8.
4685
4686           Example:
4687             [#1] image.jpg rgb2hsv8 split c
4688
4689         rgb2int:
4690
4691           Convert  color  representation of selected images from RGB to INT24
4692       scalars.
4693
4694           Example:
4695             [#1] image.jpg rgb2int
4696
4697         rgb2jzazbz:
4698             illuminant={ 0=D50 | 1=D65 | 2=E } |
4699             (no arg)
4700
4701           Convert color representation of selected images from RGB to Jzazbz.
4702
4703           Default value: 'illuminant=2'.
4704
4705         rgb2lab:
4706             illuminant={ 0=D50 | 1=D65 | 2=E } |
4707             (no arg)
4708
4709           Convert color representation of selected images from RGB to Lab.
4710
4711           Default value: 'illuminant=2'.
4712
4713         rgb2lab8:
4714             illuminant={ 0=D50 | 1=D65 | 2=E } |
4715             (no arg)
4716
4717           Convert color representation of selected images from RGB to Lab8.
4718
4719           Default value: 'illuminant=2'.
4720
4721           Example:
4722             [#1] image.jpg rgb2lab8 split c
4723
4724         rgb2lch:
4725             illuminant={ 0=D50 | 1=D65 | 2=E } |
4726             (no arg)
4727
4728           Convert color representation of selected images from RGB to Lch.
4729
4730           Default value: 'illuminant=2'.
4731
4732           Example:
4733             [#1] image.jpg rgb2lch split c
4734
4735         rgb2lch8:
4736             illuminant={ 0=D50 | 1=D65 | 2=E } |
4737             (no arg)
4738
4739           Convert color representation of selected images from RGB to Lch8.
4740
4741           Default value: 'illuminant=2'.
4742
4743           Example:
4744             [#1] image.jpg rgb2lch8 split c
4745
4746         rgb2luv:
4747
4748           Convert color representation of selected images from RGB to LUV.
4749
4750           Example:
4751             [#1] image.jpg rgb2luv split c
4752
4753         rgb2oklab:
4754
4755           Convert color representation of selected images from RGB to Oklab.
4756           (see      colorspace      definition      at:       https://bottos
4757       son.github.io/posts/oklab/ ).
4758           See also: oklab2rgb.
4759
4760         rgb2ryb:
4761
4762           Convert color representation of selected images from RGB to RYB.
4763
4764           Example:
4765             [#1] image.jpg rgb2ryb split c
4766
4767         rgb2srgb:
4768
4769           Convert  color representation of selected images from linear RGB to
4770       sRGB.
4771
4772         rgb2xyz:
4773             illuminant={ 0=D50 | 1=D65 | 2=E } |
4774             (no arg)
4775
4776           Convert color representation of selected images from RGB to XYZ.
4777
4778           Default value: 'illuminant=2'.
4779
4780           Example:
4781             [#1] image.jpg rgb2xyz split c
4782
4783         rgb2xyz8:
4784             illuminant={ 0=D50 | 1=D65 | 2=E } |
4785             (no arg)
4786
4787           Convert color representation of selected images from RGB to XYZ8.
4788
4789           Default value: 'illuminant=2'.
4790
4791           Example:
4792             [#1] image.jpg rgb2xyz8 split c
4793
4794         rgb2yiq:
4795
4796           Convert color representation of selected images from RGB to YIQ.
4797
4798           Example:
4799             [#1] image.jpg rgb2yiq split c
4800
4801         rgb2yiq8:
4802
4803           Convert color representation of selected images from RGB to YIQ8.
4804
4805           Example:
4806             [#1] image.jpg rgb2yiq8 split c
4807
4808         rgb2ycbcr:
4809
4810           Convert color representation of selected images from RGB to YCbCr.
4811
4812           Example:
4813             [#1] image.jpg rgb2ycbcr split c
4814
4815         rgb2yuv:
4816
4817           Convert color representation of selected images from RGB to YUV.
4818
4819           Example:
4820             [#1] image.jpg rgb2yuv split c
4821
4822         rgb2yuv8:
4823
4824           Convert color representation of selected images from RGB to YUV8.
4825
4826           Example:
4827             [#1] image.jpg rgb2yuv8 split c
4828
4829         remove_opacity:
4830
4831           Remove opacity channel of selected images.
4832
4833         ryb2rgb:
4834
4835           Convert color representation of selected images from RYB to RGB.
4836
4837         select_color:
4838             tolerance[%]>=0,col1,...,colN
4839
4840           Select pixels with specified color in selected images.
4841
4842           Example:
4843             [#1] image.jpg +select_color 40,204,153,110
4844
4845           Tutorial: https://gmic.eu/oldtutorial/_select_color
4846
4847         sepia:
4848
4849           Apply sepia tones effect on selected images.
4850
4851           Example:
4852             [#1] image.jpg sepia
4853
4854         solarize:
4855
4856           Solarize selected images.
4857
4858           Example:
4859             [#1] image.jpg solarize
4860
4861         split_colors:
4862             _tolerance>=0,_max_nb_outputs>0,_min_area>0
4863
4864           Split selected images as several image containing a single color.
4865           One selected image can be split as at most 'max_nb_outputs' images.
4866           Output images are sorted by decreasing area of extracted color  re‐
4867       gions and have an additional alpha-channel.
4868
4869           Default    values:    'tolerance=0',    'max_nb_outputs=256'    and
4870       'min_area=8'.
4871
4872           Example:
4873             [#1] image.jpg quantize 5 +split_colors , display_rgba
4874
4875         split_opacity:
4876
4877           Split color and opacity parts of selected images.
4878
4879         srgb2lab:
4880             illuminant={ 0=D50 | 1=D65 | 2=E } |
4881             (no arg)
4882
4883           Convert color representation of selected images from sRGB to Lab.
4884
4885           Default value: 'illuminant=2'.
4886
4887           Example:
4888             [#1] image.jpg srgb2lab split c
4889             [#2] image.jpg srgb2lab +split c mul[-2,-1] 2.5  append[-3--1]  c
4890       lab2srgb
4891
4892         srgb2lab8:
4893             illuminant={ 0=D50 | 1=D65 | 2=E } |
4894             (no arg)
4895
4896           Convert color representation of selected images from sRGB to Lab8.
4897
4898           Default value: 'illuminant=2'.
4899
4900         srgb2rgb:
4901
4902           Convert color representation of selected images from sRGB to linear
4903       RGB.
4904
4905         to_a:
4906
4907           Force selected images to have an alpha channel.
4908
4909         to_color:
4910
4911           Force selected images to be in color mode (RGB or RGBA).
4912
4913         to_colormode:
4914             mode={ 0=adaptive | 1=G | 2=GA | 3=RGB | 4=RGBA }
4915
4916           Force selected images to be in a given color mode.
4917
4918           Default value: 'mode=0'.
4919
4920         to_gray:
4921
4922           Force selected images to be in GRAY mode.
4923
4924           Example:
4925             [#1] image.jpg +to_gray
4926
4927         to_graya:
4928
4929           Force selected images to be in GRAYA mode.
4930
4931         to_pseudogray:
4932             _max_step>=0,_is_perceptual_constraint={ 0 | 1 },_bits_depth>0
4933
4934           Convert selected  scalar  images  ([0-255]-valued)  to  pseudo-gray
4935       color images.
4936
4937           Default   values:  'max_step=5',  'is_perceptual_constraint=1'  and
4938       'bits_depth=8'.
4939           The original pseudo-gray technique  has  been  introduced  by  Rich
4940       Franzen http://r0k.us/graphics/pseudoGrey.html.
4941           Extension of this technique to arbitrary increments for more tones,
4942       has been done by David Tschumperlé.
4943
4944         to_rgb:
4945
4946           Force selected images to be in RGB mode.
4947
4948         to_rgba:
4949
4950           Force selected images to be in RGBA mode.
4951
4952         transfer_histogram:
4953             [reference_image],_nb_levels>0,_color_channels
4954
4955           Transfer histogram of the specified reference image to selected im‐
4956       ages.
4957           Argument  'color channels' is the same as with command 'apply_chan‐
4958       nels'.
4959
4960           Default value: 'nb_levels=256' and 'color_channels=all'.
4961
4962           Example:
4963             [#1]  image.jpg   100,100,1,3,"u([256,200,100])"   +transfer_his‐
4964       togram[0] [1]
4965
4966         transfer_pca:
4967             [reference_image],_color_channels
4968
4969           Transfer mean and covariance matrix of specified vector-valued ref‐
4970       erence image to selected images.
4971           Argument 'color channels' is the same as with command  'apply_chan‐
4972       nels'.
4973
4974           Default value: 'color_channels=all'.
4975
4976           Example:
4977             [#1] sample lena,earth +transfer_pca[0] [1]
4978
4979         transfer_rgb:
4980             [target],_gamma>=0,_regularization>=0,_luminosity_con‐
4981       straints>=0,_rgb_resolution>=0,_is_constraints={ 0 | 1 }
4982
4983           Transfer colors from selected source images to  selected  reference
4984       image (given as argument).
4985           'gamma'  determines  the  importance  of  color  occurrences in the
4986       matching process (0=none to 1=huge).
4987           'regularization' determines the number of guided filter  iterations
4988       to remove quantization effects.
4989           'luminosity_constraints'  tells  if  luminosity constraints must be
4990       applied on non-confident matched colors.
4991           'is_constraints' tells if additional hard color constraints must be
4992       set (opens an interactive window).
4993
4994           Default  values:  'gamma=0.3','regularization=8',  'luminosity_con‐
4995       straints=0.1', 'rgb_resolution=64' and 'is_constraints=0'.
4996
4997           Example:
4998             [#1] sample pencils,wall +transfer_rgb[0] [1],0,0.01
4999
5000         xyz2jzazbz:
5001
5002           Convert color representation of selected images from XYZ to RGB.
5003
5004         xyz2lab:
5005             illuminant={ 0=D50 | 1=D65 | 2=E } |
5006             (no arg)
5007
5008           Convert color representation of selected images from XYZ to Lab.
5009
5010           Default value: 'illuminant=2'.
5011
5012         xyz2rgb:
5013             illuminant={ 0=D50 | 1=D65 | 2=E } |
5014             (no arg)
5015
5016           Convert color representation of selected images from XYZ to RGB.
5017
5018           Default value: 'illuminant=2'.
5019
5020         xyz82rgb:
5021             illuminant={ 0=D50 | 1=D65 | 2=E } |
5022             (no arg)
5023
5024           Convert color representation of selected images from XYZ8 to RGB.
5025
5026           Default value: 'illuminant=2'.
5027
5028         ycbcr2rgb:
5029
5030           Convert color representation of selected images from YCbCr to RGB.
5031
5032         yiq2rgb:
5033
5034           Convert color representation of selected images from YIQ to RGB.
5035
5036         yiq82rgb:
5037
5038           Convert color representation of selected images from YIQ8 to RGB.
5039
5040         yuv2rgb:
5041
5042           Convert color representation of selected images from YUV to RGB.
5043
5044         yuv82rgb:
5045
5046           Convert selected images from YUV8 to RGB color bases.
5047
5048         12.7. Geometry Manipulation
5049               ---------------------
5050
5051         a (+):
5052             Shortcut for command 'append'.
5053
5054         append (+):
5055             [image],axis,_centering |
5056             axis,_centering
5057
5058           Append specified image to selected images, or all  selected  images
5059       together, along specified axis.
5060           (equivalent to shortcut command 'a').
5061
5062           'axis' can be { x | y | z | c }.
5063           Usual  'centering'  values  are { 0=left-justified | 0.5=centered |
5064       1=right-justified }.
5065
5066           Default value: 'centering=0'.
5067
5068           Example:
5069             [#1] image.jpg split y,10 reverse append y
5070             [#2] image.jpg repeat 5 +rows[0] 0,{10+18*$>}% done remove[0] ap‐
5071       pend x,0.5
5072             [#3] image.jpg append[0] [0],y
5073
5074         append_tiles:
5075             _M>=0,_N>=0,0<=_centering_x<=1,0<=_centering_y<=1
5076
5077           Append MxN selected tiles as new images.
5078           If 'N' is set to 0, number of rows is estimated automatically.
5079           If 'M' is set to 0, number of columns is estimated automatically.
5080           If 'M' and 'N' are both set to '0', auto-mode is used.
5081           If 'M' or 'N' is set to 0, only a single image is produced.
5082           'centering_x'  and 'centering_y' tells about the centering of tiles
5083       when they have different sizes.
5084
5085           Default values: 'M=0', 'N=0', 'centering_x=centering_y=0.5'.
5086
5087           Example:
5088             [#1] image.jpg split xy,4 append_tiles ,
5089
5090         apply_scales:
5091             "command",num‐
5092       ber_of_scales>0,_min_scale[%]>=0,_max_scale[%]>=0,_scale_gamma>0,_in‐
5093       terpolation
5094
5095           Apply specified command on different scales of selected images.
5096           'interpolation' can be { 0=none | 1=nearest | 2=average |  3=linear
5097       | 4=grid | 5=bicubic | 6=lanczos }.
5098
5099           Default  value:  'min_scale=25%',  'max_scale=100%' and 'interpola‐
5100       tion=3'.
5101
5102           Example:
5103             [#1] image.jpg apply_scales "blur 5 sharpen 1000",4
5104
5105         autocrop (+):
5106             value1,value2,... |
5107             (no arg)
5108
5109           Autocrop selected images by specified vector-valued intensity.
5110           If no arguments are provided, cropping value is guessed.
5111
5112           Example:
5113             [#1]     400,400,1,3      fill_color      64,128,255      ellipse
5114       50%,50%,120,120,0,1,255 +autocrop
5115
5116         autocrop_components:
5117             _threshold[%],_min_area[%]>=0,_is_high_connectivity={   0   |   1
5118       },_output_type={ 0=crop | 1=segmentation | 2=coordinates }
5119
5120           Autocrop and extract connected components in selected  images,  ac‐
5121       cording to a mask given as the last channel of
5122           each of the selected image (e.g. alpha-channel).
5123
5124           Default  values:  'threshold=0%', 'min_area=0.1%', 'is_high_connec‐
5125       tivity=0' and 'output_type=1'.
5126
5127           Example:
5128             [#1] 256,256 noise 0.1,2 eq 1 dilate_circ 20 label_fg 0,1 normal‐
5129       ize 0,255 +neq 0 *[-1] 255 append c +autocrop_components ,
5130
5131         autocrop_seq:
5132             value1,value2,... | auto
5133
5134           Autocrop selected images using the crop geometry of the last one by
5135       specified vector-valued intensity,
5136           or by automatic guessing the cropping value.
5137
5138           Default value: auto mode.
5139
5140           Example:
5141             [#1] image.jpg +fill[-1] 0 ellipse[-1] 50%,50%,30%,20%,0,1,1  au‐
5142       tocrop_seq 0
5143
5144         channels (+):
5145             { [image0] | c0[%] },_{ [image1] | c1[%] }
5146
5147           Keep only specified channels of selected images.
5148           Dirichlet  boundary  is  used  when  specified  channels are out of
5149       range.
5150
5151           Example:
5152             [#1] image.jpg channels 0,1
5153             [#2] image.jpg luminance channels 0,2
5154
5155         columns (+):
5156             { [image0] | x0[%] },_{ [image1] | x1[%] }
5157
5158           Keep only specified columns of selected images.
5159           Dirichlet boundary is used when specified columns are out of range.
5160
5161           Example:
5162             [#1] image.jpg columns -25%,50%
5163
5164         z (+):
5165             Shortcut for command 'crop'.
5166
5167         crop (+):
5168             x0[%],x1[%],_boundary_conditions |
5169             x0[%],y0[%],x1[%],y1[%],_boundary_conditions |
5170             x0[%],y0[%],z0[%],x1[%],y1[%],z1[%],_boundary_conditions |
5171             x0[%],y0[%],z0[%],c0[%],x1[%],y1[%],z1[%],c1[%],_boundary_condi‐
5172       tions
5173
5174           Crop selected images with specified region coordinates.
5175           (equivalent to shortcut command 'z').
5176
5177           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
5178       | 3=mirror }.
5179
5180           Default value: 'boundary_conditions=0'.
5181
5182           Example:
5183             [#1]     image.jpg     +crop     -230,-230,280,280,1      crop[0]
5184       -230,-230,280,280,0
5185             [#2] image.jpg crop 25%,25%,75%,75%
5186
5187         diagonal:
5188
5189           Transform selected vectors as diagonal matrices.
5190
5191           Example:
5192             [#1] 1,10,1,1,'y' +diagonal
5193
5194         elevate:
5195             _depth,_is_plain={ 0 | 1 },_is_colored={ 0 | 1 }
5196
5197           Elevate selected 2D images into 3D volumes.
5198
5199           Default values: 'depth=64', 'is_plain=1' and 'is_colored=1'.
5200
5201         expand_x:
5202             size_x>=0,_boundary_conditions={  0=dirichlet | 1=neumann | 2=pe‐
5203       riodic | 3=mirror }
5204
5205           Expand selected images along the x-axis.
5206
5207           Default value: 'boundary_conditions=1'.
5208
5209           Example:
5210             [#1] image.jpg expand_x 30,0
5211
5212         expand_xy:
5213             size>=0,_boundary_conditions={ 0=dirichlet | 1=neumann |  2=peri‐
5214       odic | 3=mirror }
5215
5216           Expand selected images along the xy-axes.
5217
5218           Default value: 'boundary_conditions=1'.
5219
5220           Example:
5221             [#1] image.jpg expand_xy 30,0
5222
5223         expand_xyz:
5224             size>=0,_boundary_conditions={  0=dirichlet | 1=neumann | 2=peri‐
5225       odic | 3=mirror }
5226
5227           Expand selected images along the xyz-axes.
5228
5229           Default value: 'boundary_conditions=1'.
5230
5231         expand_y:
5232             size_y>=0,_boundary_conditions={ 0=dirichlet | 1=neumann |  2=pe‐
5233       riodic | 3=mirror }
5234
5235           Expand selected images along the y-axis.
5236
5237           Default value: 'boundary_conditions=1'.
5238
5239           Example:
5240             [#1] image.jpg expand_y 30,0
5241
5242         expand_z:
5243             size_z>=0,_boundary_conditions={  0=dirichlet | 1=neumann | 2=pe‐
5244       riodic | 3=mirror }
5245
5246           Expand selected images along the z-axis.
5247
5248           Default value: 'boundary_conditions=1'.
5249
5250         extract:
5251             "condition",_output_type={ 0=xyzc-coordinates | 1=xyz-coordinates
5252       | 2=scalar-values | 3=vector-values }
5253
5254           Extract a list of coordinates or values from selected image, where
5255           specified mathematical condition holds.
5256           For N coordinates matching, result is a 1xNx1x4 image.
5257
5258           Default values: 'output_type=0'.
5259
5260           Example:
5261             [#1] sp lena +extract "norm(I)>128",3
5262
5263         extract_region:
5264             [label_image],_extract_xyz_coordinates={    0    |    1    },_la‐
5265       bel_1,...,_label_M
5266
5267           Extract all pixels of selected images whose corresponding label  in
5268       '[label_image]' is equal to 'label_m',
5269           and output them as M column images.
5270
5271           Default value: 'extract_xyz_coordinates=0'.
5272
5273           Example:
5274             [#1] image.jpg +blur 3 quantize. 4,0 +extract_region[0] [1],0,1,3
5275
5276         montage:
5277             "_layout_code",_montage_mode={  0<=centering<=1  |  2<=scale+2<=3
5278       },_output_mode={ 0=single layer | 1=multiple layers },"_processing_com‐
5279       mand"
5280
5281           Create  a  single  image montage from selected images, according to
5282       specified layout code :
5283            * 'X' to assemble all images using an automatically estimated lay‐
5284       out.
5285            * 'H' to assemble all images horizontally.
5286            * 'V' to assemble all images vertically.
5287            * 'A' to assemble all images as an horizontal array.
5288            * 'B' to assemble all images as a vertical array.
5289            * 'Ha:b' to assemble two blocks 'a' and 'b' horizontally.
5290            * 'Va:b' to assemble two blocks 'a' and 'b' vertically.
5291            *  'Ra'  to  rotate a block 'a' by 90 deg. ('RRa' for 180 deg. and
5292       'RRRa' for 270 deg.).
5293            * 'Ma' to mirror a block 'a' along the X-axis ('MRRa' for  the  Y-
5294       axis).
5295           A  block  'a'  can  be  an  image index (treated periodically) or a
5296       nested layout expression 'Hb:c','Vb:c','Rb' or
5297           'Mb' itself.
5298           For example, layout code 'H0:V1:2' creates an image where image [0]
5299       is on the left, and images [1] and [2]
5300           vertically packed on the right.
5301
5302           Default  values: 'layout_code=X', 'montage_mode=2', output_mode='0'
5303       and 'processing_command=""'.
5304
5305           Example:
5306             [#1] image.jpg sample  ?  +plasma[0]  shape_cupid  256  normalize
5307       0,255  frame  3,3,0  frame  10,10,255  to_rgb  +montage A +montage[^-1]
5308       H1:V0:VH2:1H0:3
5309
5310         mirror (+):
5311             { x | y | z }...{ x | y | z }
5312
5313           Mirror selected images along specified axes.
5314
5315           Example:
5316             [#1] image.jpg +mirror y +mirror[0] c
5317             [#2] image.jpg +mirror x +mirror y append_tiles 2,2
5318
5319         permute (+):
5320             permutation_string
5321
5322           Permute selected image axes by specified permutation.
5323           'permutation' is a combination of the character set {x|y|z|c},
5324           e.g. 'xycz', 'cxyz', ...
5325
5326           Example:
5327             [#1] image.jpg permute yxzc
5328
5329         r (+):
5330             Shortcut for command 'resize'.
5331
5332         resize (+):
5333             {[image_w] | width>0[%]},_{[image_h] | height>0[%]},_{[image_d] |
5334       depth>0[%]},_{[image_s]  | spectrum>0[%]},_interpolation,_boundary_con‐
5335       ditions,_ax,_ay,_az,_ac
5336
5337           Resize selected images with specified geometry.
5338           (equivalent to shortcut command 'r').
5339
5340           'interpolation' can be  {  -1=none  (memory  content)  |  0=none  |
5341       1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }.
5342           'boundary_conditions' has different meanings, according to the cho‐
5343       sen 'interpolation' mode :
5344           . When 'interpolation=={ -1 | 1 | 2 | 4  }',  'boundary_conditions'
5345       is meaningless.
5346           . When 'interpolation==0', 'boundary_conditions' can be { 0=dirich‐
5347       let | 1=neumann | 2=periodic | 3=mirror }.
5348           . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be
5349       { 0=none | 1=neumann }.
5350           'ax,ay,az,ac'  set  the  centering along each axis when 'interpola‐
5351       tion=0 or 4'
5352           (set to '0' by default, must be defined in range [0,1]).
5353
5354           Default  values:  'interpolation=1',  'boundary_conditions=0'   and
5355       'ax=ay=az=ac=0'.
5356
5357           Example:
5358             [#1]     image.jpg    +resize[-1]    256,128,1,3,2    +resize[-1]
5359       120%,120%,1,3,0,1,0.5,0.5  +resize[-1]  120%,120%,1,3,0,0,0.2,0.2  +re‐
5360       size[-1] [0],[0],1,3,4
5361
5362         ri:
5363             Shortcut for command 'resize_as_image'.
5364
5365         resize_as_image:
5366             [reference],_interpolation,_boundary_conditions,_ax,_ay,_az,_ac
5367
5368           Resize selected images to the geometry of specified [reference] im‐
5369       age.
5370           (equivalent to shortcut command 'ri').
5371
5372           Default  values:  'interpolation=1',  'boundary_conditions=0'   and
5373       'ax=ay=az=ac=0'.
5374
5375           Example:
5376             [#1] image.jpg sample duck +resize_as_image[-1] [-2]
5377
5378         resize_mn:
5379             width[%]>=0,_height[%]>=0,_depth[%]>=0,_B_value,_C_value
5380
5381           Resize selected images with Mitchell-Netravali filter (cubic).
5382           For        details        about        the       method,       see:
5383       https://de.wikipedia.org/wiki/Mitchell-Netravali-Filter.
5384
5385           Default  values:  'height=100%',   'depth=100%',   'B=0.3333'   and
5386       'C=0.3333'.
5387
5388           Example:
5389             [#1] image.jpg resize2dx 32 resize_mn 800%,800%
5390
5391         resize_pow2:
5392             _interpolation,_boundary_conditions,_ax,_ay,_az,_ac
5393
5394           Resize selected images so that each dimension is a power of 2.
5395           'interpolation'  can  be  {  -1=none  (memory  content)  | 0=none |
5396       1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }.
5397           'boundary_conditions' has different meanings, according to the cho‐
5398       sen 'interpolation' mode :
5399           .  When  'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions'
5400       is meaningless.
5401           . When 'interpolation==0', 'boundary_conditions' can be { 0=dirich‐
5402       let | 1=neumann | 2=periodic | 3=mirror }.
5403           . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be
5404       { 0=none | 1=neumann }.
5405           'ax,ay,az,ac' set the centering along each  axis  when  'interpola‐
5406       tion=0'
5407           (set to '0' by default, must be defined in range [0,1]).
5408
5409           Default   values:  'interpolation=0',  'boundary_conditions=0'  and
5410       'ax=ay=az=ac=0'.
5411
5412           Example:
5413             [#1] image.jpg +resize_pow2[-1] 0
5414
5415         rr2d:
5416             Shortcut for command 'resize_ratio2d'.
5417
5418         resize_ratio2d:
5419             width>0,height>0,_mode={  0=inside   |   1=outside   |   2=padded
5420       },0=<_interpolation<=6
5421
5422           Resize selected images while preserving their aspect ratio.
5423           (equivalent to shortcut command 'rr2d').
5424
5425           Default values: 'mode=0' and 'interpolation=6'.
5426
5427         r2dx:
5428             Shortcut for command 'resize2dx'.
5429
5430         resize2dx:
5431             width[%]>0,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac
5432
5433           Resize selected images along the x-axis, preserving 2D ratio.
5434           (equivalent to shortcut command 'r2dx').
5435
5436           'interpolation'  can  be  {  -1=none  (memory  content)  | 0=none |
5437       1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }.
5438           'boundary_conditions' has different meanings, according to the cho‐
5439       sen 'interpolation' mode :
5440           .  When  'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions'
5441       is meaningless.
5442           . When 'interpolation==0', 'boundary_conditions' can be { 0=dirich‐
5443       let | 1=neumann | 2=periodic | 3=mirror }.
5444           . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be
5445       { 0=none | 1=neumann }.
5446           'ax,ay,az,ac' set the centering along each  axis  when  'interpola‐
5447       tion=0'
5448           (set to '0' by default, must be defined in range [0,1]).
5449
5450           Default   values:  'interpolation=3',  'boundary_conditions=0'  and
5451       'ax=ay=az=ac=0'.
5452
5453           Example:
5454             [#1] image.jpg +resize2dx 100,2 append x
5455
5456         r2dy:
5457             Shortcut for command 'resize2dy'.
5458
5459         resize2dy:
5460             height[%]>=0,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac
5461
5462           Resize selected images along the y-axis, preserving 2D ratio.
5463           (equivalent to shortcut command 'r2dy').
5464
5465           'interpolation' can be  {  -1=none  (memory  content)  |  0=none  |
5466       1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }.
5467           'boundary_conditions' has different meanings, according to the cho‐
5468       sen 'interpolation' mode :
5469           . When 'interpolation=={ -1 | 1 | 2 | 4  }',  'boundary_conditions'
5470       is meaningless.
5471           . When 'interpolation==0', 'boundary_conditions' can be { 0=dirich‐
5472       let | 1=neumann | 2=periodic | 3=mirror }.
5473           . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be
5474       { 0=none | 1=neumann }.
5475           'ax,ay,az,ac'  set  the  centering along each axis when 'interpola‐
5476       tion=0'
5477           (set to '0' by default, must be defined in range [0,1]).
5478
5479           Default  values:  'interpolation=3',  'boundary_conditions=0'   and
5480       'ax=ay=az=ac=0'.
5481
5482           Example:
5483             [#1] image.jpg +resize2dy 100,2 append x
5484
5485         r3dx:
5486             Shortcut for command 'resize3dx'.
5487
5488         resize3dx:
5489             width[%]>0,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac
5490
5491           Resize selected images along the x-axis, preserving 3D ratio.
5492           (equivalent to shortcut command 'r3dx').
5493
5494           'interpolation'  can  be  {  -1=none  (memory  content)  | 0=none |
5495       1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }.
5496           'boundary_conditions' has different meanings, according to the cho‐
5497       sen 'interpolation' mode :
5498           .  When  'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions'
5499       is meaningless.
5500           . When 'interpolation==0', 'boundary_conditions' can be { 0=dirich‐
5501       let | 1=neumann | 2=periodic | 3=mirror }.
5502           . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be
5503       { 0=none | 1=neumann }.
5504           'ax,ay,az,ac' set the centering along each  axis  when  'interpola‐
5505       tion=0'
5506           (set to '0' by default, must be defined in range [0,1]).
5507
5508           Default   values:  'interpolation=3',  'boundary_conditions=0'  and
5509       'ax=ay=az=ac=0'.
5510
5511         r3dy:
5512             Shortcut for command 'resize3dy'.
5513
5514         resize3dy:
5515             height[%]>0,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac
5516
5517           Resize selected images along the y-axis, preserving 3D ratio.
5518           (equivalent to shortcut command 'r3dy').
5519
5520           'interpolation' can be  {  -1=none  (memory  content)  |  0=none  |
5521       1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }.
5522           'boundary_conditions' has different meanings, according to the cho‐
5523       sen 'interpolation' mode :
5524           . When 'interpolation=={ -1 | 1 | 2 | 4  }',  'boundary_conditions'
5525       is meaningless.
5526           . When 'interpolation==0', 'boundary_conditions' can be { 0=dirich‐
5527       let | 1=neumann | 2=periodic | 3=mirror }.
5528           . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be
5529       { 0=none | 1=neumann }.
5530           'ax,ay,az,ac'  set  the  centering along each axis when 'interpola‐
5531       tion=0'
5532           (set to '0' by default, must be defined in range [0,1]).
5533
5534           Default  values:  'interpolation=3',  'boundary_conditions=0'   and
5535       'ax=ay=az=ac=0'.
5536
5537         r3dz:
5538             Shortcut for command 'resize3dz'.
5539
5540         resize3dz:
5541             depth[%]>0,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac
5542
5543           Resize selected images along the z-axis, preserving 3D ratio.
5544           (equivalent to shortcut command 'r3dz').
5545
5546           'interpolation'  can  be  {  -1=none  (memory  content)  | 0=none |
5547       1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }.
5548           'boundary_conditions' has different meanings, according to the cho‐
5549       sen 'interpolation' mode :
5550           .  When  'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions'
5551       is meaningless.
5552           . When 'interpolation==0', 'boundary_conditions' can be { 0=dirich‐
5553       let | 1=neumann | 2=periodic | 3=mirror }.
5554           . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be
5555       { 0=none | 1=neumann }.
5556           'ax,ay,az,ac' set the centering along each  axis  when  'interpola‐
5557       tion=0'
5558           (set to '0' by default, must be defined in range [0,1]).
5559
5560           Default   values:  'interpolation=3',  'boundary_conditions=0'  and
5561       'ax=ay=az=ac=0'.
5562
5563         rotate (+):
5564             angle,_interpolation,_boundary_conditions,_center_x[%],_cen‐
5565       ter_y[%] |
5566             u,v,w,angle,interpolation,boundary_conditions,_center_x[%],_cen‐
5567       ter_y[%],_center_z[%]
5568
5569           Rotate selected images with specified angle (in deg.), and  option‐
5570       ally 3D axis (u,v,w).
5571           'interpolation' can be { 0=none | 1=linear | 2=bicubic }.
5572           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
5573       | 3=mirror }.
5574           When a rotation center (cx,cy,_cz) is specified, the  size  of  the
5575       image is preserved.
5576
5577           Default   values:  'interpolation=1',  'boundary_conditions=0'  and
5578       'center_x=center_y=(undefined)'.
5579
5580           Example:
5581             [#1] image.jpg +rotate -25,1,2,50%,50% rotate[0] 25
5582
5583         rotate_tileable:
5584             angle,_max_size_factor>=0
5585
5586           Rotate selected images by specified angle and make them tileable.
5587           If resulting size of an image is too big, the image is replaced  by
5588       a 1x1 image.
5589
5590           Default values: 'max_size_factor=8'.
5591
5592         rows (+):
5593             { [image0] | y0[%] },_{ [image1] | y1[%] }
5594
5595           Keep only specified rows of selected images.
5596           Dirichlet  boundary conditions are used when specified rows are out
5597       of range.
5598
5599           Example:
5600             [#1] image.jpg rows -25%,50%
5601
5602         scale2x:
5603
5604           Resize selected images using the Scale2x algorithm.
5605
5606           Example:
5607             [#1] image.jpg threshold 50% resize 50%,50% +scale2x
5608
5609         scale3x:
5610
5611           Resize selected images using the Scale3x algorithm.
5612
5613           Example:
5614             [#1] image.jpg threshold 50% resize 33%,33% +scale3x
5615
5616         scale_dcci2x:
5617             _edge_threshold>=0,_exponent>0,_extend_1px={ 0=false | 1=true }
5618
5619           Double image size using directional  cubic  convolution  interpola‐
5620       tion,
5621           as   described   in   https://en.wikipedia.org/wiki/Directional_Cu
5622       bic_Convolution_Interpolation.
5623
5624           Default  values:  'edge_threshold=1.15',  'exponent=5'   and   'ex‐
5625       tend_1px=0'.
5626
5627           Example:
5628             [#1] image.jpg +scale_dcci2x ,
5629
5630         seamcarve:
5631             _width[%]>=0,_height[%]>=0,_is_priority_channel={ 0 | 1 },_is_an‐
5632       tialiasing={ 0 | 1 },_maximum_seams[%]>=0
5633
5634           Resize selected images with specified 2D geometry, using the  seam-
5635       carving algorithm.
5636
5637           Default  values:  'height=100%',  'is_priority_channel=0',  'is_an‐
5638       tialiasing=1' and 'maximum_seams=25%'.
5639
5640           Example:
5641             [#1] image.jpg seamcarve 60%
5642
5643         shift (+):
5644             vx[%],_vy[%],_vz[%],_vc[%],_boundary_conditions,_interpolation={
5645       0=nearest_neighbor | 1=linear }
5646
5647           Shift selected images by specified displacement vector.
5648           Displacement  vector can be non-integer in which case linear inter‐
5649       polation should be chosen.
5650           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
5651       | 3=mirror }.
5652
5653           Default value: 'boundary_conditions=0' and 'interpolation=0'.
5654
5655           Example:
5656             [#1]  image.jpg  +shift[0]  50%,50%,0,0,0 +shift[0] 50%,50%,0,0,1
5657       +shift[0] 50%,50%,0,0,2
5658
5659         shrink_x:
5660             size_x>=0
5661
5662           Shrink selected images along the x-axis.
5663
5664           Example:
5665             [#1] image.jpg shrink_x 30
5666
5667         shrink_xy:
5668             size>=0
5669
5670           Shrink selected images along the xy-axes.
5671
5672           Example:
5673             [#1] image.jpg shrink_xy 30
5674
5675         shrink_xyz:
5676             size>=0
5677
5678           Shrink selected images along the xyz-axes.
5679
5680         shrink_y:
5681             size_y>=0
5682
5683           Shrink selected images along the y-axis.
5684
5685           Example:
5686             [#1] image.jpg shrink_y 30
5687
5688         shrink_z:
5689             size_z>=0
5690
5691           Shrink selected images along the z-axis.
5692
5693         slices (+):
5694             { [image0] | z0[%] },_{ [image1] | z1[%] }
5695
5696           Keep only specified slices of selected images.
5697           Dirichlet boundary conditions are used when  specified  slices  are
5698       out of range.
5699
5700         sort (+):
5701             _ordering={ + | - },_axis={ x | y | z | c }
5702
5703           Sort pixel values of selected images.
5704           If  'axis'  is specified, the sorting is done according to the data
5705       of the first column/row/slice/channel
5706           of selected images.
5707
5708           Default values: 'ordering=+' and 'axis=(undefined)'.
5709
5710           Example:
5711             [#1] 64 rand 0,100 +sort display_graph 400,300,3
5712
5713         s (+):
5714             Shortcut for command 'split'.
5715
5716         split (+):
5717             { x | y | z | c }...{ x | y | z | c },_split_mode |
5718             keep_splitting_values={ + | - },_{ x | y | z | c }...{ x | y |  z
5719       | c },value1,_value2,... |
5720             (no arg)
5721
5722           Split  selected  images along specified axes, or regarding to a se‐
5723       quence of scalar values
5724           (optionally along specified axes too).
5725           (equivalent to shortcut command 's').
5726
5727           'split_mode' can be  {  0=split  according  to  constant  values  |
5728       >0=split in N parts | <0=split in parts of size -N }.
5729
5730           Default value: 'split_mode=-1'.
5731
5732           Example:
5733             [#1] image.jpg split c
5734             [#2] image.jpg split y,3
5735             [#3] image.jpg split x,-128
5736             [#4] 1,20,1,1,"1,2,3,4" +split -,2,3 append[1--1] y
5737             [#5] (1,2,2,3,3,3,4,4,4,4) +split x,0 append[1--1] y
5738
5739         split_tiles:
5740             M!=0,_N!=0,_is_homogeneous={ 0 | 1 }
5741
5742           Split selected images as a MxN array of tiles.
5743           If M or N is negative, it stands for the tile size instead.
5744
5745           Default values: 'N=M' and 'is_homogeneous=0'.
5746
5747           Example:
5748             [#1]  image.jpg  +local  split_tiles 5,4 blur 3,0 sharpen 700 ap‐
5749       pend_tiles 4,5 endlocal
5750
5751         undistort:
5752             -1<=_amplitude<=1,_aspect_ratio,_zoom,_center_x[%],_cen‐
5753       ter_y[%],_boundary_conditions
5754
5755           Correct  barrel/pincushion  distortions  occurring  with wide-angle
5756       lens.
5757           References:
5758           [1] Zhang Z. (1999). Flexible camera calibration by viewing a plane
5759       from unknown orientation.
5760           [2]  Andrew W. Fitzgibbon (2001). Simultaneous linear estimation of
5761       multiple view geometry and lens distortion.
5762           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
5763       | 3=mirror }.
5764
5765           Default values: 'amplitude=0.25', 'aspect_ratio=0', 'zoom=0', 'cen‐
5766       ter_x=center_y=50%' and 'boundary_conditions=0'.
5767
5768         y (+):
5769             Shortcut for command 'unroll'.
5770
5771         unroll (+):
5772             _axis={ x | y | z | c }
5773
5774           Unroll selected images along specified axis.
5775           (equivalent to shortcut command 'y').
5776
5777           Default value: 'axis=y'.
5778
5779           Example:
5780             [#1] (1,2,3;4,5,6;7,8,9) +unroll y
5781
5782         upscale_smart:
5783             width[%],_height[%],_depth,_smoothness>=0,_anisot‐
5784       ropy=[0,1],sharpening>=0
5785
5786           Upscale selected images with an edge-preserving algorithm.
5787
5788           Default  values:  'height=100%', 'depth=100%', 'smoothness=2', 'an‐
5789       isotropy=0.4' and 'sharpening=10'.
5790
5791           Example:
5792             [#1] image.jpg resize2dy 100 +upscale_smart 500%,500% append x
5793
5794         warp (+):
5795             [warping_field],_mode,_interpolation,_boundary_condi‐
5796       tions,_nb_frames>0
5797
5798           Warp selected images with specified displacement field.
5799           'mode'  can be { 0=backward-absolute | 1=backward-relative | 2=for‐
5800       ward-absolute | 3=forward-relative }.
5801           'interpolation' can be { 0=nearest-neighbor | 1=linear | 2=cubic }.
5802           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
5803       | 3=mirror }.
5804
5805           Default   values:   'mode=0',  'interpolation=1',  'boundary_condi‐
5806       tions=1' and 'nb_frames=1'.
5807
5808           Example:
5809             [#1]                                                    image.jpg
5810       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))'
5811       warp[-2] [-1],1,1,0 quiver[-1] [-1],10,1,1,1,100
5812
5813           Tutorial: https://gmic.eu/oldtutorial/_warp
5814
5815         warp_patch:
5816             [warp‐
5817       ing_field],patch_width>=1,_patch_height>=1,_patch_depth>=1,_std_fac‐
5818       tor>0,_boundary_conditions.
5819
5820           Patch-warp selected images, with specified 2D  or  3D  displacement
5821       field (in backward-absolute mode).
5822           Argument  'std_factor' sets the std of the gaussian weights for the
5823       patch overlap,
5824           equal to 'std = std_factor*patch_size'.
5825           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
5826       | 3=mirror }.
5827
5828           Default values: 'std_factor=0.3' and 'boundary_conditions=3'.
5829
5830         warp_rbf:
5831             xs0[%],ys0[%],xt0[%],yt0[%],...,xsN[%],ysN[%],xtN[%],ytN[%]
5832
5833           Warp selected images using RBF-based interpolation.
5834           Each argument (xsk,ysk)-(xtk,ytk) corresponds to the coordinates of
5835       a keypoint
5836           respectively on the source and target images. The set of  all  key‐
5837       points define the overall image deformation.
5838
5839           Example:
5840             [#1]                      image.jpg                     +warp_rbf
5841       0,0,0,0,100%,0,100%,0,100%,100%,100%,100%,0,100%,0,100%,50%,50%,70%,50%,25%,25%,25%,75%
5842
5843         12.8. Filtering
5844               ---------
5845
5846         bandpass:
5847             _min_freq[%],_max_freq[%]
5848
5849           Apply bandpass filter to selected images.
5850
5851           Default values: 'min_freq=0' and 'max_freq=20%'.
5852
5853           Example:
5854             [#1] image.jpg bandpass 1%,3%
5855
5856           Tutorial: https://gmic.eu/oldtutorial/_bandpass
5857
5858         bilateral (+):
5859             [guide],std_deviation_s[%]>=0,std_deviation_r[%]>=0,_sam‐
5860       pling_s>=0,_sampling_r>=0 |
5861             std_deviation_s[%]>=0,std_deviation_r[%]>=0,_sampling_s>=0,_sam‐
5862       pling_r>=0
5863
5864           Blur selected images by anisotropic (eventually joint/cross) bilat‐
5865       eral filtering.
5866           If a guide image is provided, it is used for  drive  the  smoothing
5867       filter.
5868           A guide image must be of the same xyz-size as the selected images.
5869           Set 'sampling' arguments to '0' for automatic adjustment.
5870
5871           Example:
5872             [#1] image.jpg repeat 5 bilateral 10,10 done
5873
5874         b (+):
5875             Shortcut for command 'blur'.
5876
5877         blur (+):
5878             std_deviation>=0[%],_boundary_conditions,_kernel |
5879             axes,std_deviation>=0[%],_boundary_conditions,_kernel
5880
5881           Blur selected images by a deriche or gaussian filter (recursive im‐
5882       plementation).
5883           (equivalent to shortcut command 'b').
5884
5885           'boundary_conditions' can be { 0=dirichlet | 1=neumann }.
5886           'kernel' can be { 0=deriche | 1=gaussian }.
5887           When specified, argument 'axes' is a sequence of { x | y | z | c }.
5888           Specifying one axis multiple times apply  also  the  blur  multiple
5889       times.
5890
5891           Default values: 'boundary_conditions=1' and 'kernel=1'.
5892
5893           Example:
5894             [#1] image.jpg +blur 5,0 +blur[0] 5,1
5895             [#2] image.jpg +blur y,10%
5896
5897           Tutorial: https://gmic.eu/oldtutorial/_blur
5898
5899         blur_angular:
5900             amplitude[%],_center_x[%],_center_y[%]
5901
5902           Apply angular blur on selected images.
5903
5904           Default values: 'center_x=center_y=50%'.
5905
5906           Example:
5907             [#1] image.jpg blur_angular 2%
5908
5909           Tutorial: https://gmic.eu/oldtutorial/_blur_angular
5910
5911         blur_bloom:
5912             _amplitude>=0,_ratio>=0,_nb_iter>=0,_blend_operator={  +  | max |
5913       min },_kernel={ 0=deriche | 1=gaussian | 2=box |  3=triangle  |  4=qua‐
5914       dratic },_normalize_scales={ 0 | 1 },_axes
5915
5916           Apply  a bloom filter that blend multiple blur filters of different
5917       radii,
5918           resulting in a larger but sharper glare than a simple blur.
5919           When specified, argument 'axes' is a sequence of { x | y | z | c }.
5920           Specifying one axis multiple times apply  also  the  blur  multiple
5921       times.
5922           Reference: Masaki Kawase, "Practical Implementation of High Dynamic
5923       Range Rendering", GDC 2004.
5924
5925           Default values: 'amplitude=1', 'ratio=2', 'nb_iter=5', 'blend_oper‐
5926       ator=+', 'kernel=1', 'normalize_scales=0' and 'axes=(all)'
5927
5928           Example:
5929             [#1] image.jpg blur_bloom ,
5930
5931         blur_linear:
5932             amplitude1[%],_amplitude2[%],_angle,_boundary_conditions={
5933       0=dirichlet | 1=neumann }
5934
5935           Apply linear blur on selected images, with specified angle and  am‐
5936       plitudes.
5937
5938           Default  values:  'amplitude2=0',  'angle=0'  and  'boundary_condi‐
5939       tions=1'.
5940
5941           Example:
5942             [#1] image.jpg blur_linear 10,0,45
5943
5944           Tutorial: https://gmic.eu/oldtutorial/_blur_linear
5945
5946         blur_radial:
5947             amplitude[%],_center_x[%],_center_y[%]
5948
5949           Apply radial blur on selected images.
5950
5951           Default values: 'center_x=center_y=50%'.
5952
5953           Example:
5954             [#1] image.jpg blur_radial 2%
5955
5956           Tutorial: https://gmic.eu/oldtutorial/_blur_radial
5957
5958         blur_selective:
5959             sigma>=0,_edges>0,_nb_scales>0
5960
5961           Blur selected images using selective gaussian scales.
5962
5963           Default values: 'sigma=5', 'edges=0.5' and 'nb_scales=5'.
5964
5965           Example:
5966             [#1] image.jpg noise 20 cut 0,255 +local[-1] repeat 4 blur_selec‐
5967       tive , done endlocal
5968
5969           Tutorial: https://gmic.eu/oldtutorial/_blur_selective
5970
5971         blur_x:
5972             amplitude[%]>=0,_boundary_conditions={ 0=dirichlet | 1=neumann }
5973
5974           Blur selected images along the x-axis.
5975
5976           Default value: 'boundary_conditions=1'.
5977
5978           Example:
5979             [#1] image.jpg +blur_x 6
5980
5981           Tutorial: https://gmic.eu/oldtutorial/_blur_x
5982
5983         blur_xy:
5984             amplitude_x[%],amplitude_y[%],_boundary_conditions={  0=dirichlet
5985       | 1=neumann }
5986
5987           Blur selected images along the X and Y axes.
5988
5989           Default value: 'boundary_conditions=1'.
5990
5991           Example:
5992             [#1] image.jpg +blur_xy 6
5993
5994           Tutorial: https://gmic.eu/oldtutorial/_blur_y
5995
5996         blur_xyz:
5997             amplitude_x[%],amplitude_y[%],amplitude_z,_boundary_conditions={
5998       0=dirichlet | 1=neumann }
5999
6000           Blur selected images along the X, Y and Z axes.
6001
6002           Default value: 'boundary_conditions=1'.
6003
6004           Tutorial: https://gmic.eu/oldtutorial/_blur_xyz
6005
6006         blur_y:
6007             amplitude[%]>=0,_boundary_conditions={ 0=dirichlet | 1=neumann }
6008
6009           Blur selected images along the y-axis.
6010
6011           Default value: 'boundary_conditions=1'.
6012
6013           Example:
6014             [#1] image.jpg +blur_y 6
6015
6016           Tutorial: https://gmic.eu/oldtutorial/_blur_y
6017
6018         blur_z:
6019             amplitude[%]>=0,_boundary_conditions={ 0=dirichlet | 1=neumann }
6020
6021           Blur selected images along the z-axis.
6022
6023           Default value: 'boundary_conditions=1'.
6024
6025           Tutorial: https://gmic.eu/oldtutorial/_blur_z
6026
6027         boxfilter (+):
6028             size>=0[%],_order,_boundary_conditions,_nb_iter>=0 |
6029             axes,size>=0[%],_order,_boundary_conditions,_nb_iter>=0
6030
6031           Blur selected images by a box filter of specified size (fast recur‐
6032       sive implementation).
6033           'order' can be { 0=smooth | 1=1st-derivative | 2=2nd-derivative }.
6034           'boundary_conditions' can be { 0=dirichlet | 1=neumann }.
6035           When specified, argument 'axes' is a sequence of { x | y | z | c }.
6036           Specifying one axis multiple times apply  also  the  blur  multiple
6037       times.
6038
6039           Default values: 'order=0', 'boundary_conditions=1' and 'nb_iter=1'.
6040
6041           Example:
6042             [#1] image.jpg +boxfilter 5%
6043             [#2] image.jpg +boxfilter y,3,1
6044
6045         bump2normal:
6046
6047           Convert selected bumpmaps to normalmaps.
6048
6049           Example:
6050             [#1] 300,300 circle 50%,50%,128,1,1 blur 5% bump2normal
6051
6052         compose_freq:
6053
6054           Compose selected low and high frequency parts into new images.
6055
6056           Example:
6057             [#1] image.jpg split_freq 2% mirror[-1] x compose_freq
6058
6059         convolve (+):
6060             [mask],_boundary_conditions,_is_normalized={   0   |  1  },_chan‐
6061       nel_mode,_xcenter,_ycenter,_zcenter,_xstart,_ystart,_zs‐
6062       tart,_xend,_yend,_zend,_xstride,_ystride,_zstride,_xdilation,_ydila‐
6063       tion,_zdilation,
6064               interpolation_type
6065
6066           Convolve selected images by specified mask.
6067           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
6068       | 3=mirror }.
6069           'channel_mode'  can  be  {  0=sum  input channels | 1=one-for-one |
6070       2=expand }.
6071           'interpolation_type' can be { 0=nearest-neighbor | 1=linear }.
6072
6073           Default values: 'boundary_conditions=1', 'is_normalized=0',  'chan‐
6074       nel_mode=1',  'xcenter=ycenter=zcenter=-1'  (-1=centered),  'xstart=ys‐
6075       tart=zstart=0',
6076            'xend=yend=zend=-1'             (-1=max              coordinates),
6077       'xstride=ystride=zstride=1', 'xdilation=ydilation=zdilation=1' and 'in‐
6078       terpolation_type=0'.
6079
6080           Example:
6081             [#1] image.jpg (0,1,0;1,-4,1;0,1,0) convolve[-2] [-1] keep[-2]
6082             [#2] image.jpg (0,1,0) resize[-1] 130,1,1,1,3 +convolve[0] [1]
6083
6084           Tutorial: https://gmic.eu/oldtutorial/_convolve
6085
6086         convolve_fft:
6087             [mask],_boundary_conditions
6088
6089           Convolve selected images with specified mask, in  the  fourier  do‐
6090       main.
6091           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
6092       | 3=mirror }.
6093
6094           Example:
6095             [#1] image.jpg 100%,100%  gaussian[-1]  20,1,45  +convolve_fft[0]
6096       [1]
6097
6098         correlate (+):
6099             [mask],_boundary_conditions,_is_normalized={   0   |  1  },_chan‐
6100       nel_mode,_xcenter,_ycenter,_zcenter,_xstart,_ystart,_zs‐
6101       tart,_xend,_yend,_zend,_xstride,_ystride,_zstride,_xdilation,_ydila‐
6102       tion,_zdilation,
6103               interpolation_type
6104
6105           Correlate selected images by specified mask.
6106           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
6107       | 3=mirror }.
6108           'channel_mode'  can  be  {  0=sum  input channels | 1=one-for-one |
6109       2=expand }.
6110           'interpolation_type' can be { 0=nearest-neighbor | 1=linear }.
6111
6112           Default values: 'boundary_conditions=1', 'is_normalized=0',  'chan‐
6113       nel_mode=1',  'xcenter=ycenter=zcenter=-1'  (-1=centered),  'xstart=ys‐
6114       tart=zstart=0',
6115            'xend=yend=zend=-1'             (-1=max              coordinates),
6116       'xstride=ystride=zstride=1', 'xdilation=ydilation=zdilation=1' and 'in‐
6117       terpolation_type=0'.
6118
6119           Example:
6120             [#1] image.jpg (0,1,0;1,-4,1;0,1,0) correlate[-2] [-1] keep[-2]
6121             [#2] image.jpg +crop 40%,40%,60%,60% +correlate[0] [-1],0,1
6122
6123         cross_correlation:
6124             [mask]
6125
6126           Compute cross-correlation of selected images with specified mask.
6127
6128           Example:
6129             [#1] image.jpg +shift -30,-20 +cross_correlation[0] [1]
6130
6131         curvature:
6132
6133           Compute isophote curvatures on selected images.
6134
6135           Example:
6136             [#1] image.jpg blur 10 curvature
6137
6138         dct:
6139             _{ x | y | z }...{ x | y | z } |
6140             (no arg)
6141
6142           Compute the discrete cosine transform of selected  images,  option‐
6143       ally along the specified axes only.
6144           Output  images  are always evenly sized, so this command may change
6145       the size of the selected images.
6146
6147           Default values: (no arg)
6148           See also: idct.
6149
6150           Example:
6151             [#1] image.jpg +dct +idct[-1] abs[-2] +[-2] 1 log[-2]
6152
6153           Tutorial: https://gmic.eu/oldtutorial/_dct-and-idct
6154
6155         deblur:
6156             amplitude[%]>=0,_nb_iter>=0,_dt>=0,_regul>=0,_regul_type={
6157       0=Tikhonov | 1=meancurv. | 2=TV }
6158
6159           Deblur image using a regularized Jansson-Van Cittert algorithm.
6160
6161           Default    values:    'nb_iter=10',    'dt=20',   'regul=0.7'   and
6162       'regul_type=1'.
6163
6164           Example:
6165             [#1] image.jpg blur 3 +deblur 3,40,20,0.01
6166
6167         deblur_goldmeinel:
6168             sigma>=0,_nb_iter>=0,_acceleration>=0,_kernel_type={ 0=deriche  |
6169       1=gaussian }.
6170
6171           Deblur selected images using Gold-Meinel algorithm
6172
6173           Default values: 'nb_iter=8', 'acceleration=1' and 'kernel_type=1'.
6174
6175           Example:
6176             [#1] image.jpg +blur 1 +deblur_goldmeinel[-1] 1
6177
6178         deblur_richardsonlucy:
6179             sigma>=0, nb_iter>=0, _kernel_type={ 0=deriche | 1=gaussian }.
6180
6181           Deblur selected images using Richardson-Lucy algorithm.
6182
6183           Default values: 'nb_iter=50' and 'kernel_type=1'.
6184
6185           Example:
6186             [#1] image.jpg +blur 1 +deblur_richardsonlucy[-1] 1
6187
6188         deconvolve_fft:
6189             [kernel],_regularization>=0
6190
6191           Deconvolve selected images by specified mask in the fourier space.
6192
6193           Default value: 'regularization>=0'.
6194
6195           Example:
6196             [#1]   image.jpg   +gaussian   5   +convolve_fft[0]  [1]  +decon‐
6197       volve_fft[-1] [1]
6198
6199         deinterlace:
6200             _method={ 0 | 1 }
6201
6202           Deinterlace selected images ('method' can be { 0=standard or  1=mo‐
6203       tion-compensated }).
6204
6205           Default value: 'method=0'.
6206
6207           Example:
6208             [#1]  image.jpg  +rotate  3,1,1,50%,50%  resize  100%,50%  resize
6209       100%,200%,1,3,4 shift[-1] 0,1 add +deinterlace 1
6210
6211         denoise (+):
6212             [guide],std_deviation_s[%]>=0,_std_devia‐
6213       tion_r[%]>=0,_patch_size>0,_lookup_size>0,_smoothness,_fast_approx={  0
6214       | 1 } |
6215             std_deviation_s[%]>=0,_std_devia‐
6216       tion_r[%]>=0,_patch_size>0,_lookup_size>0,_smoothness,_fast_approx={  0
6217       | 1 }
6218
6219           Denoise selected images by non-local patch averaging.
6220
6221           Default     values:      'std_deviation_p=10',      'patch_size=5',
6222       'lookup_size=6' and 'smoothness=1'.
6223
6224           Example:
6225             [#1] image.jpg +denoise 5,5,8
6226
6227         denoise_haar:
6228             _threshold>=0,_nb_scales>=0,_cycle_spinning>0
6229
6230           Denoise  selected images using haar-wavelet thresholding with cycle
6231       spinning.
6232           Set 'nb_scales==0' to automatically determine the optimal number of
6233       scales.
6234
6235           Default  values:  'threshold=1.4',  'nb_scale=0'  and  'cycle_spin‐
6236       ning=10'.
6237
6238           Example:
6239             [#1] image.jpg noise 20 cut 0,255 +denoise_haar[-1] 0.8
6240
6241         denoise_patchpca:
6242             _strength>=0,_patch_size>0,_lookup_size>0,_spatial_sampling>0
6243
6244           Denoise selected images using the patch-pca algorithm.
6245
6246           Default values: 'patch_size=7', 'lookup_size=11', 'details=1.8' and
6247       'spatial_sampling=5'.
6248
6249           Example:
6250             [#1] image.jpg +noise 20 cut[-1] 0,255 +denoise_patchpca[-1] ,
6251
6252         deriche (+):
6253             std_deviation>=0[%],order={  0  |  1  |  2 },axis={ x | y | z | c
6254       },_boundary_conditions
6255
6256           Apply Deriche recursive filter on selected images, along  specified
6257       axis and with
6258           specified standard deviation, order and boundary conditions.
6259           'boundary_conditions' can be { 0=dirichlet | 1=neumann }.
6260
6261           Default value: 'boundary_conditions=1'.
6262
6263           Example:
6264             [#1] image.jpg deriche 3,1,x
6265             [#2] image.jpg +deriche 30,0,x deriche[-2] 30,0,y add
6266
6267           Tutorial: https://gmic.eu/oldtutorial/_deriche
6268
6269         dilate (+):
6270             size>=0 |
6271             size_x>=0,size_y>=0,size_z>=0 |
6272             [kernel],_boundary_conditions,_is_real={  0=binary-mode | 1=real-
6273       mode }
6274
6275           Dilate selected images by a rectangular or the specified  structur‐
6276       ing element.
6277           'boundary_conditions' can be { 0=dirichlet | 1=neumann }.
6278
6279           Default    values:    'size_z=1',    'boundary_conditions=1'    and
6280       'is_real=0'.
6281
6282           Example:
6283             [#1] image.jpg +dilate 10
6284
6285         dilate_circ:
6286             _size>=0,_boundary_conditions,_is_normalized={ 0 | 1 }
6287
6288           Apply circular dilation of selected images by specified size.
6289
6290           Default values: 'boundary_conditions=1' and 'is_normalized=0'.
6291
6292           Example:
6293             [#1] image.jpg +dilate_circ 7
6294
6295         dilate_oct:
6296             _size>=0,_boundary_conditions,_is_normalized={ 0 | 1 }
6297
6298           Apply octagonal dilation of selected images by specified size.
6299
6300           Default values: 'boundary_conditions=1' and 'is_normalized=0'.
6301
6302           Example:
6303             [#1] image.jpg +dilate_oct 7
6304
6305         dilate_threshold:
6306             size_x>=1,size_y>=1,size_z>=1,_threshold>=0,_boundary_conditions
6307
6308           Dilate selected images in the (X,Y,Z,I) space.
6309           'boundary_conditions' can be { 0=dirichlet | 1=neumann }.
6310
6311           Default values: 'size_y=size_x',  'size_z=1',  'threshold=255'  and
6312       'boundary_conditions=1'.
6313
6314         divergence:
6315
6316           Compute divergence of selected vector fields.
6317
6318           Example:
6319             [#1] image.jpg luminance +gradient append[-2,-1] c divergence[-1]
6320
6321         dog:
6322             _sigma1>=0[%],_sigma2>=0[%]
6323
6324           Compute difference of gaussian on selected images.
6325
6326           Default values: 'sigma1=2%' and 'sigma2=3%'.
6327
6328           Example:
6329             [#1] image.jpg dog 2,3
6330
6331         diffusiontensors:
6332             _sharpness>=0,0<=_anisotropy<=1,_alpha[%],_sigma[%],is_sqrt={ 0 |
6333       1 }
6334
6335           Compute the diffusion tensors of selected images for  edge-preserv‐
6336       ing smoothing algorithms.
6337
6338           Default  values:  'sharpness=0.7',  'anisotropy=0.3',  'alpha=0.6',
6339       'sigma=1.1' and 'is_sqrt=0'.
6340
6341           Example:
6342             [#1] image.jpg diffusiontensors 0.8 abs pow 0.2
6343
6344           Tutorial: https://gmic.eu/oldtutorial/_diffusiontensors
6345
6346         edges:
6347             _threshold[%]>=0
6348
6349           Estimate contours of selected images.
6350
6351           Default value: 'edges=15%'
6352
6353           Example:
6354             [#1] image.jpg +edges 15%
6355
6356         erode (+):
6357             size>=0 |
6358             size_x>=0,size_y>=0,_size_z>=0 |
6359             [kernel],_boundary_conditions,_is_real={ 0=binary-mode |  1=real-
6360       mode }
6361
6362           Erode selected images by a rectangular or the specified structuring
6363       element.
6364           'boundary_conditions' can be { 0=dirichlet | 1=neumann }.
6365
6366           Default    values:    'size_z=1',    'boundary_conditions=1'    and
6367       'is_real=0'.
6368
6369           Example:
6370             [#1] image.jpg +erode 10
6371
6372         erode_circ:
6373             _size>=0,_boundary_conditions,_is_normalized={ 0 | 1 }
6374
6375           Apply circular erosion of selected images by specified size.
6376
6377           Default values: 'boundary_conditions=1' and 'is_normalized=0'.
6378
6379           Example:
6380             [#1] image.jpg +erode_circ 7
6381
6382         erode_oct:
6383             _size>=0,_boundary_conditions,_is_normalized={ 0 | 1 }
6384
6385           Apply octagonal erosion of selected images by specified size.
6386
6387           Default values: 'boundary_conditions=1' and 'is_normalized=0'.
6388
6389           Example:
6390             [#1] image.jpg +erode_oct 7
6391
6392         erode_threshold:
6393             size_x>=1,size_y>=1,size_z>=1,_threshold>=0,_boundary_conditions
6394
6395           Erode selected images in the (X,Y,Z,I) space.
6396           'boundary_conditions' can be { 0=dirichlet | 1=neumann }.
6397
6398           Default  values:  'size_y=size_x',  'size_z=1', 'threshold=255' and
6399       'boundary_conditions=1'.
6400
6401         fft (+):
6402             _{ x | y | z }...{ x | y | z }
6403
6404           Compute the direct fourier transform (real and imaginary parts)  of
6405       selected images,
6406           optionally along the specified axes only.
6407           See also: ifft.
6408
6409           Example:
6410             [#1]  image.jpg  luminance  +fft append[-2,-1] c norm[-1] log[-1]
6411       shift[-1] 50%,50%,0,0,2
6412             [#2]   image.jpg   w2={int(w/2)}    h2={int(h/2)}    fft    shift
6413       $w2,$h2,0,0,2  ellipse  $w2,$h2,30,30,0,1,0  shift -$w2,-$h2,0,0,2 ifft
6414       remove[-1]
6415
6416           Tutorial: https://gmic.eu/oldtutorial/_fft
6417
6418         g (+):
6419             Shortcut for command 'gradient'.
6420
6421         gradient (+):
6422             { x | y | z }...{ x | y | z },_scheme |
6423             (no arg)
6424
6425           Compute the gradient components (first derivatives) of selected im‐
6426       ages.
6427           (equivalent to shortcut command 'g').
6428
6429           'scheme'  can be { -1=backward | 0=centered | 1=forward | 2=sobel |
6430       3=rotation-invariant (default) | 4=deriche | 5=vanvliet }.
6431           (no arg) compute all significant components.
6432
6433           Default value: 'scheme=0'.
6434
6435           Example:
6436             [#1] image.jpg gradient
6437
6438           Tutorial: https://gmic.eu/oldtutorial/_gradient
6439
6440         gradient_norm:
6441
6442           Compute gradient norm of selected images.
6443
6444           Example:
6445             [#1] image.jpg gradient_norm equalize
6446
6447           Tutorial: https://gmic.eu/oldtutorial/_gradient_norm
6448
6449         gradient_orientation:
6450             _dimension={1,2,3}
6451
6452           Compute N-d gradient orientation of selected images.
6453
6454           Default value: 'dimension=3'.
6455
6456           Example:
6457             [#1] image.jpg +gradient_orientation 2
6458
6459         guided (+):
6460             [guide],radius[%]>=0,regularization[%]>=0 |
6461             radius[%]>=0,regularization[%]>=0
6462
6463           Blur selected images by guided image filtering.
6464           If a guide image is provided, it is used  to  drive  the  smoothing
6465       process.
6466           A guide image must be of the same xyz-size as the selected images.
6467           This command implements the filtering algorithm described in:
6468           He, Kaiming; Sun, Jian; Tang, Xiaoou, "Guided Image Filtering",
6469           IEEE  Transactions  on  Pattern  Analysis and Machine Intelligence,
6470       vol.35, no.6, pp.1397,1409, June 2013
6471
6472           Example:
6473             [#1] image.jpg +guided 5,400
6474
6475         haar:
6476             scale>0
6477
6478           Compute the direct haar multiscale wavelet  transform  of  selected
6479       images.
6480           See also: ihaar.
6481
6482           Tutorial: https://gmic.eu/oldtutorial/_haar
6483
6484         heat_flow:
6485             _nb_iter>=0,_dt,_keep_sequence={ 0 | 1 }
6486
6487           Apply iterations of the heat flow on selected images.
6488
6489           Default values: 'nb_iter=10', 'dt=30' and 'keep_sequence=0'.
6490
6491           Example:
6492             [#1] image.jpg +heat_flow 20
6493
6494         hessian (+):
6495             { xx | xy | xz | yy | yz | zz }...{ xx | xy | xz | yy | yz | zz }
6496       |
6497             (no arg)
6498
6499           Compute the hessian components (second derivatives) of selected im‐
6500       ages.
6501           (no arg) compute all significant components.
6502
6503           Example:
6504             [#1] image.jpg hessian
6505
6506         idct:
6507             _{ x | y | z }...{ x | y | z } |
6508             (no arg)
6509
6510           Compute  the  inverse discrete cosine transform of selected images,
6511       optionally along the specified axes only.
6512           Output images are always evenly sized, so this command  may  change
6513       the size of the selected images.
6514           (dct  images  obtained with the 'dct' command are evenly sized any‐
6515       way).
6516
6517           Default values: (no arg)
6518           See also: dct.
6519
6520           Tutorial: https://gmic.eu/oldtutorial/_dct-and-idct
6521
6522         iee:
6523
6524           Compute gradient-orthogonal-directed 2nd derivative of image(s).
6525
6526           Example:
6527             [#1] image.jpg iee
6528
6529         ifft (+):
6530             _{ x | y | z }...{ x | y | z }
6531
6532           Compute the inverse fourier transform (real and imaginary parts) of
6533       selected images.
6534           optionally along the specified axes only.
6535           See also: fft.
6536
6537           Tutorial: https://gmic.eu/oldtutorial/_fft
6538
6539         ihaar:
6540             scale>0
6541
6542           Compute  the  inverse haar multiscale wavelet transform of selected
6543       images.
6544           See also: haar.
6545
6546           Tutorial: https://gmic.eu/oldtutorial/_haar
6547
6548         ilaplacian:
6549             { nb_iterations>0 | 0 },_[initial_estimate]
6550
6551           Invert selected Laplacian images.
6552           If given 'nb_iterations' is '0', inversion is done in Fourier space
6553       (single iteration),
6554           otherwise, by applying 'nb_iterations' of a Laplacian-inversion PDE
6555       flow.
6556           Note that the resulting inversions are just  estimation  of  possi‐
6557       ble/approximated solutions.
6558
6559           Default  values:  'nb_iterations=0' and '[initial_estimated]=(unde‐
6560       fined)'.
6561
6562           Example:
6563             [#1] image.jpg +laplacian +ilaplacian[-1] 0
6564
6565         inn:
6566
6567           Compute gradient-directed 2nd derivative of image(s).
6568
6569           Example:
6570             [#1] image.jpg inn
6571
6572         inpaint (+):
6573             [mask] |
6574             [mask],0,_fast_method |
6575             [mask],_patch_size>=1,_lookup_size>=1,_lookup_fac‐
6576       tor>=0,_lookup_increment!=0,_blend_size>=0,0<=_blend_thresh‐
6577       old<=1,_blend_decay>=0,_blend_scales>=1,_is_blend_outer={ 0 | 1 }
6578
6579           Inpaint selected images by specified mask.
6580           If no patch size (or 0) is specified, inpainting is  done  using  a
6581       fast average or median algorithm.
6582           Otherwise, it used a patch-based reconstruction method, that can be
6583       very time consuming.
6584           'fast_method' can be { 0=low-connectivity average |  1=high-connec‐
6585       tivity average | 2=low-connectivity median | 3=high-connectivity median
6586       }.
6587
6588           Default values: 'patch_size=0', 'fast_method=1',  'lookup_size=22',
6589       'lookup_factor=0.5',        'lookup_increment=1',       'blend_size=0',
6590       'blend_threshold=0',
6591            'blend_decay=0.05', 'blend_scales=10' and 'is_blend_outer=1'.
6592
6593           Example:
6594             [#1] image.jpg 100%,100%  ellipse  50%,50%,30,30,0,1,255  ellipse
6595       20%,20%,30,10,0,1,255 +inpaint[-2] [-1] remove[-2]
6596             [#2]  image.jpg  100%,100%  circle  30%,30%,30,1,255,0,255 circle
6597       70%,70%,50,1,255,0,255 +inpaint[0] [1],5,15,0.5,1,9,0 remove[1]
6598
6599         inpaint_pde:
6600             [mask],_nb_scales[%]>=0,_diffusion_type={ 0=isotropic |  1=delau‐
6601       nay-guided | 2=edge-guided | 3=mask-guided },_diffusion_iter>=0
6602
6603           Inpaint selected images by specified mask using a multiscale trans‐
6604       port-diffusion algorithm.
6605           If 'diffusion type==3', non-zero values of the mask  (e.g.  a  dis‐
6606       tance function) are used
6607           to guide the diffusion process.
6608
6609           Default  values:  'nb_scales=75%',  'diffusion_type=1'  and 'diffu‐
6610       sion_iter=20'.
6611
6612           Example:
6613             [#1] image.jpg 100%,100% ellipse[-1]  30%,30%,40,30,0,1,255  +in‐
6614       paint_pde[0] [1]
6615
6616         inpaint_flow:
6617             [mask],_nb_global_iter>=0,_nb_local_iter>=0,_dt>0,_al‐
6618       pha>=0,_sigma>=0
6619
6620           Apply iteration of the inpainting flow on selected images.
6621
6622           Default values: 'nb_global_iter=10',  'nb_local_iter=100',  'dt=5',
6623       'alpha=1' and 'sigma=3'.
6624
6625           Example:
6626             [#1]  image.jpg  100%,100%  ellipse[-1] 30%,30%,40,30,0,1,255 in‐
6627       paint_flow[0] [1]
6628
6629         inpaint_holes:
6630             maximal_area[%]>=0,_tolerance>=0,_is_high_connectivity={ 0 | 1 }
6631
6632           Inpaint all connected regions having an area  less  than  specified
6633       value.
6634
6635           Default  values:  'maximal_area=4', 'tolerance=0' and 'is_high_con‐
6636       nectivity=0'.
6637
6638           Example:
6639             [#1] image.jpg noise 5%,2 +inpaint_holes 8,40
6640
6641         inpaint_morpho:
6642             [mask]
6643
6644           Inpaint selected images by specified mask using morphological oper‐
6645       ators.
6646
6647           Example:
6648             [#1]  image.jpg  100%,100% ellipse[-1] 30%,30%,40,30,0,1,255 +in‐
6649       paint_morpho[0] [1]
6650
6651         inpaint_matchpatch:
6652             [mask],_nb_scales={  0=auto   |   >0   },_patch_size>0,_nb_itera‐
6653       tions_per_scale>0,_blend_size>=0,_allow_outer_blending={    0    |    1
6654       },_is_already_initialized={ 0 | 1 }
6655
6656           Inpaint selected images by specified binary mask,  using  a  multi-
6657       scale matchpatch algorithm.
6658
6659           Default    values:    'nb_scales=0',   'patch_size=9',   'nb_itera‐
6660       tions_per_scale=10',    'blend_size=5','allow_outer_blending=1'     and
6661       'is_already_initialized=0'.
6662
6663           Example:
6664             [#1]  image.jpg  100%,100% ellipse[-1] 30%,30%,40,30,0,1,255 +in‐
6665       paint_matchpatch[0] [1]
6666
6667         kuwahara:
6668             size>0
6669
6670           Apply Kuwahara filter of specified size on selected images.
6671
6672           Example:
6673             [#1] image.jpg kuwahara 9
6674
6675         laplacian:
6676
6677           Compute Laplacian of selected images.
6678
6679           Example:
6680             [#1] image.jpg laplacian
6681
6682         lic:
6683             _amplitude>0,_channels>0
6684
6685           Render LIC representation of selected vector fields.
6686
6687           Default values: 'amplitude=30' and 'channels=1'.
6688
6689           Example:
6690             [#1]  400,400,1,2,'if(c==0,x-w/2,y-h/2)'  +lic  200,3  quiver[-2]
6691       [-2],10,1,1,1,255
6692
6693         map_tones:
6694             _threshold>=0,_gamma>=0,_smoothness>=0,nb_iter>=0
6695
6696           Apply  tone  mapping  operator on selected images, based on Poisson
6697       equation.
6698
6699           Default values: 'threshold=0.1', 'gamma=0.8', 'smoothness=0.5'  and
6700       'nb_iter=30'.
6701
6702           Example:
6703             [#1] image.jpg +map_tones ,
6704
6705         map_tones_fast:
6706             _radius[%]>=0,_power>=0
6707
6708           Apply fast tone mapping operator on selected images.
6709
6710           Default values: 'radius=3%' and 'power=0.3'.
6711
6712           Example:
6713             [#1] image.jpg +map_tones_fast ,
6714
6715         meancurvature_flow:
6716             _nb_iter>=0,_dt,_keep_sequence={ 0 | 1 }
6717
6718           Apply iterations of the mean curvature flow on selected images.
6719
6720           Default values: 'nb_iter=10', 'dt=30' and 'keep_sequence=0'.
6721
6722           Example:
6723             [#1] image.jpg +meancurvature_flow 20
6724
6725         median (+):
6726             size>=0,_threshold>0
6727
6728           Apply  (opt.  thresholded)  median  filter  on selected images with
6729       structuring element size x size.
6730
6731           Example:
6732             [#1] image.jpg +median 5
6733
6734         nlmeans:
6735             [guide],_patch_radius>0,_spatial_bandwidth>0,_tonal_band‐
6736       width>0,_patch_measure_command |
6737             _patch_radius>0,_spatial_bandwidth>0,_tonal_band‐
6738       width>0,_patch_measure_command
6739
6740           Apply non local means denoising of Buades et al, 2005. on  selected
6741       images.
6742           The patch is a gaussian function of 'std_patch_radius'.
6743           The spatial kernel is a rectangle of radius 'spatial_bandwidth'.
6744           The tonal kernel is exponential ('exp(-d^2/_tonal_bandwidth^2)')
6745           with 'd' the euclidean distance between image patches.
6746
6747           Default     values:     'patch_radius=4',    'spatial_bandwidth=4',
6748       'tonal_bandwidth=10' and 'patch_measure_command=-norm'.
6749
6750           Example:
6751             [#1] image.jpg +noise 10 nlmeans[-1] 4,4,{0.6*${-std_noise}}
6752
6753         nlmeans_core:
6754             _reference_image,_scaling_map,_patch_radius>0,_spatial_band‐
6755       width>0
6756
6757           Apply  non local means denoising using a image for weight and a map
6758       for scaling
6759
6760         normalize_local:
6761             _amplitude>=0,_radius>0,_n_smooth>=0[%],_a_smooth>=0[%],_is_cut={
6762       0 | 1 },_min=0,_max=255
6763
6764           Normalize selected images locally.
6765
6766           Default    values:   'amplitude=3',   'radius=16',   'n_smooth=4%',
6767       'a_smooth=2%', 'is_cut=1', 'min=0' and 'max=255'.
6768
6769           Example:
6770             [#1] image.jpg normalize_local 8,10
6771
6772         normalized_cross_correlation:
6773             [mask]
6774
6775           Compute normalized cross-correlation of selected images with speci‐
6776       fied mask.
6777
6778           Example:
6779             [#1]  image.jpg  +shift  -30,-20 +normalized_cross_correlation[0]
6780       [1]
6781
6782         percentile:
6783             [mask],0<=_min_percentile[%]<=100,0<=_max_percentile[%]<=100.
6784
6785           Apply percentile averaging filter to selected images.
6786
6787           Default values: 'min_percentile=0' and 'max_percentile=100'.
6788
6789           Example:
6790             [#1] image.jpg shape_circle 11,11 +percentile[0] [1],25,75
6791
6792         peronamalik_flow:
6793             K_factor>0,_nb_iter>=0,_dt,_keep_sequence={ 0 | 1 }
6794
6795           Apply iterations of the Perona-Malik flow on selected images.
6796
6797           Default values: 'K_factor=20', 'nb_iter=5',  'dt=5'  and  'keep_se‐
6798       quence=0'.
6799
6800           Example:
6801             [#1] image.jpg +heat_flow 20
6802
6803         phase_correlation:
6804             [destination]
6805
6806           Estimate  translation  vector  between  selected  source images and
6807       specified destination.
6808
6809           Example:
6810             [#1]  image.jpg  +shift  -30,-20  +phase_correlation[0]  [1]  un‐
6811       roll[-1] y
6812
6813         pde_flow:
6814             _nb_iter>=0,_dt,_velocity_command,_keep_sequence={ 0 | 1 }
6815
6816           Apply iterations of a generic PDE flow on selected images.
6817
6818           Default values: 'nb_iter=10', 'dt=30', 'velocity_command=laplacian'
6819       and 'keep_sequence=0'.
6820
6821           Example:
6822             [#1] image.jpg +pde_flow 20
6823
6824         periodize_poisson:
6825
6826           Periodize selected images using a Poisson solver in Fourier space.
6827
6828           Example:
6829             [#1] image.jpg +periodize_poisson array 2,2,2
6830
6831         rbf:
6832             dx,_x0,_x1,_phi(r) |
6833             dx,dy,_x0,_y0,_x1,_y1,_phi(r) |
6834             dx,dy,dz,x0,y0,z0,x1,y1,z1,phi(r)
6835
6836           Reconstruct 1D/2D or 3D image from selected sets of  keypoints,  by
6837       RBF-interpolation.
6838           A  set  of keypoints is represented by a vector-valued image, where
6839       each pixel represents a single keypoint.
6840           Vector components of a keypoint have the following meaning:
6841              -  For 1D reconstruction: [ x_k, f1(k),...fN(k) ].
6842              -  For 2D reconstruction: [ x_k,y_k, f1(k),...,fN(k) ].
6843              -  For 3D reconstruction: [ x_k,y_k,z_k, f1(k),...,fN(k) ].
6844           Values 'x_k','y_k' and 'z_k' are the spatial  coordinates  of  key‐
6845       point 'k'.
6846           Values  'f1(k),..,fN(k)' are the 'N' components of the vector value
6847       of keypoint 'k'.
6848           The   command   reconstructs   an   image   with   specified   size
6849       'dx'x'dy'x'dz', with 'N' channels.
6850
6851           Default  values:  'x0=y0=z0=0',  'x1=dx-1',  'y1=dy-1',  'z1=dz-1',
6852       'phi(r)=r^2*log(1e-5+r)'.
6853
6854           Example:
6855             [#1]  sp  colorful  r2dx  400  100%,100%  noise_poissondisk.   10
6856       1,{is},1,5  eval[-2]  "begin(p=0);i?(I[#-1,p++]=[x,y,I(#0)])" to_rgb[1]
6857       mul[0,1] dilate_circ[0] 5 +rbf[-1] {0,[w,h]} c[-1] 0,255
6858             [#2] 32,1,1,5,u([400,400,255,255,255]) rbf 400,400 c 0,255
6859
6860         red_eye:
6861             0<=_threshold<=100,_smoothness>=0,0<=attenuation<=1
6862
6863           Attenuate red-eye effect in selected images.
6864
6865           Default  values:  'threshold=75',  'smoothness=3.5'  and  'attenua‐
6866       tion=0.1'.
6867
6868           Example:
6869             [#1] image.jpg +red_eye ,
6870
6871         remove_hotpixels:
6872             _mask_size>0, _threshold[%]>0
6873
6874           Remove hot pixels in selected images.
6875
6876           Default values: 'mask_size=3' and 'threshold=10%'.
6877
6878           Example:
6879             [#1] image.jpg noise 10,2 +remove_hotpixels ,
6880
6881         remove_pixels:
6882             number_of_pixels[%]>=0
6883
6884           Remove specified number of pixels (i.e. set them to 0) from the set
6885       of non-zero pixels in selected images.
6886
6887           Example:
6888             [#1] image.jpg +remove_pixels 50%
6889
6890         rolling_guidance:
6891             std_deviation_s[%]>=0,std_deviation_r[%]>=0,_precision>=0
6892
6893           Apply the rolling guidance filter on selected image.
6894           Rolling guidance filter is a fast  image  abstraction  filter,  de‐
6895       scribed in:
6896           "Rolling  Guidance  Filter",  Qi  Zhang Xiaoyong, Shen Li, Xu Jiaya
6897       Jia, ECCV'2014.
6898
6899           Default values: 'std_deviation_s=4', 'std_deviation_r=10' and 'pre‐
6900       cision=0.5'.
6901
6902           Example:
6903             [#1] image.jpg +rolling_guidance , +-
6904
6905         sharpen (+):
6906             amplitude>=0 |
6907             amplitude>=0,edge>=0,_alpha,_sigma
6908
6909           Sharpen selected images by inverse diffusion or shock filters meth‐
6910       ods.
6911           'edge' must be specified to enable shock-filter method.
6912
6913           Default values: 'alpha=0' and 'sigma=0'.
6914
6915           Example:
6916             [#1] image.jpg sharpen 300
6917             [#2] image.jpg blur 5 sharpen 300,1
6918
6919         smooth (+):
6920             amplitude[%]>=0,_sharpness>=0,0<=_anisotropy<=1,_al‐
6921       pha[%],_sigma[%],_dl>0,_da>0,_precision>0,_interpolation,_fast_approx={
6922       0 | 1 } |
6923             nb_iterations>=0,_sharpness>=0,_anisotropy,_alpha,_sigma,_dt>0,0
6924       |
6925             [tensor_field],_amplitude>=0,_dl>0,_da>0,_precision>0,_interpola‐
6926       tion,_fast_approx={ 0 | 1 } |
6927             [tensor_field],_nb_iters>=0,_dt>0,0
6928
6929           Smooth selected images anisotropically using diffusion PDE's,  with
6930       specified field of
6931           diffusion tensors.
6932           'interpolation' can be { 0=nearest | 1=linear | 2=runge-kutta }.
6933
6934           Default  values:  'sharpness=0.7',  'anisotropy=0.3',  'alpha=0.6',
6935       'sigma=1.1', 'dl=0.8', 'da=30', 'precision=2', 'interpolation=0' and
6936            'fast_approx=1'.
6937
6938           Example:
6939             [#1] image.jpg repeat 3 smooth 40,0,1,1,2 done
6940             [#2]  image.jpg  100%,100%,1,2   rand[-1]   -100,100   repeat   2
6941       smooth[-1] 100,0.2,1,4,4 done warp[0] [-1],1,1
6942
6943           Tutorial: https://gmic.eu/oldtutorial/_smooth
6944
6945         split_freq:
6946             smoothness>0[%]
6947
6948           Split selected images into low and high frequency parts.
6949
6950           Example:
6951             [#1] image.jpg split_freq 2%
6952
6953         solve_poisson:
6954             "laplacian_command",_nb_iterations>=0,_time_step>0,_nb_scales>=0
6955
6956           Solve  Poisson equation so that applying 'laplacian[n]' is close to
6957       the result of 'laplacian_command[n]'.
6958           Solving is performed using a  multi-scale  gradient  descent  algo‐
6959       rithm.
6960           If 'nb_scales=0', the number of scales is automatically determined.
6961
6962           Default values: 'nb_iterations=60', 'dt=5' and 'nb_scales=0'.
6963
6964           Example:
6965             [#1]  image.jpg  command  "foo  :  gradient x" +solve_poisson foo
6966       +foo[0] +laplacian[1]
6967
6968         split_details:
6969             _nb_scales>0,_base_scale[%]>=0,_detail_scale[%]>=0
6970
6971           Split selected images into 'nb_scales' detail scales.
6972           If 'base_scale''detail_scale'0, the  image  decomposition  is  done
6973       with 'a trous' wavelets.
6974           Otherwise,  it  uses laplacian pyramids with linear standard devia‐
6975       tions.
6976
6977           Default values: 'nb_scales=4', 'base_scale=0' and 'detail_scale=0'.
6978
6979           Example:
6980             [#1] image.jpg split_details ,
6981
6982         structuretensors (+):
6983             _scheme={ 0=centered | 1=forward/backward }
6984
6985           Compute the structure tensor field of selected images.
6986
6987           Default value: 'scheme=1'.
6988
6989           Example:
6990             [#1] image.jpg structuretensors abs pow 0.2
6991
6992           Tutorial: https://gmic.eu/oldtutorial/_structuretensors
6993
6994         solidify:
6995             _smoothness[%]>=0,_diffusion_type={ 0=isotropic | 1=delaunay-ori‐
6996       ented | 2=edge-oriented },_diffusion_iter>=0
6997
6998           Solidify selected transparent images.
6999
7000           Default  values:  'smoothness=75%',  'diffusion_type=1' and 'diffu‐
7001       sion_iter=20'.
7002
7003           Example:
7004             [#1] image.jpg 100%,100% circle[-1]  50%,50%,25%,1,255  append  c
7005       +solidify , display_rgba
7006
7007         syntexturize:
7008             _width[%]>0,_height[%]>0
7009
7010           Resynthetize  'width'x'height'  versions of selected micro-textures
7011       by phase randomization.
7012           The texture synthesis algorithm is a straightforward implementation
7013       of the method described in :
7014           http://www.ipol.im/pub/art/2011/ggm_rpn/.
7015
7016           Default values: 'width=height=100%'.
7017
7018           Example:
7019             [#1] image.jpg crop 2,282,50,328 +syntexturize 320,320
7020
7021         syntexturize_matchpatch:
7022             _width[%]>0,_height[%]>0,_nb_scales>=0,_patch_size>0,_blend‐
7023       ing_size>=0,_precision>=0
7024
7025           Resynthetize 'width'x'height' versions of  selected  micro-textures
7026       using a patch-matching algorithm.
7027           If  'nbscales==0',  the number of scales used is estimated from the
7028       image size.
7029
7030           Default values: 'width=height=100%', 'nb_scales=0', 'patch_size=7',
7031       'blending_size=5' and 'precision=1'.
7032
7033           Example:
7034             [#1]   image.jpg   crop  25%,25%,75%,75%  syntexturize_matchpatch
7035       512,512
7036
7037         tv_flow:
7038             _nb_iter>=0,_dt,_keep_sequence={ 0 | 1 }
7039
7040           Apply iterations of the total variation flow on selected images.
7041
7042           Default values: 'nb_iter=10', 'dt=30' and 'keep_sequence=0'.
7043
7044           Example:
7045             [#1] image.jpg +tv_flow 40
7046
7047         unsharp:
7048             radius[%]>=0,_amount>=0,_threshold[%]>=0
7049
7050           Apply unsharp mask on selected images.
7051
7052           Default values: 'amount=2' and 'threshold=0'.
7053
7054           Example:
7055             [#1] image.jpg blur 3 +unsharp 1.5,15 cut 0,255
7056
7057         unsharp_octave:
7058             _nb_scales>0,_radius[%]>=0,_amount>=0,threshold[%]>=0
7059
7060           Apply octave sharpening on selected images.
7061
7062           Default values: 'nb_scales=4', 'radius=1', 'amount=2' and  'thresh‐
7063       old=0'.
7064
7065           Example:
7066             [#1] image.jpg blur 3 +unsharp_octave 4,5,15 cut 0,255
7067
7068         vanvliet (+):
7069             std_deviation>=0[%],order={  0 | 1 | 2 | 3 },axis={ x | y | z | c
7070       },_boundary_conditions
7071
7072           Apply Vanvliet recursive filter on selected images, along specified
7073       axis and with
7074           specified standard deviation, order and boundary conditions.
7075           'boundary_conditions' can be { 0=dirichlet | 1=neumann }.
7076
7077           Default value: 'boundary_conditions=1'.
7078
7079           Example:
7080             [#1] image.jpg +vanvliet 3,1,x
7081             [#2] image.jpg +vanvliet 30,0,x vanvliet[-2] 30,0,y add
7082
7083         voronoi:
7084
7085           Compute the discrete Voronoi diagram of non-zero pixels in selected
7086       images.
7087
7088           Example:
7089             [#1] 400,400 noise 0.2,2 eq 1  +label_fg  0  voronoi[-1]  +gradi‐
7090       ent[-1]  xy,1  append[-2,-1] c norm[-1] ==[-1] 0 map[-2] 2,2 mul[-2,-1]
7091       normalize[-2] 0,255 dilate_circ[-2] 4 reverse max
7092
7093         watermark_fourier:
7094             text,_size>0
7095
7096           Add a textual watermark in the frequency domain of selected images.
7097
7098           Default value: 'size=33'.
7099
7100           Example:
7101             [#1] image.jpg +watermark_fourier "Watermarked!" +display_fft re‐
7102       move[-3,-1] normalize 0,255 append[-4,-2] y append[-2,-1] y
7103
7104         watershed (+):
7105             [priority_image],_is_high_connectivity={ 0 | 1 }
7106
7107           Compute the watershed transform of selected images.
7108
7109           Default value: 'is_high_connectivity=1'.
7110
7111           Example:
7112             [#1]  400,400  noise  0.2,2 eq 1 +distance 1 mul[-1] -1 label[-2]
7113       watershed[-2] [-1] mod[-2] 256 map[-2] 0 reverse
7114
7115         12.9. Features Extraction
7116               -------------------
7117
7118         area:
7119             tolerance>=0,is_high_connectivity={ 0 | 1 }
7120
7121           Compute area of connected components in selected images.
7122
7123           Default values: 'is_high_connectivity=0'.
7124
7125           Example:
7126             [#1] image.jpg luminance stencil[-1] 1 +area 0
7127
7128           Tutorial: https://gmic.eu/oldtutorial/_area
7129
7130         area_fg:
7131             tolerance>=0,is_high_connectivity={ 0 | 1 }
7132
7133           Compute area of connected components for  non-zero  values  in  se‐
7134       lected images.
7135           Similar to 'area' except that 0-valued pixels are not considered.
7136
7137           Default values: 'is_high_connectivity=0'.
7138
7139           Example:
7140             [#1] image.jpg luminance stencil[-1] 1 +area_fg 0
7141
7142         at_line:
7143             x0[%],y0[%],z0[%],x1[%],y1[%],z1[%]
7144
7145           Retrieve  pixels  of the selected images belonging to the specified
7146       line (x0,y0,z0)-(x1,y1,z1).
7147
7148           Example:
7149             [#1]     image.jpg     +at_line     0,0,0,100%,100%,0     line[0]
7150       0,0,100%,100%,1,0xFF00FF00,255,0,0
7151
7152         at_quadrangle:
7153             x0[%],y0[%],x1[%],y1[%],x2[%],y2[%],x3[%],y3[%],_interpola‐
7154       tion,_boundary_conditions |
7155             x0[%],y0[%],z0[%],x1[%],y1[%],z1[%],x2[%],y2[%],z2[%],x3[%],y3[%],z3[%],_in‐
7156       terpolation,_boundary_conditions
7157
7158           Retrieve  pixels  of the selected images belonging to the specified
7159       2D or 3D quadrangle.
7160           'interpolation' can be { 0=nearest-neighbor | 1=linear | 2=cubic }.
7161           'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
7162       | 3=mirror }.
7163
7164           Example:
7165             [#1] image.jpg params=5%,5%,95%,5%,60%,95%,40%,95% +at_quadrangle
7166       $params polygon.. 4,$params,0.5,255
7167
7168         barycenter:
7169
7170           Compute the barycenter vector of pixel values.
7171
7172           Example:
7173             [#1] 256,256 ellipse 50%,50%,20%,20%,0,1,1 deform 20  +barycenter
7174       +ellipse[-2] {@0,1},5,5,0,10
7175
7176         delaunay:
7177
7178           Generate  discrete  2D Delaunay triangulation of non-zero pixels in
7179       selected images.
7180           Input images must be scalar.
7181           Each pixel of the output image is a  triplet  (a,b,c)  meaning  the
7182       pixel belongs to
7183           the Delaunay triangle 'ABC' where 'a','b','c' are the labels of the
7184       pixels 'A','B','C'.
7185
7186           Example:
7187             [#1] 400,400 rand 32,255 100%,100% noise. 0.4,2 eq. 1 mul +delau‐
7188       nay
7189             [#2]  image.jpg  b  1% 100%,100% noise. 0.8,2 eq. 1 mul +delaunay
7190       channels 0,2
7191
7192         detect_skin:
7193             0<=tolerance<=1,_skin_x,_skin_y,_skin_radius>=0
7194
7195           Detect skin in selected color images  and  output  an  appartenance
7196       probability map.
7197           Detection is performed using CbCr chromaticity data of skin pixels.
7198           If  arguments  'skin_x',  'skin_y'  and 'skin_radius' are provided,
7199       skin pixels are learnt
7200           from   the   sample   pixels   inside   the   circle   located   at
7201       ('skin_x','skin_y') with radius 'skin_radius'.
7202
7203           Default value: 'tolerance=0.5' and 'skin_x=skiny=radius=-1'.
7204
7205         displacement (+):
7206             [source_image],_smoothness,_precision>=0,_nb_scales>=0,_itera‐
7207       tion_max>=0,is_backward={ 0 | 1 },_[guide]
7208
7209           Estimate displacement field between specified source  and  selected
7210       target images.
7211           If  'smoothness>=0',  regularization type is set to isotropic, else
7212       to anisotropic.
7213           If 'nbscales==0', the number of scales used is estimated  from  the
7214       image size.
7215
7216           Default  values:  'smoothness=0.1',  'precision=5',  'nb_scales=0',
7217       'iteration_max=10000', 'is_backward=1' and '[guide]=(unused)'.
7218
7219           Example:
7220             [#1]  image.jpg  +rotate  3,1,0,50%,50%  +displacement[-1]   [-2]
7221       quiver[-1] [-1],15,1,1,1,{1.5*iM}
7222
7223         distance (+):
7224             isovalue[%],_metric |
7225             isovalue[%],[metric],_method
7226
7227           Compute  the unsigned distance function to specified isovalue, opt.
7228       according to a custom metric.
7229           'metric' can  be  {  0=chebyshev  |  1=manhattan  |  2=euclidean  |
7230       3=squared-euclidean }.
7231           'method'  can  be { 0=fast-marching | 1=low-connectivity dijkstra |
7232       2=high-connectivity dijkstra | 3=1+return path | 4=2+return path }.
7233
7234           Default value: 'metric=2' and 'method=0'.
7235
7236           Example:
7237             [#1] image.jpg threshold 20% distance 0 pow 0.3
7238             [#2] 400,400 set 1,50%,50% +distance[0] 1,2 +distance[0] 1,1 dis‐
7239       tance[0] 1,0 mod 32 threshold 16 append c
7240
7241           Tutorial: https://gmic.eu/oldtutorial/_distance
7242
7243         fftpolar:
7244
7245           Compute  fourier  transform  of selected images, as centered magni‐
7246       tude/phase images.
7247
7248           Example:
7249             [#1] image.jpg fftpolar ellipse 50%,50%,10,10,0,1,0 ifftpolar
7250
7251         histogram (+):
7252             nb_levels>0[%],_min_value[%],_max_value[%]
7253
7254           Compute the histogram of selected images.
7255           If value range is set, the histogram is estimated only  for  pixels
7256       in the specified
7257           value  range. Argument 'max_value' must be specified if 'min_value'
7258       is set.
7259
7260           Default values: 'min_value=0%' and 'max_value=100%'.
7261
7262           Example:
7263             [#1] image.jpg +histogram 64 display_graph[-1] 400,300,3
7264
7265         histogram_nd:
7266             nb_levels>0[%],_value0[%],_value1[%]
7267
7268           Compute the 1D,2D or 3D histogram of selected multi-channels images
7269       (having 1,2 or 3 channels).
7270           If  value  range is set, the histogram is estimated only for pixels
7271       in the specified
7272           value range.
7273
7274           Default values: 'value0=0%' and 'value1=100%'.
7275
7276           Example:
7277             [#1] image.jpg channels 0,1 +histogram_nd 256
7278
7279         histogram_cumul:
7280             _nb_levels>0,_is_normalized={ 0 | 1 },_val0[%],_val1[%]
7281
7282           Compute cumulative histogram of selected images.
7283
7284           Default values: 'nb_levels=256', 'is_normalized=0',  'val0=0%'  and
7285       'val1=100%'.
7286
7287           Example:
7288             [#1]   image.jpg   +histogram_cumul  256  histogram[0]  256  dis‐
7289       play_graph 400,300,3
7290
7291         histogram_pointwise:
7292             nb_levels>0[%],_value0[%],_value1[%]
7293
7294           Compute the histogram of each vector-valued point of  selected  im‐
7295       ages.
7296           If  value  range is set, the histogram is estimated only for values
7297       in the specified
7298           value range.
7299
7300           Default values: 'value0=0%' and 'value1=100%'.
7301
7302         hough:
7303             _width>0,_height>0,gradient_norm_voting={ 0 | 1 }
7304
7305           Compute hough transform (theta,rho) of selected images.
7306
7307           Default values: 'width=512', 'height=width' and 'gradient_norm_vot‐
7308       ing=1'.
7309
7310           Example:
7311             [#1] image.jpg +blur 1.5 hough[-1] 400,400 blur[-1] 0.5 add[-1] 1
7312       log[-1]
7313
7314         ifftpolar:
7315
7316           Compute inverse fourier transform of selected images, from centered
7317       magnitude/phase images.
7318
7319         isophotes:
7320             _nb_levels>0
7321
7322           Render isophotes of selected images on a transparent background.
7323
7324           Default value: 'nb_levels=64'
7325
7326           Example:
7327             [#1] image.jpg blur 2 isophotes 6 dilate_circ 5 display_rgba
7328
7329         label (+):
7330             _tolerance>=0,is_high_connectivity={  0 | 1 },_is_L2_norm={ 0 | 1
7331       }
7332
7333           Label connected components in selected images.
7334
7335           Default   values:   'tolerance=0',   'is_high_connectivity=0'   and
7336       'is_L2_norm=1'.
7337
7338           Example:
7339             [#1]  image.jpg luminance threshold 60% label normalize 0,255 map
7340       0
7341             [#2] 400,400 set 1,50%,50% distance 1 mod 16  threshold  8  label
7342       mod 255 map 2
7343
7344           Tutorial: https://gmic.eu/oldtutorial/_label
7345
7346         label_fg:
7347             tolerance>=0,is_high_connectivity={ 0 | 1 }
7348
7349           Label  connected components for non-zero values (foreground) in se‐
7350       lected images.
7351           Similar to 'label' except that 0-valued pixels are not labeled.
7352
7353           Default value: 'is_high_connectivity=0'.
7354
7355         laar:
7356
7357           Extract the largest axis-aligned rectangle in non-zero areas of se‐
7358       lected images.
7359           Rectangle coordinates are returned in status, as a sequence of num‐
7360       bers x0,y0,x1,y1.
7361
7362           Example:
7363             [#1] shape_cupid 256 coords=${-laar} normalize 0,255 to_rgb  rec‐
7364       tangle $coords,0.5,0,128,0
7365
7366         max_patch:
7367             _patch_size>=1
7368
7369           Return  locations  of maximal values in local patch-based neighbor‐
7370       hood of given size for selected images.
7371
7372           Default value: 'patch_size=16'.
7373
7374           Example:
7375             [#1] image.jpg norm +max_patch 16
7376
7377         min_patch:
7378             _patch_size>=1
7379
7380           Return locations of minimal values in local  patch-based  neighbor‐
7381       hood of given size for selected images.
7382
7383           Default value: 'patch_size=16'.
7384
7385           Example:
7386             [#1] image.jpg norm +min_patch 16
7387
7388         minimal_path:
7389             x0[%]>=0,y0[%]>=0,z0[%]>=0,x1[%]>=0,y1[%]>=0,z1[%]>=0,_is_high_con‐
7390       nectivity={ 0 | 1 }
7391
7392           Compute minimal path between two points on selected potential maps.
7393
7394           Default value: 'is_high_connectivity=0'.
7395
7396           Example:
7397             [#1] image.jpg +gradient_norm fill[-1]  1/(1+i)  minimal_path[-1]
7398       0,0,0,100%,100%,0  pointcloud[-1]  0 *[-1] 280 to_rgb[-1] ri[-1] [-2],0
7399       or
7400
7401         mse:
7402
7403           Compute MSE (Mean-Squared Error) matrix between selected images.
7404
7405           Example:
7406             [#1] image.jpg +noise 30 +noise[0] 35 +noise[0] 38 cut. 0,255 mse
7407
7408         patches:
7409             patch_width>0,patch_height>0,patch_depth>0,x0,y0,z0,_x1,_y1,_z1,...,_xN,_yN,_zN
7410
7411           Extract N+1 patches from selected images, centered at specified lo‐
7412       cations.
7413
7414           Example:
7415             [#1]                      image.jpg                      +patches
7416       64,64,1,153,124,0,184,240,0,217,126,0,275,38,0
7417
7418         matchpatch (+):
7419             [patch_im‐
7420       age],patch_width>=1,_patch_height>=1,_patch_depth>=1,_nb_itera‐
7421       tions>=0,_nb_randoms>=0,_patch_penalization,_output_score={   0   |   1
7422       },_[guide]
7423
7424           Estimate correspondence map between selected images  and  specified
7425       patch image, using
7426           a patch-matching algorithm.
7427           Each  pixel  of  the returned correspondence map gives the location
7428       (p,q) of the closest patch in
7429           the specified patch image. If 'output_score=1', the  third  channel
7430       also gives the corresponding
7431           matching score for each patch as well.
7432           If  'patch_penalization' is >=0, SSD is penalized with patch occur‐
7433       rences.
7434           If 'patch_penalization' is <0, SSD is inf-penalized  when  distance
7435       between patches are less than '-patch_penalization'.
7436
7437           Default    values:   'patch_height=patch_width',   'patch_depth=1',
7438       'nb_iterations=5',   'nb_randoms=5',   'patch_penalization=0',    'out‐
7439       put_score=0' and
7440            'guide=(undefined)'.
7441
7442           Example:
7443             [#1]  image.jpg  sample  colorful  +matchpatch[0] [1],3 +warp[-2]
7444       [-1],0
7445
7446         plot2value:
7447
7448           Retrieve values from selected 2D graph plots.
7449
7450           Example:
7451             [#1]  400,300,1,1,'if(y>300*abs(cos(x/10+2*u)),1,0)'  +plot2value
7452       +display_graph[-1] 400,300
7453
7454         pointcloud:
7455             _type  =  {  -X=-X-opacity  | 0=binary | 1=cumulative | 2=label |
7456       3=retrieve coordinates },_width,_height>0,_depth>0
7457
7458           Render a set of point coordinates, as a point cloud in a  1D/2D  or
7459       3D binary image
7460           (or  do  the  reverse, i.e. retrieve coordinates of non-zero points
7461       from a rendered point cloud).
7462           Input point coordinates can be a NxMx1x1, Nx1x1xM or 1xNx1xM image,
7463       where 'N' is the number of points,
7464           and M the point coordinates.
7465           If 'M'>3, the 3-to-M components sets the (M-3)-dimensional color at
7466       each point.
7467           Parameters 'width','height' and 'depth' are related to the size  of
7468       the final image :
7469              -   If  set to 0, the size is automatically set along the speci‐
7470       fied axis.
7471              -  If set to N>0, the size along the specified axis is N.
7472              -  If set to N<0, the size along the specified axis is  at  most
7473       N.
7474           Points  with coordinates that are negative or higher than specified
7475       ('width','height','depth')
7476           are not plotted.
7477
7478           Default values: 'type=0' and 'max_width=max_height=max_depth=0'.
7479
7480           Example:
7481             [#1] 3000,2 rand 0,400 +pointcloud 0 dilate[-1] 3
7482             [#2] 3000,2 rand 0,400 {w} {w},3 rand[-1] 0,255 append y  +point‐
7483       cloud 0 dilate[-1] 3
7484
7485         psnr:
7486             _max_value
7487
7488           Compute  PSNR  (Peak Signal-to-Noise Ratio) matrix between selected
7489       images.
7490
7491           Default value: 'max_value=255'.
7492
7493           Example:
7494             [#1] image.jpg +noise 30 +noise[0] 35 +noise[0] 38 cut[-1]  0,255
7495       psnr 255 replace_inf 0
7496
7497         segment_watershed:
7498             _threshold>=0
7499
7500           Apply watershed segmentation on selected images.
7501
7502           Default values: 'threshold=2'.
7503
7504           Example:
7505             [#1] image.jpg segment_watershed 2
7506
7507         shape2bump:
7508             _resolution>=0,0<=_weight_avg_max_avg<=1,_dilation,_smoothness>=0
7509
7510           Estimate bumpmap from binary shape in selected images.
7511
7512           Default   value:  'resolution=256',  'weight_avg_max=0.75',  'dila‐
7513       tion=0' and 'smoothness=100'.
7514
7515         skeleton:
7516             _boundary_conditions={ 0=dirichlet | 1=neumann }
7517
7518           Compute skeleton of binary shapes using distance transform and con‐
7519       strained thinning.
7520
7521           Default value: 'boundary_conditions=1'.
7522
7523           Example:
7524             [#1] shape_cupid 320 +skeleton 0
7525
7526         slic:
7527             size>0,_regularity>=0,_nb_iterations>0
7528
7529           Segment  selected  2D images with superpixels, using the SLIC algo‐
7530       rithm (Simple Linear Iterative Clustering).
7531           Scalar images of increasingly labeled pixels are returned.
7532           Reference paper: Achanta, R., Shaji, A.,  Smith,  K.,  Lucchi,  A.,
7533       Fua,  P.,  &  Susstrunk,  S.  (2010).  SLIC  Superpixels  (No. EPFL-RE‐
7534       PORT-149300).
7535
7536           Default values: 'size=16', 'regularity=10' and 'nb_iterations=10'.
7537
7538           Example:
7539             [#1] image.jpg +srgb2lab slic[-1] 16  +blend  shapeaverage  f[-2]
7540       "j(1,0)==i && j(0,1)==i" *[-1] [-2]
7541
7542         ssd_patch:
7543             [patch],_use_fourier={ 0 | 1 },_boundary_conditions={ 0=dirichlet
7544       | 1=neumann }
7545
7546           Compute fields of SSD between selected images and specified patch.
7547           Argument 'boundary_conditions' is valid only when 'use_fourier=0'.
7548
7549           Default value: 'use_fourier=0' and 'boundary_conditions=0'.
7550
7551           Example:
7552             [#1] image.jpg +crop 20%,20%,35%,35% +ssd_patch[0] [1],0,0
7553
7554         thinning:
7555             _boundary_conditions={ 0=dirichlet | 1=neumann }
7556
7557           Compute skeleton of binary shapes using morphological thinning
7558           (beware, this is a quite slow iterative process)
7559
7560           Default value: 'boundary_conditions=1'.
7561
7562           Example:
7563             [#1] shape_cupid 320 +thinning
7564
7565         tones:
7566             N>0
7567
7568           Get N tones masks from selected images.
7569
7570           Example:
7571             [#1] image.jpg +tones 3
7572
7573         topographic_map:
7574             _nb_levels>0,_smoothness
7575
7576           Render selected images as topographic maps.
7577
7578           Default values: 'nb_levels=16' and 'smoothness=2'.
7579
7580           Example:
7581             [#1] image.jpg topographic_map 10
7582
7583         tsp:
7584             _precision>=0
7585
7586           Try to solve the 'travelling salesman' problem, using a combination
7587       of greedy search and 2-opt algorithms.
7588           Selected  images must have dimensions Nx1x1xC to represent N cities
7589       each with C-dimensional coordinates.
7590           This command re-order the selected data along the  x-axis  so  that
7591       the point sequence becomes a shortest path.
7592
7593           Default values: 'precision=256'.
7594
7595           Example:
7596             [#1] 256,1,1,2 rand 0,512 tsp , 512,512,1,3 repeat w#0 circle[-1]
7597       {0,I[$>]},2,1,255,255,255              line[-1]               {0,bound‐
7598       ary=2;[I[$>],I[$>+1]]},1,255,128,0 done keep[-1]
7599
7600         variance_patch:
7601             _patch_size>=1
7602
7603           Compute  variance  of  each  images patch centered at (x,y), in se‐
7604       lected images.
7605
7606           Default value: 'patch_size=16'
7607
7608           Example:
7609             [#1] image.jpg +variance_patch
7610
7611         12.10. Image Drawing
7612                -------------
7613
7614         arrow:
7615             x0[%],y0[%],x1[%],y1[%],_thick‐
7616       ness[%]>=0,_head_length[%]>=0,_head_thickness[%]>=0,_opacity,_pat‐
7617       tern,_color1,...
7618
7619           Draw specified arrow on selected images.
7620           'pattern' is an hexadecimal number starting with '0x' which can  be
7621       omitted
7622           even  if a color is specified. If a pattern is specified, the arrow
7623       is
7624           drawn outlined instead of filled.
7625
7626           Default  values:  'thickness=1%',  'head_length=10%',  'head_thick‐
7627       ness=3%', 'opacity=1', 'pattern=(undefined)' and 'color1=0'.
7628
7629           Example:
7630             [#1]         400,400,1,3         repeat         100         arrow
7631       50%,50%,{u(100)}%,{u(100)}%,3,20,10,0.3,${-rgb} done
7632
7633         axes:
7634             x0,x1,y0,y1,_font_height>=0,_opacity,_pattern,_color1,...
7635
7636           Draw xy-axes on selected images.
7637           'pattern' is an hexadecimal number starting with '0x' which can  be
7638       omitted
7639           even if a color is specified.
7640           To draw only one x-axis at row Y, set both 'y0' and 'y1' to Y.
7641           To draw only one y-axis at column X, set both 'x0' and 'x1' to X.
7642
7643           Default   values:  'font_height=14',  'opacity=1',  'pattern=(unde‐
7644       fined)' and 'color1=0'.
7645
7646           Example:
7647             [#1] 400,400,1,3,255 axes -1,1,1,-1
7648
7649         ball:
7650             _size>0,                _R,_G,_B,0<=_specular_light<=8,0<=_specu‐
7651       lar_size<=8,_shadow>=0
7652
7653           Input a 2D RGBA colored ball sprite.
7654
7655           Default   values:   'size=64',   'R=255',   'G=R',  'B=R',  'specu‐
7656       lar_light=0.8', 'specular_size=1' and 'shading=1.5'.
7657
7658           Example:
7659             [#1] repeat 9 ball {1.5^($>+2)},${-rgb} done append x
7660
7661         chessboard:
7662             size1>0,_size2>0,_offset1,_offset2,_angle,_opac‐
7663       ity,_color1,...,_color2,...
7664
7665           Draw chessboard on selected images.
7666
7667           Default   values:  'size2=size1',  'offset1=offset2=0',  'angle=0',
7668       'opacity=1', 'color1=0' and 'color2=255'.
7669
7670           Example:
7671             [#1] image.jpg chessboard 32,32,0,0,25,0.3,255,128,0,0,128,255
7672
7673         cie1931:
7674
7675           Draw CIE-1931 chromaticity diagram on selected images.
7676
7677           Example:
7678             [#1] 500,400,1,3 cie1931
7679
7680         circle:
7681             x[%],y[%],R[%],_opacity,_pattern,_color1,...
7682
7683           Draw specified colored circle on selected images.
7684           A radius of '100%' stands for 'sqrt(width^2+height^2)'.
7685           'pattern' is an hexadecimal number starting with '0x' which can  be
7686       omitted
7687           even if a color is specified. If a pattern is specified, the circle
7688       is
7689           drawn outlined instead of filled.
7690
7691           Default values: 'opacity=1', 'pattern=(undefined)' and 'color1=0'.
7692
7693           Example:
7694             [#1]         image.jpg         repeat         300          circle
7695       {u(100)}%,{u(100)}%,{u(30)},0.3,${-rgb} done circle 50%,50%,100,0.7,255
7696
7697         close_binary:
7698             0<=_endpoint_rate<=100,_endpoint_connectivity>=0,_spline_dist‐
7699       max>=0,_segment_distmax>=0,0<=_spline_anglemax<=180,_spline_round‐
7700       ness>=0,_area_min>=0,_allow_self_intersection={ 0 | 1 }
7701
7702           Automatically  close  open  shapes in binary images (defining white
7703       strokes on black background).
7704
7705           Default  values:   'endpoint_rate=75',   'endpoint_connectivity=2',
7706       'spline_distmax=80',     'segment_distmax=20',    'spline_anglemax=90',
7707       'spline_roundness=1',
7708            'area_min=100', 'allow_self_intersection=1'.
7709
7710         ellipse (+):
7711             x[%],y[%],R[%],r[%],_angle,_opacity,_pattern,_color1,...
7712
7713           Draw specified colored ellipse on selected images.
7714           A radius of '100%' stands for 'sqrt(width^2+height^2)'.
7715           'pattern' is an hexadecimal number starting with '0x' which can  be
7716       omitted
7717           even  if  a  color is specified. If a pattern is specified, the el‐
7718       lipse is
7719           drawn outlined instead of filled.
7720
7721           Default values: 'opacity=1', 'pattern=(undefined)' and 'color1=0'.
7722
7723           Example:
7724             [#1]         image.jpg         repeat         300         ellipse
7725       {u(100)}%,{u(100)}%,{u(30)},{u(30)},{u(180)},0.3,${-rgb}  done  ellipse
7726       50%,50%,100,100,0,0.7,255
7727
7728         flood (+):
7729             x[%],_y[%],_z[%],_tolerance>=0,_is_high_connectivity={  0   |   1
7730       },_opacity,_color1,...
7731
7732           Flood-fill selected images using specified value and tolerance.
7733
7734           Default  values:  'y=z=0', 'tolerance=0', 'is_high_connectivity=0',
7735       'opacity=1' and 'color1=0'.
7736
7737           Example:
7738             [#1]         image.jpg         repeat         1000          flood
7739       {u(100)}%,{u(100)}%,0,20,0,1,${-rgb} done
7740
7741         gaussian:
7742             _sigma1[%],_sigma2[%],_angle
7743
7744           Draw  a  centered gaussian on selected images, with specified stan‐
7745       dard deviations and orientation.
7746
7747           Default values: 'sigma1=3', 'sigma2=sigma1' and 'angle=0'.
7748
7749           Example:
7750             [#1] 400,400 gaussian 100,30,45
7751
7752           Tutorial: https://gmic.eu/oldtutorial/_gaussian
7753
7754         graph (+):
7755             [function_image],_plot_type,_vertex_type,_ymin,_ymax,_opac‐
7756       ity,_pattern,_color1,... |
7757             'formula',_resolution>=0,_plot_type,_ver‐
7758       tex_type,_xmin,xmax,_ymin,_ymax,_opacity,_pattern,_color1,...
7759
7760           Draw specified function graph on selected images.
7761           'plot_type' can be { 0=none | 1=lines | 2=splines | 3=bar }.
7762           'vertex_type' can be { 0=none | 1=points | 2,3=crosses  |  4,5=cir‐
7763       cles | 6,7=squares }.
7764           'pattern'  is an hexadecimal number starting with '0x' which can be
7765       omitted
7766           even if a color is specified.
7767
7768           Default  values:   'plot_type=1',   'vertex_type=1',   'ymin=ymax=0
7769       (auto)', 'opacity=1', 'pattern=(undefined)'
7770           and 'color1=0'.
7771
7772           Example:
7773             [#1]  image.jpg  +rows  50%  blur[-1]  3  split[-1]  c div[0] 1.5
7774       graph[0] [1],2,0,0,0,1,255,0,0 graph[0] [2],2,0,0,0,1,0,255,0  graph[0]
7775       [3],2,0,0,0,1,0,0,255 keep[0]
7776
7777         grid:
7778             size_x[%]>=0,size_y[%]>=0,_offset_x[%],_offset_y[%],_opac‐
7779       ity,_pattern,_color1,...
7780
7781           Draw xy-grid on selected images.
7782           'pattern' is an hexadecimal number starting with '0x' which can  be
7783       omitted
7784           even if a color is specified.
7785
7786           Default values: 'offset_x=offset_y=0', 'opacity=1', 'pattern=(unde‐
7787       fined)' and 'color1=0'.
7788
7789           Example:
7790             [#1] image.jpg grid 10%,10%,0,0,0.5,255
7791             [#2] 400,400,1,3,255 grid 10%,10%,0,0,0.3,0xCCCCCCCC,128,32,16
7792
7793         j (+):
7794             Shortcut for command 'image'.
7795
7796         image (+):
7797             [sprite],_x[%|~],_y[%|~],_z[%|~],_c[%|~],_opacity,_[opac‐
7798       ity_mask],_max_opacity_mask
7799
7800           Draw specified sprite image on selected images.
7801           (equivalent to shortcut command 'j').
7802
7803           If one of the x,y,z or c argument ends with a '~', its value is ex‐
7804       pected to be
7805           a centering ratio (in [0,1]) rather than a position.
7806           Usual centering ratio  are  {  0=left-justified  |  0.5=centered  |
7807       1=right-justified }.
7808
7809           Default   values:  'x=y=z=c=0',  'opacity=1',  'opacity_mask=(unde‐
7810       fined)' and 'max_opacity_mask=1'.
7811
7812           Example:
7813             [#1] image.jpg +crop 40%,40%,60%,60%  resize[-1]  200%,200%,1,3,5
7814       frame[-1] 2,2,0 image[0] [-1],30%,30% keep[0]
7815
7816         line (+):
7817             x0[%],y0[%],x1[%],y1[%],_opacity,_pattern,_color1,...
7818
7819           Draw specified colored line on selected images.
7820           'pattern'  is an hexadecimal number starting with '0x' which can be
7821       omitted
7822           even if a color is specified.
7823
7824           Default values: 'opacity=1', 'pattern=(undefined)' and 'color1=0'.
7825
7826           Example:
7827             [#1] image.jpg repeat 500 line  50%,50%,{u(w)},{u(h)},0.5,${-rgb}
7828       done  line 0,0,100%,100%,1,0xCCCCCCCC,255 line 100%,0,0,100%,1,0xCCCCC‐
7829       CCC,255
7830
7831         linethick:
7832             x0[%],y0[%],x1[%],y1[%],_thickness,_opacity,_color1
7833
7834           Draw specified colored thick line on selected images.
7835
7836           Default values: 'thickness=2', 'opacity=1' and 'color1=0'.
7837
7838           Example:
7839             [#1]        400,400,1,3        repeat        100        linethick
7840       {u([w,h,w,h,5])},0.5,${-rgb} done
7841
7842         mandelbrot (+):
7843             z0r,z0i,z1r,z1i,_iteration_max>=0,_is_julia={      0      |     1
7844       },_c0r,_c0i,_opacity
7845
7846           Draw mandelbrot/julia fractal on selected images.
7847
7848           Default values: 'iteration_max=100', 'is_julia=0', 'c0r=c0i=0'  and
7849       'opacity=1'.
7850
7851           Example:
7852             [#1]  400,400  mandelbrot  -2.5,-2,2,2,1024  map 0 +blur 2 eleva‐
7853       tion3d[-1] -0.2
7854
7855         marble:
7856             _image_weight,_pattern_weight,_angle,_amplitude,_sharp‐
7857       ness>=0,_anisotropy>=0,_alpha,_sigma,_cut_low>=0,_cut_high>=0
7858
7859           Render marble like pattern on selected images.
7860
7861           Default   values:  'image_weight=0.2',  'pattern_weight=0.1',  'an‐
7862       gle=45', 'amplitude=0', 'sharpness=0.4' and 'anisotropy=0.8',
7863           'alpha=0.6', 'sigma=1.1' and 'cut_low=cut_high=0'.
7864
7865           Example:
7866             [#1] image.jpg +marble ,
7867
7868         maze:
7869             _width>0,_height>0,_cell_size>0
7870
7871           Input maze with specified size.
7872
7873           Example:
7874             [#1] maze 30,20 negate normalize 0,255
7875
7876         maze_mask:
7877             _cellsize>0
7878
7879           Input maze according to size and shape of selected mask images.
7880           Mask may contain disconnected shapes.
7881
7882           Example:
7883             [#1] 0 text "G'MIC",0,0,53,1,1 dilate 3 autocrop  0  frame  1,1,0
7884       maze_mask 8 dilate 3 negate mul 255
7885
7886         newton_fractal:
7887             z0r,z0i,z1r,z1i,_angle,0<=_descent_method<=2,_itera‐
7888       tion_max>=0,_convergence_preci‐
7889       sion>0,_expr_p(z),_expr_dp(z),_expr_d2p(z)
7890
7891           Draw  newton  fractal  on  selected  images, for complex numbers in
7892       range (z0r,z0i) - (z1r,z1i).
7893           Resulting images have  3  channels  whose  meaning  is  [  last_zr,
7894       last_zi, nb_iter_used_for_convergence ].
7895           'descent_method' can be { 0=secant | 1=newton | 2=householder }.
7896
7897           Default values: 'angle=0', 'descent_method=1', 'iteration_max=200',
7898       'convergence_precision=0.01',  'expr_p(z)=z^^3-1',  'expr_dp(z)=3*z^^2'
7899       and
7900            'expr_d2z(z)=6*z'.
7901
7902           Example:
7903             [#1]  400,400 newton_fractal -1.5,-1.5,1.5,1.5,0,2,200,0.01,"z^^6
7904       +   z^^3   -   1","6*z^^5   +   3*z^^2","30*z^^4   +    6*z"    f    "[
7905       atan2(i1,i0)*90+20,1,cut(i2/30,0.2,0.7) ]" hsl2rgb
7906
7907         j3d (+):
7908             Shortcut for command 'object3d'.
7909
7910         object3d (+):
7911             [object3d],_x[%],_y[%],_z,_opacity,_rendering_mode,_is_dou‐
7912       ble_sided={    0    |    1    },_is_zbuffer={    0    |    1     },_fo‐
7913       cale,_light_x,_light_y,_light_z,_specular_lightness,_specular_shininess
7914
7915           Draw specified 3D object on selected images.
7916           (equivalent to shortcut command 'j3d').
7917
7918           'rendering_mode'  can  be { 0=dots | 1=wireframe | 2=flat | 3=flat-
7919       shaded | 4=gouraud-shaded | 5=phong-shaded }.
7920
7921           Default values:  'x=y=z=0',  'opacity=1'  and  'is_zbuffer=1'.  All
7922       other arguments take their default values
7923           from the 3D environment variables.
7924
7925           Example:
7926             [#1]  image.jpg  torus3d  100,10  cone3d 30,-120 add3d[-2,-1] ro‐
7927       tate3d. 1,1,0,60 object3d[0] [-1],50%,50% keep[0]
7928
7929         pack_sprites:
7930             _nb_scales>=0,0<=_min_scale<=100,_allow_rotation={  0=0  deg.   |
7931       1=180  deg.  |  2=90  deg.  | 3=any },_spacing,_precision>=0,max_itera‐
7932       tions>=0
7933
7934           Try to randomly pack as many sprites as possible onto  the  'empty'
7935       areas of an image.
7936           Sprites  can  be  eventually  rotated and scaled during the packing
7937       process.
7938           First selected image is the canvas that will  be  filled  with  the
7939       sprites.
7940           Its  last channel must be a binary mask whose zero values represent
7941       potential locations for drawing the sprites.
7942           All other selected images  represent  the  sprites  considered  for
7943       packing.
7944           Their last channel must be a binary mask that represents the sprite
7945       shape (i.e. a 8-connected component).
7946           The order of sprite packing follows the order of specified  sprites
7947       in the image list.
7948           Sprite packing is done on random locations and iteratively with de‐
7949       creasing scales.
7950           'nb_scales' sets the number of decreasing scales considered for all
7951       specified sprites to be packed.
7952           'min_scale'  (in  %)  sets  the minimal size considered for packing
7953       (specified as a percentage of the
7954           original sprite size).
7955           'spacing' can be positive or negative.
7956           'precision' tells about the desired number of failed trials  before
7957       ending the filling process.
7958
7959           Default  values: 'nb_scales=5', 'min_scale=25', 'allow_rotation=3',
7960       'spacing=1', 'precision=7' and 'max_iterations=256'.
7961
7962           Example:
7963             [#1]      512,512,1,3,"min(255,y*c/2)"      100%,100%      circle
7964       50%,50%,100,1,255   append   c   image.jpg   resize2dy[-1]  24  to_rgba
7965       pack_sprites 3,25
7966
7967         piechart:
7968             label_height>=0,label_R,label_G,label_B,"la‐
7969       bel1",value1,R1,G1,B1,...,"labelN",valueN,RN,GN,BN
7970
7971           Draw pie chart on selected (RGB) images.
7972
7973           Example:
7974             [#1]                      image.jpg                      piechart
7975       25,0,0,0,"Red",55,255,0,0,"Green",40,0,255,0,"Blue",30,128,128,255,"Other",5,128,128,128
7976
7977         plasma (+):
7978             _alpha,_beta,_scale>=0
7979
7980           Draw a random colored plasma fractal on selected images.
7981           This command implements the so-called 'Diamond-Square' algorithm.
7982
7983           Default values: 'alpha=1', 'beta=1' and 'scale=8'.
7984
7985           Example:
7986             [#1] 400,400,1,3 plasma
7987
7988           Tutorial: https://gmic.eu/oldtutorial/_plasma
7989
7990         point (+):
7991             x[%],y[%],_z[%],_opacity,_color1,...
7992
7993           Set specified colored pixel on selected images.
7994
7995           Default values: 'z=0', 'opacity=1' and 'color1=0'.
7996
7997           Example:
7998             [#1] image.jpg repeat 10000 point {u(100)}%,{u(100)}%,0,1,${-rgb}
7999       done
8000
8001         polka_dots:
8002             diameter>=0,_density,_offset1,_offset2,_angle,_aliasing,_shad‐
8003       ing,_opacity,_color,...
8004
8005           Draw dots pattern on selected images.
8006
8007           Default   values:  'density=20',  'offset1=offset2=50',  'angle=0',
8008       'aliasing=10', 'shading=1', 'opacity=1' and 'color=255'.
8009
8010           Example:
8011             [#1] image.jpg polka_dots 10,15,0,0,20,10,1,0.5,0,128,255
8012
8013         polygon (+):
8014             N>=1,x1[%],y1[%],...,xN[%],yN[%],_opacity,_pattern,_color1,...
8015
8016           Draw specified colored N-vertices polygon on selected images.
8017           'pattern' is an hexadecimal number starting with '0x' which can  be
8018       omitted
8019           even  if a color is specified. If a pattern is specified, the poly‐
8020       gon is
8021           drawn outlined instead of filled.
8022
8023           Default values: 'opacity=1', 'pattern=(undefined)' and 'color1=0'.
8024
8025           Example:
8026             [#1]                      image.jpg                       polygon
8027       4,20%,20%,80%,30%,80%,70%,20%,80%,0.3,0,255,0                   polygon
8028       4,20%,20%,80%,30%,80%,70%,20%,80%,1,0xCCCCCCCC,255
8029             [#2]    image.jpg     2,16,1,1,'u(if(x,{h},{w}))'     polygon[-2]
8030       {h},{^},0.6,255,0,255 remove[-1]
8031
8032         quiver:
8033             [function_image],_sampling[%]>0,_factor>=0,_is_arrow={   0   |  1
8034       },_opacity,_color1,...
8035
8036           Draw specified 2D vector/orientation field on selected images.
8037
8038           Default values:  'sampling=5%',  'factor=1',  'is_arrow=1',  'opac‐
8039       ity=1', 'pattern=(undefined)'
8040           and 'color1=0'.
8041
8042           Example:
8043             [#1]      100,100,1,2,'if(c==0,x-w/2,y-h/2)'      500,500,1,3,255
8044       quiver[-1] [-2],10
8045             [#2] image.jpg +resize2dy 600 luminance[0] gradient[0] mul[1]  -1
8046       reverse[0,1]   append[0,1]   c   blur[0]   8  orientation[0]  quiver[1]
8047       [0],20,1,1,0.8,255
8048
8049         rectangle:
8050             x0[%],y0[%],x1[%],y1[%],_opacity,_pattern,_color1,...
8051
8052           Draw specified colored rectangle on selected images.
8053           'pattern' is an hexadecimal number starting with '0x' which can  be
8054       omitted
8055           even  if  a color is specified. If a pattern is specified, the rec‐
8056       tangle is
8057           drawn outlined instead of filled.
8058
8059           Default values: 'opacity=1', 'pattern=(undefined)' and 'color1=0'.
8060
8061           Example:
8062             [#1]        image.jpg         repeat         30         rectangle
8063       {u(100)}%,{u(100)}%,{u(100)}%,{u(100)}%,0.3,${-rgb} done
8064
8065         rorschach:
8066             'smoothness[%]>=0','mirroring={ 0=none | 1=x | 2=y | 3=xy }
8067
8068           Render rorschach-like inkblots on selected images.
8069
8070           Default values: 'smoothness=5%' and 'mirroring=1'.
8071
8072           Example:
8073             [#1] 400,400 rorschach 3%
8074
8075         sierpinski:
8076             recursion_level>=0
8077
8078           Draw Sierpinski triangle on selected images.
8079
8080           Default value: 'recursion_level=7'.
8081
8082           Example:
8083             [#1] image.jpg sierpinski 7
8084
8085         spiralbw:
8086             width>0,_height>0,_is_2dcoords={ 0 | 1 }
8087
8088           Input a 2D rectangular spiral image with specified size.
8089
8090           Default values: 'height=width' and 'is_2dcoords=0'.
8091
8092           Example:
8093             [#1] spiralbw 16
8094             [#2] image.jpg spiralbw {[w,h]},1 +warp[0] [1],0 +warp[2] [1],2
8095
8096         spline:
8097             x0[%],y0[%],u0[%],v0[%],x1[%],y1[%],u1[%],v1[%],_opac‐
8098       ity,_color1,...
8099
8100           Draw specified colored spline curve on selected images (cubic  her‐
8101       mite spline).
8102
8103           Default values: 'opacity=1' and 'color1=0'.
8104
8105           Example:
8106             [#1]          image.jpg          repeat         30         spline
8107       {u(100)}%,{u(100)}%,{u(-600,600)},{u(-600,600)},{u(100)}%,{u(100)}%,{u(-600,600)},{u(-600,600)},0.6,255
8108       done
8109
8110         tetraedron_shade:
8111             x0,y0,z0,x1,y1,z1,x2,y2,z2,x3,y3,z3,R0,G0,B0,...,R1,G1,B1,...,R2,G2,B2,...,R3,G3,B3,...
8112
8113           Draw tetraedron with interpolated colors on  selected  (volumetric)
8114       images.
8115
8116         t (+):
8117             Shortcut for command 'text'.
8118
8119         text (+):
8120             text,_x[%|~],_y[%|~],_font_height[%]>=0,_opacity,_color1,...
8121
8122           Draw specified colored text string on selected images.
8123           (equivalent to shortcut command 't').
8124
8125           If  one  of  the  x or y argument ends with a '~', its value is ex‐
8126       pected to be
8127           a centering ratio (in [0,1]) rather than a position.
8128           Usual centering ratio  are  {  0=left-justified  |  0.5=centered  |
8129       1=right-justified }.
8130           Sizes  '13'  and  '128'  are special and correspond to binary fonts
8131       (no-antialiasing).
8132           Any other font size is rendered with anti-aliasing.
8133           Specifying an empty target image resizes it to new dimensions  such
8134       that the image contains
8135           the entire text string.
8136
8137           Default  values:  'x=y=0.01~',  'font_height=16',  'opacity=1'  and
8138       'color1=0'.
8139
8140           Example:
8141             [#1] image.jpg resize2dy 600 y=0 repeat 30 text {2*$>}" : This is
8142       a nice text, isn't it ?",10,$y,{2*$>},0.9,255 y+={2*$>} done
8143             [#2] 0 text "G'MIC",0,0,23,1,255
8144
8145         to:
8146             Shortcut for command 'text_outline'.
8147
8148         text_outline:
8149             text,_x[%|~],_y[%|~],_font_height[%]>0,_outline>=0,_opac‐
8150       ity,_color1,...
8151
8152           Draw specified colored and outlined text string on selected images.
8153           If one of the x or y argument ends with a '~',  its  value  is  ex‐
8154       pected to be
8155           a centering ratio (in [0,1]) rather than a position.
8156           Usual  centering  ratio  are  {  0=left-justified  | 0.5=centered |
8157       1=right-justified }.
8158
8159           Default  values:  'x=y=0.01~',   'font_height=7.5%',   'outline=2',
8160       'opacity=1', 'color1=color2=color3=255' and 'color4=255'.
8161
8162           Example:
8163             [#1] image.jpg text_outline "Hi there!",10,10,63,3
8164
8165         triangle_shade:
8166             x0,y0,x1,y1,x2,y2,R0,G0,B0,...,R1,G1,B1,...,R2,G2,B2,...
8167
8168           Draw triangle with interpolated colors on selected images.
8169
8170           Example:
8171             [#1]                   image.jpg                   triangle_shade
8172       20,20,400,100,120,200,255,0,0,0,255,0,0,0,255
8173
8174         truchet:
8175             _scale>0,_radius>=0,_pattern_type={ 0=straight | 1=curved }
8176
8177           Fill selected images with random truchet patterns.
8178
8179           Default values: 'scale=32', 'radius=5' and 'pattern_type=1'.
8180
8181           Example:
8182             [#1] 400,300 truchet ,
8183
8184         turbulence:
8185             _radius>0,_octaves={1,2,3...,12},_alpha>0,_differ‐
8186       ence={-10,10},_mode={0,1,2,3}
8187
8188           Render fractal noise or turbulence on selected images.
8189
8190           Default values: 'radius=32', 'octaves=6', 'alpha=3', 'difference=0'
8191       and 'mode=0'.
8192
8193           Example:
8194             [#1] 400,400,1,3 turbulence 16
8195
8196           Tutorial: https://gmic.eu/oldtutorial/_turbulence
8197
8198         yinyang:
8199
8200           Draw a yin-yang symbol on selected images.
8201
8202           Example:
8203             [#1] 400,400 yinyang
8204
8205         12.11. Matrix Computation
8206                ------------------
8207
8208         dijkstra (+):
8209             starting_node>=0,ending_node>=0
8210
8211           Compute minimal distances and paths from specified adjacency matri‐
8212       ces by the Dijkstra algorithm.
8213
8214         eigen (+):
8215
8216           Compute  the eigenvalues and eigenvectors of selected symmetric ma‐
8217       trices or matrix fields.
8218           If one selected image has 3 or 6 channels,  it  is  regarded  as  a
8219       field of 2x2 or 3x3 symmetric matrices,
8220           whose eigen elements are computed at each point of the field.
8221
8222           Example:
8223             [#1] (1,0,0;0,2,0;0,0,3) +eigen
8224             [#2] image.jpg structuretensors blur 2 eigen split[0] c
8225
8226           Tutorial: https://gmic.eu/oldtutorial/_eigen
8227
8228         invert (+):
8229             solver={ 0=SVD | 1=LU }
8230
8231           Compute the inverse of the selected matrices.
8232           SVD solver is slower but less numerically instable than LU.
8233
8234           Default value: 'solver=1'.
8235
8236           Example:
8237             [#1] (0,1,0;0,0,1;1,0,0) +invert
8238
8239         orthogonalize:
8240             _mode = { 0=orthogonalize | 1=orthonormalize }
8241
8242           Orthogonalize  or  orthonormalize selected matrices, using Modified
8243       Gram-Schmidt process.
8244
8245           Default value: 'mode=0'.
8246
8247         meigen:
8248             m>=1
8249
8250           Compute an approximation of the 'm' largest eigenvalues and  eigen‐
8251       vectors of selected symmetric matrices,
8252           using          the         Arnoldi         iteration         method
8253       (https://en.wikipedia.org/wiki/Arnoldi_iteration).
8254           A larger 'm' goes with better numerical precision.
8255
8256           Example:
8257             [#1] (1,0,0;0,2,0;0,0,3) +meigen 3
8258
8259         mproj (+):
8260             [dictionary],_method,_max_iter={ 0=auto | >0 },_max_residual>=0
8261
8262           Find best matching projection of selected matrices onto the span of
8263       an over-complete
8264           dictionary  D,  using the orthogonal projection or Matching Pursuit
8265       algorithm.
8266           Selected images are 2D-matrices in which each  column  represent  a
8267       signal to project.
8268           '[dictionary]'  is  a  matrix in which each column is an element of
8269       the dictionary D.
8270           'method' tells what projection algorithm must be  applied.  It  can
8271       be:
8272               -  0  = orthogonal projection (least-squares solution using LU-
8273       based solver).
8274              - 1 = matching pursuit.
8275              - 2 = matching pursuit, with a single orthogonal projection step
8276       at the end.
8277               - >=3 = orthogonal matching pursuit where an orthogonal projec‐
8278       tion step is performed
8279                      every 'method-2' iterations.
8280           'max_iter' sets the max number of  iterations  processed  for  each
8281       signal.
8282           If  set to '0' (default), 'max_iter' is equal to the number of col‐
8283       umns in D.
8284           (only meaningful for matching pursuit and its variants).
8285           'max_residual' gives a stopping criterion on signal  reconstruction
8286       accuracy.
8287           (only meaningful for matching pursuit and its variants).
8288           For each selected image, the result is returned as a matrix W
8289           whose  columns  correspond to the weights associated to each column
8290       of D,
8291           such that the matrix product D*W is an approximation of  the  input
8292       matrix.
8293
8294           Default values: 'method=0', 'max_iter=0' and 'max_residual=1e-6'.
8295
8296         solve (+):
8297             [image]
8298
8299           Solve linear system AX = B for selected B-matrices and specified A-
8300       matrix.
8301           If the system is under- or over-determined, the least squares solu‐
8302       tion is returned
8303           (using SVD-based solver).
8304
8305           Example:
8306             [#1] (0,1,0;1,0,0;0,0,1) (1;2;3) +solve[-1] [-2]
8307
8308         svd (+):
8309
8310           Compute SVD decomposition of selected matrices.
8311
8312           Example:
8313             [#1] 10,10,1,1,'if(x==y,x+u(-0.2,0.2),0)' +svd
8314
8315         transpose:
8316
8317           Transpose selected matrices.
8318
8319           Example:
8320             [#1] image.jpg +transpose
8321
8322         trisolve (+):
8323             [image]
8324
8325           Solve  tridiagonal  system AX = B for selected B-vectors and speci‐
8326       fied tridiagonal A-matrix.
8327           Tridiagonal matrix must be stored as a 3 column vector,  where  2nd
8328       column contains the
8329           diagonal  coefficients,  while 1st and 3rd columns contain the left
8330       and right coefficients.
8331
8332           Example:
8333             [#1] (0,0,1;1,0,0;0,1,0) (1;2;3) +trisolve[-1] [-2]
8334
8335         12.12. 3D Meshes
8336                ---------
8337
8338         +3d (+):
8339             Shortcut for command 'add3d'.
8340
8341         add3d (+):
8342             tx,_ty,_tz |
8343             [object3d] |
8344             (no arg)
8345
8346           Shift selected 3D objects with specified  displacement  vector,  or
8347       merge them with specified
8348           3D object, or merge all selected 3D objects together.
8349           (equivalent to shortcut command '+3d').
8350
8351           Default values: 'ty=tz=0'.
8352
8353           Example:
8354             [#1] sphere3d 10 repeat 5 +add3d[-1] 10,{u(-10,10)},0 color3d[-1]
8355       ${-rgb} done add3d
8356             [#2] repeat 20 torus3d 15,2 color3d[-1] ${-rgb}  mul3d[-1]  0.5,1
8357       if  $>%2  rotate3d[-1]  0,1,0,90  fi  add3d[-1]  70  add3d rotate3d[-1]
8358       0,0,1,18 done double3d 0
8359
8360         animate3d:
8361             _width>0,_height>0,_angle_dx,_angle_dy,_angle_dz,_zoom_fac‐
8362       tor>=0,_filename
8363
8364           Animate selected 3D objects in a window.
8365           If  argument 'filename' is provided, each frame of the animation is
8366       saved as a numbered filename.
8367
8368           Default  values:  'width=640',  'height=480',  'angle_dx=0',   'an‐
8369       gle_dy=1', 'angle_dz=0', 'zoom_factor=1' and 'filename=(undefined)'.
8370
8371         apply_camera3d:
8372             pos_x,pos_y,pos_z,target_x,target_y,target_z,up_x,up_y,up_z
8373
8374           Apply 3D camera matrix to selected 3D objects.
8375
8376           Default values: 'target_x=0', 'target_y=0', 'target_z=0', 'up_x=0',
8377       'up_y=-1' and 'up_z=0'.
8378
8379         apply_matrix3d:
8380             a11,a12,a13,...,a31,a32,a33
8381
8382           Apply specified 3D rotation matrix to selected 3D objects.
8383
8384           Example:
8385             [#1]           torus3d            10,1            +apply_matrix3d
8386       {mul(rot(1,0,1,-15°),[1,0,0,0,2,0,0,0,8],3)} double3d 0
8387
8388         array3d:
8389             size_x>=1,_size_y>=1,_size_z>=1,_offset_x[%],_offset_y[%],_off‐
8390       set_y[%]
8391
8392           Duplicate a 3D object along the X,Y and Z axes.
8393
8394           Default values: 'size_y=1', 'size_z=1' and  'offset_x=offset_y=off‐
8395       set_z=100%'.
8396
8397           Example:
8398             [#1] torus3d 10,1 +array3d 5,5,5,110%,110%,300%
8399
8400         arrow3d:
8401             x0,y0,z0,x1,y1,z1,_radius[%]>=0,_head_length[%]>=0,_head_ra‐
8402       dius[%]>=0
8403
8404           Input 3D arrow with specified starting and ending 3D points.
8405
8406           Default  values:  'radius=5%',  'head_length=25%'   and   'head_ra‐
8407       dius=15%'.
8408
8409           Example:
8410             [#1]        repeat        10        a={$>*2*pi/10}        arrow3d
8411       0,0,0,{cos($a)},{sin($a)},-0.5 done +3d
8412
8413         axes3d:
8414             _size_x,_size_y,_size_z,_font_size>0,_label_x,_label_y,_la‐
8415       bel_z,_is_origin={ 0=no | 1=yes }
8416
8417           Input  3D  axes  with  specified sizes along the x,y and z orienta‐
8418       tions.
8419
8420           Default  values:  'size_x=size_y=size_z=1',  'font_size=23',   'la‐
8421       bel_x=X', 'label_y=Y', 'label_z=Z' and 'is_origin=1'
8422
8423           Example:
8424             [#1] axes3d ,
8425
8426         boundingbox3d:
8427
8428           Replace selected 3D objects by their 3D bounding boxes.
8429
8430           Example:
8431             [#1] torus3d 100,30 +boundingbox3d +3d[-1] [-2]
8432
8433         box3d:
8434             _size_x,_size_y,_size_z
8435
8436           Input 3D box at (0,0,0), with specified geometry.
8437
8438           Default values: 'size_x=1' and 'size_z=size_y=size_x'.
8439
8440           Example:
8441             [#1] box3d 100,40,30 +primitives3d 1 color3d[-2] ${-rgb}
8442
8443         c3d:
8444             Shortcut for command 'center3d'.
8445
8446         center3d:
8447
8448           Center selected 3D objects at (0,0,0).
8449           (equivalent to shortcut command 'c3d').
8450
8451           Example:
8452             [#1]  repeat 100 circle3d {u(100)},{u(100)},{u(100)},2 done add3d
8453       color3d[-1] 255,0,0 +center3d color3d[-1] 0,255,0 add3d
8454
8455         circle3d:
8456             _x0,_y0,_z0,_radius>=0
8457
8458           Input 3D circle at specified coordinates.
8459
8460           Default values: 'x0=y0=z0=0' and 'radius=1'.
8461
8462           Example:
8463             [#1]       repeat        500        a={$>*pi/250}        circle3d
8464       {cos(3*$a)},{sin(2*$a)},0,{$a/50} color3d[-1] ${-rgb},0.4 done add3d
8465
8466         circles3d:
8467             _radius>=0,_is_wireframe={ 0 | 1 }
8468
8469           Convert  specified  3D objects to sets of 3D circles with specified
8470       radius.
8471
8472           Default values: 'radius=1' and 'is_wireframe=1'.
8473
8474           Example:
8475             [#1] image.jpg luminance resize2dy 40 threshold 50% * 255  point‐
8476       cloud3d color3d[-1] 255,255,255 circles3d 0.7
8477
8478         col3d (+):
8479             Shortcut for command 'color3d'.
8480
8481         color3d (+):
8482             R,_G,_B,_opacity |
8483             (no arg)
8484
8485           Set color and opacity of selected 3D objects.
8486           (equivalent to shortcut command 'col3d').
8487
8488           Default value: 'B=G=R' and 'opacity=(undefined)'.
8489
8490           Example:
8491             [#1]  torus3d  100,10  double3d 0 repeat 7 +rotate3d[-1] 1,0,0,20
8492       color3d[-1] ${-rgb} done add3d
8493
8494         colorcube3d:
8495
8496           Input 3D color cube.
8497
8498           Example:
8499             [#1] colorcube3d mode3d 2 +primitives3d 1
8500
8501         cone3d:
8502             _radius,_height,_nb_subdivisions>0
8503
8504           Input 3D cone at (0,0,0), with specified geometry.
8505
8506           Default value: 'radius=1','height=1' and 'nb_subdivisions=24'.
8507
8508           Example:
8509             [#1] cone3d 10,40 +primitives3d 1 color3d[-2] ${-rgb}
8510
8511         cubes3d:
8512             _size>=0
8513
8514           Convert specified 3D objects to sets of  3D  cubes  with  specified
8515       size.
8516
8517           Default value: 'size=1'.
8518
8519           Example:
8520             [#1]  image.jpg luminance resize2dy 40 threshold 50% * 255 point‐
8521       cloud3d color3d[-1] 255,255,255 cubes3d 1
8522
8523         cup3d:
8524             _resolution>0
8525
8526           Input 3D cup object.
8527
8528           Default value: 'resolution=128'.
8529
8530           Example:
8531             [#1] cup3d ,
8532
8533         cylinder3d:
8534             _radius,_height,_nb_subdivisions>0
8535
8536           Input 3D cylinder at (0,0,0), with specified geometry.
8537
8538           Default value: 'radius=1','height=1' and 'nb_subdivisions=24'.
8539
8540           Example:
8541             [#1] cylinder3d 10,40 +primitives3d 1 color3d[-2] ${-rgb}
8542
8543         delaunay3d:
8544
8545           Generate 3D delaunay triangulations from selected images.
8546           One assumes that the selected input images are binary  images  con‐
8547       taining the set of points to mesh.
8548           The output 3D object is a mesh composed of non-oriented triangles.
8549
8550           Example:
8551             [#1]  500,500  noise  0.05,2  eq  1  * 255 +delaunay3d color3d[1]
8552       255,128,0 dilate_circ[0] 5 to_rgb[0] +object3d[0] [1],0,0,0,1,1 max[-1]
8553       [0]
8554
8555         distribution3d:
8556
8557           Get 3D color distribution of selected images.
8558
8559           Example:
8560             [#1]  image.jpg  distribution3d  colorcube3d  primitives3d[-1]  1
8561       add3d
8562
8563         /3d (+):
8564             Shortcut for command 'div3d'.
8565
8566         div3d (+):
8567             factor |
8568             factor_x,factor_y,_factor_z
8569
8570           Scale selected 3D objects isotropically  or  anisotropically,  with
8571       the inverse of specified
8572           factors.
8573           (equivalent to shortcut command '/3d').
8574
8575           Default value: 'factor_z=0'.
8576
8577           Example:
8578             [#1]  torus3d  5,2  repeat  5  +add3d[-1]  12,0,0  div3d[-1]  1.2
8579       color3d[-1] ${-rgb} done add3d
8580
8581         db3d (+):
8582             Shortcut for command 'double3d'.
8583
8584         double3d (+):
8585             _is_double_sided={ 0 | 1 }
8586
8587           Enable/disable double-sided mode for 3D rendering.
8588           (equivalent to shortcut command 'db3d').
8589
8590           Default value: 'is_double_sided=1'.
8591
8592           Example:
8593             [#1] mode3d 1 repeat 2 torus3d 100,30 rotate3d[-1] 1,1,0,60  dou‐
8594       ble3d $> snapshot3d[-1] 400 done
8595
8596         elevation3d:
8597             { z-factor | [elevation_map] | 'formula' },base_height={ -1 | >=0
8598       } |
8599             (no arg)
8600
8601           Generate 3D elevation of selected images, opt. with a specified el‐
8602       evation map.
8603           When invoked with (no arg) or 'z-factor', the elevation map is com‐
8604       puted as the pointwise L2 norm of the
8605           pixel values. Otherwise, the elevation map is taken from the speci‐
8606       fied image or formula.
8607
8608           Example:
8609             [#1] image.jpg +blur 5 elevation3d. 0.75
8610             [#2]  128,128,1,3,u(255) plasma 10,3 blur 4 sharpen 10000 n 0,255
8611       elevation3d[-1]
8612       'X=(x-64)/6;Y=(y-64)/6;-100*exp(-(X^2+Y^2)/30)*abs(cos(X)*sin(Y))'
8613
8614         empty3d:
8615
8616           Input empty 3D object.
8617
8618           Example:
8619             [#1] empty3d
8620
8621         extrude3d:
8622             _depth>0,_resolution>0,_smoothness[%]>=0
8623
8624           Generate extruded 3D object from selected binary XY-profiles.
8625
8626           Default   values:   'depth=16',   'resolution=1024'   and  'smooth‐
8627       ness=0.5%'.
8628
8629           Example:
8630             [#1] image.jpg threshold 50% extrude3d 16
8631
8632         f3d (+):
8633             Shortcut for command 'focale3d'.
8634
8635         focale3d (+):
8636             focale
8637
8638           Set 3D focale.
8639           (equivalent to shortcut command 'f3d').
8640
8641           Set 'focale' to 0 to enable parallel projection  (instead  of  per‐
8642       spective).
8643           Set negative 'focale' will disable 3D sprite zooming.
8644
8645           Default value: 'focale=700'.
8646
8647           Example:
8648             [#1]  repeat  5  torus3d  100,30  rotate3d[-1]  1,1,0,60 focale3d
8649       {$<*90} snapshot3d[-1] 400 done remove[0]
8650
8651         gaussians3d:
8652             _size>0,_opacity
8653
8654           Convert selected 3D objects into set of 3D gaussian-shaped sprites.
8655
8656           Example:
8657             [#1] image.jpg r2dy 32 distribution3d gaussians3d 20  colorcube3d
8658       primitives3d[-1] 1 +3d
8659
8660         gmic3d:
8661
8662           Input a 3D G'MIC logo.
8663
8664           Example:
8665             [#1] gmic3d +primitives3d 1
8666
8667         gyroid3d:
8668             _resolution>0,_zoom
8669
8670           Input 3D gyroid at (0,0,0), with specified resolution.
8671
8672           Default values: 'resolution=32' and 'zoom=5'.
8673
8674           Example:
8675             [#1] gyroid3d 48 +primitives3d 1
8676
8677         histogram3d:
8678
8679           Get 3D color histogram of selected images.
8680
8681           Example:
8682             [#1]  image.jpg  resize2dx  64 histogram3d circles3d 3 opacity3d.
8683       0.75 colorcube3d primitives3d[-1] 1 add3d
8684
8685         image6cube3d:
8686
8687           Generate 3D mapped cubes from 6-sets of selected images.
8688
8689           Example:
8690             [#1] image.jpg animate flower,"30,0","30,5",6 image6cube3d
8691
8692         imageblocks3d:
8693             _maximum_elevation,_smoothness[%]>=0
8694
8695           Generate 3D blocks from selected images.
8696           Transparency of selected images is taken into account.
8697
8698           Default values: 'maximum_elevation=10' and 'smoothness=0'.
8699
8700           Example:
8701             [#1] image.jpg resize2dy 32 imageblocks3d -20 mode3d 3
8702
8703         imagecube3d:
8704
8705           Generate 3D mapped cubes from selected images.
8706
8707           Example:
8708             [#1] image.jpg imagecube3d
8709
8710         imageplane3d:
8711
8712           Generate 3D mapped planes from selected images.
8713
8714           Example:
8715             [#1] image.jpg imageplane3d
8716
8717         imagepyramid3d:
8718
8719           Generate 3D mapped pyramids from selected images.
8720
8721           Example:
8722             [#1] image.jpg imagepyramid3d
8723
8724         imagerubik3d:
8725             _xy_tiles>=1,0<=xy_shift<=100,0<=z_shift<=100
8726
8727           Generate 3D mapped rubik's cubes from selected images.
8728
8729           Default values: 'xy_tiles=3', 'xy_shift=5' and 'z_shift=5'.
8730
8731           Example:
8732             [#1] image.jpg imagerubik3d ,
8733
8734         imagesphere3d:
8735             _resolution1>=3,_resolution2>=3
8736
8737           Generate 3D mapped sphere from selected images.
8738
8739           Default values: 'resolution1=32' and 'resolutions2=16'.
8740
8741           Example:
8742             [#1] image.jpg imagesphere3d 32,16
8743
8744         isoline3d (+):
8745             isovalue[%] |
8746             'formula',value,_x0,_y0,_x1,_y1,_size_x>0[%],_size_y>0[%]
8747
8748           Extract 3D isolines with specified value from  selected  images  or
8749       from specified formula.
8750
8751           Default values: 'x0=y0=-3', 'x1=y1=3' and 'size_x=size_y=256'.
8752
8753           Example:
8754             [#1] image.jpg blur 1 isoline3d 50%
8755             [#2] isoline3d 'X=x-w/2;Y=y-h/2;(X^2+Y^2)%20',10,-10,-10,10,10
8756
8757         isosurface3d (+):
8758             isovalue[%] |
8759             'for‐
8760       mula',value,_x0,_y0,_z0,_x1,_y1,_z1,_size_x>0[%],_size_y>0[%],_size_z>0[%]
8761
8762           Extract 3D isosurfaces with specified value from selected images or
8763       from specified formula.
8764
8765           Default      values:      'x0=y0=z0=-3',      'x1=y1=z1=3'      and
8766       'size_x=size_y=size_z=32'.
8767
8768           Example:
8769             [#1] image.jpg resize2dy 128 luminance threshold 50% expand_z 2,0
8770       blur 1 isosurface3d 50% mul3d 1,1,30
8771             [#2] isosurface3d 'x^2+y^2+abs(z)^abs(4*cos(x*y*z*3))',3
8772
8773         label3d:
8774             "text",font_height>=0,_opacity,_color1,...
8775
8776           Generate 3D text label.
8777
8778           Default     values:     'font_height=13',      'opacity=1'      and
8779       'color=255,255,255'.
8780
8781         label_points3d:
8782             _label_size>0,_opacity
8783
8784           Add a numbered label to all vertices of selected 3D objects.
8785
8786           Default values: 'label_size=13' and 'opacity=0.8'.
8787
8788           Example:
8789             [#1] torus3d 100,40,6,6 label_points3d 23,1 mode3d 1
8790
8791         lathe3d:
8792             _resolution>0,_smoothness[%]>=0,_max_angle>=0
8793
8794           Generate 3D object from selected binary XY-profiles.
8795
8796           Default  values:  'resolution=128',  'smoothness=0.5%' and 'max_an‐
8797       gle=361'.
8798
8799           Example:
8800             [#1] 300,300 rand -1,1 blur 40 sign normalize 0,255 lathe3d ,
8801
8802         l3d (+):
8803             Shortcut for command 'light3d'.
8804
8805         light3d (+):
8806             position_x,position_y,position_z |
8807             [texture] |
8808             (no arg)
8809
8810           Set the light coordinates or the light texture for 3D rendering.
8811           (equivalent to shortcut command 'l3d').
8812
8813           (no arg) resets the 3D light to default.
8814
8815           Example:
8816             [#1] torus3d 100,30 double3d  0  specs3d  1.2  repeat  5  light3d
8817       {$>*100},0,-300 +snapshot3d[0] 400 done remove[0]
8818
8819         line3d:
8820             x0,y0,z0,x1,y1,z1
8821
8822           Input 3D line at specified coordinates.
8823
8824           Example:
8825             [#1]         repeat         100        a={$>*pi/50}        line3d
8826       0,0,0,{cos(3*$a)},{sin(2*$a)},0 color3d. ${-rgb} done add3d
8827
8828         lissajous3d:
8829             resolution>1,a,A,b,B,c,C
8830
8831           Input 3D lissajous curves (x(t)=sin(at+A*2pi),  y(t)=sin(bt+B*2pi),
8832       z(t)=sin(ct+C*2pi)).
8833
8834           Default  values:  'resolution=1024',  'a=2',  'A=0',  'b=1', 'B=0',
8835       'c=0' and 'C=0'.
8836
8837           Example:
8838             [#1] lissajous3d ,
8839
8840         m3d (+):
8841             Shortcut for command 'mode3d'.
8842
8843         mode3d (+):
8844             _mode
8845
8846           Set static 3D rendering mode.
8847           (equivalent to shortcut command 'm3d').
8848
8849           'mode' can be { -1=bounding-box | 0=dots | 1=wireframe |  2=flat  |
8850       3=flat-shaded | 4=gouraud-shaded | 5=phong-shaded }.");
8851           Bounding-box  mode  ('mode==-1') is active only for the interactive
8852       3D viewer.
8853
8854           Default value: 'mode=4'.
8855
8856           Example:
8857             [#1]  (0,1,2,3,4,5)  double3d  0  repeat  w  torus3d  100,30  ro‐
8858       tate3d[-1] 1,1,0,60 mode3d {0,@$>} snapshot3d[-1] 300 done remove[0]
8859
8860         md3d (+):
8861             Shortcut for command 'moded3d'.
8862
8863         moded3d (+):
8864             _mode
8865
8866           Set dynamic 3D rendering mode for interactive 3D viewer.
8867           (equivalent to shortcut command 'md3d').
8868
8869           'mode'  can  be { -1=bounding-box | 0=dots | 1=wireframe | 2=flat |
8870       3=flat-shaded | 4=gouraud-shaded | 5=phong-shaded }.
8871
8872           Default value: 'mode=-1'.
8873
8874         *3d (+):
8875             Shortcut for command 'mul3d'.
8876
8877         mul3d (+):
8878             factor |
8879             factor_x,factor_y,_factor_z
8880
8881           Scale selected 3D objects isotropically  or  anisotropically,  with
8882       specified factors.
8883           (equivalent to shortcut command '*3d').
8884
8885           Default value: 'factor_z=0'.
8886
8887           Example:
8888             [#1]  torus3d  5,2  repeat  5  +add3d[-1]  10,0,0  mul3d[-1]  1.2
8889       color3d[-1] ${-rgb} done add3d
8890
8891         n3d:
8892             Shortcut for command 'normalize3d'.
8893
8894         normalize3d:
8895
8896           Normalize selected 3D objects to unit size.
8897           (equivalent to shortcut command 'n3d').
8898
8899           Example:
8900             [#1] repeat  100  circle3d  {u(3)},{u(3)},{u(3)},0.1  done  add3d
8901       color3d[-1] 255,0,0 +normalize3d[-1] color3d[-1] 0,255,0 add3d
8902
8903         o3d (+):
8904             Shortcut for command 'opacity3d'.
8905
8906         opacity3d (+):
8907             _opacity
8908
8909           Set opacity of selected 3D objects.
8910           (equivalent to shortcut command 'o3d').
8911
8912           Default value: 'opacity=1'.
8913
8914           Example:
8915             [#1]  torus3d  100,10  double3d 0 repeat 7 +rotate3d[-1] 1,0,0,20
8916       opacity3d[-1] {u} done add3d
8917
8918         parametric3d:
8919             _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‐
8920       ness>=0,_isovalue>=0
8921
8922           Input   3D  object  from  specified  parametric  surface  '(a,b)  ⟶
8923       (x(a,b),y(a,b),z(a,b))'.
8924
8925           Default   values:   'x=(2+cos(b))*sin(a)',   'y=(2+cos(b))*cos(a)',
8926       'c=sin(b)', 'amin=-pi', 'amax=pi', 'bmin=-pi', 'bmax=pi', 'res_a=512',
8927            'res_b=res_a',  'res_x=64', 'res_y=res_x', 'res_z=res_y', 'smooth‐
8928       ness=2%' and 'isovalue=10%'.
8929
8930           Example:
8931             [#1] parametric3d ,
8932
8933         pca_patch3d:
8934             _patch_size>0,_M>0,_N>0,_normalize_input={  0  |   1   },_normal‐
8935       ize_output={ 0 | 1 },_lambda_xy
8936
8937           Get 3D patch-pca representation of selected images.
8938           The  3D  patch-pca  is estimated from M patches on the input image,
8939       and displayed as a cloud of N 3D points.
8940
8941           Default values: 'patch_size=7', 'M=1000', 'N=3000',  'normalize_in‐
8942       put=1', 'normalize_output=0', and 'lambda_xy=0'.
8943
8944           Example:
8945             [#1] image.jpg pca_patch3d 7
8946
8947         plane3d:
8948             _size_x,_size_y,_nb_subdivisions_x>0,_nb_subdisivions_y>0
8949
8950           Input 3D plane at (0,0,0), with specified geometry.
8951
8952           Default   values:   'size_x=1',  'size_y=size_x'  and  'nb_subdivi‐
8953       sions_x=nb_subdivisions_y=24'.
8954
8955           Example:
8956             [#1] plane3d 50,30 +primitives3d 1 color3d[-2] ${-rgb}
8957
8958         point3d:
8959             x0,y0,z0
8960
8961           Input 3D point at specified coordinates.
8962
8963           Example:
8964             [#1] repeat 1000 a={$>*pi/500} point3d  {cos(3*$a)},{sin(2*$a)},0
8965       color3d[-1] ${-rgb} done add3d
8966
8967         pointcloud3d:
8968
8969           Convert selected planar or volumetric images to 3D point clouds.
8970
8971           Example:
8972             [#1]  image.jpg  luminance  resize2dy  100  threshold 50% mul 255
8973       pointcloud3d color3d[-1] 255,255,255
8974
8975         pose3d:
8976             p1,...,p12
8977
8978           Apply 3D pose matrix to selected 3D objects.
8979
8980           Example:
8981             [#1]              torus3d              100,20              pose3d
8982       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
8983       snapshot3d 400
8984
8985         p3d:
8986             Shortcut for command 'primitives3d'.
8987
8988         primitives3d:
8989             mode
8990
8991           Convert primitives of selected 3D objects.
8992           (equivalent to shortcut command 'p3d').
8993
8994           'mode' can be { 0=points | 1=outlines | 2=non-textured }.
8995
8996           Example:
8997             [#1] sphere3d 30 primitives3d 1 torus3d 50,10 color3d[-1] ${-rgb}
8998       add3d
8999
9000         projections3d:
9001             _x[%],_y[%],_z[%],_is_bounding_box={ 0 | 1 }
9002
9003           Generate  3D  xy,xz,yz  projection planes from specified volumetric
9004       images.
9005
9006         pyramid3d:
9007             width,height
9008
9009           Input 3D pyramid at (0,0,0), with specified geometry.
9010
9011           Example:
9012             [#1] pyramid3d 100,-100 +primitives3d 1 color3d[-2] ${-rgb}
9013
9014         quadrangle3d:
9015             x0,y0,z0,x1,y1,z1,x2,y2,z2,x3,y3,z3
9016
9017           Input 3D quadrangle at specified coordinates.
9018
9019           Example:
9020             [#1] quadrangle3d -10,-10,10,10,-10,10,10,10,10,-10,10,10  repeat
9021       10 +rotate3d[-1] 0,1,0,30 color3d[-1] ${-rgb},0.6 done add3d mode3d 2
9022
9023         random3d:
9024             nb_points>=0
9025
9026           Input random 3D point cloud in [0,1]^3.
9027
9028           Example:
9029             [#1] random3d 100 circles3d 0.1 opacity3d 0.5
9030
9031         rv3d (+):
9032             Shortcut for command 'reverse3d'.
9033
9034         reverse3d (+):
9035
9036           Reverse primitive orientations of selected 3D objects.
9037           (equivalent to shortcut command 'rv3d').
9038
9039           Example:
9040             [#1] torus3d 100,40 double3d 0 +reverse3d
9041
9042         r3d (+):
9043             Shortcut for command 'rotate3d'.
9044
9045         rotate3d (+):
9046             u,v,w,angle
9047
9048           Rotate selected 3D objects around specified axis with specified an‐
9049       gle (in deg.).
9050           (equivalent to shortcut command 'r3d').
9051
9052           Example:
9053             [#1] torus3d 100,10 double3d 0 repeat  7  +rotate3d[-1]  1,0,0,20
9054       done add3d
9055
9056         rotation3d:
9057             u,v,w,angle
9058
9059           Input 3x3 rotation matrix with specified axis and angle (in deg).
9060
9061           Example:
9062             [#1] rotation3d 1,0,0,0 rotation3d 1,0,0,90 rotation3d 1,0,0,180
9063
9064         sierpinski3d:
9065             _recursion_level>=0,_width,_height
9066
9067           Input 3d Sierpinski pyramid.
9068
9069           Example:
9070             [#1] sierpinski3d 3,100,-100 +primitives3d 1 color3d[-2] ${-rgb}
9071
9072         size3d:
9073
9074           Return bounding box size of the last selected 3D object.
9075
9076         skeleton3d:
9077             _metric,_frame_type={ 0=squares | 1=diamonds | 2=circles | 3=auto
9078       },_skeleton_opacity,_frame_opacity,_is_frame_wireframe={ 0 | 1 }
9079
9080           Build 3D skeletal structure object from 2d binary shapes located in
9081       selected images.
9082           'metric' can be { 0=chebyshev | 1=manhattan | 2=euclidean }.
9083
9084           Default  values:  'metric=2',  'bones_type=3', 'skeleton_opacity=1'
9085       and 'frame_opacity=0.1'.
9086
9087           Example:
9088             [#1] shape_cupid 480 +skeleton3d ,
9089
9090         snapshot3d:
9091             _size>0,_zoom>=0,_backgroundR,_backgroundG,_backgroundB,_back‐
9092       groundA |
9093             [background_image],zoom>=0
9094
9095           Take 2d snapshots of selected 3D objects.
9096           Set 'zoom' to 0 to disable object auto-scaling.
9097
9098           Default  values:  'size=512', 'zoom=1' and '[background_image]=(de‐
9099       fault)'.
9100
9101           Example:
9102             [#1]    torus3d    100,20    rotate3d     1,1,0,60     snapshot3d
9103       400,1.2,128,64,32
9104             [#2]  torus3d  100,20  rotate3d  1,1,0,60 sample ? +snapshot3d[0]
9105       [1],1.2
9106
9107         sl3d (+):
9108             Shortcut for command 'specl3d'.
9109
9110         specl3d (+):
9111             value>=0
9112
9113           Set lightness of 3D specular light.
9114           (equivalent to shortcut command 'sl3d').
9115
9116           Default value: 'value=0.15'.
9117
9118           Example:
9119             [#1] (0,0.3,0.6,0.9,1.2) repeat  w  torus3d  100,30  rotate3d[-1]
9120       1,1,0,60  color3d[-1]  255,0,0  specl3d {0,@$>} snapshot3d[-1] 400 done
9121       remove[0]
9122
9123         ss3d (+):
9124             Shortcut for command 'specs3d'.
9125
9126         specs3d (+):
9127             value>=0
9128
9129           Set shininess of 3D specular light.
9130           (equivalent to shortcut command 'ss3d').
9131
9132           Default value: 'value=0.8'.
9133
9134           Example:
9135             [#1] (0,0.3,0.6,0.9,1.2) repeat  w  torus3d  100,30  rotate3d[-1]
9136       1,1,0,60  color3d[-1]  255,0,0  specs3d {0,@$>} snapshot3d[-1] 400 done
9137       remove[0]
9138
9139         sphere3d (+):
9140             radius,_nb_recursions>=0
9141
9142           Input 3D sphere at (0,0,0), with specified geometry.
9143
9144           Default value: 'nb_recursions=3'.
9145
9146           Example:
9147             [#1] sphere3d 100 +primitives3d 1 color3d[-2] ${-rgb}
9148
9149         spherical3d:
9150             _nb_azimuth>=3,_nb_zenith>=3,_radius_function(phi,theta)
9151
9152           Input 3D spherical object at (0,0,0), with specified geometry.
9153
9154           Default   values:   'nb_zenith=nb_azimut=64'   and    'radius_func‐
9155       tion="abs(1+0.5*cos(3*phi)*sin(4*theta))"'.
9156
9157           Example:
9158             [#1] spherical3d 64 +primitives3d 1
9159
9160         spline3d:
9161             x0[%],y0[%],z0[%],u0[%],v0[%],w0[%],x1[%],y1[%],z1[%],u1[%],v1[%],w1[%],_nb_ver‐
9162       tices>=2
9163
9164           Input 3D spline with specified geometry.
9165
9166           Default values: 'nb_vertices=128'.
9167
9168           Example:
9169             [#1]              repeat               100               spline3d
9170       {u},{u},{u},{u},{u},{u},{u},{u},{u},{u},{u},{u},128 color3d[-1] ${-rgb}
9171       done box3d 1 primitives3d[-1] 1 add3d
9172
9173         s3d (+):
9174             Shortcut for command 'split3d'.
9175
9176         split3d (+):
9177             _full_split={ 0 | 1 }
9178
9179           Split selected 3D objects into feature vectors :
9180            * If 'full_split==0', { header, sizes, vertices, primitives,  col‐
9181       ors, opacities }.
9182            *  If  'full_split==1',  {  header,  sizes,  vertices,  p0,...,pP,
9183       c0,...,cP, o0,...,oP }.
9184           (equivalent to shortcut command 's3d').
9185
9186           To recreate the 3D object, append all produced images along the  y-
9187       axis.
9188
9189           Default value: 'full_split=0'.
9190
9191           Example:
9192             [#1] box3d 100 +split3d
9193
9194         sprite3d:
9195
9196           Convert selected images as 3D sprites.
9197           Selected images with alpha channels are managed.
9198
9199           Example:
9200             [#1] image.jpg sprite3d
9201
9202         sprites3d:
9203             [sprite],_sprite_has_alpha_channel={ 0 | 1 }
9204
9205           Convert selected 3D objects as a sprite cloud.
9206           Set 'sprite_has_alpha_channel' to 1 to make the last channel of the
9207       selected sprite be a transparency mask.
9208
9209           Default value: 'mask_has_alpha_channel=0'.
9210
9211           Example:
9212             [#1] torus3d 100,20 image.jpg resize2dy[-1] 64  100%,100%  gauss‐
9213       ian[-1]  30%,30%  *[-1]  255  append[-2,-1]  c +sprites3d[0] [1],1 dis‐
9214       play_rgba[-2]
9215
9216         star3d:
9217             _nb_branches>0,0<=_thickness<=1
9218
9219           Input 3D star at position '(0,0,0)', with specified geometry.
9220
9221           Default values: 'nb_branches=5' and 'thickness=0.38'.
9222
9223           Example:
9224             [#1] star3d , +primitives3d 1 color3d[-2] ${-rgb}
9225
9226         streamline3d (+):
9227             x[%],y[%],z[%],_L>=0,_dl>0,_interpolation,_is_backward={  0  |  1
9228       },_is_oriented={ 0 | 1 } |
9229             'formula',x,y,z,_L>=0,_dl>0,_interpolation,_is_backward={  0  | 1
9230       },_is_oriented={ 0 | 1 }
9231
9232           Extract 3D streamlines from selected vector fields or  from  speci‐
9233       fied formula.
9234           'interpolation'  can  be { 0=nearest integer | 1=1st-order | 2=2nd-
9235       order | 3=4th-order }.
9236
9237           Default values: 'dl=0.1',  'interpolation=2',  'is_backward=0'  and
9238       'is_oriented=0'.
9239
9240           Example:
9241             [#1] 100,100,100,3 rand -10,10 blur 3 repeat 300 +streamline3d[0]
9242       {u(100)},{u(100)},{u(100)},1000,1,1 color3d[-1] ${-rgb} done  remove[0]
9243       box3d 100 primitives3d[-1] 1 add3d
9244
9245         -3d (+):
9246             Shortcut for command 'sub3d'.
9247
9248         sub3d (+):
9249             tx,_ty,_tz
9250
9251           Shift  selected 3D objects with the opposite of specified displace‐
9252       ment vector.
9253           (equivalent to shortcut command '3d').
9254
9255           Default values: 'ty=tz=0'.
9256
9257           Example:
9258             [#1] sphere3d 10 repeat 5 +sub3d[-1] 10,{u(-10,10)},0 color3d[-1]
9259       ${-rgb} done add3d
9260
9261         superformula3d:
9262             resolution>1,m>=1,n1,n2,n3
9263
9264           Input 2D superformula curve as a 3D object.
9265
9266           Default   values:  'resolution=1024',  'm=8',  'n1=1',  'n2=5'  and
9267       'n3=8'.
9268
9269           Example:
9270             [#1] superformula3d ,
9271
9272         tensors3d:
9273             _radius_factor>=0,_shape={ 0=box | >=N=ellipsoid },_radius_min>=0
9274
9275           Generate 3D tensor fields from selected images.
9276           when 'shape'>0, it gives the ellipsoid shape precision.
9277
9278           Default values: 'radius_factor=1', 'shape=2' and 'radius_min=0.05'.
9279
9280           Example:
9281             [#1] 6,6,6,9,"U = [x,y,z] - [w,h,d]/2; U/=norm(U);  mul(U,U,3)  +
9282       0.3*eye(3)" tensors3d 0.8
9283
9284         text_pointcloud3d:
9285             _"text1",_"text2",_smoothness
9286
9287           Input 3D text pointcloud from the two specified strings.
9288
9289           Default   values:  'text1="text1"',  'text2="text2"'  and  'smooth‐
9290       ness=1'.
9291
9292           Example:
9293             [#1] text_pointcloud3d "G'MIC","Rocks!"
9294
9295         text3d:
9296             text,_font_height>0,_depth>0,_smoothness
9297
9298           Input a 3D text object from specified text.
9299
9300           Default values: 'font_height=53', 'depth=10' and 'smoothness=1.5'.
9301
9302           Example:
9303             [#1] text3d "G'MIC as a0D logo!"
9304
9305         t3d:
9306             Shortcut for command 'texturize3d'.
9307
9308         texturize3d:
9309             [ind_texture],_[ind_coords]
9310
9311           Texturize selected 3D objects with specified  texture  and  coordi‐
9312       nates.
9313           (equivalent to shortcut command 't3d').
9314
9315           When  '[ind_coords]'  is  omitted, default XY texture projection is
9316       performed.
9317
9318           Default value: 'ind_coords=(undefined)'.
9319
9320           Example:
9321             [#1] image.jpg torus3d 100,30 texturize3d[-1] [-2] keep[-1]
9322
9323         torus3d:
9324             _radius1,_radius2,_nb_subdivisions1>2,_nb_subdivisions2>2
9325
9326           Input 3D torus at (0,0,0), with specified geometry.
9327
9328           Default values: 'radius1=1',  'radius2=0.3',  'nb_subdivisions1=24'
9329       and 'nb_subdivisions2=12'.
9330
9331           Example:
9332             [#1] torus3d 10,3 +primitives3d 1 color3d[-2] ${-rgb}
9333
9334         triangle3d:
9335             x0,y0,z0,x1,y1,z1,x2,y2,z2
9336
9337           Input 3D triangle at specified coordinates.
9338
9339           Example:
9340             [#1]        repeat        100       a={$>*pi/50}       triangle3d
9341       0,0,0,0,0,3,{cos(3*$a)},{sin(2*$a)},0 color3d[-1] ${-rgb} done add3d
9342
9343         volume3d:
9344
9345           Transform selected 3D volumetric images as 3D parallelepipedic  ob‐
9346       jects.
9347
9348           Example:
9349             [#1] image.jpg animate blur,0,5,30 append z volume3d
9350
9351         weird3d:
9352             _resolution>0
9353
9354           Input 3D weird object at (0,0,0), with specified resolution.
9355
9356           Default value: 'resolution=32'.
9357
9358           Example:
9359             [#1] weird3d 48 +primitives3d 1 color3d[-2] ${-rgb}
9360
9361         12.13. Control Flow
9362                ------------
9363
9364         ap:
9365             Shortcut for command 'apply_parallel'.
9366
9367         apply_parallel:
9368             "command"
9369
9370           Apply  specified  command on each of the selected images, by paral‐
9371       lelizing it for all image of the list.
9372           (equivalent to shortcut command 'ap').
9373
9374           Example:
9375             [#1] image.jpg +mirror x +mirror y apply_parallel "blur 3"
9376
9377         apc:
9378             Shortcut for command 'apply_parallel_channels'.
9379
9380         apply_parallel_channels:
9381             "command"
9382
9383           Apply specified command on each of the selected images,  by  paral‐
9384       lelizing it for all channel
9385           of the images independently.
9386           (equivalent to shortcut command 'apc').
9387
9388           Example:
9389             [#1] image.jpg apply_parallel_channels "blur 3"
9390
9391         apo:
9392             Shortcut for command 'apply_parallel_overlap'.
9393
9394         apply_parallel_overlap:
9395             "command",overlap[%],nb_threads={ 0=auto | 1 | 2 | 4 | 8 | 16 }
9396
9397           Apply  specified  command on each of the selected images, by paral‐
9398       lelizing it on 'nb_threads'
9399           overlapped sub-images.
9400           (equivalent to shortcut command 'apo').
9401
9402           'nb_threads' must be a power of 2.
9403
9404           Default values: 'overlap=0','nb_threads=0'.
9405
9406           Example:
9407             [#1] image.jpg +apply_parallel_overlap "smooth 500,0,1",1
9408
9409         at:
9410             Shortcut for command 'apply_tiles'.
9411
9412         apply_tiles:
9413             "com‐
9414       mand",_tile_width[%]>0,_tile_height[%]>0,_tile_depth[%]>0,_over‐
9415       lap_width[%]>=0,_overlap_height[%]>=0,_overlap_depth[%]>=0,_bound‐
9416       ary_conditions={ 0=dirichlet | 1=neumann | 2=periodic |
9417               3=mirror }
9418
9419           Apply specified command on each tile (neighborhood) of the selected
9420       images, eventually with overlapping tiles.
9421           (equivalent to shortcut command 'at').
9422
9423           Default   values:    'tile_width=tile_height=tile_depth=10%','over‐
9424       lap_width=overlap_height=overlap_depth=0' and 'boundary_conditions=1'.
9425
9426           Example:
9427             [#1]   image.jpg   +equalize[0]   256  +apply_tiles[0]  "equalize
9428       256",16,16,1,50%,50%
9429
9430         apply_timeout:
9431             "command",_timeout={ 0=no timeout | >0=with specified timeout (in
9432       seconds) }
9433
9434           Apply a command with a timeout.
9435           Set  variable '$_is_timeout' to '1' if timeout occurred, '0' other‐
9436       wise.
9437
9438           Default value: 'timeout=20'.
9439
9440         check (+):
9441             condition
9442
9443           Evaluate specified condition and display an error message if evalu‐
9444       ated to false.
9445           If 'expression' is not a math expression, it is regarded as a file‐
9446       name and checked if it exists.
9447
9448         check3d (+):
9449             _is_full_check={ 0 | 1 }
9450
9451           Check validity of selected 3D vector objects, and display an  error
9452       message
9453           if one of the selected images is not a valid 3D vector object.
9454           Full 3D object check is slower but more precise.
9455
9456           Default value: 'is_full_check=1'.
9457
9458         continue (+):
9459
9460           Go to end of current 'repeat...done', 'do...while' or 'local...end‐
9461       local' block.
9462
9463           Example:
9464             [#1] image.jpg repeat 10 blur 1 if 1==1  continue  fi  deform  10
9465       done
9466
9467         break (+):
9468
9469           Break  current  'repeat...done', 'do...while' or 'local...endlocal'
9470       block.
9471
9472           Example:
9473             [#1] image.jpg repeat 10 blur 1 if 1==1 break fi deform 10 done
9474
9475         do (+):
9476
9477           Start a 'do...while' block.
9478
9479           Example:
9480             [#1] image.jpg luminance i={ia+2} do set  255,{u(100)}%,{u(100)}%
9481       while ia<$i
9482
9483         done (+):
9484
9485           End  a 'repeat/for...done' block, and go to associated 'repeat/for'
9486       position, if iterations remain.
9487
9488         elif (+):
9489             condition
9490
9491           Start a 'elif...[else]...fi' block if previous 'if' was  not  veri‐
9492       fied
9493           and test if specified condition holds
9494           'condition'  is  a mathematical expression, whose evaluation is in‐
9495       terpreted as { 0=false | other=true }..
9496
9497           Tutorial: https://gmic.eu/tutorial/iffi
9498
9499         else (+):
9500
9501           Execute following commands if previous 'if'  or  'elif'  conditions
9502       failed.
9503
9504           Tutorial: https://gmic.eu/tutorial/iffi
9505
9506         fi (+):
9507
9508           End a 'if...[elif]...[else]...fi' block.
9509           (equivalent to shortcut command 'fi').
9510
9511           Tutorial: https://gmic.eu/tutorial/iffi
9512
9513         endl (+):
9514             Shortcut for command 'endlocal'.
9515
9516         endlocal (+):
9517
9518           End a 'local...endlocal' block.
9519           (equivalent to shortcut command 'endl').
9520
9521         error (+):
9522             message
9523
9524           Print  specified  error  message on the standard error (stderr) and
9525       exit interpreter, except
9526           if error is caught by a 'onfail' command.
9527           Command selection (if any) stands for displayed call  stack  subset
9528       instead of image indices.
9529
9530         eval (+):
9531             expression
9532
9533           Evaluate specified math expression.
9534            *  If  no command selection is specified, the expression is evalu‐
9535       ated once and its result is set to status.
9536            * If command selection is specified, the evaluation is looped over
9537       selected images. Status is not modified.
9538             (in this latter case, 'eval' is similar to 'fill' without assign‐
9539       ing the image values).
9540
9541         x (+):
9542             Shortcut for command 'exec'.
9543
9544         exec (+):
9545             _is_verbose={ 0 | 1 },"command"
9546
9547           Execute external command using a system call.
9548           The status value is then set to the error code returned by the sys‐
9549       tem call.
9550           If  'is_verbose=1',  the  executed  command is allowed to output on
9551       stdout/stderr.
9552           (equivalent to shortcut command 'x').
9553
9554           Default value: 'is_verbose=1'.
9555
9556         xo:
9557             Shortcut for command 'exec_out'.
9558
9559         exec_out:
9560             _mode,"command"
9561
9562           Execute external command using a system call, and return  resulting
9563       'stdout' and/or 'stderr'.
9564           'mode' can be { 0=stdout | 1=stderr | 2=stdout+stderr }.
9565
9566         for (+):
9567             condition
9568
9569           Start a 'for...done' block.
9570
9571           Example:
9572             [#1]  image.jpg  resize2dy 32 400,400,1,3 x=0 for $x<400 image[1]
9573       [0],$x,$x x+=40 done
9574
9575         if (+):
9576             condition
9577
9578           Start a 'if...[elif]...[else]...fi' block  and  test  if  specified
9579       condition holds.
9580           'condition'  is  a mathematical expression, whose evaluation is in‐
9581       terpreted as { 0=false | other=true }.
9582
9583           Example:
9584             [#1] image.jpg if ia<64 add 50% elif ia<128 add 25%  elif  ia<192
9585       sub 25% else sub 50% fi cut 0,255
9586
9587           Tutorial: https://gmic.eu/tutorial/iffi
9588
9589         l (+):
9590             Shortcut for command 'local'.
9591
9592         local (+):
9593
9594           Start a 'local...[onfail]...endlocal' block, with selected images.
9595           (equivalent to shortcut command 'l').
9596
9597           Example:
9598             [#1]  image.jpg  local[] 300,300,1,3 rand[0] 0,255 blur 4 sharpen
9599       1000 endlocal
9600             [#2] image.jpg +local repeat 3 deform 20 done endlocal
9601
9602           Tutorial: https://gmic.eu/oldtutorial/_local
9603
9604         mutex (+):
9605             index,_action={ 0=unlock | 1=lock }
9606
9607           Lock or unlock specified mutex for multi-threaded programming.
9608           A locked mutex can be unlocked only by the same thread. All mutexes
9609       are unlocked by default.
9610           'index' designates the mutex index, in [0,255].
9611
9612           Default value: 'action=1'.
9613
9614         noarg (+):
9615
9616           Used  in a custom command, 'noarg' tells the command that its argu‐
9617       ment list have not been used
9618           finally, and so they must be evaluated next in the G'MIC  pipeline,
9619       just as if the custom
9620           command takes no arguments at all.
9621           Use  this  command to write a custom command which can decide if it
9622       takes arguments or not.
9623
9624         onfail (+):
9625
9626           Execute following commands when an error is encountered in the body
9627       of the 'local...endlocal' block.
9628           The status value is set with the corresponding error message.
9629
9630           Example:
9631             [#1] image.jpg +local blur -3 onfail mirror x endlocal
9632
9633         parallel (+):
9634             _wait_threads,"command1","command2",...
9635
9636           Execute specified commands in parallel, each in a different thread.
9637           Parallel threads share the list of images.
9638           'wait_threads' can be { 0=when current environment ends | 1=immedi‐
9639       ately }.
9640
9641           Default value: 'wait_threads=1'.
9642
9643           Example:
9644             [#1] image.jpg [0] parallel "blur[0] 3","mirror[1] c"
9645
9646         progress (+):
9647             0<=value<=100 |
9648             -1
9649
9650           Set the progress index of the current processing pipeline.
9651           This command is useful only when G'MIC is used by an embedding  ap‐
9652       plication.
9653
9654         q (+):
9655             Shortcut for command 'quit'.
9656
9657         quit (+):
9658
9659           Quit G'MIC interpreter.
9660           (equivalent to shortcut command 'q').
9661
9662         repeat (+):
9663             nb_iterations,_variable_name
9664
9665           Start 'nb_iterations' iterations of a 'repeat...done' block.
9666           'nb_iterations'  is  a  mathematical expression that will be evalu‐
9667       ated.
9668
9669           Example:
9670             [#1] image.jpg split y repeat $!,n shift[$n] $<,0,0,0,2 done  ap‐
9671       pend y
9672             [#2]  image.jpg  mode3d  2 repeat 4 imagecube3d rotate3d 1,1,0,40
9673       snapshot3d 400,1.4 done
9674
9675           Tutorial: https://gmic.eu/oldtutorial/_repeat
9676
9677         return (+):
9678
9679           Return from current custom command.
9680
9681         rprogress:
9682             0<=value<=100          |           -1           |           "com‐
9683       mand",0<=value_min<=100,0<=value_max<=100
9684
9685           Set  the  progress  index of the current processing pipeline (rela‐
9686       tively to
9687           previously defined progress bounds), or call the specified  command
9688       with
9689           specified progress bounds.
9690
9691         run:
9692             "G'MIC pipeline"
9693
9694           Run specified G'MIC pipeline.
9695           This  is  only  useful  when used from a shell, e.g. to avoid shell
9696       substitutions to happen in argument.
9697
9698         skip (+):
9699             item
9700
9701           Do nothing but skip specified item.
9702
9703         u (+):
9704             Shortcut for command 'status'.
9705
9706         status (+):
9707             status_string
9708
9709           Set the current status. Used to define a  returning  value  from  a
9710       function.
9711           (equivalent to shortcut command 'u').
9712
9713           Example:
9714             [#1]   image.jpg   command   "foo   :  u0=Dark  u1=Bright  status
9715       ${u{ia>=128}}" text_outline ${-foo},2,2,23,2,1,255
9716
9717         while (+):
9718             condition
9719
9720           End a 'do...while' block and go back to associated 'do'  if  speci‐
9721       fied condition holds.
9722           'condition'  is  a mathematical expression, whose evaluation is in‐
9723       terpreted as { 0=false | other=true }.
9724
9725         12.14. Neural Networks
9726                ---------------
9727
9728         nn_lib ::
9729
9730           Return the list of library functions that has to be included  in  a
9731       math expression,in order to use the neural network library.
9732
9733         nn_init:
9734
9735           Initialize a new network.
9736
9737         nn_check_layer:
9738             name
9739
9740           Check that the layer with specified name exists in the network.
9741
9742         nn_save:
9743             'filename.gmz'
9744
9745           Save current network as a .gmz file.
9746           Neural network files can be only saved in .gmz format.
9747
9748         nn_load:
9749             'filename.gmz'
9750
9751           Load and initialize network saved as a .gmz file.
9752           Neural network files can be only loaded in .gmz format.
9753
9754         nn_layer_input:
9755             name,width,_height,_depth,_spectrum
9756
9757           Add an 'input' layer to the network.
9758
9759           Default values: 'height=1', 'depth=1' and 'spectrum=1'.
9760
9761         nn_layer_add:
9762             name,in0,in1
9763
9764           Add an 'add' layer to the network.
9765
9766         nn_layer_append:
9767             name,in0,in1
9768
9769           Add an 'append' layer to the network.
9770
9771         nn_layer_avgpool2d:
9772             name,in
9773
9774           Add a 'avgpool2d' layer (2d average pooling) to the network.
9775
9776         nn_layer_batchnorm:
9777             name,in,learning_mode.
9778
9779           Add a 'batchnorm' layer to the network.
9780           'learning_mode'  can  be  { 0=no parameters learnt | 1=gamma-only |
9781       2=beta-only | 3=gamma & beta}.
9782
9783         nn_layer_clone:
9784             name0,name1,in
9785
9786           Add a 'clone' layer to the network.
9787
9788         nn_layer_conv2d:
9789             name,in,nb_channels>0,_kernel_size>0,_stride>0,_dilation>0
9790
9791           Add a 'conv2d' layer (2D convolutional layer) to the network.
9792
9793           Default values: 'kernel_size=3', 'stride=1' and 'dilation=1'.
9794
9795         nn_layer_conv2dnl:
9796             name,in,nb_channels>0,_kernel_size>0,_stride>0,_dilation>0,_acti‐
9797       vation
9798
9799           Add  a  'con2dnl' (2D convolutional layer followed by a non-linear‐
9800       ity), to the network.
9801
9802           Default values: 'kernel_size=3', 'stride=1', 'dilation=1' and  'ac‐
9803       tivation=leakyrelu'.
9804
9805         nn_layer_fc:
9806             name,in,nb_channels>0
9807
9808           Add a 'fc' layer (fully connected layer) to the network.
9809
9810         nn_layer_fcnl:
9811             name,in,nb_neurons>0,_activation
9812
9813           Add a 'fcnl' layer (fully connected layer followed by a non-linear‐
9814       ity), to the network.
9815
9816           Default value: 'activation=leakyrelu'.
9817
9818         nn_layer_maxpool2d:
9819             name,in
9820
9821           Add a 'maxpool2d' layer (2d max pooling) to the network.
9822
9823         nn_layer_nl:
9824             name,in,activation
9825
9826           Add a 'nl' layer (non-linearity) to the network.
9827
9828           Default value: 'activation=leakyrelu'.
9829
9830         nn_layer_rename:
9831             name,in
9832
9833           Add a 'rename' layer to the network.
9834
9835         nn_layer_reshape:
9836             name,in,width>0,height>0,depth>0,spectrum>0
9837
9838           Add a 'reshape' layer to the network.
9839
9840         nn_layer_split:
9841             name0,name1,in,nb_channels0
9842
9843           Add a 'split' layer to the network.
9844
9845         nn_layer_upsample2d:
9846             name,in,_interpolation_type = { 0=nearest-neighbor | 1=linear }
9847
9848           Add a 'upsample2d' layer to the network.
9849
9850         nn_loss_mse:
9851             name,in,ground_truth,_learning_rate,_is_adaptive_learning_rate={
9852       0=false | 1=true }
9853
9854           Add a 'mse' loss to the network.
9855
9856           Default   value:   'learning_rate=1e-6'   and   'is_adaptive_learn‐
9857       ing_rate=1'.
9858
9859         12.15. Arrays, Tiles and Frames
9860                ------------------------
9861
9862         array:
9863             M>0,_N>0,_expand_type={ 0=min | 1=max | 2=all }
9864
9865           Create MxN array from selected images.
9866
9867           Default values: 'N=M' and 'expand_type=0'.
9868
9869           Example:
9870             [#1] image.jpg array 3,2,2
9871
9872         array_fade:
9873             M>0,_N>0,0<=_fade_start<=100,0<=_fade_end<=100,_ex‐
9874       pand_type={0=min | 1=max | 2=all}
9875
9876           Create MxN array from selected images.
9877
9878           Default  values:  'N=M',  'fade_start=60',  'fade_end=90'  and 'ex‐
9879       pand_type=1'.
9880
9881           Example:
9882             [#1] image.jpg array_fade 3,2
9883
9884         array_mirror:
9885             N>=0,_dir={ 0=x | 1=y | 2=xy | 3=tri-xy },_expand_type={ 0 | 1 }
9886
9887           Create 2^Nx2^N array from selected images.
9888
9889           Default values: 'dir=2' and 'expand_type=0'.
9890
9891           Example:
9892             [#1] image.jpg array_mirror 2
9893
9894         array_random:
9895             Ms>0,_Ns>0,_Md>0,_Nd>0
9896
9897           Create MdxNd array of tiles from selected MsxNs source arrays.
9898
9899           Default values: 'Ns=Ms', 'Md=Ms' and 'Nd=Ns'.
9900
9901           Example:
9902             [#1] image.jpg +array_random 8,8,15,10
9903
9904         frame:
9905             Shortcut for command 'frame_xy'.
9906
9907         frame_blur:
9908             _sharpness>0,_size>=0,_smoothness,_shading,_blur
9909
9910           Draw RGBA-colored round frame in selected images.
9911
9912           Default values: 'sharpness=10', 'size=30',  'smoothness=0',  'shad‐
9913       ing=1' and 'blur=3%'.
9914
9915           Example:
9916             [#1] image.jpg frame_blur 3,30,8,10%
9917
9918         frame_cube:
9919             _depth>=0,_centering_x,_centering_y,_left_side={0=normal | 1=mir‐
9920       ror-x | 2=mirror-y | 3=mirror-xy},_right_side,_lower_side,_upper_side
9921
9922           Insert 3D frames in selected images.
9923
9924           Default   values:   'depth=1',   'centering_x=centering_y=0'    and
9925       'left_side=right_side,lower_side=upper_side=0'.
9926
9927           Example:
9928             [#1] image.jpg frame_cube ,
9929
9930         frame_fuzzy:
9931             size_x[%]>=0,_size_y[%]>=0,_fuzzyness>=0,_smooth‐
9932       ness[%]>=0,_R,_G,_B,_A
9933
9934           Draw RGBA-colored fuzzy frame in selected images.
9935
9936           Default values: 'size_y=size_x', 'fuzzyness=5', 'smoothness=1'  and
9937       'R=G=B=A=255'.
9938
9939           Example:
9940             [#1] image.jpg frame_fuzzy 20
9941
9942         frame_painting:
9943             _size[%]>=0,0<=_contrast<=1,_profile_smooth‐
9944       ness[%]>=0,_R,_G,_B,_vignette_size[%]>=0,_vignette_contrast>=0,_de‐
9945       fects_contrast>=0,0<=_defects_density<=100,_defects_size>=0,_de‐
9946       fects_smoothness[%]>=0,
9947               _serial_number
9948
9949           Add a painting frame to selected images.
9950
9951           Default  values:   'size=10%',   'contrast=0.4',   'profile_smooth‐
9952       ness=6%', 'R=225', 'G=200', 'B=120', 'vignette_size=2%', 'vignette_con‐
9953       trast=400',
9954            'defects_contrast=50',   'defects_density=10',   'defects_size=1',
9955       'defects_smoothness=0.5%' and 'serial_number=123456789'.
9956
9957           Example:
9958             [#1] image.jpg frame_painting ,
9959
9960         frame_pattern:
9961             M>=3,_constrain_size={ 0 | 1 } |
9962             M>=3,_[frame_image],_constrain_size={ 0 | 1 }
9963
9964           Insert selected pattern frame in selected images.
9965
9966           Default values: 'pattern=0' and 'constrain_size=0'.
9967
9968           Example:
9969             [#1] image.jpg frame_pattern 8
9970
9971         frame_round:
9972             _sharpness>0,_size>=0,_smoothness,_shading,_R,_G,_B,_A
9973
9974           Draw RGBA-colored round frame in selected images.
9975
9976           Default  values:  'sharpness=10', 'size=10', 'smoothness=0', 'shad‐
9977       ing=0' and 'R=G=B=A=255'.
9978
9979           Example:
9980             [#1] image.jpg frame_round 10
9981
9982         frame_seamless:
9983             frame_size>=0,_patch_size>0,_blend_size>=0,_frame_direction={
9984       0=inner (preserve image size) | 1=outer }
9985
9986           Insert frame in selected images, so that tiling the resulting image
9987       makes less visible seams.
9988
9989           Default values: 'patch_size=7',  'blend_size=5'  and  'frame_direc‐
9990       tion=1'.
9991
9992           Example:
9993             [#1] image.jpg +frame_seamless 30 array 2,2
9994
9995         frame_x:
9996             size_x[%],_col1,...,_colN
9997
9998           Insert colored frame along the x-axis in selected images.
9999
10000           Default values: 'col1=col2=col3=255' and 'col4=255'.
10001
10002           Example:
10003             [#1] image.jpg frame_x 20,255,0,255
10004
10005         frame_xy:
10006             size_x[%],_size_y[%],_col1,...,_colN
10007
10008           Insert colored frame along the x-axis in selected images.
10009
10010           Default    values:    'size_y=size_x',   'col1=col2=col3=255'   and
10011       'col4=255'.
10012           (equivalent to shortcut command 'frame').
10013
10014           Example:
10015             [#1] image.jpg frame_xy 1,1,0 frame_xy 20,10,255,0,255
10016
10017         frame_xyz:
10018             size_x[%],_size_y[%],_size_z[%]_col1,...,_colN
10019
10020           Insert colored frame along the x-axis in selected images.
10021
10022           Default values:  'size_y=size_x=size_z',  'col1=col2=col3=255'  and
10023       'col4=255'.
10024
10025         frame_y:
10026             size_y[%],_col1,...,_colN
10027
10028           Insert colored frame along the y-axis in selected images.
10029
10030           Default values: 'col1=col2=col3=255' and 'col4=255'.
10031
10032           Example:
10033             [#1] image.jpg frame_y 20,255,0,255
10034
10035         img2ascii:
10036             _charset,_analysis_scale>0,_analysis_smoothness[%]>=0,_synthe‐
10037       sis_scale>0,_output_ascii_filename
10038
10039           Render selected images as binary ascii art.
10040           This command returns the  corresponding  the  list  of  widths  and
10041       heights (expressed as a number of characters)
10042           for each selected image.
10043
10044           Default  values:  'charset=[ascii  charset]',  'analysis_scale=16',
10045       'analysis_smoothness=20%',     'synthesis_scale=16'     and      '_out‐
10046       put_ascii_filename=[undefined]'.
10047
10048           Example:
10049             [#1] image.jpg img2ascii ,
10050
10051         imagegrid:
10052             M>0,_N>0
10053
10054           Create MxN image grid from selected images.
10055
10056           Default value: 'N=M'.
10057
10058           Example:
10059             [#1] image.jpg imagegrid 16
10060
10061         imagegrid_hexagonal:
10062             _resolution>0,0<=_outline<=1
10063
10064           Create hexagonal grids from selected images.
10065
10066           Default   values:   'resolution=32',   'outline=0.1'   and  'is_an‐
10067       tialiased=1'.
10068
10069           Example:
10070             [#1] image.jpg imagegrid_hexagonal 24
10071
10072         imagegrid_triangular:
10073             pattern_width>=1,_pattern_height>=1,_pattern_type,0<=_out‐
10074       line_opacity<=1,_outline_color1,...
10075
10076           Create triangular grids from selected images.
10077           'pattern  type'  can  be  { 0=horizontal | 1=vertical | 2=crossed |
10078       3=cube | 4=decreasing | 5=increasing }.
10079
10080           Default values: 'pattern_width=24', 'pattern_height=pattern_width',
10081       'pattern_type=0', 'outline_opacity=0.1' and 'outline_color1=0'.
10082
10083           Example:
10084             [#1] image.jpg imagegrid_triangular 6,10,3,0.5
10085
10086         linearize_tiles:
10087             M>0,_N>0
10088
10089           Linearize MxN tiles on selected images.
10090
10091           Default value: 'N=M'.
10092
10093           Example:
10094             [#1] image.jpg +linearize_tiles 16
10095
10096         map_sprites:
10097             _nb_sprites>=1,_allow_rotation={  0=none | 1=90 deg. | 2=180 deg.
10098       }
10099
10100           Map set of sprites (defined as the 'nb_sprites'  latest  images  of
10101       the selection) to other selected images,
10102           according to the luminosity of their pixel values.
10103
10104           Example:
10105             [#1]  image.jpg  resize2dy  48  repeat  16  ball {8+2*$>},${-rgb}
10106       mul[-1] {(1+$>)/16} done map_sprites 16
10107
10108         pack:
10109             is_ratio_constraint={ 0 | 1 },_sort_criterion
10110
10111           Pack selected images into a single image.
10112           The returned status contains the list of new (x,y) offsets for each
10113       input image.
10114           Parameter  'is_ratio_constraint'  tells if the resulting image must
10115       tend to a square image.
10116
10117           Default   values:    'is_ratio_constraint=0'    and    'sort_crite‐
10118       rion=max(w,h)'.
10119
10120           Example:
10121             [#1]  image.jpg  repeat  10  +resize2dx[-1] 75% balance_gamma[-1]
10122       ${-rgb} done pack 0
10123
10124         puzzle:
10125             _width>0,_height>0,_M>=1,_N>=1,_curvature,_centering,_connec‐
10126       tors_variability,_resolution>=1
10127
10128           Input puzzle binary mask with specified size and geometry.
10129
10130           Default values: 'width=height=512', 'M=N=5', 'curvature=0.5', 'cen‐
10131       tering=0.5', 'connectors_variability=0.5' and 'resolution=64'.
10132
10133           Example:
10134             [#1] puzzle ,
10135
10136         quadratize_tiles:
10137             M>0,_N>0
10138
10139           Quadratize MxN tiles on selected images.
10140
10141           Default value: 'N=M'.
10142
10143           Example:
10144             [#1] image.jpg +quadratize_tiles 16
10145
10146         rotate_tiles:
10147             angle,_M>0,N>0
10148
10149           Apply MxN tiled-rotation effect on selected images.
10150
10151           Default values: 'M=8' and 'N=M'.
10152
10153           Example:
10154             [#1] image.jpg to_rgba rotate_tiles 10,8 drop_shadow  10,10  dis‐
10155       play_rgba
10156
10157         shift_tiles:
10158             M>0,_N>0,_amplitude
10159
10160           Apply MxN tiled-shift effect on selected images.
10161
10162           Default values: 'N=M' and 'amplitude=20'.
10163
10164           Example:
10165             [#1] image.jpg +shift_tiles 8,8,10
10166
10167         taquin:
10168             M>0,_N>0,_remove_tile={  0=none  |  1=first  |  2=last | 3=random
10169       },_relief,_border_thickness[%],_border_outline[%],_outline_color
10170
10171           Create MxN taquin puzzle from selected images.
10172
10173           Default  value:  'N=M',  'relief=50',  'border_thickness=5',  'bor‐
10174       der_outline=0' and 'remove_tile=0'.
10175
10176           Example:
10177             [#1] image.jpg +taquin 8
10178
10179         tunnel:
10180             _level>=0,_factor>0,_centering_x,_centering_y,_opacity,_angle
10181
10182           Apply tunnel effect on selected images.
10183
10184           Default   values:   'level=9',  'factor=80%',  'centering_x=center‐
10185       ing_y=0.5', 'opacity=1' and 'angle=0'
10186
10187           Example:
10188             [#1] image.jpg tunnel 20
10189
10190         12.16. Artistic
10191                --------
10192
10193         boxfitting:
10194             _min_box_size>=1,_max_box_size>=0,_initial_density>=0,_nb_at‐
10195       tempts>=1
10196
10197           Apply  box  fitting effect on selected images, as displayed the web
10198       page:
10199           http://www.complexification.net/gallery/machines/boxFittingImg/.
10200
10201           Default values: 'min_box_size=1',  'max_box_size=0',  'initial_den‐
10202       sity=0.1' and 'nb_attempts=3'.
10203
10204           Example:
10205             [#1] image.jpg boxfitting ,
10206
10207         brushify:
10208             [brush],_brush_nb_sizes>=1,0<=_brush_min_size_fac‐
10209       tor<=1,_brush_nb_orienta‐
10210       tions>=1,_brush_light_type,0<=_brush_light_strength<=1,_brush_opac‐
10211       ity,_painting_density[%]>=0,
10212               0<=_painting_contours_coherence<=1,0<=_painting_orientation_co‐
10213       herence<=1,_painting_coherence_alpha[%]>=0,_painting_coher‐
10214       ence_sigma[%]>=0,_painting_primary_angle,
10215               0<=_painting_angle_dispersion<=1
10216
10217           Apply specified brush to create painterly versions of specified im‐
10218       ages.
10219           'brush_light_type'  can be { 0=none | 1=flat | 2=darken | 3=lighten
10220       | 4=full }.
10221
10222           Default values:  'brush_nb_sizes=3',  'brush_min_size_factor=0.66',
10223       'brush_nb_orientations=12',                       'brush_light_type=0',
10224       'brush_light_strength=0.25',
10225            'brush_opacity=0.8',    'painting_density=20%',     'painting_con‐
10226       tours_coherence=0.9',   'painting_orientation_coherence=0.9',   'paint‐
10227       ing_coherence_alpha=1',
10228            'painting_coherence_sigma=1', 'painting_primary_angle=0',  'paint‐
10229       ing_angle_dispersion=0.2'
10230
10231           Example:
10232             [#1]   image.jpg   40,40   gaussian[-1]   10,4   spread[-1]  10,0
10233       brushify[0] [1],1
10234
10235         cartoon:
10236             _smoothness,_sharpening,_threshold>=0,_thick‐
10237       ness>=0,_color>=0,quantization>0
10238
10239           Apply cartoon effect on selected images.
10240
10241           Default  values:  'smoothness=3', 'sharpening=150', 'threshold=20',
10242       'thickness=0.25', 'color=1.5' and 'quantization=8'.
10243
10244           Example:
10245             [#1] image.jpg cartoon 3,50,10,0.25,3,16
10246
10247         color_ellipses:
10248             _count>0,_radius>=0,_opacity>=0
10249
10250           Add random color ellipses to selected images.
10251
10252           Default values: 'count=400', 'radius=5' and 'opacity=0.1'.
10253
10254           Example:
10255             [#1] image.jpg +color_ellipses ,,0.15
10256
10257         cubism:
10258             _density>=0,0<=_thickness<=50,_max_angle,_opacity,_smoothness>=0
10259
10260           Apply cubism effect on selected images.
10261
10262           Default  values:  'density=50',   'thickness=10',   'max_angle=75',
10263       'opacity=0.7' and 'smoothness=0'.
10264
10265           Example:
10266             [#1] image.jpg cubism ,
10267
10268         draw_whirl:
10269             _amplitude>=0
10270
10271           Apply whirl drawing effect on selected images.
10272
10273           Default value: 'amplitude=100'.
10274
10275           Example:
10276             [#1] image.jpg draw_whirl ,
10277
10278         drawing:
10279             _amplitude>=0
10280
10281           Apply drawing effect on selected images.
10282
10283           Default value: 'amplitude=200'.
10284
10285           Example:
10286             [#1] image.jpg +drawing ,
10287
10288         drop_shadow:
10289             _offset_x[%],_offset_y[%],_smoothness[%]>=0,0<=_curvature<=1,_ex‐
10290       pand_size={ 0 | 1 }
10291
10292           Drop shadow behind selected images.
10293
10294           Default values: 'offset_x=20', 'offset_y=offset_x', 'smoothness=5',
10295       'curvature=0' and 'expand_size=1'.
10296
10297           Example:
10298             [#1]   image.jpg  drop_shadow  10,20,5,0.5  expand_xy  20,0  dis‐
10299       play_rgba
10300
10301         ellipsionism:
10302             _R>0[%],_r>0[%],_smoothness>=0[%],_opacity,_outline>0,_density>0
10303
10304           Apply ellipsionism filter to selected images.
10305
10306           Default  values:  'R=10',  'r=3',  'smoothness=1%',  'opacity=0.7',
10307       'outline=8' and 'density=0.6'.
10308
10309           Example:
10310             [#1] image.jpg ellipsionism ,
10311
10312         fire_edges:
10313             _edges>=0,0<=_attenuation<=1,_smoothness>=0,_thresh‐
10314       old>=0,_nb_frames>0,_starting_frame>=0,frame_skip>=0
10315
10316           Generate fire effect from edges of selected images.
10317
10318           Default values: 'edges=0.7', 'attenuation=0.25',  'smoothness=0.5',
10319       'threshold=25', 'nb_frames=1', 'starting_frame=20' and 'frame_skip=0'.
10320
10321           Example:
10322             [#1] image.jpg fire_edges ,
10323
10324         fractalize:
10325             0<=detail_level<=1
10326
10327           Randomly fractalize selected images.
10328
10329           Default value: 'detail_level=0.8'
10330
10331           Example:
10332             [#1] image.jpg fractalize ,
10333
10334         glow:
10335             _amplitude>=0
10336
10337           Add soft glow on selected images.
10338
10339           Default value: 'amplitude=1%'.
10340
10341           Example:
10342             [#1] image.jpg glow ,
10343
10344         halftone:
10345             nb_levels>=2,_size_dark>=2,_size_bright>=2,_shape={   0=square  |
10346       1=diamond | 2=circle |  3=inv-square  |  4=inv-diamond  |  5=inv-circle
10347       },_smoothness[%]>=0
10348
10349           Apply halftone dithering to selected images.
10350
10351           Default   values:  'nb_levels=5',  'size_dark=8',  'size_bright=8',
10352       'shape=5' and 'smoothnesss=0'.
10353
10354           Example:
10355             [#1] image.jpg halftone ,
10356
10357         hardsketchbw:
10358             _amplitude>=0,_density>=0,_opacity,0<=_edge_thresh‐
10359       old<=100,_is_fast={ 0 | 1 }
10360
10361           Apply hard B&W sketch effect on selected images.
10362
10363           Default   values:  'amplitude=1000',  'sampling=3',  'opacity=0.1',
10364       'edge_threshold=20' and 'is_fast=0'.
10365
10366           Example:
10367             [#1] image.jpg +hardsketchbw 200,70,0.1,10  median[-1]  2  +local
10368       reverse blur[-1] 3 blend[-2,-1] overlay endlocal
10369
10370         hearts:
10371             _density>=0
10372
10373           Apply heart effect on selected images.
10374
10375           Default value: 'density=10'.
10376
10377           Example:
10378             [#1] image.jpg hearts ,
10379
10380         houghsketchbw:
10381             _density>=0,_radius>0,0<=_threshold<=100,0<=_opacity<=1,_vote‐
10382       size[%]>0
10383
10384           Apply hough B&W sketch effect on selected images.
10385
10386           Default values: 'density=100', 'radius=3', 'threshold=100',  'opac‐
10387       ity=0.1' and 'votesize=100%'.
10388
10389           Example:
10390             [#1] image.jpg +houghsketchbw ,
10391
10392         lightrays:
10393             100<=_density<=0,_center_x[%],_cen‐
10394       ter_y[%],_ray_length>=0,_ray_attenuation>=0
10395
10396           Generate ray lights from the edges of selected images.
10397
10398           Default  values:  'density=50%',  'center_x=50%',   'center_y=50%',
10399       'ray_length=0.9' and 'ray_attenuation=0.5'.
10400
10401           Example:
10402             [#1] image.jpg +lightrays , + cut 0,255
10403
10404         light_relief:
10405             _ambient_light,_specular_lightness,_specular_size,_dark‐
10406       ness,_light_smoothness,_xl,_yl,_zl,_zscale,_opacity_is_heightmap={ 0  |
10407       1 }
10408
10409           Apply relief light to selected images.
10410           Default  values(s) : 'ambient_light=0.3', 'specular_lightness=0.5',
10411       'specular_size=0.2', 'darkness=0', 'xl=0.2', 'yl=zl=0.5',
10412           'zscale=1', 'opacity=1' and 'opacity_is_heightmap=0'.
10413
10414           Example:
10415             [#1] image.jpg blur 2 light_relief 0.3,4,0.1,0
10416
10417         linify:
10418             0<=_density<=100,_spreading>=0,_resolution[%]>0,_line_opac‐
10419       ity>=0,_line_precision>0,_mode={ 0=subtractive | 1=additive }
10420
10421           Apply linify effect on selected images.
10422           The  algorithm  is  inspired  from the one described on the webpage
10423       http://linify.me/about.
10424
10425           Default  values:  'density=50',  'spreading=2',   'resolution=40%',
10426       'line_opacity=10', 'line_precision=24' and 'mode=0'.
10427
10428           Example:
10429             [#1] image.jpg linify 60
10430
10431         mosaic:
10432             0<=_density<=100
10433
10434           Create random mosaic from selected images.
10435
10436           Default values: 'density=30'.
10437
10438           Example:
10439             [#1] image.jpg mosaic , +fill "I!=J(1) || I!=J(0,1)?[0,0,0]:I"
10440
10441         old_photo:
10442
10443           Apply old photo effect on selected images.
10444
10445           Example:
10446             [#1] image.jpg old_photo
10447
10448         pencilbw:
10449             _size>=0,_amplitude>=0
10450
10451           Apply B&W pencil effect on selected images.
10452
10453           Default values: 'size=0.3' and 'amplitude=60'.
10454
10455           Example:
10456             [#1] image.jpg pencilbw ,
10457
10458         pixelsort:
10459             _ordering={  + | - },_axis={ x | y | z | xy | yx },_[sorting_cri‐
10460       terion],_[mask]
10461
10462           Apply a 'pixel sorting' algorithm on selected images, as  described
10463       in the page :
10464           http://satyarth.me/articles/pixel-sorting/.
10465
10466           Default   values:   'ordering=+',   'axis=x'   and  'sorting_crite‐
10467       rion=mask=(undefined)'.
10468
10469           Example:
10470             [#1] image.jpg +norm +ge[-1] 30% +pixelsort[0] +,y,[1],[2]
10471
10472         polaroid:
10473             _size1>=0,_size2>=0
10474
10475           Create polaroid effect in selected images.
10476
10477           Default values: 'size1=10' and 'size2=20'.
10478
10479           Example:
10480             [#1] image.jpg to_rgba polaroid  5,30  rotate  20  drop_shadow  ,
10481       drgba
10482
10483         polygonize:
10484             _warp_amplitude>=0,_smoothness[%]>=0,_min_area[%]>=0,_resolu‐
10485       tion_x[%]>0,_resolution_y[%]>0
10486
10487           Apply polygon effect on selected images.
10488
10489           Default     values:     'warp_amplitude=300',      'smoothness=2%',
10490       'min_area=0.1%', 'resolution_x=resolution_y=10%'.
10491
10492           Example:
10493             [#1]  image.jpg  image.jpg  polygonize  100,10  +fill "I!=J(1) ||
10494       I!=J(0,1)?[0,0,0]:I"
10495
10496         poster_edges:
10497             0<=_edge_threshold<=100,0<=_edge_shade<=100,_edge_thick‐
10498       ness>=0,_edge_antialiasing>=0,0<=_posterization_level<=15,_posteriza‐
10499       tion_antialiasing>=0
10500
10501           Apply poster edges effect on selected images.
10502
10503           Default values: 'edge_threshold=40',  'edge_shade=5',  'edge_thick‐
10504       ness=0.5', 'edge_antialiasing=10', 'posterization_level=12' and
10505            'posterization_antialiasing=0'.
10506
10507           Example:
10508             [#1] image.jpg poster_edges ,
10509
10510         poster_hope:
10511             _smoothness>=0
10512
10513           Apply Hope stencil poster effect on selected images.
10514
10515           Default value: 'smoothness=3'.
10516
10517           Example:
10518             [#1] image.jpg poster_hope ,
10519
10520         rodilius:
10521             0<=_amplitude<=100,_0<=thickness<=100,_sharpness>=0,_nb_orienta‐
10522       tions>0,_offset,_color_mode={ 0=darker | 1=brighter }
10523
10524           Apply rodilius (fractalius-like) filter on selected images.
10525
10526           Default values:  'amplitude=10',  'thickness=10',  'sharpness=400',
10527       'nb_orientations=7', 'offset=0' and 'color_mode=1'.
10528
10529           Example:
10530             [#1] image.jpg rodilius 12,10,300,10 normalize_local 10,6
10531             [#2]  image.jpg normalize_local 10,16 rodilius 10,4,400,16 smooth
10532       60,0,1,1,4 normalize_local 10,16
10533
10534         sketchbw:
10535             _nb_angles>0,_start_angle,_angle_range>=0,_length>=0,_thresh‐
10536       old>=0,_opacity,_bgfactor>=0,_density>0,_sharpness>=0,_anisot‐
10537       ropy>=0,_smoothness>=0,_coherence>=0,_is_boost={ 0 | 1 },_is_curved={ 0
10538       |
10539               1 }
10540
10541           Apply sketch effect to selected images.
10542
10543           Default values: 'nb_angles=2', 'start_angle=45', 'angle_range=180',
10544       'length=30',   'threshold=3',   'opacity=0.03',   'bgfactor=0',   'den‐
10545       sity=0.6',
10546            'sharpness=0.1',   'anisotropy=0.6',   'smoothness=0.25',  'coher‐
10547       ence=1', 'is_boost=0' and 'is_curved=1'.
10548
10549           Example:
10550             [#1] image.jpg +sketchbw 1 reverse blur[-1] 3 blend[-2,-1]  over‐
10551       lay
10552
10553         sponge:
10554             _size>0
10555
10556           Apply sponge effect on selected images.
10557
10558           Default value: 'size=13'.
10559
10560           Example:
10561             [#1] image.jpg sponge ,
10562
10563         stained_glass:
10564             _edges[%]>=0, shading>=0, is_thin_separators={ 0 | 1 }
10565
10566           Generate stained glass from selected images.
10567
10568           Default values: 'edges=40%', 'shading=0.2' and 'is_precise=0'.
10569
10570           Example:
10571             [#1] image.jpg stained_glass 20%,1 cut 0,20
10572
10573         stars:
10574             _density[%]>=0,_depth>=0,_size>0,_nb_branches>=1,0<=_thick‐
10575       ness<=1,_smoothness[%]>=0,_R,_G,_B,_opacity
10576
10577           Add random stars to selected images.
10578
10579           Default    values:     'density=10%',     'depth=1',     'size=32',
10580       'nb_branches=5',  'thickness=0.38',  'smoothness=0.5',  'R=G=B=200' and
10581       'opacity=1'.
10582
10583           Example:
10584             [#1] image.jpg stars ,
10585
10586         stencil:
10587             _radius[%]>=0,_smoothness>=0,_iterations>=0
10588
10589           Apply stencil filter on selected images.
10590
10591           Default values: 'radius=3', 'smoothness=1' and 'iterations=8'.
10592
10593           Example:
10594             [#1] image.jpg +norm stencil. 2,1,4 +mul rm[0]
10595
10596         stencilbw:
10597             _edges>=0,_smoothness>=0
10598
10599           Apply B&W stencil effect on selected images.
10600
10601           Default values: 'edges=15' and 'smoothness=10'.
10602
10603           Example:
10604             [#1] image.jpg +stencilbw 40,4
10605
10606         stylize:
10607             [style_image],_fidelity_finest,_fidelity_coarsest,_fi‐
10608       delity_smoothness_finest>=0,_fidelity_smoothnes_coarsest>=0,0<=_fi‐
10609       delity_chroma<=1,_init_type,_init_resolution>=0,init_max_gradient>=0,
10610               _patchsize_analysis>0,_patchsize_synthesis>0,_patchsize_synthe‐
10611       sis_final>0,_nb_matches_finest>=0,_nb_matches_coarsest>=0,_penal‐
10612       ize_repetitions>=0,_matching_precision>=0,_scale_factor>1,
10613               _skip_finest_scales>=0,_"image_matching_command"
10614
10615           Transfer colors and textures from specified style image to selected
10616       images, using a multi-scale patch-mathing algorithm.
10617           If instant display window[0] is opened, the steps of the image syn‐
10618       thesis are displayed on it.
10619           'init_type' can be { 0=best-match | 1=identity | 2=randomized }.
10620
10621           Default values: 'fidelity_finest=0.5', 'fidelity_coarsest=2',  'fi‐
10622       delity_smoothness_finest=3',  'fidelity_smoothness_coarsest=0.5',  'fi‐
10623       delity_chroma=0.1',
10624            'init_type=0',    'init_resolution=16',     'init_max_gradient=0',
10625       'patchsize_analysis=5',   'patchsize_synthesis=5',   'patchsize_synthe‐
10626       sis_final=5',
10627            'nb_matches_finest=2', 'nb_matchesc_coarsest=30',  'penalize_repe‐
10628       titions=10',        'matching_precision=2',        'scale_factor=1.85',
10629       'skip_finest_scales=0' and
10630            'image_matching_command'="s c,-3 transfer_pca[0] [2] b[0,2] xy,0.7
10631       n[0,2] 0,255 n[1,2] 0,200 a[0,1] c a[1,2] c"'.
10632
10633         tetris:
10634             _scale>0
10635
10636           Apply tetris effect on selected images.
10637
10638           Default value: 'scale=10'.
10639
10640           Example:
10641             [#1] image.jpg +tetris 10
10642
10643         warhol:
10644             _M>0,_N>0,_smoothness>=0,_color>=0
10645
10646           Create MxN Andy Warhol-like artwork from selected images.
10647
10648           Default values: 'M=3', 'N=M', 'smoothness=2' and 'color=20'.
10649
10650           Example:
10651             [#1] image.jpg warhol 3,3,3,40
10652
10653         weave:
10654             _density>=0,0<=_thickness<=100,0<=_shadow<=100,_shad‐
10655       ing>=0,_fibers_amplitude>=0,_fibers_smoothness>=0,_angle,-1<=_x_curva‐
10656       ture<=1,-1<=_y_curvature<=1
10657
10658           Apply weave effect to the selected images.
10659           'angle'  can  be { 0=0 deg. | 1=22.5 deg. | 2=45 deg. | 3=67.5 deg.
10660       }.
10661
10662           Default values: 'density=6',  'thickness=65',  'shadow=40',  'shad‐
10663       ing=0.5', 'fibers_amplitude=0', _'fibers_smoothness=0', 'angle=0' and
10664            'curvature_x=curvature_y=0'
10665
10666           Example:
10667             [#1] image.jpg weave ,
10668
10669         whirls:
10670             _texture>=0,_smoothness>=0,_darkness>=0,_lightness>=0
10671
10672           Add random whirl texture to selected images.
10673
10674           Default  values:  'texture=3',  'smoothness=6',  'darkness=0.5' and
10675       'lightness=1.8'.
10676
10677           Example:
10678             [#1] image.jpg whirls ,
10679
10680         12.17. Warpings
10681                --------
10682
10683         deform:
10684             _amplitude>=0,_interpolation
10685
10686           Apply random smooth deformation on selected images.
10687           'interpolation' can be { 0=none | 1=linear | 2=bicubic }.
10688
10689           Default value: 'amplitude=10'.
10690
10691           Example:
10692             [#1] image.jpg +deform[0] 10 +deform[0] 20
10693
10694         euclidean2polar:
10695             _center_x[%],_center_y[%],_stretch_factor>0,_boundary_condi‐
10696       tions={ 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }
10697
10698           Apply euclidean to polar transform on selected images.
10699
10700           Default  values:  'center_x=center_y=50%',  'stretch_factor=1'  and
10701       'boundary_conditions=1'.
10702
10703           Example:
10704             [#1] image.jpg +euclidean2polar ,
10705
10706         equirectangular2nadirzenith:
10707
10708           Transform selected equirectangular images to nadir/zenith rectilin‐
10709       ear projections.
10710
10711         fisheye:
10712             _center_x,_center_y,0<=_radius<=100,_amplitude>=0
10713
10714           Apply fish-eye deformation on selected images.
10715
10716           Default values: 'x=y=50', 'radius=50' and 'amplitude=1.2'.
10717
10718           Example:
10719             [#1] image.jpg +fisheye ,
10720
10721         flower:
10722             _amplitude,_frequency,_offset_r[%],_angle,_center_x[%],_cen‐
10723       ter_y[%],_boundary_conditions={ 0=dirichlet | 1=neumann | 2=periodic  |
10724       3=mirror}
10725
10726             toto
10727           Apply flower deformation on selected images.
10728
10729           Default  values:  'amplitude=30', 'frequency=6', 'offset_r=0', 'an‐
10730       gle=0', 'center_x=center_y=50%' and 'boundary_conditions=3'.
10731
10732           Example:
10733             [#1] image.jpg +flower ,
10734
10735         kaleidoscope:
10736             _center_x[%],_center_y[%],_radius,_angle,_boundary_conditions={
10737       0=dirichlet | 1=neumann | 2=periodic | 3=mirror }
10738
10739           Create kaleidoscope effect from selected images.
10740
10741           Default  values:  'center_x=center_y=50%', 'radius=100', 'angle=30'
10742       and 'boundary_conditions=3'.
10743
10744           Example:
10745             [#1] image.jpg kaleidoscope ,
10746
10747         map_sphere:
10748             _width>0,_height>0,_radius,_dilation>0,_fading>=0,_fad‐
10749       ing_power>=0
10750
10751           Map selected images on a sphere.
10752
10753           Default  values:  'width=height=512', 'radius=100', 'dilation=0.5',
10754       'fading=0' and 'fading_power=0.5'.
10755
10756           Example:
10757             [#1] image.jpg map_sphere ,
10758
10759         nadirzenith2equirectangular:
10760
10761           Transform  selected   nadir/zenith   rectilinear   projections   to
10762       equirectangular images.
10763
10764         polar2euclidean:
10765             _center_x[%],_center_y[%],_stretch_factor>0,_boundary_condi‐
10766       tions={ 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }
10767
10768           Apply euclidean to polar transform on selected images.
10769
10770           Default  values:  'center_x=center_y=50%',  'stretch_factor=1'  and
10771       'boundary_conditions=1'.
10772
10773           Example:
10774             [#1] image.jpg +euclidean2polar ,
10775
10776         raindrops:
10777             _amplitude,_density>=0,_wavelength>=0,_merging_steps>=0
10778
10779           Apply raindrops deformation on selected images.
10780
10781           Default  values:  'amplitude=80','density=0.1',  'wavelength=1' and
10782       'merging_steps=0'.
10783
10784           Example:
10785             [#1] image.jpg +raindrops ,
10786
10787         ripple:
10788             _amplitude,_bandwidth,_shape={ 0=bloc |  1=triangle  |  2=sine  |
10789       3=sine+ | 4=random },_angle,_offset
10790
10791           Apply ripple deformation on selected images.
10792
10793           Default  values:  'amplitude=10',  'bandwidth=10',  'shape=2', 'an‐
10794       gle=0' and 'offset=0'.
10795
10796           Example:
10797             [#1] image.jpg +ripple ,
10798
10799         rotoidoscope:
10800             _center_x[%],_center_y[%],_tiles>0,_smoothness[%]>=0,_bound‐
10801       ary_conditions={ 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }
10802
10803           Create rotational kaleidoscope effect from selected images.
10804
10805           Default values: 'center_x=center_y=50%', 'tiles=10', 'smoothness=1'
10806       and 'boundary_conditions=3'.
10807
10808           Example:
10809             [#1] image.jpg +rotoidoscope ,
10810
10811         spherize:
10812             _radius[%]>=0,_strength,_smoothness[%]>=0,_center_x[%],_cen‐
10813       ter_y[%],_ratio_x/y>0,_angle,_interpolation
10814
10815           Apply spherize effect on selected images.
10816
10817           Default  values:  'radius=50%', 'strength=1', 'smoothness=0', 'cen‐
10818       ter_x=center_y=50%', 'ratio_x/y=1', 'angle=0' and 'interpolation=1'.
10819
10820           Example:
10821             [#1] image.jpg grid 5%,5%,0,0,0.6,255 spherize ,
10822
10823         symmetrize:
10824             _x[%],_y[%],_angle,_boundary_conditions={ 0=dirichlet | 1=neumann
10825       |  2=periodic | 3=mirror },_is_antisymmetry={ 0 | 1 },_swap_sides={ 0 |
10826       1 }
10827
10828           Symmetrize selected images regarding specified axis.
10829
10830           Default  values:  'x=y=50%',  'angle=90',  'boundary_conditions=3',
10831       'is_antisymmetry=0' and 'swap_sides=0'.
10832
10833           Example:
10834             [#1] image.jpg +symmetrize 50%,50%,45 +symmetrize[-1] 50%,50%,-45
10835
10836         transform_polar:
10837             "expr_radius",_"expr_angle",_center_x[%],_center_y[%],_bound‐
10838       ary_conditions={ 0=dirichlet | 1=neumann }
10839
10840           Apply user-defined transform on polar  representation  of  selected
10841       images.
10842
10843           Default  values: 'expr_radius=R-r', 'expr_rangle=a', 'center_x=cen‐
10844       ter_y=50%' and 'boundary_conditions=1'.
10845
10846           Example:
10847             [#1]  image.jpg  +transform_polar[0]  R*(r/R)^2,a  +transform_po‐
10848       lar[0] r,2*a
10849
10850         twirl:
10851             _amplitude,_center_x[%],_center_y[%],_boundary_conditions={
10852       0=dirichlet | 1=neumann | 2=periodic | 3=mirror }
10853
10854           Apply twirl deformation on selected images.
10855
10856           Default values: 'amplitude=1', 'center_x=center_y=50%' and  'bound‐
10857       ary_conditions=3'.
10858
10859           Example:
10860             [#1] image.jpg twirl 0.6
10861
10862         warp_perspective:
10863             _x-angle,_y-angle,_zoom>0,_x-center,_y-center,_boundary_condi‐
10864       tions={ 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }
10865
10866           Warp selected images with perspective deformation.
10867
10868           Default values: 'x-angle=1.5', 'y-angle=0', 'zoom=1',  'x-center=y-
10869       center=50' and 'boundary_conditions=2'.
10870
10871           Example:
10872             [#1] image.jpg warp_perspective ,
10873
10874         water:
10875             _amplitude,_smoothness>=0,_angle
10876
10877           Apply water deformation on selected images.
10878
10879           Default values: 'amplitude=30', 'smoothness=1.5' and 'angle=45'.
10880
10881           Example:
10882             [#1] image.jpg water ,
10883
10884         wave:
10885             _amplitude>=0,_frequency>=0,_center_x,_center_y
10886
10887           Apply wave deformation on selected images.
10888
10889           Default  values:  'amplitude=4', 'frequency=0.4' and 'center_x=cen‐
10890       ter_y=50'.
10891
10892           Example:
10893             [#1] image.jpg wave ,
10894
10895         wind:
10896             _amplitude>=0,_angle,0<=_attenuation<=1,_threshold
10897
10898           Apply wind effect on selected images.
10899
10900           Default values: 'amplitude=20',  'angle=0',  'attenuation=0.7'  and
10901       'threshold=20'.
10902
10903           Example:
10904             [#1] image.jpg +wind ,
10905
10906         zoom:
10907             _factor,_cx,_cy,_cz,_boundary_conditions={  0=dirichlet  | 1=neu‐
10908       mann | 2=periodic | 3=mirror }
10909
10910           Apply zoom factor to selected images.
10911
10912           Default values:  'factor=1',  'cx=cy=cz=0.5'  and  'boundary_condi‐
10913       tions=0'.
10914
10915           Example:
10916             [#1] image.jpg +zoom[0] 0.6 +zoom[0] 1.5
10917
10918         12.18. Degradations
10919                ------------
10920
10921         cracks:
10922             0<=_density<=100,_is_relief={ 0 | 1 },_opacity,_color1,...
10923
10924           Draw random cracks on selected images with specified color.
10925
10926           Default   values:   'density=25',  'is_relief=0',  'opacity=1'  and
10927       'color1=0'.
10928
10929           Example:
10930             [#1] image.jpg +cracks ,
10931
10932         light_patch:
10933             _density>0,_darkness>=0,_lightness>=0
10934
10935           Add light patches to selected images.
10936
10937           Default values: 'density=10', 'darkness=0.9' and 'lightness=1.7'.
10938
10939           Example:
10940             [#1] image.jpg +light_patch 20,0.9,4
10941
10942         noise_hurl:
10943             _amplitude>=0
10944
10945           Add hurl noise to selected images.
10946
10947           Default value: 'amplitude=10'.
10948
10949           Example:
10950             [#1] image.jpg +noise_hurl ,
10951
10952         pixelize:
10953             _scale_x>0,_scale_y>0,_scale_z>0
10954
10955           Pixelize selected images with specified scales.
10956
10957           Default values: 'scale_x=20' and 'scale_y=scale_z=scale_x'.
10958
10959           Example:
10960             [#1] image.jpg +pixelize ,
10961
10962         scanlines:
10963             _amplitude,_bandwidth,_shape={ 0=bloc |  1=triangle  |  2=sine  |
10964       3=sine+ | 4=random },_angle,_offset
10965
10966           Apply ripple deformation on selected images.
10967
10968           Default values: 'amplitude=60', 'bandwidth=2', 'shape=0', 'angle=0'
10969       and 'offset=0'.
10970
10971           Example:
10972             [#1] image.jpg +scanlines ,
10973
10974         shade_stripes:
10975             _frequency>=0,_direction={  0=horizontal  |  1=vertical  },_dark‐
10976       ness>=0,_lightness>=0
10977
10978           Add shade stripes to selected images.
10979
10980           Default  values:  'frequency=5',  'direction=1', 'darkness=0.8' and
10981       'lightness=2'.
10982
10983           Example:
10984             [#1] image.jpg +shade_stripes 30
10985
10986         shadow_patch:
10987             _opacity>=0
10988
10989           Add shadow patches to selected images.
10990
10991           Default value: 'opacity=0.7'.
10992
10993           Example:
10994             [#1] image.jpg +shadow_patch 0.4
10995
10996         spread:
10997             _dx>=0,_dy>=0,_dz>=0
10998
10999           Spread pixel values of selected images randomly along x,y and z.
11000
11001           Default values: 'dx=3', 'dy=dx' and 'dz=0'.
11002
11003           Example:
11004             [#1] image.jpg +spread 3
11005
11006         stripes_y:
11007             _frequency>=0
11008
11009           Add vertical stripes to selected images.
11010
11011           Default value: 'frequency=10'.
11012
11013           Example:
11014             [#1] image.jpg +stripes_y ,
11015
11016         texturize_canvas:
11017             _amplitude>=0,_fibrousness>=0,_emboss_level>=0
11018
11019           Add paint canvas texture to selected images.
11020
11021           Default   values:   'amplitude=20',   'fibrousness=3'   and    'em‐
11022       boss_level=0.6'.
11023
11024           Example:
11025             [#1] image.jpg +texturize_canvas ,
11026
11027         texturize_paper:
11028
11029           Add paper texture to selected images.
11030
11031           Example:
11032             [#1] image.jpg +texturize_paper
11033
11034         vignette:
11035             _strength>=0,0<=_radius_min<=100,0<=_radius_max<=100
11036
11037           Add vignette effect to selected images.
11038
11039           Default    values:   'strength=100',   'radius_min=70'   and   'ra‐
11040       dius_max=90'.
11041
11042           Example:
11043             [#1] image.jpg vignette ,
11044
11045         watermark_visible:
11046             _text,0<_opacity<1,_size>0,_angle,_mode={   0=remove   |    1=add
11047       },_smoothness>=0
11048
11049           Add  or  remove a visible watermark on selected images (value range
11050       must be [0,255]).
11051
11052           Default values: 'text=(c) G'MIC',  'opacity=0.3',  'size=53',  'an‐
11053       gle=25', 'mode=1' and 'smoothness=0'.
11054
11055           Example:
11056             [#1] image.jpg watermark_visible ,0.7
11057
11058         12.19. Blending and Fading
11059                -------------------
11060
11061         blend:
11062             [layer],blending_mode,_opacity[%],_selection_is={ 0=base-layers |
11063       1=top-layers } |
11064             blending_mode,_opacity[%]
11065
11066           Blend selected G,GA,RGB or RGBA images by specified layer or  blend
11067       all selected images together,
11068           using specified blending mode.
11069           'blending_mode'  can be { add | alpha | and | average | blue | burn
11070       | darken | difference |
11071           divide | dodge | edges | exclusion | freeze | grainextract | grain‐
11072       merge | green | hardlight |
11073           hardmix  | hue | interpolation | lchlightness | lighten | lightness
11074       | linearburn | linearlight | luminance |
11075           multiply | negation | or | overlay | pinlight |  red  |  reflect  |
11076       saturation | seamless | seamless_mixed |
11077           screen  |  shapeareamax  |  shapeareamax0  |  shapeareamin  |  sha‐
11078       peareamin0 | shapeaverage | shapeaverage0 |
11079           shapemedian | shapemedian0 | shapemin  |  shapemin0  |  shapemax  |
11080       shapemax0 | softburn | softdodge |
11081           softlight | stamp | subtract | value | vividlight | xor }.
11082           'opacity'  should  be  in '[0,1]', or '[0,100]' if expressed with a
11083       '%'.
11084
11085           Default  values:  'blending_mode=alpha',  'opacity=1'  and  'selec‐
11086       tion_is=0'.
11087
11088           Example:
11089             [#1]  image.jpg  +drop_shadow  ,  resize2dy[-1] 200 rotate[-1] 20
11090       +blend alpha display_rgba[-2]
11091             [#2] image.jpg testimage2d {w},{h} blend overlay
11092             [#3] command "ex : $""=arg repeat $""#  +blend[0,1]  ${arg{$>+1}}
11093       text_outline[-1] Mode:
11094              darken
11095             [#4]  command  "ex : $""=arg repeat $""# +blend[0,1] ${arg{$>+1}}
11096       text_outline[-1] Mode:
11097              freeze,grainextract,grainmerge
11098             [#5] command "ex : $""=arg repeat $""#  +blend[0,1]  ${arg{$>+1}}
11099       text_outline[-1] Mode:
11100              interpolation,lighten,lightness
11101             [#6]  command  "ex : $""=arg repeat $""# +blend[0,1] ${arg{$>+1}}
11102       text_outline[-1] Mode:
11103              multiply,negation,or,overlay
11104             [#7] command "ex : $""=arg repeat $""#  +blend[0,1]  ${arg{$>+1}}
11105       text_outline[-1] Mode:
11106              screen,shapeaverage,softburn
11107             [#8]  command  "ex : $""=arg repeat $""# +blend[0,1] ${arg{$>+1}}
11108       text_outline[-1] Mode:
11109              value,vividlight,xor
11110
11111         blend_edges:
11112             smoothness[%]>=0
11113
11114           Blend selected images togethers using 'edges' mode.
11115
11116           Example:
11117             [#1] image.jpg testimage2d {w},{h} +blend_edges 0.8
11118
11119         blend_fade:
11120             [fading_shape]
11121
11122           Blend selected images together using specified fading shape.
11123
11124           Example:
11125             [#1] image.jpg testimage2d {w},{h} 100%,100%,1,1,'cos(y/10)' nor‐
11126       malize[-1] 0,1 +blend_fade[0,1] [2]
11127
11128         blend_median:
11129
11130           Blend selected images together using 'median' mode.
11131
11132           Example:
11133             [#1] image.jpg testimage2d {w},{h} +mirror[0] y +blend_median
11134
11135         blend_seamless:
11136             _is_mixed_mode={ 0 | 1 },_inner_fading[%]>=0,_outer_fading[%]>=0
11137
11138           Blend  selected  images  using  a  seamless blending mode (Poisson-
11139       based).
11140
11141           Default  values:  'is_mixed=0',  'inner_fading=0'  and  'outer_fad‐
11142       ing=100%'.
11143
11144         fade_diamond:
11145             0<=_start<=100,0<=_end<=100
11146
11147           Create diamond fading from selected images.
11148
11149           Default values: 'start=80' and 'end=90'.
11150
11151           Example:
11152             [#1] image.jpg testimage2d {w},{h} +fade_diamond 80,85
11153
11154         fade_linear:
11155             _angle,0<=_start<=100,0<=_end<=100
11156
11157           Create linear fading from selected images.
11158
11159           Default values: 'angle=45', 'start=30' and 'end=70'.
11160
11161           Example:
11162             [#1] image.jpg testimage2d {w},{h} +fade_linear 45,48,52
11163
11164         fade_radial:
11165             0<=_start<=100,0<=_end<=100
11166
11167           Create radial fading from selected images.
11168
11169           Default values: 'start=30' and 'end=70'.
11170
11171           Example:
11172             [#1] image.jpg testimage2d {w},{h} +fade_radial 30,70
11173
11174         fade_x:
11175             0<=_start<=100,0<=_end<=100
11176
11177           Create horizontal fading from selected images.
11178
11179           Default values: 'start=30' and 'end=70'.
11180
11181           Example:
11182             [#1] image.jpg testimage2d {w},{h} +fade_x 30,70
11183
11184         fade_y:
11185             0<=_start<=100,0<=_end<=100
11186
11187           Create vertical fading from selected images.
11188
11189           Default values: 'start=30' and 'end=70'.
11190
11191           Example:
11192             [#1] image.jpg testimage2d {w},{h} +fade_y 30,70
11193
11194         fade_z:
11195             0<=_start<=100,0<=_end<=100
11196
11197           Create transversal fading from selected images.
11198
11199           Default values: 'start=30' and 'end=70'.
11200
11201         sub_alpha:
11202             [base_image],_opacity_gain>=1
11203
11204           Compute  the  minimal  alpha-channel  difference (opposite of alpha
11205       blending) between the selected images
11206           and the specified base image.
11207           The alpha difference A-B is defined as  the  image  having  minimal
11208       opacity, such that alpha_blend(B,A-B) = A.
11209
11210           Default value: 'opacity_gain=1'.
11211
11212           Example:
11213             [#1] image.jpg testimage2d {w},{h} +sub_alpha[0] [1] display_rgba
11214
11215         12.20. Image Sequences and Videos
11216                --------------------------
11217
11218         animate:
11219             fil‐
11220       ter_name,"param1_start,...,paramN_start","param1_end,...,paramN_end",nb_frames>=0,_out‐
11221       put_frames={ 0 | 1 },_output_filename |
11222             delay>0,_back and forth={ 0 | 1 }
11223
11224           Animate filter from starting parameters to ending parameters or an‐
11225       imate selected images
11226           in a display window.
11227
11228           Default value: 'delay=30'.
11229
11230           Example:
11231             [#1] image.jpg animate flower,"0,3","20,8",9
11232
11233         apply_camera:
11234             _"command",_camera_index>=0,_skip_frames>=0,_output_filename
11235
11236           Apply specified command on live camera stream, and  display  it  on
11237       display window [0].
11238           This command requires features from the OpenCV library (not enabled
11239       in G'MIC by default).
11240
11241           Default values: 'command=""',  'camera_index=0'  (default  camera),
11242       'skip_frames=0' and 'output_filename=""'.
11243
11244         apply_files:
11245             "filename_pattern",_"command",_first_frame>=0,_last_frame={ >=0 |
11246       -1=last },_frame_step>=1,_output_filename
11247
11248           Apply a G'MIC command on specified input image files, in a streamed
11249       way.
11250           If  a display window is opened, rendered frames are displayed in it
11251       during processing.
11252           The output filename may have extension '.avi' or '.mp4' (saved as a
11253       video), or any other usual image file
11254           extension (saved as a sequence of images).
11255
11256           Default     values:     'command=(undefined)',     'first_frame=0',
11257       'last_frame=-1', 'frame_step=1' and 'output_filename=(undefined)'.
11258
11259         apply_video:
11260             video_filename,_"command",_first_frame>=0,_last_frame={   >=0   |
11261       -1=last },_frame_step>=1,_output_filename
11262
11263           Apply  a  G'MIC  command on all frames of the specified input video
11264       file, in a streamed way.
11265           If a display window is opened, rendered frames are displayed in  it
11266       during processing.
11267           The output filename may have extension '.avi' or '.mp4' (saved as a
11268       video), or any other usual image
11269           file extension (saved as a sequence of images).
11270           This command requires features from the OpenCV library (not enabled
11271       in G'MIC by default).
11272
11273           Default  values:  'first_frame=0',  'last_frame=-1', 'frame_step=1'
11274       and 'output_filename=(undefined)'.
11275
11276         average_files:
11277             "filename_pattern",_first_frame>=0,_last_frame={  >=0  |  -1=last
11278       },_frame_step>=1,_output_filename
11279
11280           Average specified input image files, in a streamed way.
11281           If  a display window is opened, rendered frames are displayed in it
11282       during processing.
11283           The output filename may have extension '.avi' or '.mp4' (saved as a
11284       video), or any other usual image
11285           file extension (saved as a sequence of images).
11286
11287           Default  values:  'first_frame=0',  'last_frame=-1', 'frame_step=1'
11288       and 'output_filename=(undefined)'.
11289
11290         average_video:
11291             video_filename,_first_frame>=0,_last_frame={   >=0   |    -1=last
11292       },_frame_step>=1,_output_filename
11293
11294           Average frames of specified input video file, in a streamed way.
11295           If  a display window is opened, rendered frames are displayed in it
11296       during processing.
11297           The output filename may have extension '.avi' or '.mp4' (saved as a
11298       video), or any other usual image
11299           file extension (saved as a sequence of images).
11300           This command requires features from the OpenCV library (not enabled
11301       in G'MIC by default).
11302
11303           Default values:  'first_frame=0',  'last_frame=-1',  'frame_step=1'
11304       and 'output_filename=(undefined)'.
11305
11306         fade_files:
11307             "filename_pattern",_nb_in‐
11308       ner_frames>0,_first_frame>=0,_last_frame={      >=0      |      -1=last
11309       },_frame_step>=1,_output_filename
11310
11311           Generate  a  temporal fading from specified input image files, in a
11312       streamed way.
11313           If a display window is opened, rendered frames are displayed in  it
11314       during processing.
11315           The  output  filename may have extension 'avi' or 'mp4' (saved as a
11316       video), or any other usual image
11317           file extension (saved as a sequence of images).
11318
11319           Default     values:     'nb_inner_frames=10',      'first_frame=0',
11320       'last_frame=-1', 'frame_step=1' and 'output_filename=(undefined)'.
11321
11322         fade_video:
11323             video_filename,_nb_inner_frames>0,_first_frame>=0,_last_frame={
11324       >=0 | -1=last },_frame_step>=1,_output_filename
11325
11326           Create a temporal fading sequence from specified input video  file,
11327       in a streamed way.
11328           If  a display window is opened, rendered frames are displayed in it
11329       during processing.
11330           This command requires features from the OpenCV library (not enabled
11331       in G'MIC by default).
11332
11333           Default      values:     'nb_inner_frames=10',     'first_frame=0',
11334       'last_frame=-1', 'frame_step=1' and 'output_filename=(undefined)'.
11335
11336         files2video:
11337             "filename_pattern",_output_filename,_fps>0,_codec
11338
11339           Convert several files into a single video file.
11340
11341           Default   values:   'output_filename=output.mp4',   'fps=25'    and
11342       'codec=mp4v'.
11343
11344         median_files:
11345             "filename_pattern",_first_frame>=0,_last_frame={  >=0  |  -1=last
11346       },_frame_step>=1,_frame_rows[%]>=1,_is_fast_approximation={ 0 | 1 }
11347
11348           Compute the median frame of  specified  input  image  files,  in  a
11349       streamed way.
11350           If  a  display  window is opened, rendered frame is displayed in it
11351       during processing.
11352
11353           Default values: 'first_frame=0',  'last_frame=-1',  'frame_step=1',
11354       'frame_rows=20%' and 'is_fast_approximation=0'.
11355
11356         median_video:
11357             video_filename,_first_frame>=0,_last_frame={    >=0   |   -1=last
11358       },_frame_step>=1,_frame_rows[%]>=1,_is_fast_approximation={ 0 | 1 }
11359
11360           Compute the median of all frames of  an  input  video  file,  in  a
11361       streamed way.
11362           If  a  display  window is opened, rendered frame is displayed in it
11363       during processing.
11364           This command requires features from the OpenCV library (not enabled
11365       in G'MIC by default).
11366
11367           Default  values:  'first_frame=0', 'last_frame=-1', 'frame_step=1',
11368       'frame_rows=100%' and 'is_fast_approximation=1'.
11369
11370         morph:
11371             nb_inner_frames>=1,_smoothness>=0,_precision>=0
11372
11373           Create morphing sequence between selected images.
11374
11375           Default values: 'smoothness=0.1' and 'precision=4'.
11376
11377           Example:
11378             [#1] image.jpg +rotate 20,1,1,50%,50% morph 9
11379
11380         morph_files:
11381             "filename_pattern",_nb_inner_frames>0,_smoothness>=0,_preci‐
11382       sion>=0,_first_frame>=0,_last_frame={        >=0        |       -1=last
11383       },_frame_step>=1,_output_filename
11384
11385           Generate a temporal morphing from specified input image files, in a
11386       streamed way.
11387           If  a display window is opened, rendered frames are displayed in it
11388       during processing.
11389           The output filename may have extension '.avi' or '.mp4' (saved as a
11390       video), or any other usual image
11391           file extension (saved as a sequence of images).
11392
11393           Default  values:  'nb_inner_frames=10',  'smoothness=0.1',  'preci‐
11394       sion=4', 'first_frame=0', 'last_frame=-1', 'frame_step=1' and
11395            'output_filename=(undefined)'.
11396
11397         morph_rbf:
11398             nb_in‐
11399       ner_frames>=1,xs0[%],ys0[%],xt0[%],yt0[%],...,xsN[%],ysN[%],xtN[%],ytN[%]
11400
11401           Create morphing sequence between selected images,  using  RBF-based
11402       interpolation.
11403           Each argument (xsk,ysk)-(xtk,ytk) corresponds to the coordinates of
11404       a keypoint
11405           respectively on the source and target images. The set of  all  key‐
11406       points define the overall image deformation.
11407
11408         morph_video:
11409             video_filename,_nb_inner_frames>0,_smoothness>=0,_preci‐
11410       sion>=0,_first_frame>=0,_last_frame={       >=0        |        -1=last
11411       },_frame_step>=1,_output_filename
11412
11413           Generate  a temporal morphing from specified input video file, in a
11414       streamed way.
11415           If a display window is opened, rendered frames are displayed in  it
11416       during processing.
11417           The output filename may have extension '.avi' or '.mp4' (saved as a
11418       video), or any other usual image
11419           file extension (saved as a sequence of images).
11420           This command requires features from the OpenCV library (not enabled
11421       in G'MIC by default).
11422
11423           Default  values:  'nb_inner_frames=10',  'smoothness=0.1',  'preci‐
11424       sion=4', 'first_frame=0', 'last_frame=-1', 'frame_step=1' and
11425            'output_filename=(undefined)'.
11426
11427         register_nonrigid:
11428             [destination],_smoothness>=0,_precision>0,_nb_scale>=0
11429
11430           Register selected source images with specified  destination  image,
11431       using non-rigid warp.
11432
11433           Default     values:     'smoothness=0.2',     'precision=6'     and
11434       'nb_scale=0(auto)'.
11435
11436           Example:
11437             [#1] image.jpg +rotate 20,1,1,50%,50% +register_nonrigid[0] [1]
11438
11439         register_rigid:
11440             [destination],_smoothness>=0,_boundary_conditions={ 0=dirichlet |
11441       1=neumann | 2=periodic | 3=mirror }
11442
11443           Register  selected  source images with specified destination image,
11444       using rigid warp (shift).
11445
11446           Default values: 'smoothness=0.1%' and 'boundary_conditions=0'.
11447
11448           Example:
11449             [#1] image.jpg +shift 30,20 +register_rigid[0] [1]
11450
11451         transition:
11452             [transition_shape],nb_added_frames>=0,100>=shading>=0,_sin‐
11453       gle_frame_only={ -1=disabled | >=0 }
11454
11455           Generate a transition sequence between selected images.
11456
11457           Default values: 'shading=0' and 'single_frame_only=-1'.
11458
11459           Example:
11460             [#1]  image.jpg  +mirror  c  100%,100%  plasma[-1]  1,1,6 transi‐
11461       tion[0,1] [2],5
11462
11463         transition3d:
11464             _nb_frames>=2,_nb_xtiles>0,_nb_ytiles>0,_axis_x,_axis_y,_axis_z,_is_an‐
11465       tialias={ 0 | 1 }
11466
11467           Create 3D transition sequence between selected consecutive images.
11468           'axis_x',  'axis_y' and 'axis_z' can be set as mathematical expres‐
11469       sions, depending on 'x' and 'y'.
11470
11471           Default    values:     'nb_frames=10',     'nb_xtiles=nb_ytiles=3',
11472       'axis_x=1', 'axis_y=1', 'axis_z=0' and 'is_antialias=1'.
11473
11474           Example:
11475             [#1] image.jpg +blur 5 transition3d 9 display_rgba
11476
11477         video2files:
11478             input_filename,_output_filename,_first_frame>=0,_last_frame={ >=0
11479       | -1=last },_frame_step>=1
11480
11481           Split specified input video file into image  files,  one  for  each
11482       frame.
11483           First  and last frames as well as step between frames can be speci‐
11484       fied.
11485
11486           Default   values:   'output_filename=frame.png',   'first_frame=0',
11487       'last_frame=-1' and 'frame_step=1'.
11488
11489         12.21. Convenience Functions
11490                ---------------------
11491
11492         alert:
11493             _title,_message,_label_button1,_label_button2,...
11494
11495           Display an alert box and wait for user's choice.
11496           If  a  single  image is in the selection, it is used as an icon for
11497       the alert box.
11498
11499           Default values: 'title=[G'MIC Alert]' and 'message=This is an alert
11500       box.'.
11501
11502         arg:
11503             n>=1,_arg1,...,_argN
11504
11505           Return the n-th argument of the specified argument list.
11506
11507         arg0:
11508             n>=0,_arg0,...,_argN
11509
11510           Return  the n-th argument of the specified argument list (where 'n'
11511       starts from '0').
11512
11513         arg2img:
11514             argument_1,...,argument_N
11515
11516           Split specified list of arguments and return each as  a  new  image
11517       (as a null-terminated string).
11518
11519         arg2var:
11520             variable_name,argument_1,...,argument_N
11521
11522           For each i in [1...N], set 'variable_name$i=argument_i'.
11523           The  variable  name  should  be  global to make this command useful
11524       (i.e. starts by an underscore).
11525
11526         autocrop_coords:
11527             value1,value2,... | auto
11528
11529           Return coordinates (x0,y0,z0,x1,y1,z1) of the autocrop  that  could
11530       be performed on the latest
11531           of the selected images.
11532
11533           Default value: 'auto'
11534
11535         average_colors:
11536
11537           Return  the  average vector-value of the latest of the selected im‐
11538       ages.
11539
11540         base642img:
11541             "base64_string"
11542
11543           Decode given base64-encoded string as a newly inserted image at the
11544       end of the list.
11545           The   argument  string  must  have  been  generated  using  command
11546       'img2base64'.
11547
11548         base642uchar:
11549             "base64_string"
11550
11551           Decode given base64-encoded string as a newly inserted 1-column im‐
11552       age at the end of the list.
11553           The   argument  string  must  have  been  generated  using  command
11554       'uchar2base64'.
11555
11556         basename:
11557             file_path,_variable_name_for_folder
11558
11559           Return the basename of a file path, and opt. its folder location.
11560           When specified 'variable_name_for_folder' must starts by an  under‐
11561       score
11562           (global variable accessible from calling function).
11563
11564         bin:
11565             binary_int1,...
11566
11567           Print specified binary integers into their octal, decimal, hexadec‐
11568       imal and string representations.
11569
11570         bin2dec:
11571             binary_int1,...
11572
11573           Convert specified binary integers into  their  decimal  representa‐
11574       tions.
11575
11576         covariance_colors:
11577             _avg_outvarname
11578
11579           Return  the  covariance  matrix  of the vector-valued colors in the
11580       latest of the selected images
11581           (for arbitrary number of channels).
11582           Parameter 'avg_outvarname' is used as a variable  name  that  takes
11583       the value of the average vector-value.
11584
11585         dec:
11586             decimal_int1,...
11587
11588           Print specified decimal integers into their binary, octal, hexadec‐
11589       imal and string representations.
11590
11591         dec2str:
11592             decimal_int1,...
11593
11594           Convert specifial decimal integers into its string representation.
11595
11596         dec2bin:
11597             decimal_int1,...
11598
11599           Convert specified decimal integers into  their  binary  representa‐
11600       tions.
11601
11602         dec2hex:
11603             decimal_int1,...
11604
11605           Convert specified decimal integers into their hexadecimal represen‐
11606       tations.
11607
11608         dec2oct:
11609             decimal_int1,...
11610
11611           Convert specified decimal integers  into  their  octal  representa‐
11612       tions.
11613
11614         fact:
11615             value
11616
11617           Return the factorial of the specified value.
11618
11619         fibonacci:
11620             N>=0
11621
11622           Return the Nth number of the Fibonacci sequence.
11623
11624           Example:
11625             [#1] echo ${"fibonacci 10"}
11626
11627
11628             [gmic]-0./ Start G'MIC interpreter.
11629             [gmic]-0./ 55
11630             [gmic]-0./ End G'MIC interpreter.
11631
11632         file_mv:
11633             filename_src,filename_dest
11634
11635           Rename or move a file from a location $1 to another location $2.
11636
11637         file_rand:
11638
11639           Return a random filename for storing temporary data.
11640
11641         filename:
11642             filename,_number1,_number2,...,_numberN
11643
11644           Return a filename numbered with specified indices.
11645
11646         files (+):
11647             _mode,path
11648
11649           Return the list of files and/or subfolders from specified path.
11650           'path' can be eventually a matching pattern.
11651           'mode'  can  be { 0=files only | 1=folders only | 2=files + folders
11652       }.
11653           Add '3' to 'mode' to return full paths instead of filenames only.
11654
11655           Default value: 'mode=5'.
11656
11657         fitratio_wh:
11658             min_width,min_height,ratio_wh
11659
11660           Return  a   2D   size   'width,height'   which   is   bigger   than
11661       'min_width,min_height' and has the specified w/h ratio.
11662
11663         fitscreen:
11664             width,height,_depth,_minimal_size[%],_maximal_size[%] |
11665             [image],_minimal_size[%],_maximal_size[%]
11666
11667           Return the 'ideal' size WxH for a window intended to display an im‐
11668       age of specified size on screen.
11669
11670           Default   values:   'depth=1',   'minimal_size=128'   and    'maxi‐
11671       mal_size=85%'.
11672
11673         fontchart:
11674
11675           Insert G'MIC font chart at the end of the image list.
11676
11677           Example:
11678             [#1] fontchart
11679
11680         fps:
11681
11682           Return the number of time this function is called per second, or -1
11683       if this info is not yet available.
11684           Useful to display the framerate when displaying animations.
11685
11686         gcd:
11687             a,b
11688
11689           Return the GCD (greatest common divisor) between a and b.
11690
11691         hex:
11692             hexadecimal_int1,...
11693
11694           Print specified hexadecimal integers into their binary, octal, dec‐
11695       imal and string representations.
11696
11697         hex2dec:
11698             hexadecimal_int1,...
11699
11700           Convert specified hexadecimal integers into their decimal represen‐
11701       tations.
11702
11703         hex2img:
11704             "hexadecimal_string"
11705
11706           Insert new image 1xN at the end of the list with  values  specified
11707       by the given hexadecimal-encoded string.
11708
11709         hex2str:
11710             hexadecimal_string
11711
11712           Convert specified hexadecimal string into a string.
11713           See also: str2hex.
11714
11715         img2base64:
11716             _encoding={ 0=base64 | 1=base64url },_store_names={ 0 | 1 }
11717
11718           Encode selected images as a base64-encoded string.
11719           The images can be then decoded using command 'base642img'.
11720
11721           Default values: 'encoding=0'.
11722
11723         img2hex:
11724
11725           Return  representation  of  last  image  as  an hexadecimal-encoded
11726       string.
11727           Input image must have values that are integers in [0,255].
11728
11729         img2str:
11730
11731           Return the content of the latest of the selected images as  a  spe‐
11732       cial G'MIC input string.
11733
11734         img2text:
11735             _line_separator
11736
11737           Return text contained in a multi-line image.
11738
11739           Default value: 'line_separator= '.
11740
11741         img82hex:
11742
11743           Convert selected 8bits-valued vectors into their hexadecimal repre‐
11744       sentations (ascii-encoded).
11745
11746         hex2img8:
11747
11748           Convert selected hexadecimal representations  (ascii-encoded)  into
11749       8bits-valued vectors.
11750
11751         is_3d:
11752
11753           Return 1 if all of the selected images are 3D objects, 0 otherwise.
11754
11755         is_change:
11756             _value={ 0=false | 1=true }
11757
11758           Set or unset the 'is_change' flag associated to the image list.
11759           This  flag  tells  the  interpreter  whether  or not the image list
11760       should be displayed when the pipeline ends.
11761
11762           Default value: 'value=1'.
11763
11764         is_half:
11765
11766           Return 1 if the type of image pixels is limited to half-float.
11767
11768         is_ext:
11769             filename,_extension
11770
11771           Return 1 if specified filename has a given extensioin.
11772
11773         is_image_arg:
11774             string
11775
11776           Return 1 if specified string looks like '[ind]'.
11777
11778         is_pattern:
11779             string
11780
11781           Return  1  if  specified  string  looks  like  a  drawing   pattern
11782       '0x......'.
11783
11784         is_percent:
11785             string
11786
11787           Return 1 if specified string ends with a '%', 0 otherwise.
11788
11789         is_variable_name:
11790             "str"
11791
11792           Returns  1  if  specified  argument can be considered as a variable
11793       name, 0 otherwise.
11794
11795         is_videofilename:
11796
11797           Return 1 if extension of specified filename is typical  from  video
11798       files.
11799
11800         is_macos:
11801
11802           Return 1 if current computer OS is Darwin (MacOS), 0 otherwise.
11803
11804         is_windows:
11805
11806           Return 1 if current computer OS is Windows, 0 otherwise.
11807
11808         math_lib:
11809
11810           Return  string  that defines a set of several useful macros for the
11811       embedded math evaluator.
11812
11813         mad:
11814
11815           Return the MAD (Maximum Absolute Deviation) of  the  last  selected
11816       image.
11817           The MAD is defined as MAD = med_i|x_i-med_j(x_j)|
11818
11819         max_w:
11820
11821           Return the maximal width between selected images.
11822
11823         max_h:
11824
11825           Return the maximal height between selected images.
11826
11827         max_d:
11828
11829           Return the maximal depth between selected images.
11830
11831         max_s:
11832
11833           Return the maximal spectrum between selected images.
11834
11835         max_wh:
11836
11837           Return the maximal wxh size of selected images.
11838
11839         max_whd:
11840
11841           Return the maximal wxhxd size of selected images.
11842
11843         max_whds:
11844
11845           Return the maximal wxhxdxs size of selected images.
11846
11847         median_color:
11848
11849           Return the median color value of the last selected image.
11850
11851         min_w:
11852
11853           Return the minimal width between selected images.
11854
11855         min_h:
11856
11857           Return the minimal height between selected images.
11858
11859         min_d:
11860
11861           Return the minimal depth between selected images.
11862
11863         min_s:
11864
11865           Return the minimal s size of selected images.
11866
11867         min_wh:
11868
11869           Return the minimal wxh size of selected images.
11870
11871         min_whd:
11872
11873           Return the minimal wxhxd size of selected images.
11874
11875         min_whds:
11876
11877           Return the minimal wxhxdxs size of selected images.
11878
11879         nmd (+):
11880             Shortcut for command 'named'.
11881
11882         named (+):
11883             _mode,"name1","name2",...
11884
11885           Return  the set of indices corresponding to images of the selection
11886       with specified names.
11887           After this command returns, the status contains a list  of  indices
11888       (unsigned integers),
11889           separated  by  commas  (or  an empty string if no images with those
11890       names have been found).
11891           (equivalent to shortcut command 'nmd').
11892
11893           'mode' can be { 0=all indices (default) | 1=lowest index |  2=high‐
11894       est index | 3 = all indices (case insensitive) | 4 = lowest index (case
11895       insensitive) | 5 = highest index (case
11896           insensitive)}
11897
11898         normalize_filename:
11899             filename
11900
11901           Return a "normalized" version of the  specified  filename,  without
11902       spaces and capital letters.
11903
11904         oct:
11905             octal_int1,...
11906
11907           Print specified octal integers into their binary, decimal, hexadec‐
11908       imal and string representations.
11909
11910         oct2dec:
11911             octal_int1,...
11912
11913           Convert specified octal integers  into  their  decimal  representa‐
11914       tions.
11915
11916         padint:
11917             number,_size>0
11918
11919           Return  a  integer  with 'size' digits (eventually left-padded with
11920       '0').
11921
11922         path_cache:
11923
11924           Return a path to store G'MIC data files for one user  (whose  value
11925       is OS-dependent).
11926
11927         path_current:
11928
11929           Return current folder from where G'MIC has been run.
11930
11931         path_gimp:
11932
11933           Return a path to store GIMP configuration files for one user (whose
11934       value is OS-dependent).
11935
11936         path_tmp:
11937
11938           Return a path to store temporary files (whose  value  is  OS-depen‐
11939       dent).
11940
11941         remove_copymark:
11942             "image_name"
11943
11944           Remove copy mark from names of selected images.
11945
11946         reset:
11947
11948           Reset global parameters of the interpreter environment.
11949
11950         rgb:
11951
11952           Return a random int-valued RGB color.
11953
11954         rgba:
11955
11956           Return a random int-valued RGBA color.
11957
11958         shell_cols:
11959
11960           Return the estimated number of columns of the current shell.
11961
11962         size_value:
11963
11964           Return the size (in bytes) of an image value.
11965
11966         std_noise:
11967
11968           Return  the estimated noise standard deviation of the last selected
11969       image.
11970
11971         str:
11972             string
11973
11974           Print specified string into its binary, octal, decimal and hexadec‐
11975       imal representations.
11976
11977         str2hex:
11978             "string"
11979
11980           Convert  specified  string  argument into a sequence of hexadecimal
11981       values (returned as a string).
11982           See also: hex2str.
11983
11984           Example:
11985             [#1] hex=${"str2hex
11986
11987
11988             [gmic]-0./ Start G'MIC interpreter.
11989             [gmic]-0./ 48656c6c6f206d7920667269656e6473
11990             [gmic]-0./ End G'MIC interpreter.
11991
11992         strcapitalize:
11993             string
11994
11995           Capitalize specified string.
11996
11997         strcontains:
11998             string1,string2
11999
12000           Return 1 if the first string contains the second one.
12001
12002         strlen:
12003             string1
12004
12005           Return the length of specified string argument.
12006
12007         strreplace:
12008             string,search,replace
12009
12010           Search and replace substrings in an input string.
12011
12012         strlowercase:
12013             string
12014
12015           Return a lower-case version of the specified string.
12016
12017         struppercase:
12018             string
12019
12020           Return an upper-case version of the specified string.
12021
12022         strvar:
12023             "string"
12024
12025           Return a simplified version of the specified string,  that  can  be
12026       used as a variable name.
12027           (version  that  creates  a  lowercase  result,  no  longer than 128
12028       chars).
12029
12030         strcasevar:
12031             "string"
12032
12033           Return a simplified version of the specified string,  that  can  be
12034       used as a variable name.
12035           (version  that  keeps  original case of specified string, no longer
12036       than 128 chars).
12037
12038         strver:
12039             _version
12040
12041           Return the specified version number of the G'MIC interpreter, as  a
12042       string.
12043
12044           Default value: 'version=$_version'.
12045
12046         tic:
12047
12048           Initialize tic-toc timer.
12049           Use it in conjunction with 'toc'.
12050
12051         toc:
12052
12053           Display  elapsed  time  of the tic-toc timer since the last call to
12054       'tic'.
12055           This command returns the elapsed time in the status value.
12056           Use it in conjunction with 'tic'.
12057
12058         to_clutname:
12059             "string"
12060
12061           Return simplified name that can be used as a CLUT name, from speci‐
12062       fied input string.
12063
12064         uchar2base64:
12065             _encoding={ 0=base64 | 1=base64url }
12066
12067           Encode  the  values  of  the  latest  of  the  selected images as a
12068       base64-encoded string.
12069           The string can be decoded using command 'base642uchar'.
12070           Selected images must have values that are integers in [0,255].
12071
12072           Default values: 'encoding=0'.
12073
12074         12.22. Other Interactive Commands
12075                --------------------------
12076
12077         demos:
12078             _run_in_parallel={ 0=no | 1=yes | 2=auto }
12079
12080           Show a menu to select and view all G'MIC interactive demos.
12081
12082         tixy:
12083             "expression"
12084
12085           Animate specified mathematical expression with a 16x16 grid of cir‐
12086       cles, using the rules described at https://tixy.land.
12087
12088         x_2048:
12089
12090           Launch the 2048 game.
12091
12092         x_blobs:
12093
12094           Launch the blobs editor.
12095           ../img/x_blobs.jpg [image: 'x_blobs']
12096
12097         x_bouncing:
12098
12099           Launch the bouncing balls demo.
12100
12101         x_color_curves:
12102             _colorspace={  rgb  |  cmy | cmyk | hsi | hsl | hsv | lab | lch |
12103       ycbcr | last }
12104
12105           Apply color curves on selected RGB[A] images, using an  interactive
12106       window.
12107           Set 'colorspace' to 'last' to apply last defined color curves with‐
12108       out opening interactive windows.
12109
12110           Default value: 'colorspace=rgb'.
12111
12112         x_colorize:
12113             _is_lineart={ 0 | 1 },_max_resolution={ 0 |  >=128  },_multichan‐
12114       nels_output={ 0 | 1 },_[palette1],_[palette2],_[grabber1]
12115
12116           Colorized selected B&W images, using an interactive window.
12117           When  >0, argument 'max_resolution' defines the maximal image reso‐
12118       lution used in the interactive window.
12119
12120           Default values: 'is_lineart=1', 'max_resolution=1024'  and  'multi‐
12121       channels_output=0'.
12122
12123         x_connect4:
12124
12125           Launch the Connect Four game.
12126
12127         xz:
12128             Shortcut for command 'x_crop'.
12129
12130         x_crop:
12131
12132           Crop selected images interactively.
12133           (equivalent to shortcut command 'xz').
12134
12135         x_cut:
12136
12137           Cut selected images interactively.
12138
12139         x_fire:
12140
12141           Launch the fire effect demo.
12142
12143         x_fireworks:
12144
12145           Launch the fireworks demo.
12146
12147         x_fisheye:
12148
12149           Launch the fish-eye effect demo.
12150
12151         x_fourier:
12152
12153           Launch the fourier filtering demo.
12154
12155         x_grab_color:
12156             _variable_name
12157
12158           Open a color grabber widget from the first selected image.
12159           Argument  'variable_name'  specifies the variable that contains the
12160       selected color values at any time.
12161           Assigning '-1' to it forces the interactive window to close.
12162
12163           Default values: 'variable_name=xgc_variable'.
12164
12165         x_hanoi:
12166
12167           Launch the Tower of Hanoi game.
12168
12169         x_histogram:
12170
12171           Launch the histogram demo.
12172
12173         x_hough:
12174
12175           Launch the hough transform demo.
12176
12177         x_jawbreaker:
12178             0<_width<20,0<_height<20,0<_balls<=8
12179
12180           Launch the Jawbreaker game.
12181
12182         x_landscape:
12183
12184           Launch the virtual landscape demo.
12185
12186         x_life:
12187
12188           Launch the game of life.
12189
12190         x_light:
12191
12192           Launch the light effect demo.
12193
12194         x_mandelbrot:
12195             _julia={ 0 | 1 },_c0r,_c0i
12196
12197           Launch Mandelbrot/Julia explorer.
12198
12199         x_mask_color:
12200             _colorspace={ all | rgb | lrgb | ycbcr | lab | lch | hsv | hsi  |
12201       hsl | cmy | cmyk | yiq },_spatial_tolerance>=0,_color_tolerance>=0
12202
12203           Interactively  select  a color, and add an alpha channel containing
12204       the corresponding color mask.
12205           Argument 'colorspace' refers to the color metric  used  to  compute
12206       color similarities, and can be basically
12207           one  of  { rgb | lrgb | ycbcr | lab | lch | hsv | hsi | hsl | cmy |
12208       cmyk | yiq }.
12209           You can also select one one particular channel of this  colorspace,
12210       by setting 'colorspace' as
12211           'colorspace_channel' (e.g. 'hsv_h' for the hue).
12212
12213           Default   values:   'colorspace=all',   'spatial_tolerance=5'   and
12214       'color_tolerance=5'.
12215
12216         x_metaballs3d:
12217
12218           Launch the 3D metaballs demo.
12219
12220         x_minesweeper:
12221             8<=_width=<20,8<=_height<=20
12222
12223           Launch the Minesweeper game.
12224
12225         x_minimal_path:
12226
12227           Launch the minimal path demo.
12228
12229         x_morph:
12230             _nb_frames>=2,_preview_fidelity={ 0=coarsest | 1=coarse |  2=nor‐
12231       mal | 3=fine | 4=finest }
12232
12233           Launch the interactive image morpher.
12234
12235           Default values: 'nb_frames=16' and 'preview_fidelity=3'.
12236
12237         x_pacman:
12238
12239           Launch pacman game.
12240
12241         x_paint:
12242
12243           Launch the interactive painter.
12244
12245         x_plasma:
12246
12247           Launch the plasma effect demo.
12248
12249         x_quantize_rgb:
12250             _nbcolors>=2
12251
12252           Launch the RGB color quantization demo.
12253
12254         x_reflection3d:
12255
12256           Launch the 3D reflection demo.
12257
12258         x_rubber3d:
12259
12260           Launch the 3D rubber object demo.
12261
12262         x_segment:
12263             _max_resolution={ 0 | >=128 }
12264
12265           Segment  foreground  from background in selected opaque RGB images,
12266       interactively.
12267           Return RGBA images with binary alpha-channels.
12268
12269           Default value: 'max_resolution=1024'.
12270
12271         x_select_color:
12272             _variable_name
12273
12274           Display a RGB or RGBA color selector.
12275           Argument 'variable_name' specifies the variable that  contains  the
12276       selected color values (as R,G,B,[A])
12277           at any time.
12278           Its  value  specifies the initial selected color. Assigning '-1' to
12279       it forces the interactive window to close.
12280
12281           Default value: 'variable_name=xsc_variable'.
12282
12283         x_select_function1d:
12284             _variable_name,_background_curve_R,_background_curve_G,_back‐
12285       ground_curve_B
12286
12287           Open  an  interactive window, where the user can defined its own 1D
12288       function.
12289           If an image is selected, it is used to display additional  informa‐
12290       tion :
12291              -   The  first row defines the values of a background curve dis‐
12292       played on the window (e.g. an histogram).
12293              -  The 2nd, 3rd and 4th rows define the R,G,B  color  components
12294       displayed beside the X and Y axes.
12295           Argument  'variable_name'  specifies the variable that contains the
12296       selected function keypoints at any time.
12297           Assigning '-1' to it forces the interactive window to close.
12298
12299           Default      values:      'variable_name=xsf_variable',      'back‐
12300       ground_curve_R=220',       'background_curve_G=background_curve_B=back‐
12301       ground_curve_T'.
12302
12303         x_select_palette:
12304             _variable_name,_number_of_columns={ 0=auto | >0 }
12305
12306           Open a RGB or RGBA color selector widget from a palette.
12307           The palette is given as a selected image.
12308           Argument 'variable_name' specifies the variable that  contains  the
12309       selected color values (as R,G,B,[A])
12310           at any time.
12311           Assigning '-1' to it forces the interactive window to close.
12312
12313           Default  values:  'variable_name=xsp_variable'  and 'number_of_col‐
12314       umns=2'.
12315
12316         x_shadebobs:
12317
12318           Launch the shade bobs demo.
12319
12320         x_spline:
12321
12322           Launch spline curve editor.
12323
12324         x_starfield3d:
12325
12326           Launch the 3D starfield demo.
12327
12328         x_tetris:
12329
12330           Launch tetris game.
12331
12332         x_threshold:
12333
12334           Threshold selected images interactively.
12335
12336         x_tictactoe:
12337
12338           Launch tic-tac-toe game.
12339
12340         x_warp:
12341             _nb_keypoints_xgrid>=2,_nb_keypoints_ygrid>=2,_nb_keypoints_con‐
12342       tours>=0,_preview_fidelity={  0=coarsest | 1=coarse | 2=normal | 3=fine
12343       | 4=finest },_[background_image],0<=_background_opacity<=1
12344
12345           Launch the interactive image warper.
12346
12347           Default values: 'nb_keypoints_xgrid=nb_keypoints_ygrid=2', 'nb_key‐
12348       points_contours=0' and 'preview_fidelity=1'.
12349
12350         x_waves:
12351
12352           Launch the image waves demo.
12353
12354         x_whirl:
12355             _opacity>=0
12356
12357           Launch the fractal whirls demo.
12358
12359           Default values: 'opacity=0.2'.
12360
12361         13. Examples of Use
12362             ---------------
12363
12364         'gmic' is a generic image processing tool which can be used in a wide
12365       variety of situations. The few examples below illustrate possible  uses
12366       of this tool:
12367
12368         ### View a list of images:
12369
12370           $ gmic file1.bmp file2.jpeg
12371
12372         ### Convert an image file:
12373
12374           $ gmic input.bmp output output.jpg
12375
12376         ### Create a volumetric image from a movie sequence:
12377
12378           $ gmic input.mpg append z output output.hdr
12379
12380         ### Compute image gradient norm:
12381
12382           $ gmic input.bmp gradient_norm
12383
12384         ### Denoise a color image:
12385
12386           $ gmic image.jpg denoise 30,10 output denoised.jpg
12387
12388         ### Compose two images using overlay layer blending:
12389
12390           $ gmic image1.jpg image2.jpg blend overlay output blended.jpg
12391
12392         ### Evaluate a mathematical expression:
12393
12394           $ gmic echo "cos(pi/4)^2+sin(pi/4)^2={cos(pi/4)^2+sin(pi/4)^2}"
12395
12396         ### Plot a 2D function:
12397
12398           $                gmic                1000,1,1,2                fill
12399       "X=3*(x-500)/500;X^2*sin(3*X^2)+if(c==0,u(0,-1),cos(X*10))" plot
12400
12401                                                           ../img/exam‐
12402       ple_plot.png [image: '']
12403
12404         ### Plot a 3D elevated function in random colors:
12405
12406           $  gmic  128,128,1,3,"u(0,255)"  plasma 10,3 blur 4 sharpen 10000 n
12407       0,255                                                   elevation3d[-1]
12408       "'X=(x-64)/6;Y=(y-64)/6;100*exp(-(X^2+Y^2)/30)*abs(cos(X)*sin(Y))'"
12409
12410                                                           ../img/example_ele‐
12411       vation3d.png [image: '']
12412
12413         ### Plot the isosurface of a 3D volume:
12414
12415           $   gmic   mode3d   5   moded3d   5   double3d    0    isosurface3d
12416       "'x^2+y^2+abs(z)^abs(4*cos(x*y*z*3))'",3
12417
12418                                                           ../img/example_iso‐
12419       surface3d.png [image: '']
12420
12421         ### Render a G'MIC 3D logo:
12422
12423           $ gmic 0 text G´MIC,0,0,53,1,1,1,1 expand_xy 10,0 blur 1  normalize
12424       0,100 +plasma 0.4 add blur 1 elevation3d -0.1 moded3d 4
12425
12426                                                           d../img/exam‐
12427       ple_logo.png [image: '']
12428
12429         ### Generate a 3D ring of torii:
12430
12431           $     gmic     repeat     20     torus3d      15,2      color3d[-1]
12432       "{u(60,255)},{u(60,255)},{u(60,255)}"  *3d[-1]  0.5,1  if  "{$>%2}" ro‐
12433       tate3d[-1] 0,1,0,90  fi  add3d[-1]  70  add3d  rotate3d  0,0,1,18  done
12434       moded3d 3 mode3d 5
12435          double3d 0
12436
12437                                                           ../img/exam‐
12438       ple_torii.png [image: '']
12439
12440         ### Create a vase from a 3D isosurface:
12441
12442           $ gmic moded3d 4 isosurface3d "'x^2+2*abs(y/2)*sin(2*y)^2+z^2-3',0"
12443       sphere3d  1.5  sub3d[-1]  0,5  plane3d 15,15 rotate3d[-1] 1,0,0,90 cen‐
12444       ter3d[-1] add3d[-1] 0,3.2 color3d[-1] 180,150,255
12445          color3d[-2] 128,255,0 color3d[-3] 255,128,0 add3d
12446
12447                                                           ../img/exam‐
12448       ple_vase.png [image: '']
12449
12450         ### Launch a set of interactive demos:
12451
12452           $ gmic demos
12453
12454
12455
12456         **  G'MIC  comes  with  ABSOLUTELY  NO  WARRANTY;  for details visit:
12457       https://gmic.eu **
12458
12459
12460
12461                                                                      G'MIC(1)
Impressum