1G'MIC(1) General Commands Manual G'MIC(1)
2
3
4
6 gmic - Perform image processing operations using the G'MIC framework.
7
8
10 gmic: GREYC's Magic for Image Computing: command-line interface
11 Version 2.9.7
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.7.
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' concatenates specified 'string' to the
233 end of variable 'name'.
234 * Multiple variable assignments and updates are allowed, with ex‐
235 pressions:
236 'name1,name2,...,nameN=value' or 'name1,name2,...,na‐
237 meN=value1,value2,
238 ...,valueN' where assignment operator '=' can be replaced by one of
239 the allowed operators (e.g. '+=').
240 * Variables usually store numbers or strings. Use command store to
241 assign variables from image data (and syntax 'input $variable' to
242 bring
243 them back on the image list afterwards).
244
245
246 6. Command Items and Selections
247 ----------------------------
248
249 * A G'MIC item that is not a filename nor a special input string
250 designates a 'command' most of the time. Generally, commands perform
251 image processing operations on one or several available images of
252 the list.
253 * Reccurent commands have two equivalent names ('regular' and
254 'short'). For instance, command names 'resize' and 'r' refer
255 to the same image resizing action.
256 * A G'MIC command may have mandatory or optional arguments. Command
257 arguments must be specified in the next item on the command line.
258 Commas ',
259 ' are used to separate multiple arguments of a single command, when
260 required.
261 * The execution of a G'MIC command may be restricted only to a sub‐
262 set of
263 the image list, by appending '[selection]' to the command name. Ex‐
264 amples
265 of valid syntaxes for 'selection' are:
266 - 'command[-2]': Apply command only on the penultimate image
267 '[-2]' of the list.
268 - 'command[0,1,3]': Apply command only on images '[0]',
269 '[1]' and '[3]'.
270 - 'command[3-6]': Apply command only on images '[3]' to
271 '[6]' (i.e, '[3]', '[4]', '[5]' and '[6]').
272 - 'command[50%-100%]': Apply command only on the second half of
273 the
274 image list.
275 - 'command[0,-4--1]': Apply command only on the first image and
276 the
277 last four images.
278 - 'command[0-9:3]': Apply command only on images '[0]' to
279 '[9]', with a step of 3 (i.e. on images '[0]', '[3]',
280 '[6]' and '[9]').
281 - 'command[0-9:25%]': Apply command only on images '[0]' to
282 '[9]', with a step of 25% (i.e. on images '[0]', '[3]',
283 '[6]' and '[9]').
284 - 'command[0--1:2]': Apply command only on images of the list
285 with
286 even indices.
287 - 'command[0,2-4,50%--1]': Apply command on images '[0]',
288 '[2]', '[3]', '[4]' and on the second half of the image list.
289 - 'command[^0,1]': Apply command on all images except the first
290 two.
291 - 'command[name1,name2]': Apply command on named images 'name1'
292 and 'name2'.
293
294 * Indices in selections are always sorted in increasing order, and
295 duplicate
296 indices are discarded. For instance, selections '[3-1,1-3]' and
297 '[1,1,
298 1,3,2]' are both equivalent to '[1-3]'. If you want to repeat a sin‐
299 gle
300 command multiple times on an image, use a 'repeat..done' loop in‐
301 stead.
302 Inverting the order of images for a command is achieved by explic‐
303 itly inverting
304 the order of the images in the list, with command 'reverse[selec‐
305 tion]'.
306 * Command selections '[-1]', '[-2]' and '[-3]' are so often
307 used they have their own shortcuts, respectively '.', '..' and
308 '...'. For instance, command 'blur..' is equivalent to
309 'blur[-2]'. These shortcuts work also when specifying command argu‐
310 ments.
311 * G'MIC commands invoked without '[selection]' are applied on all
312 images
313 of the list, i.e. the default selection is '[0--1]' (except for com‐
314 mand
315 input whose default selection is '[-1]'').
316 * Prepending a single hyphen '-' to a G'MIC command is allowed. This
317 may
318 be useful to recognize command items more easily in a one-liner
319 pipeline
320 (typically invoked from a shell).
321 * A G'MIC command prepended with a plus sign '+' does not act
322 in-place but inserts its result as one or several new images at the
323 end
324 of the image list.
325 * There are two different types of commands that can be run by the
326 G'MIC
327 interpreter:
328 - Built-in commands are the hard-coded functionalities in the
329 interpreter core. They are thus compiled as binary code and run
330 fast, most of
331 the time. Omitting an argument when invoking a built-in command is
332 not
333 permitted, except if all following arguments are also omitted. For
334 instance,
335 invoking 'plasma 10,,5' is invalid but 'plasma 10' is correct.
336 - Custom commands, are defined as G'MIC pipelines of built-in or
337 other custom commands. They are parsed by the G'MIC interpreter, and
338 thus run a
339 bit slower than built-in commands. Omitting arguments when invoking
340 a custom
341 command is permitted. For instance, expressions 'flower ,,,100,,2'
342 or
343 'flower ,' are correct.
344
345 * Most of the existing commands in G'MIC are actually defined as
346 custom
347 commands.
348 * A user can easily add its own custom commands to the G'MIC inter‐
349 preter (see
350 section Adding Custom Commands for more details). New built-in com‐
351 mands
352 cannot be added (unless you modify the G'MIC interpreter source code
353 and
354 recompile it).
355
356
357 7. Input/Output Properties
358 -----------------------
359
360 * G'MIC is able to read/write most of the classical image file for‐
361 mats,
362 including:
363 - 2D grayscale/color files: '.png', '.jpeg', '.gif',
364 '.pnm', '.tif', '.bmp', ...
365 - 3D volumetric files: '.dcm', '.hdr', '.nii',
366 '.cube', '.pan', '.inr', '.pnk', ...
367 - Video files: '.mpeg', '.avi', '.mp4', '.mov',
368 '.ogg', '.flv', ...
369 - Generic text or binary data files: '.gmz', '.cimg',
370 '.cimgz', 'flo', 'ggr', 'gpl', '.dlm',
371 '.asc', '.pfm', '.raw', '.txt', '.h'.
372 - 3D mesh files: '.off', '.obj' (output only)
373
374 * When dealing with color images, G'MIC generally reads, writes and
375 displays
376 data using the usual sRGB color space.
377 * G'MIC is able to manage 3D objects that may be read from files or
378 generated by G'MIC commands. A 3D object is stored as a one-column
379 scalar image
380 containing the object data, in the following order: { magic_number;
381 sizes;
382 vertices; primitives; colors; opacities }. These 3D representations
383 can be
384 then processed as regular images (see command split3d for accessing
385 each
386 of these 3D object data separately).
387 * Be aware that usual file formats may be sometimes not adapted to
388 store all
389 the available image data, since G'MIC uses float-valued image buf‐
390 fers. For
391 instance, saving an image that was initially loaded as a
392 16bits/channel image,
393 as a '.jpg' file will result in a loss of information. Use the
394 G'MIC-specific file extension '.gmz' to ensure that all data preci‐
395 sion is
396 preserved when saving images.
397 * Sometimes, file options may/must be set for file formats:
398 - Video files: Only sub-frames of an image sequence may be
399 loaded,
400 using the input expression 'filename.ext,[first_frame[,last_frame[,
401 step]]]'. Set 'last_frame==-1' to tell it must be the last frame of
402 the video. Set 'step' to '0' to force an opened video file to be
403 opened/closed. Output framerate and codec can be also set by using
404 the output
405 expression 'filename.avi,_fps,_codec,_keep_open' where 'keep_open'
406 can be { 0 | 1 }. 'codec' is a 4-char string (see
407 http://www.fourcc.org/codecs.php ) or '0' for the default codec.
408 'keep_open' tells if the output video file must be kept open for
409 appending new frames afterwards.
410 - '.cimg[z]' files: Only crops and sub-images of .cimg files
411 can be loaded, using the input expressions 'filename.cimg,N0,N1',
412 'filename.cimg,N0,N1,x0,x1', 'filename.cimg,N0,N1,x0,y0,x1,y1',
413 'filename.cimg,N0,N1,x0,y0,z0,x1,y1,z1' or 'file‐
414 name.cimg,N0,N1,x0,y0,
415 z0,c0,x1,y1,z1,c1'. Specifying '-1' for one coordinates stands for
416 the
417 maximum possible value. Output expression 'file‐
418 name.cimg[z][,datatype]'
419 can be used to force the output pixel type. 'datatype' can be { auto
420 |
421 bool | uchar | char | ushort | short | uint | int | uint64 | int64 |
422 float |
423 double }.
424 - '.raw' binary files: Image dimensions and input pixel type
425 may be specified when loading '.raw' files with input expression
426 'filename.raw[,datatype][,width][,height[,depth[,dim[,offset]]]]]'.
427 If no
428 dimensions are specified, the resulting image is a one-column vector
429 with
430 maximum possible height. Pixel type can also be specified with the
431 output
432 expression 'filename.raw[,datatype]'. 'datatype' can be the same as
433 for '.cimg[z]' files.
434 - '.yuv' files: Image dimensions must be specified when loading,
435 and only sub-frames of an image sequence may be loaded, using the
436 input
437 expression 'filename.yuv,width,height[,chroma_subsam‐
438 pling[,first_frame[,
439 last_frame[,step]]]'. 'chroma_subsampling' can be { 420 | 422 | 444
440 }. When saving, chroma subsampling mode can be specified with output
441 expression 'filename.yuv[,chroma_subsampling]'.
442 - '.tiff' files: Only sub-images of multi-pages tiff files can
443 be loaded, using the input expression 'file‐
444 name.tif,_first_frame,_last_frame,
445 _step'. Output expression 'filename.tiff,_datatype,_compression,
446 _force_multipage,_use_bigtiff' can be used to specify the output
447 pixel type,
448 as well as the compression method. 'datatype' can be the same as for
449 '.cimg[z]' files. 'compression' can be { none (default) | lzw |
450 jpeg }. 'force_multipage' can be { 0=no (default) | 1=yes }.
451 'use_bigtiff' can be { 0=no | 1=yes (default) }.
452 - '.pdf' files: When loading a file, the rendering resolution
453 can be specified using the input expression 'filename.pdf,resolu‐
454 tion',
455 where 'resolution' is an unsigned integer value.
456 - '.gif' files: Animated gif files can be saved, using the
457 input expression 'filename.gif,fps>0,nb_loops'. Specify
458 'nb_loops=0' to get an infinite number of animation loops (this is
459 the
460 default behavior).
461 - '.jpeg' files: The output quality may be specified (in %),
462 using the output expression 'filename.jpg,30' (here, to get a 30%
463 quality
464 output). '100' is the default.
465 - '.mnc' files: The output header can set from another file,
466 using the output expression 'filename.mnc,header_template.mnc'.
467 - '.pan', '.cpp', '.hpp', '.c' and '.h'
468 files: The output datatype can be selected with output expression
469 'filename[,datatype]'. 'datatype' can be the same as for
470 '.cimg[z]' files.
471 - '.gmic' files: These filenames are assumed to be G'MIC custom
472 commands files. Loading such a file will add the commands it defines
473 to the
474 interpreter. Debug information can be enabled/disabled by the input
475 expression
476 'filename.gmic[,add_debug_info' where 'debug_info' can be {
477 0=false | 1=true }.
478 - Inserting 'ext:' on the beginning of a filename (e.g.
479 'jpg:filename') forces G'MIC to read/write the file as it would have
480 been
481 done if it had the specified extension '.ext'.
482
483 * Some input/output formats and options may not be supported, de‐
484 pending on the
485 configuration flags that have been set during the build of the G'MIC
486 software.
487
488
489 8. Substitution Rules
490 ------------------
491
492 * G'MIC items containing '$' or '{}' are substituted before
493 being interpreted. Use these substituting expressions to access var‐
494 ious data
495 from the interpreter environment.
496 * '$name' and '${name}' are both substituted by the value of the
497 specified named variable (set previously by the item 'name=value').
498 If
499 this variable has not been already set, the expression is substi‐
500 tuted by the
501 highest positive index of the named image '[name]'. If no image has
502 this
503 name, the expression is substituted by the value of the OS environ‐
504 ment variable
505 with same name (it may be thus an empty string if it is not de‐
506 fined).
507 * The following reserved variables are predefined by the G'MIC in‐
508 terpreter:
509 - '$!': The current number of images in the list.
510 - '$>' and '$<': The increasing/decreasing index of the latest
511 (currently running) 'repeat...done' loop. '$>' goes from '0'
512 (first loop iteration) to 'nb_iterations - 1' (last iteration).
513 '$<' does the opposite.
514 - '$/': The current call stack. Stack items are separated by
515 slashes
516 '/'.
517 - '$|': The current value (expressed in seconds) of a millisecond
518 precision timer.
519 - '$^': The current verbosity level.
520 - '$_cpus': The number of computation cores available on your ma‐
521 chine.
522 - '$_flags': The list of enabled flags when G'MIC interpreter has
523 been compiled.
524 - '$_host': A string telling about the host running the G'MIC
525 interpreter (e.g. 'cli' or 'gimp').
526 - '$_os': A string describing the running operating system.
527 - '$_path_rc': The path to the G'MIC folder used to store
528 configuration files (its value is OS-dependent).
529 - '$_path_user': The path to the G'MIC user file '.gmic' or
530 'user.gmic' (its value is OS-dependent).
531 - '$_path_commands': A list of all imported command files (stored
532 as
533 a list-valued variable).
534 - '$_pid': The current process identifier, as an integer.
535 - '$_pixeltype': The type of image pixels (default: 'float').
536 - '$_prerelease': For pre-releases, the date of the pre-release
537 as
538 'yymmdd'. For stable releases, this variable is set to '0'.
539 - '$_version': A 3-digits number telling about the current ver‐
540 sion of
541 the G'MIC interpreter (e.g. '297').
542 - '$_vt100': Set to '1' if colored text output is allowed on
543 the console. Otherwise, set to '0'.
544
545 * '$$name' and '$${name}' are both substituted by the G'MIC script
546 code of the specified named 'custom command', or by an empty string
547 if no
548 custom command with specified name exists.
549 * '${"-pipeline"}' is substituted by the status value after the
550 execution of the specified G'MIC pipeline (see command status).
551 Expression '${}' thus stands for the current status value.
552 * '{``string}' (starting with two backquotes) is substituted by a
553 double-quoted version of the specified string.
554 * '{/string}' is substituted by the escaped version of the specified
555 string.
556 * '{'string'[:delimiter]}' (between single quotes) is substituted by
557 the
558 sequence of character codes that composes the specified string, sep‐
559 arated by
560 specified delimiter. Possible delimiters are ',' (default), ';',
561 '/', '^' or ' '. For instance, item '{'foo'}' is substituted
562 by '102,111,111' and '{'foo':;}' by '102;111;111'.
563 * '{image,feature[:delimiter]}' is substituted by a specific feature
564 of
565 the image '[image]'. 'image' can be either an image number or an
566 image name. It can be also eluded, in which case, the last image
567 '[-1]'
568 of the list is considered for the requested feature. Specified 'fea‐
569 ture'
570 can be one of:
571 - 'b': The image basename (i.e. filename without the folder path
572 nor
573 extension).
574 - 'f': The image folder name.
575 - 'n': The image name or filename (if the image has been read
576 from a
577 file).
578 - 't': The text string from the image values regarded as charac‐
579 ter
580 codes.
581 - 'x': The image extension (i.e the characters after the last
582 '.' in the image name).
583 - '^': The sequence of all image values, separated by commas ',
584 '.
585 - '@subset': The sequence of image values corresponding to the
586 specified subset, and separated by commas ','.
587 - Any other 'feature' is considered as a mathematical
588 expression associated to the image '[image]' and is substituted by
589 the
590 result of its evaluation (float value). For instance, expression
591 '{0,
592 w+h}' is substituted by the sum of the width and height of the first
593 image
594 (see section Mathematical Expressions for more details). If a
595 mathematical expression starts with an underscore '_', the resulting
596 value is truncated to a readable format. For instance, item '{_pi}'
597 is
598 substituted by '3.14159' (while '{pi}' is substituted by
599 '3.141592653589793').
600 - A 'feature' delimited by backquotes is replaced by a string
601 whose
602 character codes correspond to the list of values resulting from the
603 evaluation
604 of the specified mathematical expression. For instance, item
605 '{`[102,111,
606 111]`}' is substituted by 'foo' and item '{`vector8(65)`}' by
607 'AAAAAAAA'.
608
609 * '{*}' is substituted by the visibility state of the instant dis‐
610 play
611 window '#0' (can be { 0=closed | 1=visible }.
612 * '{*[index],feature1,...,featureN[:delimiter]}' is substituted by a
613 specific set of features of the instant display window '#0' (or
614 '#index', if specified). Requested 'features' can be:
615 - 'w': display width (i.e. width of the display area managed by
616 the
617 window).
618 - 'h': display height (i.e. height of the display area managed by
619 the
620 window).
621 - 'wh': display width x display height.
622 - 'd': window width (i.e. width of the window widget).
623 - 'e': window height (i.e. height of the window widget).
624 - 'de': window width x window height.
625 - 'u': screen width (actually independent on the window size).
626 - 'v': screen height (actually independent on the window size).
627 - 'uv': screen width x screen height.
628 - 'n': current normalization type of the instant display.
629 - 't': window title of the instant display.
630 - 'x': X-coordinate of the mouse position (or -1, if outside the
631 display area).
632 - 'y': Y-coordinate of the mouse position (or -1, if outside the
633 display area).
634 - 'b': state of the mouse buttons { 1=left-but. | 2=right-but. |
635 4=middle-but. }.
636 - 'o': state of the mouse wheel.
637 - 'k': decimal code of the pressed key if any, 0 otherwise.
638 - 'c': boolean (0 or 1) telling if the instant display has been
639 closed recently.
640 - 'r': boolean telling if the instant display has been resized
641 recently.
642 - 'm': boolean telling if the instant display has been moved re‐
643 cently.
644 - Any other 'feature' stands for a keycode name (in capital let‐
645 ters),
646 and is substituted by a boolean describing the current key state {
647 0=pressed
648 | 1=released }.
649 - You can also prepend a hyphen '-' to a 'feature' (that
650 supports it) to flush the corresponding event immediately after
651 reading its
652 state (works for keys, mouse and window events).
653
654 * Item substitution is never performed in items between double
655 quotes.
656 One must break the quotes to enable substitution if needed, as in
657 '"3+8 kg =
658 "{3+8}" kg"'. Using double quotes is then a convenient way to dis‐
659 able the
660 substitutions mechanism in items, when necessary.
661 * One can also disable the substitution mechanism on items outside
662 double
663 quotes, by escaping the '{', '}' or '$' characters, as in
664 '3+4 doesn't evaluate'.
665
666
667 9. Mathematical Expressions
668 ------------------------
669
670 * G'MIC has an embedded mathematical parser, used to evaluate
671 (possibly complex) math expressions specified inside braces '{}', or
672 formulas in commands that may take one as an argument (e.g. fill or
673 eval).
674 * When the context allows it, a formula is evaluated for each pixel
675 of
676 the selected images (e.g. fill or eval).
677 * A math expression may return a scalar or a vector-valued result
678 (with a fixed number of components).
679 The mathematical parser understands the following set of functions,
680 operators
681 and variables:
682
683 ## Usual operators:
684
685 '||' (logical or), '&&' (logical and), '|' (bitwise or),
686 '&' (bitwise and), '!=', '==', '<=', '>=',
687 '<', '>', '<<' (left bitwise shift), '>>' (right
688 bitwise shift), '-', '+', '*', '/', '%' (modulo),
689 '^' (power), '!' (logical not), '~' (bitwise not), '++',
690 '--', '+=', '-=', '*=', '/=', '%=',
691 '&=', '|=', '^=', '>>', '<<=' (in-place
692 operators).
693
694 ## Usual math functions:
695
696 'abs()', 'acos()', 'acosh()', 'arg()', 'arg0()',
697 'argkth()', 'argmax()', 'argmaxabs()', 'argmin()',
698 'argminabs()', 'asin()', 'asinh()', 'atan()',
699 'atan2()', 'atanh()', 'avg()', 'bool()', 'cbrt()',
700 'ceil()', 'cos()', 'cosh()', 'cut()', 'exp()',
701 'fact()', 'fibo()', 'floor()', 'gauss()', 'gcd()',
702 'int()', 'isnan()', 'isnum()', 'isinf()',
703 'isint()', 'isbool()', 'isexpr()', 'isfile()',
704 'isdir()', 'isin()', 'kth()', 'log()', 'log2()',
705 'log10()', 'max()', 'maxabs()', 'med()', 'min()',
706 'minabs()', 'narg()', 'prod()', 'rol()' (left bit
707 rotation), 'ror()' (right bit rotation), 'round()', 'sign()',
708 'sin()', 'sinc()', 'sinh()', 'sqrt()', 'std()',
709 'srand(_seed)', 'sum()', 'tan()', 'tanh()',
710 'var()', 'xor()'.
711
712 * 'atan2(y,x)' is the version of 'atan()' with two arguments
713 'y' and 'x' (as in C/C++).
714 * 'permut(k,n,with_order)' computes the number of permutations of
715 'k' objects from a set of 'n' objects.
716 * 'gauss(x,_sigma,_is_normalized)' returns
717 'exp(-x^2/(2*s^2))/(is_normalized?sqrt(2*pi*sigma^2):1)'.
718 * 'cut(value,min,max)' returns 'value' if it is in range '[min,
719 max]', or 'min' or 'max' otherwise.
720 * 'narg(a_1,...,a_N)' returns the number of specified arguments
721 (here,
722 'N').
723 * 'arg(i,a_1,..,a_N)' returns the 'i'-th argument 'a_i'.
724 * 'isnum()', 'isnan()', 'isinf()', 'isint()',
725 'isbool()' test the type of the given number or expression, and re‐
726 turn
727 '0' (false) or '1' (true).
728 * 'isfile('path')' (resp. 'isdir('path')') returns '0'
729 (false) or '1' (true) whether its string argument is a path to an
730 existing file (resp. to a directory) or not.
731 * 'isin(v,a_1,...,a_n)' returns '0' (false) or '1' (true)
732 whether the first value 'v' appears in the set of other values
733 'a_i'.
734 * 'inrange(value,m,M,include_m,include_M)' returns '0' (false) or
735 '1' (true) whether the specified value lies in range '[m,M]' or not
736 ('include_m' and 'includeM' tells how boundaries 'm' and
737 'M' are considered).
738 * 'argkth()', 'argmin()', 'argmax()', 'argminabs()',
739 'argmaxabs()'', 'avg()', 'kth()', 'min()',
740 'max()', 'minabs()', 'maxabs()', 'med()',
741 'prod()', 'std()', 'sum()' and 'var()' can be called
742 with an arbitrary number of scalar/vector arguments.
743 * 'vargkth()', 'vargmin()', 'vargmax()',
744 'vargminabs()', 'vargmaxabs()', 'vavg()', 'vkth()',
745 'vmin()', 'vmax()', 'vminabs()', 'vmaxabs()',
746 'vmed()', 'vprod()', 'vstd()', 'vsum()' and
747 'vvar()' are the versions of the previous function with vector-val‐
748 ued
749 arguments.
750 * 'round(value,rounding_value,direction)' returns a rounded value.
751 'direction' can be { -1=to-lowest | 0=to-nearest | 1=to-highest }.
752 * 'lerp(a,b,t)' returns 'a(1-t) + bt'.
753 * 'swap(a,b)' swaps the values of the given arguments.
754
755 ## Variable names:
756
757 Variable names below are pre-defined. They can be overridden.
758 * 'l': length of the associated list of images.
759 * 'k': index of the associated image, in '[0,l-1]'.
760 * 'w': width of the associated image, if any ('0' otherwise).
761 * 'h': height of the associated image, if any ('0' otherwise).
762 * 'd': depth of the associated image, if any ('0' otherwise).
763 * 's': spectrum of the associated image, if any ('0' otherwise).
764 * 'r': shared state of the associated image, if any ('0'
765 otherwise).
766 * 'wh': shortcut for width x height.
767 * 'whd': shortcut for width x height x depth.
768 * 'whds': shortcut for width x height x depth x spectrum (i.e. num‐
769 ber of
770 image values).
771 * 'im', 'iM', 'ia', 'iv', 'is', 'ip',
772 'ic', 'in': Respectively the minimum, maximum, average, variance,
773 sum, product, median value and L2-norm of the associated image, if
774 any
775 ('0' otherwise).
776 * 'xm', 'ym', 'zm', 'cm': The pixel coordinates of the
777 minimum value in the associated image, if any ('0' otherwise).
778 * 'xM', 'yM', 'zM', 'cM': The pixel coordinates of the
779 maximum value in the associated image, if any ('0' otherwise).
780 * All these variables are considered as constant values by the math
781 parser (for optimization purposes) which is indeed the case most of
782 the time.
783 Anyway, this might not be the case, if function 'resize(#ind,..)' is
784 used
785 in the math expression. If so, it is safer to invoke functions
786 'l()',
787 'w(_#ind)', 'h(_#ind)', ... 's(_#ind)' and 'in(_#ind)'
788 instead of the corresponding named variables.
789 * 'i': current processed pixel value (i.e. value located at '(x,y,z,
790 c)') in the associated image, if any ('0' otherwise).
791 * 'iN': N-th channel value of current processed pixel (i.e. value
792 located at '(x,y,z,N)' in the associated image, if any ('0'
793 otherwise). 'N' must be an integer in range '[0,9]'.
794 * 'R', 'G', 'B' and 'A' are equivalent to 'i0',
795 'i1', 'i2' and 'i3' respectively.
796 * 'I': current vector-valued processed pixel in the associated im‐
797 age, if
798 any ('0' otherwise). The number of vector components is equal to the
799 number of image channels (e.g. 'I' = '[ R,G,B ]' for a 'RGB'
800 image).
801 * You may add '#ind' to any of the variable name above to retrieve
802 the
803 information for any numbered image '[ind]' of the list (when this
804 makes
805 sense). For instance 'ia#0' denotes the average value of the first
806 image
807 of the list).
808 * 'x': current processed column of the associated image, if any
809 ('0' otherwise).
810 * 'y': current processed row of the associated image, if any ('0'
811 otherwise).
812 * 'z': current processed slice of the associated image, if any
813 ('0' otherwise).
814 * 'c': current processed channel of the associated image, if any
815 ('0' otherwise).
816 * 't': thread id when an expression is evaluated with multiple
817 threads
818 ('0' means master thread).
819 * 'e': value of e, i.e. '2.71828...'.
820 * 'pi': value of pi, i.e. '3.1415926...'.
821 * 'u': a random value between '[0,1]', following a uniform
822 distribution.
823 * 'g': a random value, following a gaussian distribution of variance
824 1
825 (roughly in '[-6,6]').
826 * 'interpolation': value of the default interpolation mode used when
827 reading pixel values with the pixel access operators (i.e. when the
828 interpolation argument is not explicitly specified, see below for
829 more details
830 on pixel access operators). Its initial default value is '0'.
831 * 'boundary': value of the default boundary conditions used when
832 reading
833 pixel values with the pixel access operators (i.e. when the boundary
834 condition
835 argument is not explicitly specified, see below for more details on
836 pixel
837 access operators). Its initial default value is '0'.
838
839 ## Vector calculus:
840
841 Most operators are also able to work with vector-valued elements.
842 * '[a0,a1,...,aN-1]' defines a 'N'-dimensional vector with scalar
843 coefficients 'ak'.
844 * 'vectorN(a0,a1,,...,aN-1)' does the same, with the 'ak' being
845 repeated periodically if only a few are specified.
846 * 'vector(#N,a0,a1,,...,aN-1)' does the same, and can be used for
847 any
848 constant expression 'N'.
849 * In previous expressions, the 'ak' can be vectors themselves, to be
850 concatenated into a single vector.
851 * The scalar element 'ak' of a vector 'X' is retrieved by
852 'X[k]'.
853 * The sub-vector '[X[p],X[p+s]...X[p+s*(q-1)]]' (of size 'q') of a
854 vector 'X' is retrieved by 'X[p,q,s]'.
855 * 'expr(formula,_w,_h,_d,_s)' outputs a vector of size 'w*h*d*s'
856 with values generated from the specified formula, as if one were
857 filling an
858 image with dimensions '(w,h,d,s)'.
859 * Equality/inequality comparisons between two vectors is done with
860 operators
861 '==' and '!='.
862 * Some vector-specific functions can be used on vector values:
863 'cross(X,
864 Y)' (cross product), 'dot(X,Y)' (dot product), 'size(X)' (vector
865 dimension), 'sort(X,_is_increasing,_nb_elts,_size_elt)' (sorted val‐
866 ues),
867 'reverse(A)' (reverse order of components), 'shift(A,_length,
868 _boundary_conditions)' and 'same(A,B,_nb_vals,_is_case_sensitive)'
869 (vector equality test).
870 * Function 'normP(u1,...,un)' computes the LP-norm of the specified
871 vector ('P' being an 'unsigned integer' constant or 'inf').
872 If 'P' is omitted, the L2 norm is calculated.
873 * Function 'resize(A,size,_interpolation,_boundary_conditions)' re‐
874 turns
875 a resized version of a vector 'A' with specified interpolation mode.
876 'interpolation' can be { -1=none (memory content) | 0=none | 1=near‐
877 est
878 | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }, and
879 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
880 |
881 3=mirror }.
882 * Function 'find(A,B,_starting_index,_search_step)' returns the in‐
883 dex
884 where sub-vector 'B' appears in vector 'A', (or '-1' if
885 'B' is not contained in 'A'). Argument 'A' can be also
886 replaced by an image index '#ind'.
887 * A '2'-dimensional vector may be seen as a complex number and used
888 in
889 those particular functions/operators: '**' (complex multiplication),
890 '//' (complex division), '^^' (complex exponentiation), '**='
891 (complex self-multiplication), '//=' (complex self-division), '^^='
892 (complex self-exponentiation), 'cabs()' (complex modulus), 'carg()'
893 (complex argument), 'cconj()' (complex conjugate), 'cexp()'
894 (complex exponential), 'clog()' (complex logarithm), 'ccos()'
895 (complex cosine), 'csin()' (complex sine), 'ctan()' (complex
896 tangent), 'ccosh()' (complex hyperpolic cosine), 'csinh()' (complex
897 hyperbolic sine) and 'ctanh()' (complex hyperbolic tangent).
898 * A 'MN'-dimensional vector may be seen as a 'M' x 'N'
899 matrix and used in those particular functions/operators: '*'
900 (matrix-vector multiplication), 'det(A)' (determinant), 'diag(V)'
901 (diagonal matrix from a vector), 'eig(A)' (eigenvalues/eigenvec‐
902 tors),
903 'eye(n)' (n x n identity matrix), 'invert(A,_solver)' (matrix
904 inverse), 'mul(A,B,_nb_colsB)' (matrix-matrix multiplication),
905 'pseudoinvert(A,_nb_colsA,_solver)', 'rot(u,v,w,angle)' (3D
906 rotation matrix), 'rot(angle)' (2D rotation matrix), 'solve(A,B,
907 _nb_colsB)' (solver of linear system A.X = B), 'svd(A,_nb_colsA)'
908 (singular value decomposition), 'trace(A)' (matrix trace) and
909 'transpose(A,nb_colsA)' (matrix transpose). Argument 'nb_colsB' may
910 be omitted if it is equal to '1'.
911 * 'mproj(S,nb_colsS,D,nb_colsD,method,max_iter,max_residual)'
912 projects a
913 matrix 'S' onto a dictionary (matrix) 'D'. Equivalent to command
914 mproj but inside the math evaluator.
915 * Specifying a vector-valued math expression as an argument of a
916 command that
917 operates on image values (e.g. 'fill') modifies the whole spectrum
918 range
919 of the processed image(s), for each spatial coordinates '(x,y,z)'.
920 The
921 command does not loop over the 'c'-axis in this case.
922
923 ## String manipulation:
924
925 Character strings are defined and managed as vectors objects. Dedi‐
926 cated
927 functions and initializers to manage strings are:
928 * '['string']' and ''string'' define a vector whose values are the
929 character codes of the specified 'character string' (e.g. ''foo''
930 is equal to '[ 102,111,111 ]').
931 * '_'character'' returns the (scalar) byte code of the specified
932 character (e.g. '_'A'' is equal to '65').
933 * A special case happens for empty strings: Values of both expres‐
934 sions
935 '['']' and '''' are '0'.
936 * Functions 'lowercase()' and 'uppercase()' return string with all
937 string characters lowercased or uppercased.
938 * Function 'stov(str,_starting_index,_is_strict)' parses specified
939 string 'str' and returns the value contained in it.
940 * Function 'vtos(expr,_nb_digits,_siz)' returns a vector of size
941 'siz' which contains the character representation of values de‐
942 scribed by
943 expression 'expr'. 'nb_digits' can be { -1=auto-reduced | 0=all
944 | >0=max number of digits }.
945 * Function 'echo(str1,str2,...,strN)' prints the concatenation of
946 given
947 string arguments on the console.
948 * Function 'string(_#siz,str1,str2,...,strN)' generates a vector
949 corresponding to the concatenation of given string/number arguments.
950
951 ## Special operators:
952
953 * ';': expression separator. The returned value is always the last
954 encountered expression. For instance expression '1;2;pi' is evalu‐
955 ated as
956 'pi'.
957 * '=': variable assignment. Variables in mathematical parser can
958 only
959 refer to numerical values (vectors or scalars). Variable names are
960 case-sensitive. Use this operator in conjunction with ';' to define
961 more
962 complex evaluable expressions, such as
963
964 t = cos(x); 3*t^2 + 2*t + 1
965
966 These variables remain local to the mathematical parser and cannot be
967 accessed outside the evaluated expression.
968 * Variables defined in math parser may have a constant property, by
969 specifying keyword 'const' before the variable name (e.g. 'const foo
970 =
971 pi/4;'). The value set to such a variable must be indeed a constant
972 scalar. Constant variables allows certain types of optimizations in
973 the math
974 JIT compiler.
975
976 ## Specific functions:
977
978 * 'addr(expr)': return the pointer address to the specified expres‐
979 sion
980 'expr'. * 'u(max)' or 'u(min,max)': return a random value
981 between '[0,max]' or '[min,max]', following a uniform distribution.
982 * 'f2ui(value)' and 'ui2f(value)': Convert a large unsigned
983 integer as a negative floating point value (and vice-versa), so that
984 32bits
985 floats can be used to store large integers while keeping a unitary
986 precision.
987 * 'i(_a,_b,_c,_d,_interpolation_type,_boundary_conditions)': return
988 the
989 value of the pixel located at position '(a,b,c,d)' in the associated
990 image, if any ('0' otherwise). 'interpolation_type' can be {
991 0=nearest neighbor | 1=linear | 2=cubic }. 'boundary_conditions' can
992 be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. Omitted
993 coordinates are replaced by their default values which are respec‐
994 tively
995 'x', 'y', 'z', 'c', 'interpolation' and
996 'boundary'. For instance command
997
998 fill 0.5*(i(x+1)-i(x-1))
999
1000 will estimate the X-derivative of an image with a classical finite
1001 difference
1002 scheme.
1003 * 'j(_dx,_dy,_dz,_dc,_interpolation_type,_boundary_conditions)' does
1004 the
1005 same for the pixel located at position '(x+dx,y+dy,z+dz,c+dc)'
1006 (pixel
1007 access relative to the current coordinates).
1008 * 'i[offset,_boundary_conditions]' returns the value of the pixel
1009 located at specified 'offset' in the associated image buffer (or
1010 '0' if offset is out-of-bounds).
1011 * 'j[offset,_boundary_conditions]' does the same for an offset rela‐
1012 tive
1013 to the current pixel coordinates '(x,y,z,c)'.
1014 * 'i(#ind,_x,_y,_z,_c,_interpolation,_boundary_conditions)',
1015 'j(#ind,
1016 _dx,_dy,_dz,_dc,_interpolation,_boundary_conditions)', 'i[#ind,off‐
1017 set,
1018 _boundary_conditions]' and 'i[offset,_boundary_conditions]' are
1019 similar expressions used to access pixel values for any numbered im‐
1020 age
1021 '[ind]' of the list.
1022 * 'I/J[offset,_boundary_conditions]' and 'I/J(#ind,_x,_y,_z,
1023 _interpolation,_boundary_conditions)' do the same as 'i/j[offset,
1024 _boundary_conditions]' and 'i/j(#ind,_x,_y,_z,_c,_interpolation,
1025 _boundary_conditions)' but return a vector instead of a scalar (e.g.
1026 a
1027 vector '[ R,G,B ]' for a pixel at '(a,b,c)' in a color image).
1028 * 'crop(_#ind,_x,_y,_z,_c,_dx,_dy,_dz,_dc,_boundary_conditions)' re‐
1029 turns
1030 a vector whose values come from the cropped region of image '[ind]'
1031 (or
1032 from default image selected if 'ind' is not specified). Cropped re‐
1033 gion
1034 starts from point '(x,y,z,c)' and has a size of 'dx x dy x dz x
1035 dc'. Arguments for coordinates and sizes can be omitted if they are
1036 not
1037 ambiguous (e.g. 'crop(#ind,x,y,dx,dy)' is a valid invocation of this
1038 function).
1039 * 'draw(_#ind,S,x,y,z,c,dx,_dy,_dz,_dc,_opacity,_M,_max_M)' draws a
1040 sprite 'S' in image '[ind]' (or in default image selected if
1041 'ind' is not specified) at coordinates '(x,y,z,c)'. The size of the
1042 sprite 'dx x dy x dz x dc' must be specified. You can also specify a
1043 corresponding opacity mask 'M' if its size matches 'S'.
1044 * 'polygon(_#ind,nb_vertices,coords,_opacity,_color)' draws a filled
1045 polygon in image '[ind]' (or in default image selected if 'ind' is
1046 not specified) at specified coordinates. It draws a single line if
1047 'nb_vertices' is set to 2.
1048 * 'polygon(_#ind,-nb_vertices,coords,_opacity,_pattern,_color)'
1049 draws a
1050 outlined polygon in image '[ind]' (or in default image selected if
1051 'ind' is not specified) at specified coordinates and with specified
1052 line
1053 pattern. It draws a single line if 'nb_vertices' is set to 2.
1054 * 'ellipse(_#ind,xc,yc,radius1,_radius2,_angle,_opacity,_color)'
1055 draws a
1056 filled ellipse in image '[ind]' (or in default image selected if
1057 'ind' is not specified) with specified coordinates.
1058 * 'ellipse(_#ind,xc,yc,-radius1,-_radius2,_angle,_opacity,_pattern,
1059 _color)' draws an outlined ellipse in image '[ind]' (or in default
1060 image selected if 'ind' is not specified).
1061 * 'resize(#ind,w,_h,_d,_s,_interp,_boundary_condi‐
1062 tions,_cx,_cy,_cz,_cc)'
1063 resizes an image of the associated list with specified dimension and
1064 interpolation method. When using this function, you should consider
1065 retrieving
1066 the (non-constant) image dimensions using the dynamic functions
1067 'w(_#ind)', 'h(_#ind)', 'd(_#ind)', 's(_#ind)',
1068 'wh(_#ind)', 'whd(_#ind)' and 'whds(_#ind)' instead of the
1069 corresponding constant variables.
1070 * 'if(condition,expr_then,_expr_else)': return value of
1071 'expr_then' or 'expr_else', depending on the value of
1072 'condition' { 0=false | other=true }. 'expr_else' can be
1073 omitted in which case '0' is returned if the condition does not
1074 hold.
1075 Using the ternary operator 'condition?expr_then[:expr_else]' gives
1076 an
1077 equivalent expression. For instance, G'MIC commands
1078
1079 fill if(x%10==0,255,i)
1080
1081 and
1082
1083 fill x%10?i:255
1084
1085 both draw blank vertical lines on every 10th column of an image.
1086 * 'do(expression,_condition)' repeats the evaluation of
1087 'expression' until 'condition' vanishes (or until
1088 'expression' vanishes if no 'condition' is specified). For instance,
1089 the expression:
1090
1091 if(N<2,N,n=N-1;F0=0;F1=1;do(F2=F0+F1;F0=F1;F1=F2,n=n-1))
1092
1093 returns the N-th value of the Fibonacci sequence, for 'N>=0' (e.g.,
1094 '46368' for 'N=24'). 'do(expression,condition)' always
1095 evaluates the specified expression at least once, then check for the
1096 loop
1097 condition. When done, it returns the last value of 'expression'.
1098 * 'for(init,condition,_procedure,body)' first evaluates the expres‐
1099 sion
1100 'init', then iteratively evaluates 'body' (followed by
1101 'procedure' if specified) while 'condition' holds (i.e. not zero).
1102 It may happen that no iterations are done, in which case the func‐
1103 tion returns
1104 'nan'. Otherwise, it returns the last value of 'body'. For instance,
1105 the expression:
1106
1107 if(N<2,N,for(n=N;F0=0;F1=1,n=n-1,F2=F0+F1;F0=F1;F1=F2))
1108
1109 returns the 'N'-th value of the Fibonacci sequence, for 'N>=0'
1110 (e.g., '46368' for 'N=24').
1111 * 'while(condition,expression)' is exactly the same as 'for(init,
1112 condition,expression)' without the specification of an initializing
1113 expression.
1114 * 'break()' and 'continue()' respectively breaks and continues the
1115 current running bloc (loop, init or main environment).
1116 * 'fsize('filename')' returns the size of the specified 'filename'
1117 (or '-1' if file does not exist).
1118 * 'date(attr,'path')' returns the date attribute for the given
1119 'path' (file or directory), with 'attr' being { 0=year | 1=month
1120 | 2=day | 3=day of week | 4=hour | 5=minute | 6=second }, or a vec‐
1121 tor of
1122 those values.
1123 * 'date(_attr)' returns the specified attribute for the current (lo‐
1124 cale)
1125 date (attributes being { 0...6=same meaning as above | 7=millisec‐
1126 onds }).
1127 * 'print(expr1,expr2,...)' or 'print(#ind)' prints the value of
1128 the specified expressions (or image information) on the console, and
1129 returns
1130 the value of the last expression (or 'nan' in case of an image).
1131 Function
1132 'prints(expr)' also prints the string composed of the character
1133 codes
1134 defined by the vector-valued expression (e.g. 'prints('Hello')').
1135 * 'debug(expression)' prints detailed debug info about the sequence
1136 of
1137 operations done by the math parser to evaluate the expression (and
1138 returns its
1139 value).
1140 * 'display(_X,_w,_h,_d,_s)' or 'display(#ind)' display the
1141 contents of the vector 'X' (or specified image) and wait for user
1142 events.
1143 if no arguments are provided, a memory snapshot of the math parser
1144 environment
1145 is displayed instead.
1146 * 'begin(expression)' and 'end(expression)' evaluates the
1147 specified expressions only once, respectively at the beginning and
1148 end of the
1149 evaluation procedure, and this, even when multiple evaluations are
1150 required
1151 (e.g. in 'fill ">begin(foo = 0); ++foo"').
1152 * 'copy(dest,src,_nb_elts,_inc_d,_inc_s,_opacity)' copies an entire
1153 memory block of 'nb_elts' elements starting from a source value
1154 'src' to a specified destination 'dest', with increments defined by
1155 'inc_d' and 'inc_s' respectively for the destination and source
1156 pointers.
1157 * 'stats(_#ind)' returns the statistics vector of the running image
1158 '[ind]', i.e the vector '[ im,iM,ia,iv,xm,ym,zm,cm,xM,yM,zM,cM,is,ip
1159 ]' (14 values).
1160 * 'ref(expr,a)' references specified expression 'expr' as variable
1161 name 'a'.
1162 * 'unref(a,b,...)' destroys references to the named variable given
1163 as
1164 arguments.
1165 * 'breakpoint()' inserts a possible computation breakpoint (useless
1166 with
1167 the cli interface).
1168 * '_(expr)' just ignores its arguments (useful for inserting inline
1169 comments in math expressions).
1170 * 'run('pipeline')' executes the specified G'MIC pipeline as if it
1171 was
1172 called outside the currently evaluated expression.
1173 * 'store(A,'varname',_w,_h,_d,_s,_is_compressed)' transfers the data
1174 of
1175 vector 'A' as a 'w x h x d x s' image to the G'MIC variable
1176 '$varname'. Thus, the data becomes available outside the math ex‐
1177 pression
1178 (that is equivalent to using the regular command store, but directly
1179 in
1180 the math expression).
1181 * 'get('variable_name',_size,_return_as_string)' returns the value
1182 of
1183 the specified variable, as a vector of 'size' values, or as a scalar
1184 (if
1185 'size' is zero or not specified).
1186 * 'name(_#ind,size)' returns a vector of size 'size', whose values
1187 are the characters codes of the name of image '[ind]' (or default
1188 image
1189 selected if 'ind' is not specified).
1190 * 'correlate(I,wI,hI,dI,sI,K,wK,hK,dK,sK,_boundary_conditions,
1191 _is_normalized,_channel_mode,_xcenter,_ycenter,_zcenter,_xstart,_ys‐
1192 tart,_zstart,
1193 _xend,_yend,_zend,_xstride,_ystride,_zstride,_xdilation,_ydilation,
1194 _zdilation)' returns the correlation, unrolled as a vector, of the
1195 'wI x
1196 hI x dI x sI'-sized image 'I' with the 'wK x hK x dK x sK'-sized
1197 kernel 'K' (the meaning of the other arguments are the same as in
1198 command
1199 'correlate'). Similar function 'convolve(...)' is also defined for
1200 computing the convolution between 'I' and 'K'.
1201
1202 ## User-defined macros:
1203
1204 * Custom macro functions can be defined in a math expression, using
1205 the
1206 assignment operator '=', e.g.
1207
1208 foo(x,y) = cos(x + y); result = foo(1,2) + foo(2,3)
1209
1210 * Trying to override a built-in function (e.g. 'abs()') has no ef‐
1211 fect.
1212 * Overloading macros with different number of arguments is possible.
1213 Re-defining a previously defined macro with the same number of argu‐
1214 ments
1215 discards its previous definition.
1216 * Macro functions are indeed processed as macros by the mathematical
1217 evaluator. You should avoid invoking them with arguments that are
1218 themselves
1219 results of assignments or self-operations. For instance,
1220
1221 foo(x) = x + x; z = 0; foo(++z)
1222
1223 returns '4' rather than expected value '2'.
1224 * When substituted, macro arguments are placed inside parentheses,
1225 except if a
1226 number sign '#' is located just before or after the argument name.
1227 For
1228 instance, expression
1229
1230 foo(x,y) = x*y; foo(1+2,3)
1231
1232 returns '9' (being substituted as '(1+2)*(3)'), while expression
1233
1234 foo(x,y) = x#*y#; foo(1+2,3)
1235
1236 returns '7' (being substituted as '1+2*3').
1237 * Number signs appearing between macro arguments function actually
1238 count for
1239 empty separators. They may be used to force the substitution of
1240 macro
1241 arguments in unusual places, e.g. as in
1242
1243 str(N) = ['I like N#'];
1244
1245 ## Multi-threaded and in-place evaluation:
1246
1247 * If your image data are large enough and you have several CPUs
1248 available, it
1249 is likely that the math expression passed to a 'fill', 'eval' or
1250 'input' commands is evaluated in parallel, using multiple computa‐
1251 tion
1252 threads.
1253 * Starting an expression with ':' or '*' forces the evaluations
1254 required for an image to be run in parallel, even if the amount of
1255 data to
1256 process is small (beware, it may be slower to evaluate in this
1257 case!). Specify
1258 ':' (rather than '*') to avoid possible image copy done before
1259 evaluating the expression (this saves memory, but do this only if
1260 you are sure
1261 this step is not required!)
1262 * If the specified expression starts with '>' or '<', the pixel
1263 access operators 'i()', 'i[]', 'j()' and 'j[]' return
1264 values of the image being currently modified, in forward ('>') or
1265 backward ('<') order. The multi-threading evaluation of the expres‐
1266 sion is
1267 disabled in this case.
1268 * Function 'critical(expr)' forces the execution of the given ex‐
1269 pression
1270 in a single thread at a time.
1271 * 'begin_t(expr)' and 'end_t(expr)' evaluates the specified
1272 expression once for each running thread (so possibly several times)
1273 at the
1274 beginning and the end of the evaluation procedure.
1275 * 'merge(variable,operator)' tells to merge the local variable value
1276 computed by threads, with the specified operator, when all threads
1277 have
1278 finished computing.
1279 * Expressions 'i(_#ind,x,_y,_z,_c)=value', 'j(_#ind,x,_y,_z,
1280 _c)=value', 'i[_#ind,offset]=value' and 'j[_#ind,offset]=value'
1281 set a pixel value at a different location than the running one in
1282 the image
1283 '[ind]' (or in the associated image if argument '#ind' is omitted),
1284 either with global coordinates/offsets (with 'i(...)' and 'i[...]'),
1285 or relatively to the current position '(x,y,z,c)' (with 'j(...)'
1286 and 'j[...]'). These expressions always return 'value'.
1287 * The last image of the list is always associated to the evaluations
1288 of
1289 'expressions', e.g. G'MIC sequence
1290
1291 256,128 fill {w}
1292
1293 will create a 256x128 image filled with value 256.
1294
1295 10. Image and Data Viewers
1296 ----------------------
1297
1298 * G'MIC has some very handy embedded visualization modules, for 1D
1299 signals (command plot), 1D/2D/3D images (command display) and 3D
1300 vector objects (command display3d). It manages interactive views of
1301 the
1302 selected image data.
1303 * The following actions are available in the interactive viewers:
1304 - '(mousewheel)': Zoom in/out.
1305 - 'ESC': Close window.
1306 - 'CTRL+D': Increase window size.
1307 - 'CTRL+C': Decrease window size.
1308 - 'CTRL+R': Reset window size.
1309 - 'CTRL+F': Toggle fullscreen mode.
1310 - 'CTRL+S': Save current view as a numbered file
1311 'gmic_xxxx.ext'.
1312 - 'CTRL+O': Save copy of the viewed data, as a numbered file
1313 'gmic_xxxx.ext'.
1314
1315 * Actions specific to the 1D/2D image viewer (command display) are:
1316 - 'Left mouse button': Create an image selection and zoom into
1317 it.
1318 - 'Middle mouse button', or 'CTRL+left mouse button': Move
1319 image.
1320 - 'Mouse wheel' or 'PADD+/-': Zoom in/out.
1321 - 'Arrow keys': Move image left/right/up/down.
1322 - 'CTRL+A': Enable/disable transparency (show alpha channel).
1323 - 'CTRL+N': Change normalization mode (can be { none | normal |
1324 channel-by-channel }).
1325 - 'CTRL+SPACE': Reset view.
1326 - 'CTRL+X': Show/hide axes.
1327 - 'CTRL+Z': Hold/release aspect ratio.
1328
1329 * Actions specific to the 3D volumetric image viewer (command
1330 display) are:
1331 - 'CTRL+P': Play z-stack of frames as a movie.
1332 - 'CTRL+V': Show/hide 3D view on bottom right zone.
1333 - 'CTRL+X': Show/hide axes.
1334 - 'CTRL+(mousewheel)': Go up/down.
1335 - 'SHIFT+(mousewheel)': Go left/right.
1336 - 'Numeric PAD': Zoom in/out ('+'/'-') and move through
1337 zoomed image (digits).
1338 - 'BACKSPACE': Reset zoom scale.
1339
1340 * Actions specific to the 3D object viewer (command display3d) are:
1341 - '(mouse)+(left mouse button)': Rotate 3D object.
1342 - '(mouse)+(right mouse button)': Zoom 3D object.
1343 - '(mouse)+(middle mouse button)': Shift 3D object.
1344 - 'F1 ... F6': Toggle between different 3D rendering modes.
1345 - 'F7/F8': Decrease/increase focale.
1346 - 'F9': Select animation mode.
1347 - 'F10': Select animation speed.
1348 - 'SPACE': Start/stop animation.
1349 - 'CTRL+A': Show/hide 3D axes.
1350 - 'CTRL+B': Switch between available background.
1351 - 'CTRL+G': Save 3D object, as numbered file 'gmic_xxxx.obj'.
1352 - 'CTRL+L': Show/hide outline.
1353 - 'CTRL+P': Print current 3D pose on stderr.
1354 - 'CTRL+T': Switch between single/double-sided 3D modes.
1355 - 'CTRL+V': Start animation with video output.
1356 - 'CTRL+X': Show/hide 3D bounding box.
1357 - 'CTRL+Z': Enable/disable z-buffered rendering.
1358
1359
1360 11. Adding Custom Commands
1361 ----------------------
1362
1363 * New custom commands can be added by the user, through the use of
1364 G'MIC
1365 custom commands files.
1366 * A command file is a simple text file, where each line starts ei‐
1367 ther by
1368
1369 command_name: command_definition
1370
1371 or
1372
1373 command_definition (continuation)
1374
1375 * At startup, G'MIC automatically includes user's command file
1376 '$HOME/.gmic' (on Unix) or '%APPDATA%/user.gmic' (on
1377 Windows). The CLI tool 'gmic' automatically runs the command
1378 'cli_start' if defined.
1379 * Custom command names must use character set '[a-zA-Z0-9_]' and
1380 cannot
1381 start with a number.
1382 * Any '# comment' expression found in a custom commands file is
1383 discarded by the G'MIC parser, wherever it is located in a line.
1384 * In a custom command, the following '$-expressions' are recognized
1385 and
1386 substituted:
1387 - '$*' is substituted by a copy of the specified string of argu‐
1388 ments.
1389 - '$"*"' is substituted by a copy of the specified string of
1390 arguments, each being double-quoted.
1391 - '$#' is substituted by the maximum index of known arguments
1392 (either
1393 specified by the user or set to a default value in the custom com‐
1394 mand).
1395 - '$[]' is substituted by the list of selected image indices that
1396 have been specified in the command invocation.
1397 - '$?' is substituted by a printable version of '$[]' to be
1398 used in command descriptions.
1399 - '$i' and '${i}' are both substituted by the 'i'-th
1400 specified argument. Negative indices such as '${-j}' are allowed and
1401 refer to the 'j'-th latest argument. '$0' is substituted by the
1402 custom command name.
1403 - '${i=default}' is substituted by the value of '$i' (if
1404 defined) or by its new value set to 'default' otherwise ('default'
1405 may be a '$-expression' as well).
1406 - '${subset}' is substituted by the argument values (separated by
1407 commas ',') of a specified argument subset. For instance expression
1408 '${2--2}' is substituted by all specified command arguments except
1409 the
1410 first and the last one. Expression '${^0}' is then substituted by
1411 all
1412 arguments of the invoked command (eq. to '$*' if all arguments have
1413 been
1414 indeed specified).
1415 - '$=var' is substituted by the set of instructions that will as‐
1416 sign
1417 each argument '$i' to the named variable 'var$i' (for i in
1418 '[0...$#]'. This is particularly useful when a custom command want
1419 to
1420 manage variable numbers of arguments. Variables names must use char‐
1421 acter set
1422 '[a-zA-Z0-9_]' and cannot start with a number.
1423
1424 * These particular '$-expressions' for custom commands are always
1425 substituted, even in double-quoted items or when the dollar sign '$'
1426 is escaped with a backslash '$'. To avoid substitution, place an
1427 empty
1428 double quoted string just after the '$' (as in '$""1').
1429 * Specifying arguments may be skipped when invoking a custom com‐
1430 mand, by
1431 replacing them by commas ',' as in expression
1432
1433 flower ,,3
1434
1435 Omitted arguments are set to their default values, which must be
1436 thus
1437 explicitly defined in the code of the corresponding custom command
1438 (using
1439 default argument expressions as '${1=default}').
1440 * If one numbered argument required by a custom command misses a
1441 value, an
1442 error is thrown by the G'MIC interpreter.
1443
1444
1445 12. List of Commands
1446 ----------------
1447
1448 All available G'MIC commands are listed below, by categories. An ar‐
1449 gument
1450 specified between '[]' or starting by '_' is optional except when
1451 standing for an existing image '[image]', where 'image' can be
1452 either an index number or an image name. In this case, the '[]'
1453 characters are mandatory when writing the item. Note that all images
1454 that serve
1455 as illustrations in this reference documentation are normalized in
1456 range '[0,
1457 255]' before being displayed. You may need to do this explicitly
1458 (command
1459 'normalize 0,255') if you want to save and view images with the same
1460 aspect
1461 than those illustrated in the example codes.
1462
1463 12.1. Global Options
1464 --------------
1465
1466 debug (+):
1467
1468 Activate debug mode.
1469 When activated, the G'MIC interpreter becomes very verbose and out‐
1470 puts additional log
1471 messages about its internal state on the standard output (stdout).
1472 This option is useful for developers or to report possible bugs of
1473 the interpreter.
1474
1475 h:
1476 Shortcut for command 'help'.
1477
1478 help:
1479 command |
1480 (no arg)
1481
1482 Display help (optionally for specified command only) and exit.
1483 (equivalent to shortcut command 'h').
1484
1485 version:
1486
1487 Display current version number on stdout.
1488
1489 12.2. Input / Output
1490 --------------
1491
1492 camera (+):
1493 _camera_index>=0,_nb_frames>0,_skip_frames>=0,_cap‐
1494 ture_width>=0,_capture_height>=0
1495
1496 Insert one or several frames from specified camera.
1497 When 'nb_frames==0', the camera stream is released instead of cap‐
1498 turing new images.
1499 This command requires features from the OpenCV library (not enabled
1500 in G'MIC by default).
1501
1502 Default values: 'camera_index=0' (default camera), 'nb_frames=1',
1503 'skip_frames=0' and 'capture_width=capture_height=0' (default size).
1504
1505 clut:
1506 "clut_name",_resolution>0,_cut_and_round={ 0=no | 1=yes }
1507
1508 Insert one of the 889 pre-defined CLUTs at the end of the image
1509 list.
1510 'clut_name' can be { 2-strip-process | 60s | 60s_faded |
1511 60s_faded_alt | 7drk_21 | action_magenta_01 | action_red_01 | adven‐
1512 ture_1453 | agfa_apx_100 | agfa_apx_25 | agfa_precisa_100 |
1513 agfa_ultra_color_100 | agfa_vista_200 | agressive_highligjtes_re‐
1514 covery_5 | alberto_street | alien_green | amstragram | amstragram+ |
1515 analogfx_anno_1870_color | analogfx_old_style_i | analogfx_old_style_ii
1516 | analogfx_old_style_iii | analogfx_sepia_color |
1517 analogfx_soft_sepia_i | analogfx_soft_sepia_ii | anime | apoca‐
1518 lypse_this_very_moment | aqua | aqua_and_orange_dark | arabica_12 | au‐
1519 tumn | ava_614 |
1520 avalanche | azrael_93 | bboyz_2 | bc_darkum | berlin_sky |
1521 black_and_white | black_star | blade_runner | bleach_bypass | bleachby‐
1522 pass_1 | bleachbypass_2 | bleachbypass_3 | bleachbypass_4 |
1523 bleech_bypass_green | bleech_bypass_yellow_01 | blue_cold_fade |
1524 blue_dark | blue_house | blue_ice | blue_mono | blue_shadows_01 | blues
1525 | bob_ford | bourbon_64 | bright_green_01 | bright_teal_orange |
1526 bright_warm | brightgreen | brown_mobster | brownbm | brownish |
1527 bw_1 | bw_10 | bw_2 | bw_3 | bw_4 | bw_5 | bw_6 | bw_7 | bw_8 | bw_9 |
1528 byers_11 | candlelight | caribe | chemical_168 | chrome_01 | cineblue
1529 | cinebm_4k | cinema | cinema_2 | cinema_3 | cinema_4 | cinema_5 |
1530 cinema_noir | cinematic-1 | cinematic-10 | cinematic-2 | cinematic-3 |
1531 cinematic-4 | cinematic-5 | cinematic-6 | cinematic-7 | cinematic-8
1532 | cinematic-9 | cinematic_01 | cinematic_02 | cinematic_03 | cine‐
1533 matic_for_flog | cinematic_lady_bird | cinematic_mexico | city_7 |
1534 classic_teal_and_orange | clayton_33 | clear_teal_fade | clouseau_54 |
1535 cobi_3 | coffee_44 | cold_clear_blue | cold_clear_blue_1 | cold_ice
1536 | cold_simplicity_2 | color_rich | colorful_0209 | colornegative | con‐
1537 flict_01 | contrail_35 | contrast_with_highlights_protection |
1538 contrasty_afternoon | contrasty_green | crispromance | crispwarm |
1539 crispwinter | cross_process_cp_130 | cross_process_cp_14 |
1540 cross_process_cp_15 | cross_process_cp_16 | cross_process_cp_18 |
1541 cross_process_cp_3 | cross_process_cp_4 | cross_process_cp_6 |
1542 crushin | cubicle_99 | d_o_1 | dark_blues_in_sunlight | dark_green_02 |
1543 dark_green_1 | dark_man_x | dark_place_01 | date_39 | day_4nite |
1544 day_for_night | deep | deep_blue | deep_dark_warm | deep_high_con‐
1545 trast | deep_teal_fade | deep_warm_fade | deepskintones_2 | deepskin‐
1546 tones_3 | delicatessen | denoiser_simple_40 | desert_gold_37 | dimen‐
1547 sion
1548 | directions_23 | django_25 | domingo_145 | dream_1 | dream_85 |
1549 drop_green_tint_14 | dropblues | earth_tone_boost | edgyember | ele‐
1550 gance_38 | enchanted | eterna_for_flog | expired_69 | expired_fade |
1551 expired_polaroid | extreme | fade | fade_to_green | faded |
1552 faded_47 | faded_alt | faded_analog | faded_extreme | faded_green |
1553 faded_print | faded_retro_01 | faded_retro_02 | faded_vivid | fadedlook
1554 |
1555 fallcolors | faux_infrared | faux_infrared_bw_1 | faux_in‐
1556 frared_color_p_2 | faux_infrared_color_p_3 | faux_infrared_color_r_0a |
1557 faux_infrared_color_r_0b | faux_infrared_color_yp_1 | fgcinebasic |
1558 fgcinebright | fgcinecold | fgcinedrama | fgcinetealorange_1 |
1559 fgcinetealorange_2 | fgcinevibrant | fgcinewarm | film_0987 | film_9879
1560 | film_gb-19 | film_high_contrast | film_print_01 | film_print_02 |
1561 filmic | flat_30 | flavin | foggynight | folger_50 | formula_b |
1562 french_comedy | frosted | frostedbeachpicnic | fuji_160c | fuji_160c_+
1563 | fuji_160c_++ | fuji_160c_- | fuji_3510_constlclip |
1564 fuji_3510_constlmap | fuji_3510_cuspclip | fuji_3513_constlclip |
1565 fuji_3513_constlmap | fuji_3513_cuspclip | fuji_400h | fuji_400h_+ |
1566 fuji_400h_++ | fuji_400h_- | fuji_800z | fuji_800z_+ | fuji_800z_++ |
1567 fuji_800z_- | fuji_astia_100_generic | fuji_astia_100f |
1568 fuji_fp-100c | fuji_fp-100c_+ | fuji_fp-100c_++ | fuji_fp-100c_+++ |
1569 fuji_fp-100c_++_alt | fuji_fp-100c_- | fuji_fp-100c_-- |
1570 fuji_fp-100c_alt |
1571 fuji_fp-100c_cool | fuji_fp-100c_cool_+ | fuji_fp-100c_cool_++ |
1572 fuji_fp-100c_cool_- | fuji_fp-100c_cool_-- | fuji_fp-100c_negative |
1573 fuji_fp-100c_negative_+ | fuji_fp-100c_negative_++ |
1574 fuji_fp-100c_negative_+++ | fuji_fp-100c_negative_++_alt |
1575 fuji_fp-100c_negative_- | fuji_fp-100c_negative_-- | fuji_fp-3000b |
1576 fuji_fp-3000b_+ | fuji_fp-3000b_++ | fuji_fp-3000b_+++ |
1577 fuji_fp-3000b_- |
1578 fuji_fp-3000b_-- | fuji_fp-3000b_hc | fuji_fp-3000b_negative |
1579 fuji_fp-3000b_negative_+ | fuji_fp-3000b_negative_++ |
1580 fuji_fp-3000b_negative_+++ | fuji_fp-3000b_negative_- |
1581 fuji_fp-3000b_negative_-- |
1582 fuji_fp-3000b_negative_early | fuji_fp_100c | fuji_hdr |
1583 fuji_neopan_1600 | fuji_neopan_1600_+ | fuji_neopan_1600_++ |
1584 fuji_neopan_1600_- | fuji_neopan_acros_100 | fuji_provia_100_generic |
1585 fuji_provia_100f | fuji_provia_400f | fuji_provia_400x | fuji_sen‐
1586 sia_100 | fuji_superia_100 | fuji_superia_100_+ | fuji_superia_100_++ |
1587 fuji_superia_100_- | fuji_superia_1600 | fuji_superia_1600_+ |
1588 fuji_superia_1600_++ | fuji_superia_1600_- | fuji_superia_200 |
1589 fuji_superia_200_xpro | fuji_superia_400 | fuji_superia_400_+ |
1590 fuji_superia_400_++ | fuji_superia_400_- | fuji_superia_800 |
1591 fuji_superia_800_+ | fuji_superia_800_++ | fuji_superia_800_- |
1592 fuji_superia_hg_1600 | fuji_superia_reala_100 | fuji_superia_x-tra_800
1593 | fuji_velvia_100_generic | fuji_velvia_50 | fuji_xtrans_iii_acros |
1594 fuji_xtrans_iii_acros+g | fuji_xtrans_iii_acros+r |
1595 fuji_xtrans_iii_acros+ye | fuji_xtrans_iii_astia |
1596 fuji_xtrans_iii_classic_chrome | fuji_xtrans_iii_mono |
1597 fuji_xtrans_iii_mono+g |
1598 fuji_xtrans_iii_mono+r | fuji_xtrans_iii_mono+ye |
1599 fuji_xtrans_iii_pro_neg_hi | fuji_xtrans_iii_pro_neg_std |
1600 fuji_xtrans_iii_provia | fuji_xtrans_iii_sepia | fuji_xtrans_iii_velvia
1601 | fusion_88 |
1602 futuristicbleak_1 | futuristicbleak_2 | futuristicbleak_3 | futur‐
1603 isticbleak_4 | going_for_a_walk | golden | golden_bright | golden_fade
1604 | golden_mono | golden_night_softner_43 | golden_sony_37 |
1605 golden_vibrant | goldengate | goldentime |
1606 goldfx_bright_spring_breeze | goldfx_bright_summer_heat |
1607 goldfx_hot_summer_heat | goldfx_perfect_sunset_01min | goldfx_per‐
1608 fect_sunset_05min |
1609 goldfx_perfect_sunset_10min | goldfx_spring_breeze | goldfx_sum‐
1610 mer_heat | good_morning | green_15 | green_2025 | green_action |
1611 green_afternoon | green_and_orange | green_blues | green_conflict |
1612 green_day_01 | green_day_02 | green_g_09 | green_indoor |
1613 green_light | green_mono | green_yellow | greenish_contrasty | green‐
1614 ish_fade | greenish_fade_1 | gremerta | hackmanite | happyness_133 |
1615 hard_teal_orange | harsh_day | harsh_sunset | helios | herderite |
1616 heulandite | hiddenite | highlights_protection | hilutite | hitman |
1617 hlg_1_1 | hong_kong | horrorblue | howlite | hydracore | hyla_68 |
1618 hypersthene | hypnosis | hypressen | ilford_delta_100 | il‐
1619 ford_delta_3200 | ilford_delta_3200_+ | ilford_delta_3200_++ | il‐
1620 ford_delta_3200_- | ilford_delta_400 | ilford_fp_4_plus_125 | il‐
1621 ford_hp_5 |
1622 ilford_hp_5_+ | ilford_hp_5_++ | ilford_hp_5_- | il‐
1623 ford_hp_5_plus_400 | ilford_hps_800 | ilford_pan_f_plus_50 | il‐
1624 ford_xp_2 | indoor_blue | industrial_33 | instantc | justpeachy |
1625 jwick_21 |
1626 k_tone_vintage_kodachrome | kh_1 | kh_10 | kh_2 | kh_3 | kh_4 |
1627 kh_5 | kh_6 | kh_7 | kh_8 | kh_9 | killstreak | kodak_2383_constlclip |
1628 kodak_2383_constlmap | kodak_2383_cuspclip | kodak_2393_constlclip |
1629 kodak_2393_constlmap | kodak_2393_cuspclip | kodak_bw_400_cn | ko‐
1630 dak_e-100_gx_ektachrome_100 | kodak_ektachrome_100_vs | kodak_ek‐
1631 tachrome_100_vs_generic | kodak_ektar_100 | kodak_elite_100_xpro |
1632 kodak_elite_chrome_200 | kodak_elite_chrome_400 | ko‐
1633 dak_elite_color_200 | kodak_elite_color_400 | kodak_elite_extra‐
1634 color_100 | kodak_hie_hs_infra | kodak_kodachrome_200 | kodak_ko‐
1635 dachrome_25 |
1636 kodak_kodachrome_64 | kodak_kodachrome_64_generic | kodak_por‐
1637 tra_160 | kodak_portra_160_+ | kodak_portra_160_++ | kodak_portra_160_-
1638 | kodak_portra_160_nc | kodak_portra_160_nc_+ | kodak_portra_160_nc_++
1639 |
1640 kodak_portra_160_nc_- | kodak_portra_160_vc | kodak_portra_160_vc_+
1641 | kodak_portra_160_vc_++ | kodak_portra_160_vc_- | kodak_portra_400 |
1642 kodak_portra_400_+ | kodak_portra_400_++ | kodak_portra_400_- |
1643 kodak_portra_400_nc | kodak_portra_400_nc_+ | kodak_por‐
1644 tra_400_nc_++ | kodak_portra_400_nc_- | kodak_portra_400_uc | ko‐
1645 dak_portra_400_uc_+ | kodak_portra_400_uc_++ | kodak_portra_400_uc_- |
1646 kodak_portra_400_vc | kodak_portra_400_vc_+ | kodak_por‐
1647 tra_400_vc_++ | kodak_portra_400_vc_- | kodak_portra_800 | kodak_por‐
1648 tra_800_+ | kodak_portra_800_++ | kodak_portra_800_- | kodak_por‐
1649 tra_800_hc |
1650 kodak_t-max_100 | kodak_t-max_3200 | kodak_t-max_400 | ko‐
1651 dak_tmax_3200 | kodak_tmax_3200_+ | kodak_tmax_3200_++ | ko‐
1652 dak_tmax_3200_- | kodak_tmax_3200_alt | kodak_tri-x_400 | kodak_tri-
1653 x_400_+ |
1654 kodak_tri-x_400_++ | kodak_tri-x_400_- | kodak_tri-x_400_alt | kor‐
1655 ben_214 | landscape_1 | landscape_10 | landscape_2 | landscape_3 |
1656 landscape_4 | landscape_5 | landscape_6 | landscape_7 | landscape_8 |
1657 landscape_9 | lateafternoonwanderlust | latesunset | lc_1 | lc_10 |
1658 lc_2 | lc_3 | lc_4 | lc_5 | lc_6 | lc_7 | lc_8 | lc_9 | lenox_340 |
1659 life_giving_tree | light_blown | lomo | lomography_redscale_100 |
1660 lomography_x-pro_slide_200 | london_nights | louetta | low_con‐
1661 trast_blue | low_key_01 | lucky_64 | lushgreensummer | magenta_day |
1662 magenta_day_01 | magenta_dream | magenta_yellow | magentacoffee | ma‐
1663 trix |
1664 mckinnon_75 | memories | metropolis | milo_5 | minimalistcaffeina‐
1665 tion | modern_film | mono_tinted | monochrome | monochrome_1 | mono‐
1666 chrome_2 | moody_1 | moody_10 | moody_2 | moody_3 | moody_4 | moody_5 |
1667 moody_6 | moody_7 | moody_8 | moody_9 | moonlight | moonlight_01 |
1668 moonrise | morning_6 | morroco_16 | mostly_blue | moviz_1 | moviz_10 |
1669 moviz_11 | moviz_12 | moviz_13 | moviz_14 | moviz_15 | moviz_16 |
1670 moviz_17 | moviz_18 | moviz_19 | moviz_2 | moviz_20 | moviz_21 |
1671 moviz_22 | moviz_23 | moviz_24 | moviz_25 | moviz_26 | moviz_27 |
1672 moviz_28 | moviz_29 | moviz_3 | moviz_30 | moviz_31 | moviz_32 |
1673 moviz_33
1674 | moviz_34 | moviz_35 | moviz_36 | moviz_37 | moviz_38 | moviz_39 |
1675 moviz_4 | moviz_40 | moviz_41 | moviz_42 | moviz_43 | moviz_44 |
1676 moviz_45 | moviz_46 | moviz_47 | moviz_48 | moviz_5 | moviz_6 | moviz_7
1677 | moviz_8 | moviz_9 | mute_shift | muted_01 | muted_fade | mys‐
1678 ticpurplesunset | nah | natural_vivid | nemesis | neon_770 | neu‐
1679 tral_teal_orange | neutral_warm_fade | newspaper | night_01 |
1680 night_blade_4 |
1681 night_king_141 | night_spy | nightfromday | nightlife | nostalgia‐
1682 honey | nostalgic | nw-1 | nw-10 | nw-2 | nw-3 | nw-4 | nw-5 | nw-6 |
1683 nw-7 | nw-8 | nw-9 | old_west | once_upon_a_time | only_red |
1684 only_red_and_blue | operation_yellow | orange_dark_4 | or‐
1685 ange_dark_7 | orange_dark_look | orange_tone | orange_underexposed |
1686 oranges | paladin | paladin_1875 | pasadena_21 | passing_by | pink_fade
1687 |
1688 pitaya_15 | polaroid_664 | polaroid_665 | polaroid_665_+ | po‐
1689 laroid_665_++ | polaroid_665_- | polaroid_665_-- | polaroid_665_nega‐
1690 tive | polaroid_665_negative_+ | polaroid_665_negative_- |
1691 polaroid_665_negative_hc | polaroid_667 | polaroid_669 | po‐
1692 laroid_669_+ | polaroid_669_++ | polaroid_669_+++ | polaroid_669_- |
1693 polaroid_669_-- | polaroid_669_cold | polaroid_669_cold_+ |
1694 polaroid_669_cold_- | polaroid_669_cold_-- | polaroid_672 | po‐
1695 laroid_690 | polaroid_690_+ | polaroid_690_++ | polaroid_690_- | po‐
1696 laroid_690_-- | polaroid_690_cold | polaroid_690_cold_+ |
1697 polaroid_690_cold_++ | polaroid_690_cold_- | polaroid_690_cold_-- |
1698 polaroid_690_warm | polaroid_690_warm_+ | polaroid_690_warm_++ | po‐
1699 laroid_690_warm_- | polaroid_690_warm_-- | polaroid_polachrome |
1700 polaroid_px-100uv+_cold | polaroid_px-100uv+_cold_+ | po‐
1701 laroid_px-100uv+_cold_++ | polaroid_px-100uv+_cold_+++ | po‐
1702 laroid_px-100uv+_cold_- | polaroid_px-100uv+_cold_-- | po‐
1703 laroid_px-100uv+_warm |
1704 polaroid_px-100uv+_warm_+ | polaroid_px-100uv+_warm_++ | po‐
1705 laroid_px-100uv+_warm_+++ | polaroid_px-100uv+_warm_- | po‐
1706 laroid_px-100uv+_warm_-- | polaroid_px-680 | polaroid_px-680_+ | po‐
1707 laroid_px-680_++ |
1708 polaroid_px-680_- | polaroid_px-680_-- | polaroid_px-680_cold | po‐
1709 laroid_px-680_cold_+ | polaroid_px-680_cold_++ | po‐
1710 laroid_px-680_cold_++_alt | polaroid_px-680_cold_- | po‐
1711 laroid_px-680_cold_-- |
1712 polaroid_px-680_warm | polaroid_px-680_warm_+ | po‐
1713 laroid_px-680_warm_++ | polaroid_px-680_warm_- | po‐
1714 laroid_px-680_warm_-- | polaroid_px-70 | polaroid_px-70_+ | po‐
1715 laroid_px-70_++ | polaroid_px-70_+++ |
1716 polaroid_px-70_- | polaroid_px-70_-- | polaroid_px-70_cold | po‐
1717 laroid_px-70_cold_+ | polaroid_px-70_cold_++ | polaroid_px-70_cold_- |
1718 polaroid_px-70_cold_-- | polaroid_px-70_warm | polaroid_px-70_warm_+ |
1719 polaroid_px-70_warm_++ | polaroid_px-70_warm_- | po‐
1720 laroid_px-70_warm_-- | polaroid_time_zero_expired | po‐
1721 laroid_time_zero_expired_+ | polaroid_time_zero_expired_++ | po‐
1722 laroid_time_zero_expired_- |
1723 polaroid_time_zero_expired_-- | polaroid_time_zero_expired_--- |
1724 polaroid_time_zero_expired_cold | polaroid_time_zero_expired_cold_- |
1725 polaroid_time_zero_expired_cold_-- |
1726 polaroid_time_zero_expired_cold_--- | portrait_1 | portrait_10 |
1727 portrait_2 | portrait_3 | portrait_4 | portrait_5 | portrait_6 | por‐
1728 trait_7 | portrait_8 | portrait_9 | progressen | protect_highlights_01
1729 |
1730 prussian_blue | pseudogrey | purple | purple_2 | red_afternoon_01 |
1731 red_day_01 | red_dream_01 | redblueyellow | reds | reds_oranges_yellows
1732 | reeve_38 | remy_24 | rest_33 | retro | retro_brown_01 |
1733 retro_magenta_01 | retro_summer_3 | retro_yellow_01 | rollei_ir_400
1734 | rollei_ortho_25 | rollei_retro_100_tonal | rollei_retro_80s | ro‐
1735 tate_muted | rotate_vibrant | rotated | rotated_crush | saturated_blue
1736 | saving_private_damon | science_fiction | serenity | seringe_4 |
1737 serpent | seventies_magazine | sevsuz | shadow_king_39 | shine |
1738 skin_tones | smart_contrast | smokey | smooth_clear | smooth_cromeish |
1739 smooth_fade | smooth_green_orange | smooth_sailing |
1740 smooth_teal_orange | soft_fade | softwarming | solarized_color | solar‐
1741 ized_color_2 | springmorning | sprocket_231 | spy_29 | street |
1742 studio_skin_tone_shaper | subtle_blue | subtle_green | subtle_yel‐
1743 low | summer | summer_alt | sunlightlove | sunny | sunny_alt |
1744 sunny_rich | sunny_warm | super_warm | super_warm_rich | sutro_fx |
1745 sweet_bubblegum | sweet_gelatto | taiga | tarraco | teal_fade |
1746 teal_moonlight | tealmagentagold | tealorange | tealorange_1 | tealor‐
1747 ange_2 | tealorange_3 | technicalfx_backlight_filter | teigen_28 |
1748 tensiongreen_1 | tensiongreen_2 | tensiongreen_3 | tensiongreen_4 |
1749 terra_4 | the_matrices | thriller_2 | toastedgarden | trent_18 |
1750 true_colors_8 | turkiest_42 | tweed_71 | ultra_water | undeniable |
1751 undeniable_2 | unknown | urban_cowboy | uzbek_bukhara | uzbek_mar‐
1752 riage | uzbek_samarcande | velvetia | very_warm_greenish | vfb_21 | vi‐
1753 brant | vibrant_alien | vibrant_contrast | vibrant_cromeish | victory
1754 | vintage | vintage_163 | vintage_alt | vintage_brighter | vin‐
1755 tage_chrome | vintage_mob | vintage_warmth_1 | vireo_37 | warm |
1756 warm_dark_contrasty | warm_fade | warm_fade_1 | warm_highlight |
1757 warm_neutral
1758 | warm_sunset_red | warm_teal | warm_vintage | warm_yellow |
1759 well_see | western | westernlut_2 | whiter_whites | winterlighthouse |
1760 wipe | wooden_gold_20 | yellow_55b | yellow_film_01 | yellowstone |
1761 you_can_do_it | zed_32 | zeke_39 | zilverfx_bw_solarization | zil‐
1762 verfx_infrared | zilverfx_vintage_bw }
1763
1764 Default values: 'resolution=33' and 'cut_and_round=1'.
1765
1766 Example:
1767 [#1] clut summer clut alien_green,17 clut orange_dark4,48
1768
1769 m (+):
1770 Shortcut for command 'command'.
1771
1772 command (+):
1773 _add_debug_info={ 0 | 1 },{ filename | http[s]://URL | "string" }
1774
1775 Import G'MIC custom commands from specified file, URL or string.
1776 (equivalent to shortcut command 'm').
1777
1778 Imported commands are available directly after the 'command' invo‐
1779 cation.
1780
1781 Default value: 'add_debug_info=1'.
1782
1783 Example:
1784 [#1] image.jpg command "foo : mirror y deform $""1" +foo[0] 5
1785 +foo[0] 15
1786
1787 cursor (+):
1788 _mode = { 0=hide | 1=show }
1789
1790 Show or hide mouse cursor for selected instant display windows.
1791 Command selection (if any) stands for instant display window in‐
1792 dices instead of image indices.
1793
1794 Default value: 'mode=1'.
1795
1796 delete (+):
1797 filename1[,filename2,...]
1798
1799 Delete specified filenames on disk. Multiple filenames must be sep‐
1800 arated by commas.
1801
1802 d (+):
1803 Shortcut for command 'display'.
1804
1805 display (+):
1806 _X[%]>=0,_Y[%]>=0,_Z[%]>=0,_exit_on_anykey={ 0 | 1 }
1807
1808 Display selected images in an interactive viewer (use the instant
1809 display window [0] if opened).
1810 (equivalent to shortcut command 'd').
1811
1812 Arguments 'X','Y','Z' determine the initial selection view, for 3D
1813 volumetric images.
1814
1815 Default value: 'X=Y=Z=0' and 'exit_on_anykey=0'.
1816
1817 Tutorial: https://gmic.eu/oldtutorial/_display.shtml
1818
1819 d0:
1820 Shortcut for command 'display0'.
1821
1822 display0:
1823
1824 Display selected images without value normalization.
1825 (equivalent to shortcut command 'd0').
1826
1827 d2d:
1828 Shortcut for command 'display2d'.
1829
1830 display2d:
1831
1832 Display selected 2d images in an interactive window.
1833 (equivalent to shortcut command 'd2d').
1834
1835 This command is used by default by command 'display' when display‐
1836 ing 2d images.
1837 If selected image is a volumetric image, each slice is displayed on
1838 a separate display
1839 window (up to 10 images can be displayed simultaneously this way),
1840 with synchronized moves.
1841 When interactive window is opened, the following actions are possi‐
1842 ble:
1843 * Left mouse button: Create an image selection and zoom into it.
1844 * Middle mouse button, or CTRL+left mouse button: Move image.
1845 * Mouse wheel or PADD+/-: Zoom in/out.
1846 * Arrow keys: Move image left/right/up/down.
1847 * 'CTRL + A': Enable/disable transparency (show/hide alpha chan‐
1848 nel).
1849 * 'CTRL + C': Decrease window size.
1850 * 'CTRL + D': Increase window size.
1851 * 'CTRL + F': Toggle fullscreen mode.
1852 * 'CTRL + N': Change normalization mode (can be { none | normal |
1853 channel-by-channel }).
1854 * 'CTRL + O': Save a copy of the input image, as a numbered file
1855 'gmic_xxxxxx.gmz'.
1856 * 'CTRL + R': Reset both window size and view.
1857 * 'CTRL + S': Save a screenshot of the current view, as a numbered
1858 file 'gmic_xxxxxx.png'.
1859 * 'CTRL + SPACE': Reset view.
1860 * 'CTRL + X': Show/hide axes.
1861 * 'CTRL + Z': Hold/release aspect ratio.
1862
1863 d3d:
1864 Shortcut for command 'display3d'.
1865
1866 display3d:
1867 _[background_image],_exit_on_anykey={ 0 | 1 } |
1868 _exit_on_anykey={ 0 | 1 }
1869
1870 Display selected 3D objects in an interactive viewer (use the in‐
1871 stant display window [0] if opened).
1872 (equivalent to shortcut command 'd3d').
1873
1874 Default values: '[background_image]=(default)' and
1875 'exit_on_anykey=0'.
1876
1877 da:
1878 Shortcut for command 'display_array'.
1879
1880 display_array:
1881 _width>0,_height>0
1882
1883 Display images in interactive windows where pixel neighborhoods can
1884 be explored.
1885
1886 Default values: 'width=13' and 'height=width'.
1887
1888 dc:
1889 Shortcut for command 'display_camera'.
1890
1891 display_camera:
1892
1893 Open camera viewer.
1894 This command requires features from the OpenCV library (not enabled
1895 in G'MIC by default).
1896
1897 dfft:
1898 Shortcut for command 'display_fft'.
1899
1900 display_fft:
1901
1902 Display fourier transform of selected images, with centered log-
1903 module and argument.
1904 (equivalent to shortcut command 'dfft').
1905
1906 Example:
1907 [#1] image.jpg +display_fft
1908
1909 dg:
1910 Shortcut for command 'display_graph'.
1911
1912 display_graph:
1913 _width>=0,_height>=0,_plot_type,_ver‐
1914 tex_type,_xmin,_xmax,_ymin,_ymax,_xlabel,_ylabel
1915
1916 Render graph plot from selected image data.
1917 'plot_type' can be { 0=none | 1=lines | 2=splines | 3=bar }.
1918 'vertex_type' can be { 0=none | 1=points | 2,3=crosses | 4,5=cir‐
1919 cles | 6,7=squares }.
1920 'xmin','xmax','ymin','ymax' set the coordinates of the displayed
1921 xy-axes.
1922 if specified 'width' or 'height' is '0', then image size is set to
1923 half the screen size.
1924
1925 Default values: 'width=0', 'height=0', 'plot_type=1', 'ver‐
1926 tex_type=1', 'xmin=xmax=ymin=ymax=0 (auto)', 'xlabel="x-axis"' and
1927 'ylabel="y-axis"'.
1928
1929 Example:
1930 [#1] 128,1,1,1,'cos(x/10+u)' +display_graph 400,300,3
1931
1932 dh:
1933 Shortcut for command 'display_histogram'.
1934
1935 display_histogram:
1936 _width>=0,_height>=0,_clus‐
1937 ters>0,_min_value[%],_max_value[%],_show_axes={ 0 | 1 },_expression.
1938
1939 Render a channel-by-channel histogram.
1940 If selected images have several slices, the rendering is performed
1941 for all input slices.
1942 'expression' is a mathematical expression used to transform the
1943 histogram data for visualization purpose.
1944 (equivalent to shortcut command 'dh').
1945
1946 if specified 'width' or 'height' is '0', then image size is set to
1947 half the screen size.
1948
1949 Default values: 'width=0', 'height=0', 'clusters=256',
1950 'min_value=0%', 'max_value=100%', 'show_axes=1' and 'expression=i'.
1951
1952 Example:
1953 [#1] image.jpg +display_histogram 512,300
1954
1955 display_parametric:
1956 _width>0,_height>0,_outline_opacity,_vertex_radius>=0,_is_an‐
1957 tialiased={ 0 | 1 },_is_decorated={ 0 | 1 },_xlabel,_ylabel
1958
1959 Render 2D or 3D parametric curve or point clouds from selected im‐
1960 age data.
1961 Curve points are defined as pixels of a 2 or 3-channel image.
1962 If the point image contains more than 3 channels, additional chan‐
1963 nels define the (R,G,B) color for each vertex.
1964 If 'outline_opacity>1', the outline is colored according to the
1965 specified vertex colors and
1966 'outline_opacity-1' is used as the actual drawing opacity.
1967
1968 Default values: 'width=512', 'height=width', 'outline_opacity=3',
1969 'vertex_radius=0', 'is_antialiased=1','is_decorated=1', 'xlabel="x-
1970 axis"' and
1971 'ylabel="y-axis"'.
1972
1973 Example:
1974 [#1]
1975 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)'
1976 display_parametric 512,512
1977 [#2] 1000,1,1,2,u(-100,100) quantize 4,1 noise 12 channels 0,2
1978 +normalize 0,255 append c display_parametric 512,512,0.1,8
1979
1980 dp:
1981 Shortcut for command 'display_parallel'.
1982
1983 display_parallel:
1984
1985 Display each selected image in a separate interactive display win‐
1986 dow.
1987 (equivalent to shortcut command 'dp').
1988
1989 dp0:
1990 Shortcut for command 'display_parallel0'.
1991
1992 display_parallel0:
1993
1994 Display each selected image in a separate interactive display win‐
1995 dow, without value normalization.
1996 (equivalent to shortcut command 'dp0').
1997
1998 display_polar:
1999 _width>32,_height>32,_out‐
2000 line_type,_fill_R,_fill_G,_fill_B,_theta_start,_theta_end,_xlabel,_yla‐
2001 bel
2002
2003 Render polar curve from selected image data.
2004 'outline_type' can be { r<0=dots with radius -r | 0=no outline |
2005 r>0=lines+dots with radius r }.
2006 'fill_color' can be { -1=no fill | R,G,B=fill with specified color
2007 }.
2008
2009 Default values: 'width=500', 'height=width', 'outline_type=1',
2010 'fill_R=fill_G=fill_B=200', 'theta_start=0', 'theta_end=360', 'xla‐
2011 bel="x-axis"' and
2012 'ylabel="y-axis"'.
2013
2014 Example:
2015 [#1] 300,1,1,1,'0.3+abs(cos(10*pi*x/w))+u(0.4)' display_polar
2016 512,512,4,200,255,200
2017 [#2] 3000,1,1,1,'x^3/1e10' display_polar
2018 400,400,1,-1,,,0,{15*360}
2019
2020 dq:
2021 Shortcut for command 'display_quiver'.
2022
2023 display_quiver:
2024 _size_factor>0,_arrow_size>=0,_color_mode={ 0=monochrome |
2025 1=grayscale | 2=color }
2026
2027 Render selected images of 2D vectors as a field of 2D arrows.
2028 (equivalent to shortcut command 'dq').
2029
2030 Default values: 'size_factor=16', 'arrow_size=1.5' and
2031 'color_mode=1'.
2032
2033 Example:
2034 [#1] image.jpg +luminance gradient[-1] xy rv[-2,-1] *[-2] -1
2035 a[-2,-1] c crop 60,10,90,30 +display_quiver[1] ,
2036
2037 drgba:
2038 Shortcut for command 'display_rgba'.
2039
2040 display_rgba:
2041 _background_RGB_color
2042
2043 Render selected RGBA images over a checkerboard or colored back‐
2044 ground.
2045 (equivalent to shortcut command 'drgba').
2046
2047 Default values: 'background_RGB_color=undefined' (checkerboard).
2048
2049 Example:
2050 [#1] image.jpg +norm threshold[-1] 40% blur[-1] 3 normalize[-1]
2051 0,255 append c display_rgba
2052
2053 dt:
2054 Shortcut for command 'display_tensors'.
2055
2056 display_tensors:
2057 _size_factor>0,_ellipse_size>=0,_color_mode={ 0=monochrome |
2058 1=grayscale | 2=color },_outline>=0
2059
2060 Render selected images of tensors as a field of 2D ellipses.
2061 (equivalent to shortcut command 'dt').
2062
2063 Default values: 'size_factor=16', 'ellipse_size=1.5',
2064 'color_mode=2' and 'outline=2'.
2065
2066 Example:
2067 [#1] image.jpg +diffusiontensors 0.1,0.9 resize2dx. 32 +dis‐
2068 play_tensors. 64,2
2069
2070 Tutorial: https://gmic.eu/oldtutorial/_display_tensors.shtml
2071
2072 dw:
2073 Shortcut for command 'display_warp'.
2074
2075 display_warp:
2076 _cell_size>0
2077
2078 Render selected 2D warping fields.
2079 (equivalent to shortcut command 'dw').
2080
2081 Default value: 'cell_size=15'.
2082
2083 Example:
2084 [#1] 400,400,1,2,'x=x-w/2;y=y-
2085 h/2;r=sqrt(x*x+y*y);a=atan2(y,x);5*sin(r/10)*[cos(a),sin(a)]' +dis‐
2086 play_warp 10
2087
2088 e (+):
2089 Shortcut for command 'echo'.
2090
2091 echo (+):
2092 message
2093
2094 Output specified message on the error output.
2095 (equivalent to shortcut command 'e').
2096
2097 Command selection (if any) stands for displayed call stack subset
2098 instead of image indices.
2099
2100 echo_file:
2101 filename,message
2102
2103 Output specified message, appending it to specified output file.
2104 (similar to 'echo' for specified output file stream).
2105
2106 echo_stdout:
2107 message
2108
2109 Output specified message, on the standard output (stdout).
2110 (similar to 'echo' for output on standard output instead of stan‐
2111 dard error).
2112
2113 function1d:
2114 0<=smoothness<=1,x0>=0,y0,x1>=0,y1,...,xn>=0,yn
2115
2116 Insert continuous 1D function from specified list of keypoints
2117 (xk,yk)
2118 in range [0,max(xk)] (xk are positive integers).
2119
2120 Default values: 'smoothness=1' and 'x0=y0=0'.
2121
2122 Example:
2123 [#1] function1d 1,0,0,10,30,40,20,70,30,80,0 +display_graph
2124 400,300
2125
2126 i (+):
2127 Shortcut for command 'input'.
2128
2129 input (+):
2130 [type:]filename |
2131 [type:]http://URL |
2132 [selection]x_nb_copies>0 |
2133 { width>0[%] | [image_w] },{ _height>0[%] | [image_h] },{
2134 _depth>0[%] | [image_d] },{ _spectrum>0[%] | [image_s] },_{
2135 value1,_value2,... | 'formula' } |
2136 (value1{,|;|/|^}value2{,|;|/|^}...[:{x|y|z|c|,|;|/|^}]) |
2137 0
2138
2139 Insert a new image taken from a filename or from a copy of an ex‐
2140 isting image [index],
2141 or insert new image with specified dimensions and values. Single
2142 quotes may be omitted in
2143 'formula'. Specifying argument '0' inserts an 'empty' image.
2144 (equivalent to shortcut command 'i').
2145
2146 Default values: 'nb_copies=1', 'height=depth=spectrum=1' and
2147 'value1=0'.
2148
2149 Example:
2150 [#1] input image.jpg
2151 [#2] input (1,2,3;4,5,6;7,8,9^9,8,7;6,5,4;3,2,1)
2152 [#3] image.jpg (1,2,3;4,5,6;7,8,9) (255^128^64)
2153 400,400,1,3,'if(x>w/2,x,y)*c'
2154
2155 Tutorial: https://gmic.eu/oldtutorial/_input.shtml
2156
2157 input_565:
2158 filename,width>0,height>0,reverse_endianness={ 0 | 1 }
2159
2160 Insert image data from a raw RGB-565 file, at the end of the list.
2161
2162 Default value: 'reverse_endianness=0'.
2163
2164 input_cube:
2165 "filename",_convert_1d_cluts_to_3d={ 0 | 1 }.
2166
2167 Insert CLUT data from a .cube filename (Adobe CLUT file format).
2168
2169 Default value: 'convert_1d_cluts_to_3d=1'.
2170
2171 input_flo:
2172 "filename"
2173
2174 Insert optical flow data from a .flo filename (vision.middle‐
2175 bury.edu file format).
2176
2177 ig:
2178 Shortcut for command 'input_glob'.
2179
2180 input_glob:
2181 pattern
2182
2183 Insert new images from several filenames that match the specified
2184 glob pattern.
2185 (equivalent to shortcut command 'ig').
2186
2187 input_gpl:
2188 filename
2189
2190 Input specified filename as a .gpl palette data file.
2191
2192 it:
2193 Shortcut for command 'input_text'.
2194
2195 input_text:
2196 filename
2197
2198 Input specified text-data filename as a new image.
2199 (equivalent to shortcut command 'it').
2200
2201 network (+):
2202 mode={ -1=disabled | 0=enabled w/o timeout | >0=enabled w/ speci‐
2203 fied timeout in seconds }
2204
2205 Enable/disable load-from-network and set corresponding timeout.
2206 (Default mode is 'enabled w/o timeout').
2207
2208 o (+):
2209 Shortcut for command 'output'.
2210
2211 output (+):
2212 [type:]filename,_format_options
2213
2214 Output selected images as one or several numbered file(s).
2215 (equivalent to shortcut command 'o').
2216
2217 Default value: 'format_options'=(undefined).
2218
2219 output_565:
2220 "filename",reverse_endianness={ 0=false | 1=true }
2221
2222 Output selected images as raw RGB-565 files.
2223
2224 Default value: 'reverse_endianness=0'.
2225
2226 output_cube:
2227 "filename"
2228
2229 Output selected CLUTs as a .cube file (Adobe CLUT format).
2230
2231 output_flo:
2232 "filename"
2233
2234 Output selected optical flow as a .flo file (vision.middlebury.edu
2235 file format).
2236
2237 output_ggr:
2238 filename,_gradient_name
2239
2240 Output selected images as .ggr gradient files (GIMP).
2241 If no gradient name is specified, it is deduced from the filename.
2242
2243 output_obj:
2244 filename,_save_materials={ 0=no | 1=yes }
2245
2246 Output selected 3D objects as Wavefront 3D object files.
2247 Set 'save_materials' to '1' to produce a corresponding material
2248 file ('.mtl') and eventually texture files.
2249 Beware, the export to '.obj' files may be quite slow for large 3D
2250 objects.
2251
2252 Default value: 'save_materials=1'.
2253
2254 ot:
2255 Shortcut for command 'output_text'.
2256
2257 output_text:
2258 filename
2259
2260 Output selected images as text-data filenames.
2261 (equivalent to shortcut command 'ot').
2262
2263 on:
2264 Shortcut for command 'outputn'.
2265
2266 outputn:
2267 filename,_index
2268
2269 Output selected images as automatically numbered filenames in re‐
2270 peat...done loops.
2271 (equivalent to shortcut command 'on').
2272
2273 op:
2274 Shortcut for command 'outputp'.
2275
2276 outputp:
2277 prefix
2278
2279 Output selected images as prefixed versions of their original file‐
2280 names.
2281 (equivalent to shortcut command 'op').
2282
2283 Default value: 'prefix=_'.
2284
2285 ow:
2286 Shortcut for command 'outputw'.
2287
2288 outputw:
2289
2290 Output selected images by overwriting their original location.
2291 (equivalent to shortcut command 'ow').
2292
2293 ox:
2294 Shortcut for command 'outputx'.
2295
2296 outputx:
2297 extension1,_extension2,_...,_extensionN,_output_at_same_loca‐
2298 tion={ 0 | 1 }
2299
2300 Output selected images with same base filenames but for N different
2301 extensions.
2302 (equivalent to shortcut command 'ox').
2303
2304 Default value: 'output_at_same_location=0'.
2305
2306 parse_cli:
2307 _output_mode,_{ * | command_name }
2308
2309 Parse definition of ''-documented commands and output info about
2310 them in specified output mode.
2311 'output_mode' can be { ascii | bashcompletion | html | images |
2312 print }.
2313
2314 Default values: 'output_mode=print' and 'command_name=*'.
2315
2316 parse_gmd:
2317
2318 Parse and tokenize selected images, viewed as text strings format‐
2319 ted with the G'MIC markdown syntax.
2320
2321 gmd2html:
2322 _include_default_header_footer={ 0=none | 1=Reference | 2=Tuto‐
2323 rial | 3=News } |
2324 (no arg)
2325
2326 Convert selected gmd-formatted text images to html format.
2327
2328 Default values: 'include_default_header_footer=1'.
2329
2330 gmd2ascii:
2331 _max_line_length>0,_indent_forced_newlines>=0 |
2332 (no arg)
2333
2334 Convert selected gmd-formatted text images to ascii format.
2335
2336 Default values: 'max_line_length=80' and 'indent_forced_newline=0'.
2337
2338 parse_gui:
2339 _outputmode,_{ * | filter_name}
2340
2341 Parse selected filter definitions and generate info about filters
2342 in selected output mode.
2343 'outputmode' can be { json | list | print | strings | update | zart
2344 }.
2345 It is possible to define a custom output mode, by implementing the
2346 following commands
2347 ('outputmode' must be replaced by the name of the custom user out‐
2348 put mode):
2349 . 'parse_gui_outputmode' : A command that outputs the parsing in‐
2350 formation with a custom format.
2351 . 'parse_gui_parseparams_outputmode' (optional): A simple command
2352 that returns 0 or 1. It tells the parser whether parameters of matching
2353 filter must be analyzed (slower) or not.
2354 . 'parse_gui_trigger_outputmode' (optional): A command that is
2355 called by the parser just before parsing the set of each matching fil‐
2356 ters.
2357 Here is the list of global variables set by the parser, accessible
2358 in command 'parse_gui_outputmode':
2359 '$_nbfilters': Number of matching filters.
2360 '$_nongui' (stored as an image): All merged lines in the file that
2361 do not correspond to '#@gui' lines.
2362 For each filter ' * '$_fF_name' : Filter name.
2363 * '$_fF_path' : Full path.
2364 * '$_fF_locale' : Filter locale (empty, if not specified).
2365 * '$_fF_command' : Filter command.
2366 * '$_fF_commandpreview' : Filter preview command (empty, if not
2367 specified).
2368 * '$_fF_zoomfactor' : Default zoom factor (empty, if not speci‐
2369 fied).
2370 * '$_fF_zoomaccurate' : Is preview accurate when zoom changes ?
2371 (can be { 0=false | 1=true }).
2372 * '$_fF_inputmode' : Default preferred input mode (empty, if not
2373 specified).
2374 * '$_fF_hide' : Path of filter hid by current filter (for local‐
2375 ized filters, empty if not specified).
2376 * '$_fF_nbparams' : Number of parameters.
2377 For each parameter ' * '$_fF_pP_name' : Parameter name.
2378 * '$_fF_pP_type' : Parameter type.
2379 * '$_fF_pP_responsivity' : Parameter responsivity (can be { 0 | 1
2380 }).
2381 * '$_fF_pP_visibility' : Parameter visibility.
2382 * '$_fF_pP_propagation' : Propagation of the parameter visibility.
2383 * '$_fF_pP_nbargs' : Number of parameter arguments.
2384 For each argument ' * '$_fF_pP_aA' : Argument value
2385 Default parameters: 'filter_name=*' and 'output_format=print'.
2386
2387 pass (+):
2388 _shared_state={ -1=status only | 0=non-shared (copy) | 1=shared |
2389 2=adaptive }
2390
2391 Insert images from parent context of a custom command or a local
2392 environment.
2393 Command selection (if any) stands for a selection of images in the
2394 parent context.
2395 By default (adaptive shared state), selected images are inserted in
2396 a shared state if they do not belong
2397 to the context (selection) of the current custom command or local
2398 environment as well.
2399 Typical use of command 'pass' concerns the design of custom com‐
2400 mands that take images as arguments.
2401 This commands return the list of corresponding indices in the sta‐
2402 tus.
2403
2404 Default value: 'shared_state=2'.
2405
2406 Example:
2407 [#1] command "average : pass$""1 add[^-1] [-1] remove[-1] div 2"
2408 sample ? +mirror y +average[0] [1]
2409
2410 plot (+):
2411 _plot_type,_vertex_type,_xmin,_xmax,_ymin,_ymax,_exit_on_anykey={
2412 0 | 1 } |
2413 'formula',_resolution>=0,_plot_type,_ver‐
2414 tex_type,_xmin,xmax,_ymin,_ymax,_exit_on_anykey={ 0 | 1 }
2415
2416 Display selected images or formula in an interactive viewer (use
2417 the instant display window [0] if opened).
2418 'plot_type' can be { 0=none | 1=lines | 2=splines | 3=bar }.
2419 'vertex_type' can be { 0=none | 1=points | 2,3=crosses | 4,5=cir‐
2420 cles | 6,7=squares }.
2421 'xmin', 'xmax', 'ymin', 'ymax' set the coordinates of the displayed
2422 xy-axes.
2423
2424 Default values: 'plot_type=1', 'vertex_type=1',
2425 'xmin=xmax=ymin=ymax=0 (auto)' and 'exit_on_anykey=0'.
2426
2427 p (+):
2428 Shortcut for command 'print'.
2429
2430 print (+):
2431
2432 Output information on selected images, on the standard error
2433 (stderr).
2434 (equivalent to shortcut command 'p').
2435
2436 random_pattern:
2437 _width>0,_height>0,_min_detail_level>=0
2438
2439 Insert a new RGB image of specified size at the end of the image
2440 list, rendered with a random pattern.
2441
2442 Default values: 'width=height=512' and 'min_detail_level=2'.
2443
2444 Example:
2445 [#1] repeat 6 random_pattern 256 done
2446
2447 screen (+):
2448 _x0[%],_y0[%],_x1[%],_y1[%]
2449
2450 Take screenshot, optionally grabbed with specified coordinates, and
2451 insert it
2452 at the end of the image list.
2453
2454 select (+):
2455 feature_type,_X[%]>=0,_Y[%]>=0,_Z[%]>=0,_exit_on_anykey={ 0 | 1
2456 },_is_deep_selection={ 0 | 1 }
2457
2458 Interactively select a feature from selected images (use the in‐
2459 stant display window [0] if opened).
2460 'feature_type' can be { 0=point | 1=segment | 2=rectangle | 3=el‐
2461 lipse }.
2462 Arguments 'X','Y','Z' determine the initial selection view, for 3D
2463 volumetric images.
2464 The retrieved feature is returned as a 3D vector (if 'fea‐
2465 ture_type==0') or as a 6d vector
2466 (if 'feature_type!=0') containing the feature coordinates.
2467
2468 Default values: 'X=Y=Z=(undefined)', 'exit_on_anykey=0' and
2469 'is_deep_selection=0'.
2470
2471 serialize (+):
2472 _datatype,_is_compressed={ 0 | 1 },_store_names={ 0 | 1 }
2473
2474 Serialize selected list of images into a single image, optionnally
2475 in a compressed form.
2476 'datatype' can be { auto | uchar | char | ushort | short | uint |
2477 int | uint64 | int64 | float | double }.
2478 Specify 'datatype' if all selected images have a range of values
2479 constrained to a particular datatype,
2480 in order to minimize the memory footprint.
2481 The resulting image has only integers values in [0,255] and can
2482 then be saved as a raw image of
2483 unsigned chars (doing so will output a valid .cimg[z] or .gmz
2484 file).
2485 If 'store_names' is set to '1', serialization uses the .gmz format
2486 to store data in memory
2487 (otherwise the .cimg[z] format).
2488
2489 Default values: 'datatype=auto', 'is_compressed=1' and
2490 'store_names=1'.
2491
2492 Example:
2493 [#1] image.jpg +serialize uchar +unserialize[-1]
2494
2495 shape_circle:
2496 _size>=0
2497
2498 Input a 2D circle binary shape with specified size.
2499
2500 Default value: 'size=512'.
2501
2502 Example:
2503 [#1] shape_circle ,
2504
2505 shape_cupid:
2506 _size>=0
2507
2508 Input a 2D cupid binary shape with specified size.
2509
2510 Default value: 'size=512'.
2511
2512 Example:
2513 [#1] shape_cupid ,
2514
2515 shape_diamond:
2516 _size>=0
2517
2518 Input a 2D diamond binary shape with specified size.
2519
2520 Default value: 'size=512'.
2521
2522 Example:
2523 [#1] shape_diamond ,
2524
2525 shape_dragon:
2526 _size>=0,_recursion_level>=0,_angle
2527
2528 Input a 2D Dragon curve with specified size.
2529
2530 Default value: 'size=512', 'recursion_level=18' and 'angle=0'.
2531
2532 Example:
2533 [#1] shape_dragon ,
2534
2535 shape_fern:
2536 _size>=0,_density[%]>=0,_angle,0<=_opacity<=1,_type={ 0=Asplenium
2537 adiantum-nigrum | 1=Thelypteridaceae }
2538
2539 Input a 2D Barnsley fern with specified size.
2540
2541 Default value: 'size=512', 'density=50%', 'angle=30', 'opacity=0.3'
2542 and 'type=0'.
2543
2544 Example:
2545 [#1] shape_fern ,
2546
2547 shape_gear:
2548 _size>=0,_nb_teeth>0,0<=_height_teeth<=100,0<=_off‐
2549 set_teeth<=100,0<=_inner_radius<=100
2550
2551 Input a 2D gear binary shape with specified size.
2552
2553 Default value: 'size=512', 'nb_teeth=12', 'height_teeth=20', 'off‐
2554 set_teeth=0' and 'inner_radius=40'.
2555
2556 Example:
2557 [#1] shape_gear ,
2558
2559 shape_heart:
2560 _size>=0
2561
2562 Input a 2D heart binary shape with specified size.
2563
2564 Default value: 'size=512'.
2565
2566 Example:
2567 [#1] shape_heart ,
2568
2569 shape_polygon:
2570 _size>=0,_nb_vertices>=3,_angle
2571
2572 Input a 2D polygonal binary shape with specified geometry.
2573
2574 Default value: 'size=512', 'nb_vertices=5' and 'angle=0'.
2575
2576 Example:
2577 [#1] repeat 6 shape_polygon 256,{3+$>} done
2578
2579 shape_snowflake:
2580 size>=0,0<=_nb_recursions<=6
2581
2582 Input a 2D snowflake binary shape with specified size.
2583
2584 Default values: 'size=512' and 'nb_recursions=5'.
2585
2586 Example:
2587 [#1] repeat 6 shape_snowflake 256,$> done
2588
2589 shape_star:
2590 _size>=0,_nb_branches>0,0<=_thickness<=1
2591
2592 Input a 2D star binary shape with specified size.
2593
2594 Default values: 'size=512', 'nb_branches=5' and 'thickness=0.38'.
2595
2596 Example:
2597 [#1] repeat 9 shape_star 256,{$>+2} done
2598
2599 sh (+):
2600 Shortcut for command 'shared'.
2601
2602 shared (+):
2603 x0[%],x1[%],y[%],z[%],c[%] |
2604 y0[%],y1[%],z[%],c[%] |
2605 z0[%],z1[%],c[%] |
2606 c0[%],c1[%] |
2607 c0[%] |
2608 (no arg)
2609
2610 Insert shared buffers from (opt. points/rows/planes/channels of)
2611 selected images.
2612 Shared buffers cannot be returned by a command, nor a local envi‐
2613 ronment.
2614 (equivalent to shortcut command 'sh').
2615
2616 Example:
2617 [#1] image.jpg shared 1 blur[-1] 3 remove[-1]
2618 [#2] image.jpg repeat s shared 25%,75%,0,$> mirror[-1] x re‐
2619 move[-1] done
2620
2621 Tutorial: https://gmic.eu/oldtutorial/_shared.shtml
2622
2623 sp:
2624 Shortcut for command 'sample'.
2625
2626 sample:
2627 _name1={ ? | apples | balloons | barbara | boats | bottles | but‐
2628 terfly | cameraman | car | cat | cliff | chick | colorful | david | dog
2629 | duck | eagle | elephant | earth | flower | fruits | gmicky |
2630 gmicky_mahvin | gmicky_wilber | greece | gummy | house | inside
2631 | landscape | leaf | lena | leno | lion | mandrill | monalisa | monkey
2632 | parrots | pencils | peppers | portrait0 | portrait1 |
2633 portrait2 | portrait3 | portrait4 | portrait5 | portrait6 |
2634 portrait7 | portrait8 | portrait9 | roddy | rooster | rose | square |
2635 swan | teddy | tiger | tulips | wall | waterfall | zelda },_name2,
2636 ...,_nameN,_width={ >=0 | 0 (auto) },_height = { >=0 | 0 (auto)
2637 } |
2638 (no arg)
2639
2640 Input a new sample RGB image (opt. with specified size).
2641 (equivalent to shortcut command 'sp').
2642
2643 Argument 'name' can be replaced by an integer which serves as a
2644 sample index.
2645
2646 Example:
2647 [#1] repeat 6 sample done
2648
2649 srand (+):
2650 value |
2651 (no arg)
2652
2653 Set random generator seed.
2654 If no argument is specified, a random value is used as the random
2655 generator seed.
2656
2657 store (+):
2658 _is_compressed={ 0 | 1 },variable_name1,_variable_name2,...
2659
2660 Store selected images into one or several named variables.
2661 Selected images are transferred to the variables, and are so re‐
2662 moved from the image list.
2663 (except if the prepended variant of the command '+store[selection]'
2664 is used).
2665 If a single variable name is specified, all images of the selection
2666 are assigned
2667 to the named variable. Otherwise, there must be as many variable
2668 names as images
2669 in the selection, and each selected image is assigned to each spec‐
2670 ified named variable.
2671 Use command 'input $variable' to bring the stored images back in
2672 the list.
2673
2674 Default value: 'is_compressed=0'.
2675
2676 Example:
2677 [#1] sample eagle,earth store img1,img2 input $img2 $img1
2678
2679 testimage2d:
2680 _width>0,_height>0,_spectrum>0
2681
2682 Input a 2D synthetic image.
2683
2684 Default values: 'width=512', 'height=width' and 'spectrum=3'.
2685
2686 Example:
2687 [#1] testimage2d 512
2688
2689 um:
2690 Shortcut for command 'uncommand'.
2691
2692 uncommand (+):
2693 command_name[,_command_name2,...] |
2694 *
2695
2696 Discard definition of specified custom commands.
2697 Set argument to '*' for discarding all existing custom commands.
2698 (equivalent to shortcut command 'um').
2699
2700 uniform_distribution:
2701 nb_levels>=1,spectrum>=1
2702
2703 Input set of uniformly distributed spectrum-d points in [0,1]^spec‐
2704 trum.
2705
2706 Example:
2707 [#1] uniform_distribution 64,3 * 255 +distribution3d cir‐
2708 cles3d[-1] 10
2709
2710 unserialize (+):
2711
2712 Recreate lists of images from serialized image buffers, obtained
2713 with command 'serialize'.
2714
2715 up:
2716 Shortcut for command 'update'.
2717
2718 update:
2719
2720 Update commands from the latest definition file on the G'MIC
2721 server.
2722 (equivalent to shortcut command 'up').
2723
2724 v (+):
2725 Shortcut for command 'verbose'.
2726
2727 verbose (+):
2728 level |
2729 { + | - }
2730
2731 Set or increment/decrement the verbosity level. Default level is 0.
2732 (equivalent to shortcut command 'v').
2733
2734 When 'level'>0, G'MIC log messages are displayed on the standard
2735 error (stderr).
2736
2737 Default value: 'level=1'.
2738
2739 wait (+):
2740 delay |
2741 (no arg)
2742
2743 Wait for a given delay (in ms), optionally since the last call to
2744 'wait'.
2745 or wait for a user event occurring on the selected instant display
2746 windows.
2747 'delay' can be { <0=delay+flush events | 0=event | >0=delay }.
2748 Command selection (if any) stands for instant display window in‐
2749 dices instead of image indices.
2750 If no window indices are specified and if 'delay' is positive, the
2751 command results
2752 in a 'hard' sleep during specified delay.
2753
2754 Default value: 'delay=0'.
2755
2756 warn (+):
2757 _force_visible={ 0 | 1 },_message
2758
2759 Print specified warning message, on the standard error (stderr).
2760 Command selection (if any) stands for displayed call stack subset
2761 instead of image indices.
2762
2763 w (+):
2764 Shortcut for command 'window'.
2765
2766 window (+):
2767 _width[%]>=-1,_height[%]>=-1,_normaliza‐
2768 tion,_fullscreen,_pos_x[%],_pos_y[%],_title
2769
2770 Display selected images into an instant display window with speci‐
2771 fied size, normalization type,
2772 fullscreen mode and title.
2773 (equivalent to shortcut command 'w').
2774
2775 If 'width' or 'height' is set to -1, the corresponding dimension is
2776 adjusted to the window
2777 or image size.
2778 Specify 'pos_x' and 'pos_y' arguments only if the window has to be
2779 moved to the specified
2780 coordinates. Otherwise, they can be avoided.
2781 'width'=0 or 'height'=0 closes the instant display window.
2782 'normalization' can be { -1=keep same | 0=none | 1=always | 2=1st-
2783 time | 3=auto }.
2784 'fullscreen' can be { -1=keep same | 0=no | 1=yes }.
2785 You can manage up to 10 different instant display windows by using
2786 the numbered variants
2787 'w0' (default, eq. to 'w'),'w1',...,'w9' of the command 'w'.
2788 Invoke 'window' with no selection to make the window visible, if it
2789 has been closed by the user.
2790
2791 Default values: 'width=height=normalization=fullscreen=-1' and 'ti‐
2792 tle=(undefined)'.
2793
2794 12.3. List Manipulation
2795 -----------------
2796
2797 k (+):
2798 Shortcut for command 'keep'.
2799
2800 keep (+):
2801
2802 Keep only selected images.
2803 (equivalent to shortcut command 'k').
2804
2805 Example:
2806 [#1] image.jpg split x keep[0-50%:2] append x
2807 [#2] image.jpg split x keep[^30%-70%] append x
2808
2809 mv (+):
2810 Shortcut for command 'move'.
2811
2812 move (+):
2813 position[%]
2814
2815 Move selected images at specified position.
2816 (equivalent to shortcut command 'mv').
2817
2818 Example:
2819 [#1] image.jpg split x,3 move[1] 0
2820 [#2] image.jpg split x move[50%--1:2] 0 append x
2821
2822 nm (+):
2823 Shortcut for command 'name'.
2824
2825 name (+):
2826 "name1","name2",...
2827
2828 Set names of selected images.
2829 * If the selection contains a single image, then it is assumed the
2830 command has a single name
2831 argument (possibly containing multiple comas).
2832 * If the selection contains more than one image, each command ar‐
2833 gument defines a single image
2834 name for each image of the selection.
2835 (equivalent to shortcut command 'nm').
2836
2837 Example:
2838 [#1] image.jpg name image blur[image] 2
2839
2840 Tutorial: https://gmic.eu/oldtutorial/_name.shtml
2841
2842 rm (+):
2843 Shortcut for command 'remove'.
2844
2845 remove (+):
2846
2847 Remove selected images.
2848 (equivalent to shortcut command 'rm').
2849
2850 Example:
2851 [#1] image.jpg split x remove[30%-70%] append x
2852 [#2] image.jpg split x remove[0-50%:2] append x
2853
2854 remove_duplicates:
2855
2856 Remove duplicates images in the selected images list.
2857
2858 Example:
2859 [#1] (1,2,3,4,2,4,3,1,3,4,2,1) split x remove_duplicates append x
2860
2861 remove_empty:
2862
2863 Remove empty images in the selected image list.
2864
2865 rmn:
2866 Shortcut for command 'remove_named'.
2867
2868 remove_named:
2869 "name1","name2",...
2870
2871 Remove all images with specified names from the list of images.
2872 Does nothing if no images with those names exist.
2873 (equivalent to shortcut command 'rmn').
2874
2875 rv (+):
2876 Shortcut for command 'reverse'.
2877
2878 reverse (+):
2879
2880 Reverse positions of selected images.
2881 (equivalent to shortcut command 'rv').
2882
2883 Example:
2884 [#1] image.jpg split x,3 reverse[-2,-1]
2885 [#2] image.jpg split x,-16 reverse[50%-100%] append x
2886
2887 sort_list:
2888 _ordering={ + | - },_criterion
2889
2890 Sort list of selected images according to the specified image cri‐
2891 terion.
2892
2893 Default values: 'ordering=+', 'criterion=i'.
2894
2895 Example:
2896 [#1] (1;4;7;3;9;2;4;7;6;3;9;1;0;3;3;2) split y sort_list +,i ap‐
2897 pend y
2898
2899 12.4. Mathematical Operators
2900 ----------------------
2901
2902 abs (+):
2903
2904 Compute the pointwise absolute values of selected images.
2905
2906 Example:
2907 [#1] image.jpg +sub {ia} abs[-1]
2908 [#2] 300,1,1,1,'cos(20*x/w)' +abs display_graph 400,300
2909
2910 acos (+):
2911
2912 Compute the pointwise arccosine of selected images.
2913
2914 Example:
2915 [#1] image.jpg +normalize -1,1 acos[-1]
2916 [#2] 300,1,1,1,'cut(x/w+0.1*u,0,1)' +acos display_graph 400,300
2917
2918 Tutorial: https://gmic.eu/oldtutorial/trigometric-and-inverse-
2919 trigometric-commands.shtml
2920
2921 acosh (+):
2922
2923 Compute the pointwise hyperbolic arccosine of selected images.
2924
2925 + (+):
2926 Shortcut for command 'add'.
2927
2928 add (+):
2929 value[%] |
2930 [image] |
2931 'formula' |
2932 (no arg)
2933
2934 Add specified value, image or mathematical expression to selected
2935 images, or compute the pointwise sum of selected images.
2936 (equivalent to shortcut command '+').
2937
2938 Example:
2939 [#1] image.jpg +add 30% cut 0,255
2940 [#2] image.jpg +blur 5 normalize 0,255 add[1] [0]
2941 [#3] image.jpg add '80*cos(80*(x/w-0.5)*(y/w-0.5)+c)' cut 0,255
2942 [#4] image.jpg repeat 9 +rotate[0] {$>*36},1,0,50%,50% done add
2943 div 10
2944
2945 & (+):
2946 Shortcut for command 'and'.
2947
2948 and (+):
2949 value[%] |
2950 [image] |
2951 'formula' |
2952 (no arg)
2953
2954 Compute the bitwise AND of selected images with specified value,
2955 image or mathematical expression, or compute the pointwise sequential
2956 bitwise AND of selected images.
2957 (equivalent to shortcut command '&').
2958
2959 Example:
2960 [#1] image.jpg and {128+64}
2961 [#2] image.jpg +mirror x and
2962
2963 argmax:
2964
2965 Compute the argmax of selected images. Returns a single image
2966 with each pixel value being the index of the input image with maxi‐
2967 mal value.
2968
2969 Example:
2970 [#1] image.jpg sample lena,lion,square +argmax
2971
2972 argmaxabs:
2973
2974 Compute the argmaxabs of selected images. Returns a single image
2975 with each pixel value being the index of the input image with max‐
2976 abs value.
2977
2978 argmin:
2979
2980 Compute the argmin of selected images. Returns a single image
2981 with each pixel value being the index of the input image with mini‐
2982 mal value.
2983
2984 Example:
2985 [#1] image.jpg sample lena,lion,square +argmin
2986
2987 argminabs:
2988
2989 Compute the argminabs of selected images. Returns a single image
2990 with each pixel value being the index of the input image with
2991 minabs value.
2992
2993 asin (+):
2994
2995 Compute the pointwise arcsine of selected images.
2996
2997 Example:
2998 [#1] image.jpg +normalize -1,1 asin[-1]
2999 [#2] 300,1,1,1,'cut(x/w+0.1*u,0,1)' +asin display_graph 400,300
3000
3001 Tutorial: https://gmic.eu/oldtutorial/trigometric-and-inverse-
3002 trigometric-commands.shtml
3003
3004 asinh (+):
3005
3006 Compute the pointwise hyperbolic arcsine of selected images.
3007
3008 atan (+):
3009
3010 Compute the pointwise arctangent of selected images.
3011
3012 Example:
3013 [#1] image.jpg +normalize 0,8 atan[-1]
3014 [#2] 300,1,1,1,'4*x/w+u' +atan display_graph 400,300
3015
3016 Tutorial: https://gmic.eu/oldtutorial/trigometric-and-inverse-
3017 trigometric-commands.shtml
3018
3019 atan2 (+):
3020 [x_argument]
3021
3022 Compute the pointwise oriented arctangent of selected images.
3023 Each selected image is regarded as the y-argument of the arctangent
3024 function, while the
3025 specified image gives the corresponding x-argument.
3026
3027 Example:
3028 [#1] (-1,1) (-1;1) resize 400,400,1,1,3 atan2[1] [0] keep[1] mod
3029 {pi/8}
3030
3031 Tutorial: https://gmic.eu/oldtutorial/trigometric-and-inverse-
3032 trigometric-commands.shtml
3033
3034 atanh (+):
3035
3036 Compute the pointwise hyperbolic arctangent of selected images.
3037
3038 << (+):
3039 Shortcut for command 'bsl'.
3040
3041 bsl (+):
3042 value[%] |
3043 [image] |
3044 'formula' |
3045 (no arg)
3046
3047 Compute the bitwise left shift of selected images with specified
3048 value, image or mathematical expression, or compute the pointwise se‐
3049 quential bitwise left shift of selected images.
3050 (equivalent to shortcut command '<<').
3051
3052 Example:
3053 [#1] image.jpg bsl 'round(3*x/w,0)' cut 0,255
3054
3055 >> (+):
3056 Shortcut for command 'bsr'.
3057
3058 bsr (+):
3059 value[%] |
3060 [image] |
3061 'formula' |
3062 (no arg)
3063
3064 Compute the bitwise right shift of selected images with specified
3065 value, image or mathematical expression, or compute the pointwise se‐
3066 quential bitwise right shift of selected images.
3067 (equivalent to shortcut command '>>').
3068
3069 Example:
3070 [#1] image.jpg bsr 'round(3*x/w,0)' cut 0,255
3071
3072 cos (+):
3073
3074 Compute the pointwise cosine of selected images.
3075
3076 Example:
3077 [#1] image.jpg +normalize 0,{2*pi} cos[-1]
3078 [#2] 300,1,1,1,'20*x/w+u' +cos display_graph 400,300
3079
3080 Tutorial: https://gmic.eu/oldtutorial/trigometric-and-inverse-
3081 trigometric-commands.shtml
3082
3083 cosh (+):
3084
3085 Compute the pointwise hyperbolic cosine of selected images.
3086
3087 Example:
3088 [#1] image.jpg +normalize -3,3 cosh[-1]
3089 [#2] 300,1,1,1,'4*x/w+u' +cosh display_graph 400,300
3090
3091 / (+):
3092 Shortcut for command 'div'.
3093
3094 div (+):
3095 value[%] |
3096 [image] |
3097 'formula' |
3098 (no arg)
3099
3100 Divide selected images by specified value, image or mathematical
3101 expression, or compute the pointwise quotient of selected images.
3102 (equivalent to shortcut command '/').
3103
3104 Example:
3105 [#1] image.jpg div '1+abs(cos(x/10)*sin(y/10))'
3106 [#2] image.jpg +norm add[-1] 1 +div
3107
3108 div_complex:
3109 [divider_real,divider_imag],_epsilon>=0
3110
3111 Perform division of the selected complex pairs (real1,imag1,...,re‐
3112 alN,imagN) of images by
3113 specified complex pair of images (divider_real,divider_imag).
3114 In complex pairs, the real image must be always located before the
3115 imaginary image in the image list.
3116
3117 Default value: 'epsilon=1e-8'.
3118
3119 == (+):
3120 Shortcut for command 'eq'.
3121
3122 eq (+):
3123 value[%] |
3124 [image] |
3125 'formula' |
3126 (no arg)
3127
3128 Compute the boolean equality of selected images with specified
3129 value, image or mathematical expression, or compute the boolean equal‐
3130 ity of selected images.
3131 (equivalent to shortcut command '==').
3132
3133 Example:
3134 [#1] image.jpg round 40 eq {round(ia,40)}
3135 [#2] image.jpg +mirror x eq
3136
3137 exp (+):
3138
3139 Compute the pointwise exponential of selected images.
3140
3141 Example:
3142 [#1] image.jpg +normalize 0,2 exp[-1]
3143 [#2] 300,1,1,1,'7*x/w+u' +exp display_graph 400,300
3144
3145 >= (+):
3146 Shortcut for command 'ge'.
3147
3148 ge (+):
3149 value[%] |
3150 [image] |
3151 'formula' |
3152 (no arg)
3153
3154 Compute the boolean 'greater or equal than' of selected images with
3155 specified value, image
3156 or mathematical expression, or compute the boolean 'greater or
3157 equal than' of selected images.
3158 (equivalent to shortcut command '>=').
3159
3160 Example:
3161 [#1] image.jpg ge {ia}
3162 [#2] image.jpg +mirror x ge
3163
3164 > (+):
3165 Shortcut for command 'gt'.
3166
3167 gt (+):
3168 value[%] |
3169 [image] |
3170 'formula' |
3171 (no arg)
3172
3173 Compute the boolean 'greater than' of selected images with speci‐
3174 fied value, image or mathematical expression, or compute the boolean
3175 'greater than' of selected images.
3176 (equivalent to shortcut command '>').
3177
3178 Example:
3179 [#1] image.jpg gt {ia}
3180 [#2] image.jpg +mirror x gt
3181
3182 <= (+):
3183 Shortcut for command 'le'.
3184
3185 le (+):
3186 value[%] |
3187 [image] |
3188 'formula' |
3189 (no arg)
3190
3191 Compute the boolean 'less or equal than' of selected images with
3192 specified value, image or mathematical expression, or compute the bool‐
3193 ean 'less or equal than' of selected images.
3194 (equivalent to shortcut command '<=').
3195
3196 Example:
3197 [#1] image.jpg le {ia}
3198 [#2] image.jpg +mirror x le
3199
3200 < (+):
3201 Shortcut for command 'lt'.
3202
3203 lt (+):
3204 value[%] |
3205 [image] |
3206 'formula' |
3207 (no arg)
3208
3209 Compute the boolean 'less than' of selected images with specified
3210 value, image or mathematical expression, or compute the boolean 'less
3211 than' of selected images.
3212 (equivalent to shortcut command '<').
3213
3214 Example:
3215 [#1] image.jpg lt {ia}
3216 [#2] image.jpg +mirror x lt
3217
3218 log (+):
3219
3220 Compute the pointwise base-e logarithm of selected images.
3221
3222 Example:
3223 [#1] image.jpg +add 1 log[-1]
3224 [#2] 300,1,1,1,'7*x/w+u' +log display_graph 400,300
3225
3226 log10 (+):
3227
3228 Compute the pointwise base-10 logarithm of selected images.
3229
3230 Example:
3231 [#1] image.jpg +add 1 log10[-1]
3232 [#2] 300,1,1,1,'7*x/w+u' +log10 display_graph 400,300
3233
3234 log2 (+):
3235
3236 Compute the pointwise base-2 logarithm of selected images
3237
3238 Example:
3239 [#1] image.jpg +add 1 log2[-1]
3240 [#2] 300,1,1,1,'7*x/w+u' +log2 display_graph 400,300
3241
3242 max (+):
3243 value[%] |
3244 [image] |
3245 'formula' |
3246 (no arg)
3247
3248 Compute the maximum between selected images and specified value,
3249 image or mathematical expression, or compute the pointwise maxima be‐
3250 tween selected images.
3251
3252 Example:
3253 [#1] image.jpg +mirror x max
3254 [#2] image.jpg max 'R=((x/w-0.5)^2+(y/h-0.5)^2)^0.5;255*R'
3255
3256 maxabs (+):
3257 value[%] |
3258 [image] |
3259 'formula' |
3260 (no arg)
3261
3262 Compute the maxabs between selected images and specified value, im‐
3263 age or mathematical expression, or compute the pointwise maxabs between
3264 selected images.
3265
3266 m/ (+):
3267 Shortcut for command 'mdiv'.
3268
3269 mdiv (+):
3270 value[%] |
3271 [image] |
3272 'formula' |
3273 (no arg)
3274
3275 Compute the matrix division of selected matrices/vectors by speci‐
3276 fied value, image or mathematical expression, or compute the matrix di‐
3277 vision of selected images.
3278 (equivalent to shortcut command 'm/').
3279
3280 med:
3281
3282 Compute the median of selected images.
3283
3284 Example:
3285 [#1] image.jpg sample lena,lion,square +med
3286
3287 min (+):
3288 value[%] |
3289 [image] |
3290 'formula' |
3291 (no arg)
3292
3293 Compute the minimum between selected images and specified value,
3294 image or mathematical expression, or compute the pointwise minima be‐
3295 tween selected images.
3296
3297 Example:
3298 [#1] image.jpg +mirror x min
3299 [#2] image.jpg min 'R=((x/w-0.5)^2+(y/h-0.5)^2)^0.5;255*R'
3300
3301 minabs (+):
3302 value[%] |
3303 [image] |
3304 'formula' |
3305 (no arg)
3306
3307 Compute the minabs between selected images and specified value, im‐
3308 age or mathematical expression, or compute the pointwise minabs between
3309 selected images.
3310
3311 % (+):
3312 Shortcut for command 'mod'.
3313
3314 mod (+):
3315 value[%] |
3316 [image] |
3317 'formula' |
3318 (no arg)
3319
3320 Compute the modulo of selected images with specified value, image
3321 or mathematical expression, or compute the pointwise sequential modulo
3322 of selected images.
3323 (equivalent to shortcut command '%').
3324
3325 Example:
3326 [#1] image.jpg +mirror x mod
3327 [#2] image.jpg mod 'R=((x/w-0.5)^2+(y/h-0.5)^2)^0.5;255*R'
3328
3329 m* (+):
3330 Shortcut for command 'mmul'.
3331
3332 mmul (+):
3333 value[%] |
3334 [image] |
3335 'formula' |
3336 (no arg)
3337
3338 Compute the matrix right multiplication of selected matrices/vec‐
3339 tors by specified value, image or mathematical expression, or compute
3340 the matrix right multiplication of selected images.
3341 (equivalent to shortcut command 'm*').
3342
3343 Example:
3344 [#1] (0,1,0;0,0,1;1,0,0) (1;2;3) +mmul
3345
3346 * (+):
3347 Shortcut for command 'mul'.
3348
3349 mul (+):
3350 value[%] |
3351 [image] |
3352 'formula' |
3353 (no arg)
3354
3355 Multiply selected images by specified value, image or mathematical
3356 expression, or compute the pointwise product of selected images.
3357 (equivalent to shortcut command '*').
3358
3359 See also: add, sub, div.
3360
3361 Example:
3362 [#1] image.jpg +mul 2 cut 0,255
3363 [#2] image.jpg (1,2,3,4,5,6,7,8) ri[-1] [0] mul[0] [-1]
3364 [#3] image.jpg mul '1-3*abs(x/w-0.5)' cut 0,255
3365 [#4] image.jpg +luminance negate[-1] +mul
3366
3367 mul_channels:
3368 value1,_value2,...,_valueN
3369
3370 Multiply channels of selected images by specified sequence of val‐
3371 ues.
3372
3373 Example:
3374 [#1] image.jpg +mul_channels 1,0.5,0.8
3375
3376 mul_complex:
3377 [multiplier_real,multiplier_imag]
3378
3379 Perform multiplication of the selected complex pairs
3380 (real1,imag1,...,realN,imagN) of images by
3381 specified complex pair of images (multiplier_real,multiplier_imag).
3382 In complex pairs, the real image must be always located before the
3383 imaginary image in the image list.
3384
3385 != (+):
3386 Shortcut for command 'neq'.
3387
3388 neq (+):
3389 value[%] |
3390 [image] |
3391 'formula' |
3392 (no arg)
3393
3394 Compute the boolean inequality of selected images with specified
3395 value, image or mathematical expression, or compute the boolean in‐
3396 equality of selected images.
3397 (equivalent to shortcut command '!=').
3398
3399 Example:
3400 [#1] image.jpg round 40 neq {round(ia,40)}
3401
3402 | (+):
3403 Shortcut for command 'or'.
3404
3405 or (+):
3406 value[%] |
3407 [image] |
3408 'formula' |
3409 (no arg)
3410
3411 Compute the bitwise OR of selected images with specified value, im‐
3412 age or mathematical expression, or compute the pointwise sequential
3413 bitwise OR of selected images.
3414 (equivalent to shortcut command '|').
3415
3416 Example:
3417 [#1] image.jpg or 128
3418 [#2] image.jpg +mirror x or
3419
3420 ^ (+):
3421 Shortcut for command 'pow'.
3422
3423 pow (+):
3424 value[%] |
3425 [image] |
3426 'formula' |
3427 (no arg)
3428
3429 Raise selected images to the power of specified value, image or
3430 mathematical expression, or compute the pointwise sequential powers of
3431 selected images.
3432 (equivalent to shortcut command '^').
3433
3434 Example:
3435 [#1] image.jpg div 255 +pow 0.5 mul 255
3436 [#2] image.jpg gradient pow 2 add pow 0.2
3437
3438 rol (+):
3439 value[%] |
3440 [image] |
3441 'formula' |
3442 (no arg)
3443
3444 Compute the bitwise left rotation of selected images with specified
3445 value, image or mathematical expression, or compute the pointwise se‐
3446 quential bitwise left rotation of selected images.
3447
3448 Example:
3449 [#1] image.jpg rol 'round(3*x/w,0)' cut 0,255
3450
3451 ror (+):
3452 value[%] |
3453 [image] |
3454 'formula' |
3455 (no arg)
3456
3457 Compute the bitwise right rotation of selected images with speci‐
3458 fied value, image or mathematical expression, or compute the pointwise
3459 sequential bitwise right rotation of selected images.
3460
3461 Example:
3462 [#1] image.jpg ror 'round(3*x/w,0)' cut 0,255
3463
3464 sign (+):
3465
3466 Compute the pointwise sign of selected images.
3467
3468 Example:
3469 [#1] image.jpg +sub {ia} sign[-1]
3470 [#2] 300,1,1,1,'cos(20*x/w+u)' +sign display_graph 400,300
3471
3472 sin (+):
3473
3474 Compute the pointwise sine of selected images.
3475
3476 Example:
3477 [#1] image.jpg +normalize 0,{2*pi} sin[-1]
3478 [#2] 300,1,1,1,'20*x/w+u' +sin display_graph 400,300
3479
3480 Tutorial: https://gmic.eu/oldtutorial/trigometric-and-inverse-
3481 trigometric-commands.shtml
3482
3483 sinc (+):
3484
3485 Compute the pointwise sinc function of selected images.
3486
3487 Example:
3488 [#1] image.jpg +normalize {-2*pi},{2*pi} sinc[-1]
3489 [#2] 300,1,1,1,'20*x/w+u' +sinc display_graph 400,300
3490
3491 sinh (+):
3492
3493 Compute the pointwise hyperbolic sine of selected images.
3494
3495 Example:
3496 [#1] image.jpg +normalize -3,3 sinh[-1]
3497 [#2] 300,1,1,1,'4*x/w+u' +sinh display_graph 400,300
3498
3499 sqr (+):
3500
3501 Compute the pointwise square function of selected images.
3502
3503 Example:
3504 [#1] image.jpg +sqr
3505 [#2] 300,1,1,1,'40*x/w+u' +sqr display_graph 400,300
3506
3507 sqrt (+):
3508
3509 Compute the pointwise square root of selected images.
3510
3511 Example:
3512 [#1] image.jpg +sqrt
3513 [#2] 300,1,1,1,'40*x/w+u' +sqrt display_graph 400,300
3514
3515 - (+):
3516 Shortcut for command 'sub'.
3517
3518 sub (+):
3519 value[%] |
3520 [image] |
3521 'formula' |
3522 (no arg)
3523
3524 Subtract specified value, image or mathematical expression to se‐
3525 lected images, or compute the pointwise difference of selected images.
3526 (equivalent to shortcut command '-').
3527
3528 Example:
3529 [#1] image.jpg +sub 30% cut 0,255
3530 [#2] image.jpg +mirror x sub[-1] [0]
3531 [#3] image.jpg sub 'i(w/2+0.9*(x-w/2),y)'
3532 [#4] image.jpg +mirror x sub
3533
3534 tan (+):
3535
3536 Compute the pointwise tangent of selected images.
3537
3538 Example:
3539 [#1] image.jpg +normalize {-0.47*pi},{0.47*pi} tan[-1]
3540 [#2] 300,1,1,1,'20*x/w+u' +tan display_graph 400,300
3541
3542 Tutorial: https://gmic.eu/oldtutorial/trigometric-and-inverse-
3543 trigometric-commands.shtml
3544
3545 tanh (+):
3546
3547 Compute the pointwise hyperbolic tangent of selected images.
3548
3549 Example:
3550 [#1] image.jpg +normalize -3,3 tanh[-1]
3551 [#2] 300,1,1,1,'4*x/w+u' +tanh display_graph 400,300
3552
3553 xor (+):
3554 value[%] |
3555 [image] |
3556 'formula' |
3557 (no arg)
3558
3559 Compute the bitwise XOR of selected images with specified value,
3560 image or mathematical expression, or compute the pointwise sequential
3561 bitwise XOR of selected images.
3562
3563 Example:
3564 [#1] image.jpg xor 128
3565 [#2] image.jpg +mirror x xor
3566
3567 12.5. Values Manipulation
3568 -------------------
3569
3570 apply_curve:
3571 0<=smoothness<=1,x0,y0,x1,y1,x2,y2,...,xN,yN
3572
3573 Apply curve transformation to image values.
3574
3575 Default values: 'smoothness=1', 'x0=0', 'y0=100'.
3576
3577 Example:
3578 [#1] image.jpg +apply_curve 1,0,0,128,255,255,0
3579
3580 apply_gamma:
3581 gamma>=0
3582
3583 Apply gamma correction to selected images.
3584
3585 Example:
3586 [#1] image.jpg +apply_gamma 2
3587
3588 balance_gamma:
3589 _ref_color1,...
3590
3591 Compute gamma-corrected color balance of selected image, with re‐
3592 spect to specified reference color.
3593
3594 Default value: 'ref_color1=128'.
3595
3596 Example:
3597 [#1] image.jpg +balance_gamma 128,64,64
3598
3599 cast:
3600 datatype_source,datatype_target
3601
3602 Cast datatype of image buffer from specified source type to speci‐
3603 fied target type.
3604 'datatype_source' and 'datatype_target' can be { uchar | char |
3605 ushort | short | uint | int | uint64 | int64 | float | double }.
3606
3607 complex2polar:
3608
3609 Compute complex to polar transforms of selected images.
3610
3611 Example:
3612 [#1] image.jpg +fft complex2polar[-2,-1] log[-2] shift[-2]
3613 50%,50%,0,0,2 remove[-1]
3614
3615 compress_clut:
3616 _max_error>0,_avg_error>0,_max_nbpoints>=8 | 0 (unlimited),_er‐
3617 ror_metric={ 0=L2-norm | 1=deltaE_1976 | 2=deltaE_2000 },_reconstruc‐
3618 tion_colorspace={ 0=srgb | 1=rgb | 2=lab },_try_rbf_first={ 0 | 1 }
3619
3620 Compress selected color LUTs as sequences of colored keypoints.
3621
3622 Default values: 'max_error=1.5', 'avg_error=0.75',
3623 'max_nb_points=2048', 'error_metric=2', 'reconstruction_colorspace=0'
3624 and 'try_rbf_first=1'.
3625
3626 compress_rle:
3627 _is_binary_data={ 0 | 1 },_maximum_sequence_length>=0
3628
3629 Compress selected images as 2xN data matrices, using RLE algorithm.
3630 Set 'maximum_sequence_length=0' to disable maximum length con‐
3631 straint.
3632
3633 Default values: 'is_binary_data=0' and 'maximum_sequence_length=0'.
3634
3635 Example:
3636 [#1] image.jpg resize2dy 100 quantize 4 round +compress_rle ,
3637 +decompress_rle[-1]
3638
3639 cumulate (+):
3640 { x | y | z | c }...{ x | y | z | c } |
3641 (no arg)
3642
3643 Compute the cumulative function of specified image data, optionally
3644 along the specified axes.
3645
3646 Example:
3647 [#1] image.jpg +histogram +cumulate[-1] display_graph[-2,-1]
3648 400,300,3
3649
3650 c (+):
3651 Shortcut for command 'cut'.
3652
3653 cut (+):
3654 { value0[%] | [image0] },{ value1[%] | [image1] } |
3655 [image]
3656
3657 Cut values of selected images in specified range.
3658 (equivalent to shortcut command 'c').
3659
3660 Example:
3661 [#1] image.jpg +add 30% cut[-1] 0,255
3662 [#2] image.jpg +cut 25%,75%
3663
3664 decompress_clut:
3665 _width>0,_height>0,_depth>0,_reconstruction_colorspace={ 0=srgb |
3666 1=rgb | 2=lab }
3667
3668 Decompress selected colored keypoints into 3D CLUTs, using a mixed
3669 RBF/PDE approach.
3670
3671 Default values: 'width=height=depth=33' and 'reconstruction_col‐
3672 orspace=0'.
3673
3674 decompress_clut_rbf:
3675 _width>0,_height>0,_depth>0,_reconstruction_colorspace={ 0=srgb |
3676 1=rgb | 2=lab }
3677
3678 Decompress selected colored keypoints into 3D CLUTs, using RBF thin
3679 plate spline interpolation.
3680
3681 Default value: 'width=height=depth=33' and 'reconstruction_col‐
3682 orspace=0'.
3683
3684 decompress_clut_pde:
3685 _width>0,_height>0,_depth>0,_reconstruction_colorspace={ 0=srgb |
3686 1=rgb | 2=lab }
3687
3688 Decompress selected colored keypoints into 3D CLUTs, using multi‐
3689 scale diffusion PDE's.
3690
3691 Default values: 'width=height=depth=33' and 'reconstruction_col‐
3692 orspace=0'.
3693
3694 decompress_rle:
3695
3696 Decompress selected data vectors, using RLE algorithm.
3697
3698 discard (+):
3699 _value1,_value2,... |
3700 { x | y | z | c}...{ x | y | z | c},_value1,_value2,... |
3701 (no arg)
3702
3703 Discard specified values in selected images or discard neighboring
3704 duplicate values,
3705 optionally only for the values along the first of a specified axis.
3706 If no arguments are specified, neighboring duplicate values are
3707 discarded.
3708 If all pixels of a selected image are discarded, an empty image is
3709 returned.
3710
3711 Example:
3712 [#1] (1;2;3;4;3;2;1) +discard 2
3713 [#2] (1,2,2,3,3,3,4,4,4,4) +discard x
3714
3715 eigen2tensor:
3716
3717 Recompose selected pairs of eigenvalues/eigenvectors as 2x2 or 3x3
3718 tensor fields.
3719
3720 Tutorial: https://gmic.eu/oldtutorial/_eigen2tensor.shtml
3721
3722 endian (+):
3723 _datatype
3724
3725 Reverse data endianness of selected images, eventually considering
3726 the pixel being of the specified datatype.
3727 'datatype' can be { bool | uchar | char | ushort | short | uint |
3728 int | uint64 | int64 | float | double }.
3729 This command does nothing for 'bool', 'uchar' and 'char' datatypes.
3730
3731 equalize (+):
3732 _nb_levels>0[%],_value_min[%],_value_max[%]
3733
3734 Equalize histograms of selected images.
3735 If value range is specified, the equalization is done only for pix‐
3736 els in the specified
3737 value range.
3738
3739 Default values: 'nb_levels=256', 'value_min=0%' and
3740 'value_max=100%'.
3741
3742 Example:
3743 [#1] image.jpg +equalize
3744 [#2] image.jpg +equalize 4,0,128
3745
3746 f (+):
3747 Shortcut for command 'fill'.
3748
3749 fill (+):
3750 value1,_value2,... |
3751 [image] |
3752 'formula'
3753
3754 Fill selected images with values read from the specified value
3755 list, existing image
3756 or mathematical expression. Single quotes may be omitted in 'for‐
3757 mula'.
3758 (equivalent to shortcut command 'f').
3759
3760 Example:
3761 [#1] 4,4 fill 1,2,3,4,5,6,7
3762 [#2] 4,4 (1,2,3,4,5,6,7) fill[-2] [-1]
3763 [#3] 400,400,1,3 fill "X=x-w/2; Y=y-h/2; R=sqrt(X^2+Y^2);
3764 a=atan2(Y,X);
3765 if(R<=180,255*abs(cos(c+200*(x/w-0.5)*(y/h-0.5))),850*(a%(0.1*(c+1))))"
3766
3767 Tutorial: https://gmic.eu/oldtutorial/_fill.shtml
3768
3769 index (+):
3770 { [palette] | palette_name },0<=_dithering<=1,_map_palette={ 0 |
3771 1 }
3772
3773 Index selected vector-valued images by specified vector-valued pal‐
3774 ette.
3775 'palette_name' can be { default | hsv | lines | hot | cool | jet |
3776 flag | cube | rainbow | algae | amp |balance | curl | deep | delta |
3777 dense | diff | haline | ice | matter | oxy | phase | rain |
3778 solar | speed | tarn |tempo | thermal | topo | turbid | aurora |
3779 hocuspocus | srb2 | uzebox }
3780
3781 Default values: 'dithering=0' and 'map_palette=0'.
3782
3783 Example:
3784 [#1] image.jpg +index 1,1,1
3785 [#2] image.jpg (0;255;255^0;128;255^0;0;255) +index[-2] [-1],1,1
3786
3787 Tutorial: https://gmic.eu/oldtutorial/_index.shtml
3788
3789 ir:
3790 Shortcut for command 'inrange'.
3791
3792 inrange:
3793 min[%],max[%],_include_min_boundary={ 0=no | 1=yes },_in‐
3794 clude_max_boundary={ 0=no | 1=yes }
3795
3796 Detect pixels whose values are in specified range '[min,max]', in
3797 selected images.
3798 (equivalent to shortcut command 'ir').
3799
3800 Default value: 'include_min_boundary=include_max_boundary=1'.
3801
3802 Example:
3803 [#1] image.jpg +inrange 25%,75%
3804
3805 map (+):
3806 [palette],_boundary_conditions |
3807 palette_name,_boundary_conditions
3808
3809 Map specified vector-valued palette to selected indexed scalar im‐
3810 ages.
3811 'palette_name' can be { default | hsv | lines | hot | cool | jet |
3812 flag | cube | rainbow | algae | amp | balance | curl | deep | delta |
3813 dense | diff | gray | haline | ice | matter | oxy | phase
3814 | rain | solar | speed | tarn | tempo | thermal | topo | turbid |
3815 aurora | hocuspocus | srb2 | uzebox }
3816 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
3817 | 3=mirror }.
3818
3819 Default value: 'boundary_conditions=0'.
3820
3821 Example:
3822 [#1] image.jpg +luminance map[-1] 3
3823 [#2] image.jpg +rgb2ycbcr split[-1] c (0,255,0) resize[-1]
3824 256,1,1,1,3 map[-4] [-1] remove[-1] append[-3--1] c ycbcr2rgb[-1]
3825
3826 Tutorial: https://gmic.eu/oldtutorial/_map.shtml
3827
3828 mix_channels:
3829 (a00,...,aMN) |
3830 [matrix]
3831
3832 Apply specified matrix to channels of selected images.
3833
3834 Example:
3835 [#1] image.jpg +mix_channels (0,1,0;1,0,0;0,0,1)
3836
3837 negate:
3838 base_value |
3839 (no arg)
3840
3841 Negate image values.
3842
3843 Default value: 'base_value=(undefined)'.
3844
3845 Example:
3846 [#1] image.jpg +negate
3847
3848 noise (+):
3849 std_deviation>=0[%],_noise_type
3850
3851 Add random noise to selected images.
3852 'noise_type' can be { 0=gaussian | 1=uniform | 2=salt&pepper |
3853 3=poisson | 4=rice }.
3854
3855 Default value: 'noise_type=0'.
3856
3857 Example:
3858 [#1] image.jpg +noise[0] 50,0 +noise[0] 50,1 +noise[0] 10,2 cut
3859 0,255
3860 [#2] 300,300,1,3 [0] noise[0] 20,0 noise[1] 20,1 +histogram 100
3861 display_graph[-2,-1] 400,300,3
3862
3863 noise_perlin:
3864 _scale_x[%]>0,_scale_y[%]>0,_scale_z[%]>0,_seed_x,_seed_y,_seed_z
3865
3866 Render 2D or 3D Perlin noise on selected images, from specified co‐
3867 ordinates.
3868 The Perlin noise is a specific type of smooth noise,
3869 described here : https://en.wikipedia.org/wiki/Perlin_noise.
3870
3871 Default values: 'scale_x=scale_y=scale_z=16' and
3872 'seed_x=seed_y=seed_z=0'.
3873
3874 Example:
3875 [#1] 500,500,1,3 noise_perlin ,
3876
3877 noise_poissondisk:
3878 _radius[%]>0,_max_sample_attempts>0
3879
3880 Add poisson disk sampling noise to selected images.
3881 Implements the algorithm from the article "Fast Poisson Disk Sam‐
3882 pling in Arbitrary Dimensions",
3883 by Robert Bridson (SIGGRAPH'2007).
3884
3885 Default values: 'radius=8' and 'max_sample_attempts=30'.
3886
3887 Example:
3888 [#1] 300,300 noise_poissondisk 8
3889
3890 normp:
3891 p>=0
3892
3893 Compute the pointwise Lp-norm norm of vector-valued pixels in se‐
3894 lected images.
3895
3896 Default value: 'p=2'.
3897
3898 Example:
3899 [#1] image.jpg +normp[0] 0 +normp[0] 1 +normp[0] 2 +normp[0] inf
3900
3901 norm:
3902
3903 Compute the pointwise euclidean norm of vector-valued pixels in se‐
3904 lected images.
3905
3906 Example:
3907 [#1] image.jpg +norm
3908
3909 Tutorial: https://gmic.eu/oldtutorial/_norm.shtml
3910
3911 n (+):
3912 Shortcut for command 'normalize'.
3913
3914 normalize (+):
3915 { value0[%] | [image0] },{ value1[%] | [image1] },_con‐
3916 stant_case_ratio |
3917 [image]
3918
3919 Linearly normalize values of selected images in specified range.
3920 (equivalent to shortcut command 'n').
3921
3922 Example:
3923 [#1] image.jpg split x,2 normalize[-1] 64,196 append x
3924
3925 Tutorial: https://gmic.eu/oldtutorial/_normalize.shtml
3926
3927 normalize_sum:
3928
3929 Normalize selected images with a unitary sum.
3930
3931 Example:
3932 [#1] image.jpg +histogram normalize_sum[-1] display_graph[-1]
3933 400,300
3934
3935 not:
3936
3937 Apply boolean not operation on selected images.
3938
3939 Example:
3940 [#1] image.jpg +ge 50% +not[-1]
3941
3942 orientation:
3943
3944 Compute the pointwise orientation of vector-valued pixels in se‐
3945 lected images.
3946
3947 Example:
3948 [#1] image.jpg +orientation +norm[-2] negate[-1] mul[-2] [-1] re‐
3949 verse[-2,-1]
3950
3951 Tutorial: https://gmic.eu/oldtutorial/_orientation.shtml
3952
3953 oneminus:
3954
3955 For each selected image, compute one minus image.
3956
3957 Example:
3958 [#1] image.jpg normalize 0,1 +oneminus
3959
3960 otsu:
3961 _nb_levels>0
3962
3963 Hard-threshold selected images using Otsu's method.
3964 The computed thresholds are returned as a list of values in the
3965 status.
3966
3967 Default value: 'nb_levels=256'.
3968
3969 Example:
3970 [#1] image.jpg luminance +otsu ,
3971
3972 polar2complex:
3973
3974 Compute polar to complex transforms of selected images.
3975
3976 quantize:
3977 nb_levels>=1,_keep_values={ 0 | 1 },_quantization_type={ -1=me‐
3978 dian-cut | 0=k-means | 1=uniform }
3979
3980 Quantize selected images.
3981
3982 Default value: 'keep_values=1' and 'quantization_type=0'.
3983
3984 Example:
3985 [#1] image.jpg luminance +quantize 3
3986 [#2] 200,200,1,1,'cos(x/10)*sin(y/10)' +quantize[0] 6 +quan‐
3987 tize[0] 4 +quantize[0] 3 +quantize[0] 2
3988
3989 quantize_area:
3990 _min_area>0
3991
3992 Quantize selected images such that each flat region has an area
3993 greater or equal to 'min_area'.
3994
3995 Default value: 'min_area=10'.
3996
3997 Example:
3998 [#1] image.jpg quantize 3 +blur 1 round[-1] +quantize_area[-1] 2
3999
4000 rand (+):
4001 { value0[%] | [image0] },_{ value1[%] | [image1] } |
4002 [image]
4003
4004 Fill selected images with random values uniformly distributed in
4005 the specified range.
4006
4007 Example:
4008 [#1] 400,400,1,3 rand -10,10 +blur 10 sign[-1]
4009
4010 replace:
4011 source,target
4012
4013 Replace pixel values in selected images.
4014
4015 Example:
4016 [#1] (1;2;3;4) +replace 2,3
4017
4018 replace_inf:
4019 _expression
4020
4021 Replace all infinite values in selected images by specified expres‐
4022 sion.
4023
4024 Example:
4025 [#1] (0;1;2) log +replace_inf 2
4026
4027 replace_nan:
4028 _expression
4029
4030 Replace all NaN values in selected images by specified expression.
4031
4032 Example:
4033 [#1] (-1;0;2) sqrt +replace_nan 2
4034
4035 replace_naninf:
4036 _expression
4037
4038 Replace all NaN and infinite values in selected images by specified
4039 expression.
4040
4041 replace_seq:
4042 "search_seq","replace_seq"
4043
4044 Search and replace a sequence of values in selected images.
4045
4046 Example:
4047 [#1] (1;2;3;4;5) +replace_seq "2,3,4","7,8"
4048
4049 replace_str:
4050 "search_str","replace_str"
4051
4052 Search and replace a string in selected images (viewed as strings,
4053 i.e. sequences of character codes).
4054
4055 Example:
4056 [#1] ('"Hello there, how are you ?"') +replace_str "Hello
4057 there","Hi David"
4058
4059 round (+):
4060 rounding_value>=0,_rounding_type |
4061 (no arg)
4062
4063 Round values of selected images.
4064 'rounding_type' can be { -1=backward | 0=nearest | 1=forward }.
4065
4066 Default value: 'rounding_type=0'.
4067
4068 Example:
4069 [#1] image.jpg +round 100
4070 [#2] image.jpg mul {pi/180} sin +round
4071
4072 roundify:
4073 gamma>=0
4074
4075 Apply roundify transformation on float-valued data, with specified
4076 gamma.
4077
4078 Default value: 'gamma=0'.
4079
4080 Example:
4081 [#1] 1000 fill '4*x/w' repeat 5 +roundify[0] {$>*0.2} done append
4082 c display_graph 400,300
4083
4084 = (+):
4085 Shortcut for command 'set'.
4086
4087 set (+):
4088 value,_x[%],_y[%],_z[%],_c[%]
4089
4090 Set pixel value in selected images, at specified coordinates.
4091 (equivalent to shortcut command '=').
4092
4093 If specified coordinates are outside the image bounds, no action is
4094 performed.
4095
4096 Default values: 'x=y=z=c=0'.
4097
4098 Example:
4099 [#1] 2,2 set 1,0,0 set 2,1,0 set 3,0,1 set 4,1,1
4100 [#2] image.jpg repeat 10000 set
4101 255,{u(100)}%,{u(100)}%,0,{u(100)}% done
4102
4103 threshold:
4104 value[%],_is_soft={ 0 | 1 } :
4105
4106 Threshold values of selected images.
4107 'soft' can be { 0=hard-thresholding | 1=soft-thresholding }.
4108
4109 Default value: 'is_soft=0'.
4110
4111 Example:
4112 [#1] image.jpg +threshold[0] 50% +threshold[0] 50%,1
4113
4114 Tutorial: https://gmic.eu/oldtutorial/_threshold.shtml
4115
4116 vector2tensor:
4117
4118 Convert selected vector fields to corresponding tensor fields.
4119
4120 12.6. Colors
4121 ------
4122
4123 adjust_colors:
4124 -100<=_brightness<=100,-100<=_con‐
4125 trast<=100,-100<=_gamma<=100,-100<=_hue_shift<=100,-100<=_satura‐
4126 tion<=100,_value_min,_value_max
4127
4128 Perform a global adjustment of colors on selected images.
4129 Range of correct image values are considered to be in
4130 [value_min,value_max] (e.g. [0,255]).
4131 If 'value_min==value_max==0', value range is estimated from min/max
4132 values of selected images.
4133 Processed images have pixel values constrained in
4134 [value_min,value_max].
4135
4136 Default values: 'brightness=0', 'contrast=0', 'gamma=0',
4137 'hue_shift=0', 'saturation=0', 'value_min=value_max=0'.
4138
4139 Example:
4140 [#1] image.jpg +adjust_colors 0,30,0,0,30
4141
4142 ac:
4143 Shortcut for command 'apply_channels'.
4144
4145 apply_channels:
4146 "command",color_channels,_value_action={ 0=none | 1=cut | 2=nor‐
4147 malize }
4148
4149 Apply specified command on the chosen color channel(s) of each se‐
4150 lected images.
4151 (equivalent to shortcut command 'ac').
4152
4153 Argument 'color_channels' refers to a colorspace, and can be basi‐
4154 cally one of
4155 { all | rgba | [s]rgb | ryb | lrgb | ycbcr | lab | lch | hsv | hsi
4156 | hsl | cmy | cmyk | yiq }.
4157 You can also make the processing focus on a few particular channels
4158 of this colorspace,
4159 by setting 'color_channels' as 'colorspace_channel' (e.g. 'hsv_h'
4160 for the hue).
4161 All channel values are considered to be provided in the [0,255]
4162 range.
4163
4164 Default value: 'value_action=0'.
4165
4166 Example:
4167 [#1] image.jpg +apply_channels "equalize blur 2",ycbcr_cbcr
4168
4169 autoindex:
4170 nb_colors>0,0<=_dithering<=1,_method={ 0=median-cut | 1=k-means }
4171
4172 Index selected vector-valued images by adapted colormaps.
4173
4174 Default values: 'dithering=0' and 'method=1'.
4175
4176 Example:
4177 [#1] image.jpg +autoindex[0] 4 +autoindex[0] 8 +autoindex[0] 16
4178
4179 bayer2rgb:
4180 _GM_smoothness,_RB_smoothness1,_RB_smoothness2
4181
4182 Transform selected RGB-Bayer sampled images to color images.
4183
4184 Default values: 'GM_smoothness=RB_smoothness=1' and 'RB_smooth‐
4185 ness2=0.5'.
4186
4187 Example:
4188 [#1] image.jpg rgb2bayer 0 +bayer2rgb 1,1,0.5
4189
4190 deltaE:
4191 [image],_metric={ 0=deltaE_1976 | 1=deltaE_2000 },"_to_Lab_com‐
4192 mand"
4193
4194 Compute the CIE DeltaE color difference between selected images and
4195 specified [image].
4196 Argument 'to_Lab_command' is a command able to convert colors of
4197 [image] into a Lab representation.
4198
4199 Default values: 'metric=1' and 'to_Lab_command="srgb2lab"'.
4200
4201 Example:
4202 [#1] image.jpg +blur 2 +deltaE[0] [1],1,srgb2lab
4203
4204 cmy2rgb:
4205
4206 Convert color representation of selected images from CMY to RGB.
4207
4208 cmyk2rgb:
4209
4210 Convert color representation of selected images from CMYK to RGB.
4211
4212 colorblind:
4213 type={ 0=protanopia | 1=protanomaly | 2=deuteranopia | 3=deutera‐
4214 nomaly | 4=tritanopia | 5=tritanomaly | 6=achromatopsia | 7=achro‐
4215 matomaly }
4216
4217 Simulate color blindness vision.
4218
4219 Example:
4220 [#1] image.jpg +colorblind 0
4221
4222 colormap:
4223 nb_levels>=0,_method={ 0=median-cut | 1=k-means },_sort_vectors
4224
4225 Estimate best-fitting colormap with 'nb_colors' entries, to index
4226 selected images.
4227 Set 'nb_levels==0' to extract all existing colors of an image.
4228 'sort_vectors' can be { 0=unsorted | 1=by increasing norm | 2=by
4229 decreasing occurrence }.
4230
4231 Default value: 'method=1' and 'sort_vectors=1'.
4232
4233 Example:
4234 [#1] image.jpg +colormap[0] 4 +colormap[0] 8 +colormap[0] 16
4235
4236 Tutorial: https://gmic.eu/oldtutorial/_colormap.shtml
4237
4238 compose_channels:
4239
4240 Compose all channels of each selected image, using specified arith‐
4241 metic operator (+,-,or,min,...).
4242
4243 Default value: '1=+'.
4244
4245 Example:
4246 [#1] image.jpg +compose_channels and
4247
4248 Tutorial: https://gmic.eu/oldtutorial/_compose_channels.shtml
4249
4250 direction2rgb:
4251
4252 Compute RGB representation of selected 2D direction fields.
4253
4254 Example:
4255 [#1] image.jpg luminance gradient append c blur 2 orientation
4256 +direction2rgb
4257
4258 ditheredbw:
4259
4260 Create dithered B&W version of selected images.
4261
4262 Example:
4263 [#1] image.jpg +equalize ditheredbw[-1]
4264
4265 fc:
4266 Shortcut for command 'fill_color'.
4267
4268 fill_color:
4269 col1,...,colN
4270
4271 Fill selected images with specified color.
4272 (equivalent to shortcut command 'fc').
4273
4274 Example:
4275 [#1] image.jpg +fill_color 255,0,255
4276
4277 Tutorial: https://gmic.eu/oldtutorial/_fill_color.shtml
4278
4279 gradient2rgb:
4280 _is_orientation={ 0 | 1 }
4281
4282 Compute RGB representation of 2D gradient of selected images.
4283
4284 Default value: 'is_orientation=0'.
4285
4286 Example:
4287 [#1] image.jpg +gradient2rgb 0 equalize[-1]
4288
4289 hcy2rgb:
4290
4291 Convert color representation of selected images from HCY to RGB.
4292
4293 hsi2rgb:
4294
4295 Convert color representation of selected images from HSI to RGB.
4296
4297 hsi82rgb:
4298
4299 Convert color representation of selected images from HSI8 to RGB.
4300
4301 hsl2rgb:
4302
4303 Convert color representation of selected images from HSL to RGB.
4304
4305 hsl82rgb:
4306
4307 Convert color representation of selected images from HSL8 to RGB.
4308
4309 hsv2rgb:
4310
4311 Convert color representation of selected images from HSV to RGB.
4312
4313 Example:
4314 [#1] (0,360;0,360^0,0;1,1^1,1;1,1) resize 400,400,1,3,3 hsv2rgb
4315
4316 hsv82rgb:
4317
4318 Convert color representation of selected images from HSV8 to RGB.
4319
4320 int2rgb:
4321
4322 Convert color representation of selected images from INT24 to RGB.
4323
4324 jzazbz2rgb:
4325 illuminant={ 0=D50 | 1=D65 | 2=E } |
4326 (no arg)
4327
4328 Convert color representation of selected images from RGB to Jzazbz.
4329
4330 Default value: 'illuminant=2'.
4331
4332 jzazbz2xyz:
4333
4334 Convert color representation of selected images from RGB to XYZ.
4335
4336 lab2lch:
4337
4338 Convert color representation of selected images from Lab to Lch.
4339
4340 lab2rgb:
4341 illuminant={ 0=D50 | 1=D65 | 2=E } |
4342 (no arg)
4343
4344 Convert color representation of selected images from Lab to RGB.
4345
4346 Default value: 'illuminant=2'.
4347
4348 Example:
4349 [#1] (50,50;50,50^-3,3;-3,3^-3,-3;3,3) resize 400,400,1,3,3
4350 lab2rgb
4351
4352 lab2srgb:
4353 illuminant={ 0=D50 | 1=D65 | 2=E } |
4354 (no arg)
4355
4356 Convert color representation of selected images from Lab to sRGB.
4357
4358 Default value: 'illuminant=2'.
4359
4360 Example:
4361 [#1] (50,50;50,50^-3,3;-3,3^-3,-3;3,3) resize 400,400,1,3,3
4362 lab2rgb
4363
4364 lab82srgb:
4365 illuminant={ 0=D50 | 1=D65 | 2=E } |
4366 (no arg)
4367
4368 Convert color representation of selected images from Lab8 to sRGB.
4369
4370 Default value: 'illuminant=2'.
4371
4372 Example:
4373 [#1] (50,50;50,50^-3,3;-3,3^-3,-3;3,3) resize 400,400,1,3,3
4374 lab2rgb
4375
4376 lab2xyz:
4377 illuminant={ 0=D50 | 1=D65 | 2=E } |
4378 (no arg)
4379
4380 Convert color representation of selected images from Lab to XYZ.
4381
4382 Default value: 'illuminant=2'.
4383
4384 lab82rgb:
4385 illuminant={ 0=D50 | 1=D65 | 2=E } |
4386 (no arg)
4387
4388 Convert color representation of selected images from Lab8 to RGB.
4389
4390 Default value: 'illuminant=2'.
4391
4392 lch2lab:
4393
4394 Convert color representation of selected images from Lch to Lab.
4395
4396 lch2rgb:
4397 illuminant={ 0=D50 | 1=D65 | 2=E } |
4398 (no arg)
4399
4400 Convert color representation of selected images from Lch to RGB.
4401
4402 Default value: 'illuminant=2'.
4403
4404 lch82rgb:
4405 illuminant={ 0=D50 | 1=D65 | 2=E } |
4406 (no arg)
4407
4408 Convert color representation of selected images from Lch8 to RGB.
4409
4410 Default value: 'illuminant=2'.
4411
4412 luminance:
4413
4414 Compute luminance of selected sRGB images.
4415
4416 Example:
4417 [#1] image.jpg +luminance
4418
4419 lightness:
4420
4421 Compute lightness of selected sRGB images.
4422
4423 Example:
4424 [#1] image.jpg +lightness
4425
4426 lut_contrast:
4427 _nb_colors>1,_min_rgb_value
4428
4429 Generate a RGB colormap where consecutive colors have high con‐
4430 trast.
4431 This function performs a specific score maximization to generate
4432 the result, so
4433 it may take some time when 'nb_colors' is high.
4434
4435 Default values: 'nb_colors=256' and 'min_rgb_value=64'.
4436
4437 map_clut:
4438 [clut] | "clut_name"
4439
4440 Map specified RGB color LUT to selected images.
4441
4442 Example:
4443 [#1] image.jpg uniform_distribution {2^6},3 mirror[-1] x
4444 +map_clut[0] [1]
4445
4446 mix_rgb:
4447 a11,a12,a13,a21,a22,a23,a31,a32,a33
4448
4449 Apply 3x3 specified matrix to RGB colors of selected images.
4450
4451 Default values: 'a11=1', 'a12=a13=a21=0', 'a22=1', 'a23=a31=a32=0'
4452 and 'a33=1'.
4453
4454 Example:
4455 [#1] image.jpg +mix_rgb 0,1,0,1,0,0,0,0,1
4456
4457 Tutorial: https://gmic.eu/oldtutorial/_mix_rgb.shtml
4458
4459 oklab2rgb:
4460
4461 Convert color representation of selected images from OKlab to RGB.
4462 (see colorspace definition at: https://bottos‐
4463 son.github.io/posts/oklab/ ).
4464 See also: rgb2oklab.
4465
4466 palette:
4467 palette_name | palette_number
4468
4469 Input specified color palette at the end of the image list.
4470 'palette_name' can be { default | hsv | lines | hot | cool | jet |
4471 flag | cube | rainbow | parula | spring | summer | autumn | winter |
4472 bone | copper | pink | vga | algae | amp | balance | curl |
4473 deep | delta | dense | diff | gray | haline | ice | matter | oxy |
4474 phase | rain | solar | speed | tarn | tempo | thermal | topo | turbid |
4475 aurora | hocuspocus | srb2 | uzebox | amiga7800 | amiga7800mess |
4476 fornaxvoid1 }
4477
4478 Example:
4479 [#1] palette hsv
4480
4481 pseudogray:
4482 _max_increment>=0,_JND_threshold>=0,_bits_depth>0
4483
4484 Generate pseudogray colormap with specified increment and percep‐
4485 tual threshold.
4486 If 'JND_threshold' is 0, no perceptual constraints are applied.
4487
4488 Default values: 'max_increment=5', 'JND_threshold=2.3' and
4489 'bits_depth=8'.
4490
4491 Example:
4492 [#1] pseudogray 5
4493
4494 replace_color:
4495 tolerance[%]>=0,smoothness[%]>=0,src1,src2,...,dest1,dest2,...
4496
4497 Replace pixels from/to specified colors in selected images.
4498
4499 Example:
4500 [#1] image.jpg +replace_color 40,3,204,153,110,255,0,0
4501
4502 retinex:
4503 _value_offset>0,_colorspace={ hsi | hsv | lab | lrgb | rgb |
4504 ycbcr
4505 },0<=_min_cut<=100,0<=_max_cut<=100,_sigma_low>0,_sigma_mid>0,_sigma_high>0
4506
4507 Apply multi-scale retinex algorithm on selected images to improve
4508 color consistency.
4509 (as described in the page http://www.ipol.im/pub/art/2014/107/).
4510
4511 Default values: 'offset=1', 'colorspace=hsv', 'min_cut=1',
4512 'max_cut=1', 'sigma_low=15','sigma_mid=80' and 'sigma_high=250'.
4513
4514 rgb2bayer:
4515 _start_pattern=0,_color_grid=0
4516
4517 Transform selected color images to RGB-Bayer sampled images.
4518
4519 Default values: 'start_pattern=0' and 'color_grid=0'.
4520
4521 Example:
4522 [#1] image.jpg +rgb2bayer 0
4523
4524 rgb2cmy:
4525
4526 Convert color representation of selected images from RGB to CMY.
4527
4528 Example:
4529 [#1] image.jpg rgb2cmy split c
4530
4531 rgb2cmyk:
4532
4533 Convert color representation of selected images from RGB to CMYK.
4534
4535 Example:
4536 [#1] image.jpg rgb2cmyk split c
4537 [#2] image.jpg rgb2cmyk split c fill[3] 0 append c cmyk2rgb
4538
4539 rgb2hcy:
4540
4541 Convert color representation of selected images from RGB to HCY.
4542
4543 Example:
4544 [#1] image.jpg rgb2hcy split c
4545
4546 rgb2hsi:
4547
4548 Convert color representation of selected images from RGB to HSI.
4549
4550 Example:
4551 [#1] image.jpg rgb2hsi split c
4552
4553 rgb2hsi8:
4554
4555 Convert color representation of selected images from RGB to HSI8.
4556
4557 Example:
4558 [#1] image.jpg rgb2hsi8 split c
4559
4560 rgb2hsl:
4561
4562 Convert color representation of selected images from RGB to HSL.
4563
4564 Example:
4565 [#1] image.jpg rgb2hsl split c
4566 [#2] image.jpg rgb2hsl +split c add[-3] 100 mod[-3] 360 ap‐
4567 pend[-3--1] c hsl2rgb
4568
4569 rgb2hsl8:
4570
4571 Convert color representation of selected images from RGB to HSL8.
4572
4573 Example:
4574 [#1] image.jpg rgb2hsl8 split c
4575
4576 rgb2hsv:
4577
4578 Convert color representation of selected images from RGB to HSV.
4579
4580 Example:
4581 [#1] image.jpg rgb2hsv split c
4582 [#2] image.jpg rgb2hsv +split c add[-2] 0.3 cut[-2] 0,1 ap‐
4583 pend[-3--1] c hsv2rgb
4584
4585 rgb2hsv8:
4586
4587 Convert color representation of selected images from RGB to HSV8.
4588
4589 Example:
4590 [#1] image.jpg rgb2hsv8 split c
4591
4592 rgb2int:
4593
4594 Convert color representation of selected images from RGB to INT24
4595 scalars.
4596
4597 Example:
4598 [#1] image.jpg rgb2int
4599
4600 rgb2jzazbz:
4601 illuminant={ 0=D50 | 1=D65 | 2=E } |
4602 (no arg)
4603
4604 Convert color representation of selected images from RGB to Jzazbz.
4605
4606 Default value: 'illuminant=2'.
4607
4608 rgb2lab:
4609 illuminant={ 0=D50 | 1=D65 | 2=E } |
4610 (no arg)
4611
4612 Convert color representation of selected images from RGB to Lab.
4613
4614 Default value: 'illuminant=2'.
4615
4616 rgb2lab8:
4617 illuminant={ 0=D50 | 1=D65 | 2=E } |
4618 (no arg)
4619
4620 Convert color representation of selected images from RGB to Lab8.
4621
4622 Default value: 'illuminant=2'.
4623
4624 Example:
4625 [#1] image.jpg rgb2lab8 split c
4626
4627 rgb2lch:
4628 illuminant={ 0=D50 | 1=D65 | 2=E } |
4629 (no arg)
4630
4631 Convert color representation of selected images from RGB to Lch.
4632
4633 Default value: 'illuminant=2'.
4634
4635 Example:
4636 [#1] image.jpg rgb2lch split c
4637
4638 rgb2lch8:
4639 illuminant={ 0=D50 | 1=D65 | 2=E } |
4640 (no arg)
4641
4642 Convert color representation of selected images from RGB to Lch8.
4643
4644 Default value: 'illuminant=2'.
4645
4646 Example:
4647 [#1] image.jpg rgb2lch8 split c
4648
4649 rgb2luv:
4650
4651 Convert color representation of selected images from RGB to LUV.
4652
4653 Example:
4654 [#1] image.jpg rgb2luv split c
4655
4656 rgb2oklab:
4657
4658 Convert color representation of selected images from RGB to Oklab.
4659 (see colorspace definition at: https://bottos‐
4660 son.github.io/posts/oklab/ ).
4661 See also: oklab2rgb.
4662
4663 rgb2ryb:
4664
4665 Convert color representation of selected images from RGB to RYB.
4666
4667 Example:
4668 [#1] image.jpg rgb2ryb split c
4669
4670 rgb2srgb:
4671
4672 Convert color representation of selected images from linear RGB to
4673 sRGB.
4674
4675 rgb2xyz:
4676 illuminant={ 0=D50 | 1=D65 | 2=E } |
4677 (no arg)
4678
4679 Convert color representation of selected images from RGB to XYZ.
4680
4681 Default value: 'illuminant=2'.
4682
4683 Example:
4684 [#1] image.jpg rgb2xyz split c
4685
4686 rgb2xyz8:
4687 illuminant={ 0=D50 | 1=D65 | 2=E } |
4688 (no arg)
4689
4690 Convert color representation of selected images from RGB to XYZ8.
4691
4692 Default value: 'illuminant=2'.
4693
4694 Example:
4695 [#1] image.jpg rgb2xyz8 split c
4696
4697 rgb2yiq:
4698
4699 Convert color representation of selected images from RGB to YIQ.
4700
4701 Example:
4702 [#1] image.jpg rgb2yiq split c
4703
4704 rgb2yiq8:
4705
4706 Convert color representation of selected images from RGB to YIQ8.
4707
4708 Example:
4709 [#1] image.jpg rgb2yiq8 split c
4710
4711 rgb2ycbcr:
4712
4713 Convert color representation of selected images from RGB to YCbCr.
4714
4715 Example:
4716 [#1] image.jpg rgb2ycbcr split c
4717
4718 rgb2yuv:
4719
4720 Convert color representation of selected images from RGB to YUV.
4721
4722 Example:
4723 [#1] image.jpg rgb2yuv split c
4724
4725 rgb2yuv8:
4726
4727 Convert color representation of selected images from RGB to YUV8.
4728
4729 Example:
4730 [#1] image.jpg rgb2yuv8 split c
4731
4732 remove_opacity:
4733
4734 Remove opacity channel of selected images.
4735
4736 ryb2rgb:
4737
4738 Convert color representation of selected images from RYB to RGB.
4739
4740 select_color:
4741 tolerance[%]>=0,col1,...,colN
4742
4743 Select pixels with specified color in selected images.
4744
4745 Example:
4746 [#1] image.jpg +select_color 40,204,153,110
4747
4748 Tutorial: https://gmic.eu/oldtutorial/_select_color.shtml
4749
4750 sepia:
4751
4752 Apply sepia tones effect on selected images.
4753
4754 Example:
4755 [#1] image.jpg sepia
4756
4757 solarize:
4758
4759 Solarize selected images.
4760
4761 Example:
4762 [#1] image.jpg solarize
4763
4764 split_colors:
4765 _tolerance>=0,_max_nb_outputs>0,_min_area>0
4766
4767 Split selected images as several image containing a single color.
4768 One selected image can be split as at most 'max_nb_outputs' images.
4769 Output images are sorted by decreasing area of extracted color re‐
4770 gions and have an additional alpha-channel.
4771
4772 Default values: 'tolerance=0', 'max_nb_outputs=256' and
4773 'min_area=8'.
4774
4775 Example:
4776 [#1] image.jpg quantize 5 +split_colors , display_rgba
4777
4778 split_opacity:
4779
4780 Split color and opacity parts of selected images.
4781
4782 srgb2lab:
4783 illuminant={ 0=D50 | 1=D65 | 2=E } |
4784 (no arg)
4785
4786 Convert color representation of selected images from sRGB to Lab.
4787
4788 Default value: 'illuminant=2'.
4789
4790 Example:
4791 [#1] image.jpg srgb2lab split c
4792 [#2] image.jpg srgb2lab +split c mul[-2,-1] 2.5 append[-3--1] c
4793 lab2srgb
4794
4795 srgb2lab8:
4796 illuminant={ 0=D50 | 1=D65 | 2=E } |
4797 (no arg)
4798
4799 Convert color representation of selected images from sRGB to Lab8.
4800
4801 Default value: 'illuminant=2'.
4802
4803 srgb2rgb:
4804
4805 Convert color representation of selected images from sRGB to linear
4806 RGB.
4807
4808 to_a:
4809
4810 Force selected images to have an alpha channel.
4811
4812 to_color:
4813
4814 Force selected images to be in color mode (RGB or RGBA).
4815
4816 to_colormode:
4817 mode={ 0=adaptive | 1=G | 2=GA | 3=RGB | 4=RGBA }
4818
4819 Force selected images to be in a given color mode.
4820
4821 Default value: 'mode=0'.
4822
4823 to_gray:
4824
4825 Force selected images to be in GRAY mode.
4826
4827 Example:
4828 [#1] image.jpg +to_gray
4829
4830 to_graya:
4831
4832 Force selected images to be in GRAYA mode.
4833
4834 to_pseudogray:
4835 _max_step>=0,_is_perceptual_constraint={ 0 | 1 },_bits_depth>0
4836
4837 Convert selected scalar images ([0-255]-valued) to pseudo-gray
4838 color images.
4839
4840 Default values: 'max_step=5', 'is_perceptual_constraint=1' and
4841 'bits_depth=8'.
4842 The original pseudo-gray technique has been introduced by Rich
4843 Franzen http://r0k.us/graphics/pseudoGrey.html.
4844 Extension of this technique to arbitrary increments for more tones,
4845 has been done by David Tschumperlé.
4846
4847 to_rgb:
4848
4849 Force selected images to be in RGB mode.
4850
4851 to_rgba:
4852
4853 Force selected images to be in RGBA mode.
4854
4855 transfer_histogram:
4856 [reference_image],_nb_levels>0,_color_channels
4857
4858 Transfer histogram of the specified reference image to selected im‐
4859 ages.
4860 Argument 'color channels' is the same as with command 'apply_chan‐
4861 nels'.
4862
4863 Default value: 'nb_levels=256' and 'color_channels=all'.
4864
4865 Example:
4866 [#1] image.jpg 100,100,1,3,"u([256,200,100])" +transfer_his‐
4867 togram[0] [1]
4868
4869 transfer_pca:
4870 [reference_image],_color_channels
4871
4872 Transfer mean and covariance matrix of specified vector-valued ref‐
4873 erence image to selected images.
4874 Argument 'color channels' is the same as with command 'apply_chan‐
4875 nels'.
4876
4877 Default value: 'color_channels=all'.
4878
4879 Example:
4880 [#1] sample lena,earth +transfer_pca[0] [1]
4881
4882 transfer_rgb:
4883 [target],_gamma>=0,_regularization>=0,_luminosity_con‐
4884 straints>=0,_rgb_resolution>=0,_is_constraints={ 0 | 1 }
4885
4886 Transfer colors from selected source images to selected reference
4887 image (given as argument).
4888 'gamma' determines the importance of color occurrences in the
4889 matching process (0=none to 1=huge).
4890 'regularization' determines the number of guided filter iterations
4891 to remove quantization effects.
4892 'luminosity_constraints' tells if luminosity constraints must be
4893 applied on non-confident matched colors.
4894 'is_constraints' tells if additional hard color constraints must be
4895 set (opens an interactive window).
4896
4897 Default values: 'gamma=0.3','regularization=8', 'luminosity_con‐
4898 straints=0.1', 'rgb_resolution=64' and 'is_constraints=0'.
4899
4900 Example:
4901 [#1] sample pencils,wall +transfer_rgb[0] [1],0,0.01
4902
4903 xyz2jzazbz:
4904
4905 Convert color representation of selected images from XYZ to RGB.
4906
4907 xyz2lab:
4908 illuminant={ 0=D50 | 1=D65 | 2=E } |
4909 (no arg)
4910
4911 Convert color representation of selected images from XYZ to Lab.
4912
4913 Default value: 'illuminant=2'.
4914
4915 xyz2rgb:
4916 illuminant={ 0=D50 | 1=D65 | 2=E } |
4917 (no arg)
4918
4919 Convert color representation of selected images from XYZ to RGB.
4920
4921 Default value: 'illuminant=2'.
4922
4923 xyz82rgb:
4924 illuminant={ 0=D50 | 1=D65 | 2=E } |
4925 (no arg)
4926
4927 Convert color representation of selected images from XYZ8 to RGB.
4928
4929 Default value: 'illuminant=2'.
4930
4931 ycbcr2rgb:
4932
4933 Convert color representation of selected images from YCbCr to RGB.
4934
4935 yiq2rgb:
4936
4937 Convert color representation of selected images from YIQ to RGB.
4938
4939 yiq82rgb:
4940
4941 Convert color representation of selected images from YIQ8 to RGB.
4942
4943 yuv2rgb:
4944
4945 Convert color representation of selected images from YUV to RGB.
4946
4947 yuv82rgb:
4948
4949 Convert selected images from YUV8 to RGB color bases.
4950
4951 12.7. Geometry Manipulation
4952 ---------------------
4953
4954 a (+):
4955 Shortcut for command 'append'.
4956
4957 append (+):
4958 [image],axis,_centering |
4959 axis,_centering
4960
4961 Append specified image to selected images, or all selected images
4962 together, along specified axis.
4963 (equivalent to shortcut command 'a').
4964
4965 'axis' can be { x | y | z | c }.
4966 Usual 'centering' values are { 0=left-justified | 0.5=centered |
4967 1=right-justified }.
4968
4969 Default value: 'centering=0'.
4970
4971 Example:
4972 [#1] image.jpg split y,10 reverse append y
4973 [#2] image.jpg repeat 5 +rows[0] 0,{10+18*$>}% done remove[0] ap‐
4974 pend x,0.5
4975 [#3] image.jpg append[0] [0],y
4976
4977 append_tiles:
4978 _M>=0,_N>=0,0<=_centering_x<=1,0<=_centering_y<=1
4979
4980 Append MxN selected tiles as new images.
4981 If 'N' is set to 0, number of rows is estimated automatically.
4982 If 'M' is set to 0, number of columns is estimated automatically.
4983 If 'M' and 'N' are both set to '0', auto-mode is used.
4984 If 'M' or 'N' is set to 0, only a single image is produced.
4985 'centering_x' and 'centering_y' tells about the centering of tiles
4986 when they have different sizes.
4987
4988 Default values: 'M=0', 'N=0', 'centering_x=centering_y=0.5'.
4989
4990 Example:
4991 [#1] image.jpg split xy,4 append_tiles ,
4992
4993 apply_scales:
4994 "command",num‐
4995 ber_of_scales>0,_min_scale[%]>=0,_max_scale[%]>=0,_scale_gamma>0,_in‐
4996 terpolation
4997
4998 Apply specified command on different scales of selected images.
4999 'interpolation' can be { 0=none | 1=nearest | 2=average | 3=linear
5000 | 4=grid | 5=bicubic | 6=lanczos }.
5001
5002 Default value: 'min_scale=25%', 'max_scale=100%' and 'interpola‐
5003 tion=3'.
5004
5005 Example:
5006 [#1] image.jpg apply_scales "blur 5 sharpen 1000",4
5007
5008 autocrop (+):
5009 value1,value2,... |
5010 (no arg)
5011
5012 Autocrop selected images by specified vector-valued intensity.
5013 If no arguments are provided, cropping value is guessed.
5014
5015 Example:
5016 [#1] 400,400,1,3 fill_color 64,128,255 ellipse
5017 50%,50%,120,120,0,1,255 +autocrop
5018
5019 autocrop_components:
5020 _threshold[%],_min_area[%]>=0,_is_high_connectivity={ 0 | 1
5021 },_output_type={ 0=crop | 1=segmentation | 2=coordinates }
5022
5023 Autocrop and extract connected components in selected images, ac‐
5024 cording to a mask given as the last channel of
5025 each of the selected image (e.g. alpha-channel).
5026
5027 Default values: 'threshold=0%', 'min_area=0.1%', 'is_high_connec‐
5028 tivity=0' and 'output_type=1'.
5029
5030 Example:
5031 [#1] 256,256 noise 0.1,2 eq 1 dilate_circ 20 label_fg 0,1 normal‐
5032 ize 0,255 +neq 0 *[-1] 255 append c +autocrop_components ,
5033
5034 autocrop_seq:
5035 value1,value2,... | auto
5036
5037 Autocrop selected images using the crop geometry of the last one by
5038 specified vector-valued intensity,
5039 or by automatic guessing the cropping value.
5040
5041 Default value: auto mode.
5042
5043 Example:
5044 [#1] image.jpg +fill[-1] 0 ellipse[-1] 50%,50%,30%,20%,0,1,1 au‐
5045 tocrop_seq 0
5046
5047 channels (+):
5048 { [image0] | c0[%] },_{ [image1] | c1[%] }
5049
5050 Keep only specified channels of selected images.
5051 Dirichlet boundary is used when specified channels are out of
5052 range.
5053
5054 Example:
5055 [#1] image.jpg channels 0,1
5056 [#2] image.jpg luminance channels 0,2
5057
5058 columns (+):
5059 { [image0] | x0[%] },_{ [image1] | x1[%] }
5060
5061 Keep only specified columns of selected images.
5062 Dirichlet boundary is used when specified columns are out of range.
5063
5064 Example:
5065 [#1] image.jpg columns -25%,50%
5066
5067 z (+):
5068 Shortcut for command 'crop'.
5069
5070 crop (+):
5071 x0[%],x1[%],_boundary_conditions |
5072 x0[%],y0[%],x1[%],y1[%],_boundary_conditions |
5073 x0[%],y0[%],z0[%],x1[%],y1[%],z1[%],_boundary_conditions |
5074 x0[%],y0[%],z0[%],c0[%],x1[%],y1[%],z1[%],c1[%],_boundary_condi‐
5075 tions
5076
5077 Crop selected images with specified region coordinates.
5078 (equivalent to shortcut command 'z').
5079
5080 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
5081 | 3=mirror }.
5082
5083 Default value: 'boundary_conditions=0'.
5084
5085 Example:
5086 [#1] image.jpg +crop -230,-230,280,280,1 crop[0]
5087 -230,-230,280,280,0
5088 [#2] image.jpg crop 25%,25%,75%,75%
5089
5090 diagonal:
5091
5092 Transform selected vectors as diagonal matrices.
5093
5094 Example:
5095 [#1] 1,10,1,1,'y' +diagonal
5096
5097 elevate:
5098 _depth,_is_plain={ 0 | 1 },_is_colored={ 0 | 1 }
5099
5100 Elevate selected 2D images into 3D volumes.
5101
5102 Default values: 'depth=64', 'is_plain=1' and 'is_colored=1'.
5103
5104 expand_x:
5105 size_x>=0,_boundary_conditions={ 0=dirichlet | 1=neumann | 2=pe‐
5106 riodic | 3=mirror }
5107
5108 Expand selected images along the x-axis.
5109
5110 Default value: 'boundary_conditions=1'.
5111
5112 Example:
5113 [#1] image.jpg expand_x 30,0
5114
5115 expand_xy:
5116 size>=0,_boundary_conditions={ 0=dirichlet | 1=neumann | 2=peri‐
5117 odic | 3=mirror }
5118
5119 Expand selected images along the xy-axes.
5120
5121 Default value: 'boundary_conditions=1'.
5122
5123 Example:
5124 [#1] image.jpg expand_xy 30,0
5125
5126 expand_xyz:
5127 size>=0,_boundary_conditions={ 0=dirichlet | 1=neumann | 2=peri‐
5128 odic | 3=mirror }
5129
5130 Expand selected images along the xyz-axes.
5131
5132 Default value: 'boundary_conditions=1'.
5133
5134 expand_y:
5135 size_y>=0,_boundary_conditions={ 0=dirichlet | 1=neumann | 2=pe‐
5136 riodic | 3=mirror }
5137
5138 Expand selected images along the y-axis.
5139
5140 Default value: 'boundary_conditions=1'.
5141
5142 Example:
5143 [#1] image.jpg expand_y 30,0
5144
5145 expand_z:
5146 size_z>=0,_boundary_conditions={ 0=dirichlet | 1=neumann | 2=pe‐
5147 riodic | 3=mirror }
5148
5149 Expand selected images along the z-axis.
5150
5151 Default value: 'boundary_conditions=1'.
5152
5153 extract:
5154 "condition",_output_type={ 0=xyzc-coordinates | 1=xyz-coordinates
5155 | 2=scalar-values | 3=vector-values }
5156
5157 Extract a list of coordinates or values from selected image, where
5158 specified mathematical condition holds.
5159 For N coordinates matching, result is a 1xNx1x4 image.
5160
5161 Default values: 'output_type=0'.
5162
5163 Example:
5164 [#1] sp lena +extract "norm(I)>128",3
5165
5166 extract_region:
5167 [label_image],_extract_xyz_coordinates={ 0 | 1 },_la‐
5168 bel_1,...,_label_M
5169
5170 Extract all pixels of selected images whose corresponding label in
5171 '[label_image]' is equal to 'label_m',
5172 and output them as M column images.
5173
5174 Default value: 'extract_xyz_coordinates=0'.
5175
5176 Example:
5177 [#1] image.jpg +blur 3 quantize. 4,0 +extract_region[0] [1],0,1,3
5178
5179 montage:
5180 "_layout_code",_montage_mode={ 0<=centering<=1 | 2<=scale+2<=3
5181 },_output_mode={ 0=single layer | 1=multiple layers },"_processing_com‐
5182 mand"
5183
5184 Create a single image montage from selected images, according to
5185 specified layout code :
5186 * 'X' to assemble all images using an automatically estimated lay‐
5187 out.
5188 * 'H' to assemble all images horizontally.
5189 * 'V' to assemble all images vertically.
5190 * 'A' to assemble all images as an horizontal array.
5191 * 'B' to assemble all images as a vertical array.
5192 * 'Ha:b' to assemble two blocks 'a' and 'b' horizontally.
5193 * 'Va:b' to assemble two blocks 'a' and 'b' vertically.
5194 * 'Ra' to rotate a block 'a' by 90 deg. ('RRa' for 180 deg. and
5195 'RRRa' for 270 deg.).
5196 * 'Ma' to mirror a block 'a' along the X-axis ('MRRa' for the Y-
5197 axis).
5198 A block 'a' can be an image index (treated periodically) or a
5199 nested layout expression 'Hb:c','Vb:c','Rb' or
5200 'Mb' itself.
5201 For example, layout code 'H0:V1:2' creates an image where image [0]
5202 is on the left, and images [1] and [2]
5203 vertically packed on the right.
5204
5205 Default values: 'layout_code=X', 'montage_mode=2', output_mode='0'
5206 and 'processing_command=""'.
5207
5208 Example:
5209 [#1] image.jpg sample ? +plasma[0] shape_cupid 256 normalize
5210 0,255 frame 3,3,0 frame 10,10,255 to_rgb +montage A +montage[^-1]
5211 H1:V0:VH2:1H0:3
5212
5213 mirror (+):
5214 { x | y | z }...{ x | y | z }
5215
5216 Mirror selected images along specified axes.
5217
5218 Example:
5219 [#1] image.jpg +mirror y +mirror[0] c
5220 [#2] image.jpg +mirror x +mirror y append_tiles 2,2
5221
5222 permute (+):
5223 permutation_string
5224
5225 Permute selected image axes by specified permutation.
5226 'permutation' is a combination of the character set {x|y|z|c},
5227 e.g. 'xycz', 'cxyz', ...
5228
5229 Example:
5230 [#1] image.jpg permute yxzc
5231
5232 r (+):
5233 Shortcut for command 'resize'.
5234
5235 resize (+):
5236 {[image_w] | width>0[%]},_{[image_h] | height>0[%]},_{[image_d] |
5237 depth>0[%]},_{[image_s] | spectrum>0[%]},_interpolation,_boundary_con‐
5238 ditions,_ax,_ay,_az,_ac
5239
5240 Resize selected images with specified geometry.
5241 (equivalent to shortcut command 'r').
5242
5243 'interpolation' can be { -1=none (memory content) | 0=none |
5244 1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }.
5245 'boundary_conditions' has different meanings, according to the cho‐
5246 sen 'interpolation' mode :
5247 . When 'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions'
5248 is meaningless.
5249 . When 'interpolation==0', 'boundary_conditions' can be { 0=dirich‐
5250 let | 1=neumann | 2=periodic | 3=mirror }.
5251 . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be
5252 { 0=none | 1=neumann }.
5253 'ax,ay,az,ac' set the centering along each axis when 'interpola‐
5254 tion=0 or 4'
5255 (set to '0' by default, must be defined in range [0,1]).
5256
5257 Default values: 'interpolation=1', 'boundary_conditions=0' and
5258 'ax=ay=az=ac=0'.
5259
5260 Example:
5261 [#1] image.jpg +resize[-1] 256,128,1,3,2 +resize[-1]
5262 120%,120%,1,3,0,1,0.5,0.5 +resize[-1] 120%,120%,1,3,0,0,0.2,0.2 +re‐
5263 size[-1] [0],[0],1,3,4
5264
5265 ri:
5266 Shortcut for command 'resize_as_image'.
5267
5268 resize_as_image:
5269 [reference],_interpolation,_boundary_conditions,_ax,_ay,_az,_ac
5270
5271 Resize selected images to the geometry of specified [reference] im‐
5272 age.
5273 (equivalent to shortcut command 'ri').
5274
5275 Default values: 'interpolation=1', 'boundary_conditions=0' and
5276 'ax=ay=az=ac=0'.
5277
5278 Example:
5279 [#1] image.jpg sample duck +resize_as_image[-1] [-2]
5280
5281 resize_mn:
5282 width[%]>=0,_height[%]>=0,_depth[%]>=0,_B_value,_C_value
5283
5284 Resize selected images with Mitchell-Netravali filter (cubic).
5285 For details about the method, see:
5286 https://de.wikipedia.org/wiki/Mitchell-Netravali-Filter.
5287
5288 Default values: 'height=100%', 'depth=100%', 'B=0.3333' and
5289 'C=0.3333'.
5290
5291 Example:
5292 [#1] image.jpg resize2dx 32 resize_mn 800%,800%
5293
5294 resize_pow2:
5295 _interpolation,_boundary_conditions,_ax,_ay,_az,_ac
5296
5297 Resize selected images so that each dimension is a power of 2.
5298 'interpolation' can be { -1=none (memory content) | 0=none |
5299 1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }.
5300 'boundary_conditions' has different meanings, according to the cho‐
5301 sen 'interpolation' mode :
5302 . When 'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions'
5303 is meaningless.
5304 . When 'interpolation==0', 'boundary_conditions' can be { 0=dirich‐
5305 let | 1=neumann | 2=periodic | 3=mirror }.
5306 . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be
5307 { 0=none | 1=neumann }.
5308 'ax,ay,az,ac' set the centering along each axis when 'interpola‐
5309 tion=0'
5310 (set to '0' by default, must be defined in range [0,1]).
5311
5312 Default values: 'interpolation=0', 'boundary_conditions=0' and
5313 'ax=ay=az=ac=0'.
5314
5315 Example:
5316 [#1] image.jpg +resize_pow2[-1] 0
5317
5318 rr2d:
5319 Shortcut for command 'resize_ratio2d'.
5320
5321 resize_ratio2d:
5322 width>0,height>0,_mode={ 0=inside | 1=outside | 2=padded
5323 },0=<_interpolation<=6
5324
5325 Resize selected images while preserving their aspect ratio.
5326 (equivalent to shortcut command 'rr2d').
5327
5328 Default values: 'mode=0' and 'interpolation=6'.
5329
5330 r2dx:
5331 Shortcut for command 'resize2dx'.
5332
5333 resize2dx:
5334 width[%]>0,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac
5335
5336 Resize selected images along the x-axis, preserving 2D ratio.
5337 (equivalent to shortcut command 'r2dx').
5338
5339 'interpolation' can be { -1=none (memory content) | 0=none |
5340 1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }.
5341 'boundary_conditions' has different meanings, according to the cho‐
5342 sen 'interpolation' mode :
5343 . When 'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions'
5344 is meaningless.
5345 . When 'interpolation==0', 'boundary_conditions' can be { 0=dirich‐
5346 let | 1=neumann | 2=periodic | 3=mirror }.
5347 . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be
5348 { 0=none | 1=neumann }.
5349 'ax,ay,az,ac' set the centering along each axis when 'interpola‐
5350 tion=0'
5351 (set to '0' by default, must be defined in range [0,1]).
5352
5353 Default values: 'interpolation=3', 'boundary_conditions=0' and
5354 'ax=ay=az=ac=0'.
5355
5356 Example:
5357 [#1] image.jpg +resize2dx 100,2 append x
5358
5359 r2dy:
5360 Shortcut for command 'resize2dy'.
5361
5362 resize2dy:
5363 height[%]>=0,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac
5364
5365 Resize selected images along the y-axis, preserving 2D ratio.
5366 (equivalent to shortcut command 'r2dy').
5367
5368 'interpolation' can be { -1=none (memory content) | 0=none |
5369 1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }.
5370 'boundary_conditions' has different meanings, according to the cho‐
5371 sen 'interpolation' mode :
5372 . When 'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions'
5373 is meaningless.
5374 . When 'interpolation==0', 'boundary_conditions' can be { 0=dirich‐
5375 let | 1=neumann | 2=periodic | 3=mirror }.
5376 . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be
5377 { 0=none | 1=neumann }.
5378 'ax,ay,az,ac' set the centering along each axis when 'interpola‐
5379 tion=0'
5380 (set to '0' by default, must be defined in range [0,1]).
5381
5382 Default values: 'interpolation=3', 'boundary_conditions=0' and
5383 'ax=ay=az=ac=0'.
5384
5385 Example:
5386 [#1] image.jpg +resize2dy 100,2 append x
5387
5388 r3dx:
5389 Shortcut for command 'resize3dx'.
5390
5391 resize3dx:
5392 width[%]>0,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac
5393
5394 Resize selected images along the x-axis, preserving 3D ratio.
5395 (equivalent to shortcut command 'r3dx').
5396
5397 'interpolation' can be { -1=none (memory content) | 0=none |
5398 1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }.
5399 'boundary_conditions' has different meanings, according to the cho‐
5400 sen 'interpolation' mode :
5401 . When 'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions'
5402 is meaningless.
5403 . When 'interpolation==0', 'boundary_conditions' can be { 0=dirich‐
5404 let | 1=neumann | 2=periodic | 3=mirror }.
5405 . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be
5406 { 0=none | 1=neumann }.
5407 'ax,ay,az,ac' set the centering along each axis when 'interpola‐
5408 tion=0'
5409 (set to '0' by default, must be defined in range [0,1]).
5410
5411 Default values: 'interpolation=3', 'boundary_conditions=0' and
5412 'ax=ay=az=ac=0'.
5413
5414 r3dy:
5415 Shortcut for command 'resize3dy'.
5416
5417 resize3dy:
5418 height[%]>0,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac
5419
5420 Resize selected images along the y-axis, preserving 3D ratio.
5421 (equivalent to shortcut command 'r3dy').
5422
5423 'interpolation' can be { -1=none (memory content) | 0=none |
5424 1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }.
5425 'boundary_conditions' has different meanings, according to the cho‐
5426 sen 'interpolation' mode :
5427 . When 'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions'
5428 is meaningless.
5429 . When 'interpolation==0', 'boundary_conditions' can be { 0=dirich‐
5430 let | 1=neumann | 2=periodic | 3=mirror }.
5431 . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be
5432 { 0=none | 1=neumann }.
5433 'ax,ay,az,ac' set the centering along each axis when 'interpola‐
5434 tion=0'
5435 (set to '0' by default, must be defined in range [0,1]).
5436
5437 Default values: 'interpolation=3', 'boundary_conditions=0' and
5438 'ax=ay=az=ac=0'.
5439
5440 r3dz:
5441 Shortcut for command 'resize3dz'.
5442
5443 resize3dz:
5444 depth[%]>0,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac
5445
5446 Resize selected images along the z-axis, preserving 3D ratio.
5447 (equivalent to shortcut command 'r3dz').
5448
5449 'interpolation' can be { -1=none (memory content) | 0=none |
5450 1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }.
5451 'boundary_conditions' has different meanings, according to the cho‐
5452 sen 'interpolation' mode :
5453 . When 'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions'
5454 is meaningless.
5455 . When 'interpolation==0', 'boundary_conditions' can be { 0=dirich‐
5456 let | 1=neumann | 2=periodic | 3=mirror }.
5457 . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be
5458 { 0=none | 1=neumann }.
5459 'ax,ay,az,ac' set the centering along each axis when 'interpola‐
5460 tion=0'
5461 (set to '0' by default, must be defined in range [0,1]).
5462
5463 Default values: 'interpolation=3', 'boundary_conditions=0' and
5464 'ax=ay=az=ac=0'.
5465
5466 rotate (+):
5467 angle,_interpolation,_boundary_conditions,_center_x[%],_cen‐
5468 ter_y[%] |
5469 u,v,w,angle,interpolation,boundary_conditions,_center_x[%],_cen‐
5470 ter_y[%],_center_z[%]
5471
5472 Rotate selected images with specified angle (in deg.), and option‐
5473 ally 3D axis (u,v,w).
5474 'interpolation' can be { 0=none | 1=linear | 2=bicubic }.
5475 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
5476 | 3=mirror }.
5477 When a rotation center (cx,cy,_cz) is specified, the size of the
5478 image is preserved.
5479
5480 Default values: 'interpolation=1', 'boundary_conditions=0' and
5481 'center_x=center_y=(undefined)'.
5482
5483 Example:
5484 [#1] image.jpg +rotate -25,1,2,50%,50% rotate[0] 25
5485
5486 rotate_tileable:
5487 angle,_max_size_factor>=0
5488
5489 Rotate selected images by specified angle and make them tileable.
5490 If resulting size of an image is too big, the image is replaced by
5491 a 1x1 image.
5492
5493 Default values: 'max_size_factor=8'.
5494
5495 rows (+):
5496 { [image0] | y0[%] },_{ [image1] | y1[%] }
5497
5498 Keep only specified rows of selected images.
5499 Dirichlet boundary conditions are used when specified rows are out
5500 of range.
5501
5502 Example:
5503 [#1] image.jpg rows -25%,50%
5504
5505 scale2x:
5506
5507 Resize selected images using the Scale2x algorithm.
5508
5509 Example:
5510 [#1] image.jpg threshold 50% resize 50%,50% +scale2x
5511
5512 scale3x:
5513
5514 Resize selected images using the Scale3x algorithm.
5515
5516 Example:
5517 [#1] image.jpg threshold 50% resize 33%,33% +scale3x
5518
5519 scale_dcci2x:
5520 _edge_threshold>=0,_exponent>0,_extend_1px={ 0=false | 1=true }
5521
5522 Double image size using directional cubic convolution interpola‐
5523 tion,
5524 as described in https://en.wikipedia.org/wiki/Directional_Cu‐
5525 bic_Convolution_Interpolation.
5526
5527 Default values: 'edge_threshold=1.15', 'exponent=5' and 'ex‐
5528 tend_1px=0'.
5529
5530 Example:
5531 [#1] image.jpg +scale_dcci2x ,
5532
5533 seamcarve:
5534 _width[%]>=0,_height[%]>=0,_is_priority_channel={ 0 | 1 },_is_an‐
5535 tialiasing={ 0 | 1 },_maximum_seams[%]>=0
5536
5537 Resize selected images with specified 2D geometry, using the seam-
5538 carving algorithm.
5539
5540 Default values: 'height=100%', 'is_priority_channel=0', 'is_an‐
5541 tialiasing=1' and 'maximum_seams=25%'.
5542
5543 Example:
5544 [#1] image.jpg seamcarve 60%
5545
5546 shift (+):
5547 vx[%],_vy[%],_vz[%],_vc[%],_boundary_conditions,_interpolation={
5548 0=nearest_neighbor | 1=linear }
5549
5550 Shift selected images by specified displacement vector.
5551 Displacement vector can be non-integer in which case linear inter‐
5552 polation should be chosen.
5553 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
5554 | 3=mirror }.
5555
5556 Default value: 'boundary_conditions=0' and 'interpolation=0'.
5557
5558 Example:
5559 [#1] image.jpg +shift[0] 50%,50%,0,0,0 +shift[0] 50%,50%,0,0,1
5560 +shift[0] 50%,50%,0,0,2
5561
5562 shrink_x:
5563 size_x>=0
5564
5565 Shrink selected images along the x-axis.
5566
5567 Example:
5568 [#1] image.jpg shrink_x 30
5569
5570 shrink_xy:
5571 size>=0
5572
5573 Shrink selected images along the xy-axes.
5574
5575 Example:
5576 [#1] image.jpg shrink_xy 30
5577
5578 shrink_xyz:
5579 size>=0
5580
5581 Shrink selected images along the xyz-axes.
5582
5583 shrink_y:
5584 size_y>=0
5585
5586 Shrink selected images along the y-axis.
5587
5588 Example:
5589 [#1] image.jpg shrink_y 30
5590
5591 shrink_z:
5592 size_z>=0
5593
5594 Shrink selected images along the z-axis.
5595
5596 slices (+):
5597 { [image0] | z0[%] },_{ [image1] | z1[%] }
5598
5599 Keep only specified slices of selected images.
5600 Dirichlet boundary conditions are used when specified slices are
5601 out of range.
5602
5603 sort (+):
5604 _ordering={ + | - },_axis={ x | y | z | c }
5605
5606 Sort pixel values of selected images.
5607 If 'axis' is specified, the sorting is done according to the data
5608 of the first column/row/slice/channel
5609 of selected images.
5610
5611 Default values: 'ordering=+' and 'axis=(undefined)'.
5612
5613 Example:
5614 [#1] 64 rand 0,100 +sort display_graph 400,300,3
5615
5616 s (+):
5617 Shortcut for command 'split'.
5618
5619 split (+):
5620 { x | y | z | c }...{ x | y | z | c },_split_mode |
5621 keep_splitting_values={ + | - },_{ x | y | z | c }...{ x | y | z
5622 | c },value1,_value2,... |
5623 (no arg)
5624
5625 Split selected images along specified axes, or regarding to a se‐
5626 quence of scalar values
5627 (optionally along specified axes too).
5628 (equivalent to shortcut command 's').
5629
5630 'split_mode' can be { 0=split according to constant values |
5631 >0=split in N parts | <0=split in parts of size -N }.
5632
5633 Default value: 'split_mode=-1'.
5634
5635 Example:
5636 [#1] image.jpg split c
5637 [#2] image.jpg split y,3
5638 [#3] image.jpg split x,-128
5639 [#4] 1,20,1,1,"1,2,3,4" +split -,2,3 append[1--1] y
5640 [#5] (1,2,2,3,3,3,4,4,4,4) +split x,0 append[1--1] y
5641
5642 split_tiles:
5643 M!=0,_N!=0,_is_homogeneous={ 0 | 1 }
5644
5645 Split selected images as a MxN array of tiles.
5646 If M or N is negative, it stands for the tile size instead.
5647
5648 Default values: 'N=M' and 'is_homogeneous=0'.
5649
5650 Example:
5651 [#1] image.jpg +local split_tiles 5,4 blur 3,0 sharpen 700 ap‐
5652 pend_tiles 4,5 endlocal
5653
5654 undistort:
5655 -1<=_amplitude<=1,_aspect_ratio,_zoom,_center_x[%],_cen‐
5656 ter_y[%],_boundary_conditions
5657
5658 Correct barrel/pincushion distortions occurring with wide-angle
5659 lens.
5660 References:
5661 [1] Zhang Z. (1999). Flexible camera calibration by viewing a plane
5662 from unknown orientation.
5663 [2] Andrew W. Fitzgibbon (2001). Simultaneous linear estimation of
5664 multiple view geometry and lens distortion.
5665 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
5666 | 3=mirror }.
5667
5668 Default values: 'amplitude=0.25', 'aspect_ratio=0', 'zoom=0', 'cen‐
5669 ter_x=center_y=50%' and 'boundary_conditions=0'.
5670
5671 y (+):
5672 Shortcut for command 'unroll'.
5673
5674 unroll (+):
5675 _axis={ x | y | z | c }
5676
5677 Unroll selected images along specified axis.
5678 (equivalent to shortcut command 'y').
5679
5680 Default value: 'axis=y'.
5681
5682 Example:
5683 [#1] (1,2,3;4,5,6;7,8,9) +unroll y
5684
5685 upscale_smart:
5686 width[%],_height[%],_depth,_smoothness>=0,_anisot‐
5687 ropy=[0,1],sharpening>=0
5688
5689 Upscale selected images with an edge-preserving algorithm.
5690
5691 Default values: 'height=100%', 'depth=100%', 'smoothness=2', 'an‐
5692 isotropy=0.4' and 'sharpening=10'.
5693
5694 Example:
5695 [#1] image.jpg resize2dy 100 +upscale_smart 500%,500% append x
5696
5697 warp (+):
5698 [warping_field],_mode,_interpolation,_boundary_condi‐
5699 tions,_nb_frames>0
5700
5701 Warp selected images with specified displacement field.
5702 'mode' can be { 0=backward-absolute | 1=backward-relative | 2=for‐
5703 ward-absolute | 3=forward-relative }.
5704 'interpolation' can be { 0=nearest-neighbor | 1=linear | 2=cubic }.
5705 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
5706 | 3=mirror }.
5707
5708 Default values: 'mode=0', 'interpolation=1', 'boundary_condi‐
5709 tions=1' and 'nb_frames=1'.
5710
5711 Example:
5712 [#1] image.jpg
5713 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))'
5714 warp[-2] [-1],1,1,0 quiver[-1] [-1],10,1,1,1,100
5715
5716 Tutorial: https://gmic.eu/oldtutorial/_warp.shtml
5717
5718 warp_patch:
5719 [warp‐
5720 ing_field],patch_width>=1,_patch_height>=1,_patch_depth>=1,_std_fac‐
5721 tor>0,_boundary_conditions.
5722
5723 Patch-warp selected images, with specified 2D or 3D displacement
5724 field (in backward-absolute mode).
5725 Argument 'std_factor' sets the std of the gaussian weights for the
5726 patch overlap,
5727 equal to 'std = std_factor*patch_size'.
5728 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
5729 | 3=mirror }.
5730
5731 Default values: 'std_factor=0.3' and 'boundary_conditions=3'.
5732
5733 warp_rbf:
5734 xs0[%],ys0[%],xt0[%],yt0[%],...,xsN[%],ysN[%],xtN[%],ytN[%]
5735
5736 Warp selected images using RBF-based interpolation.
5737 Each argument (xsk,ysk)-(xtk,ytk) corresponds to the coordinates of
5738 a keypoint
5739 respectively on the source and target images. The set of all key‐
5740 points define the overall image deformation.
5741
5742 Example:
5743 [#1] image.jpg +warp_rbf
5744 0,0,0,0,100%,0,100%,0,100%,100%,100%,100%,0,100%,0,100%,50%,50%,70%,50%,25%,25%,25%,75%
5745
5746 12.8. Filtering
5747 ---------
5748
5749 bandpass:
5750 _min_freq[%],_max_freq[%]
5751
5752 Apply bandpass filter to selected images.
5753
5754 Default values: 'min_freq=0' and 'max_freq=20%'.
5755
5756 Example:
5757 [#1] image.jpg bandpass 1%,3%
5758
5759 Tutorial: https://gmic.eu/oldtutorial/_bandpass.shtml
5760
5761 bilateral (+):
5762 [guide],std_deviation_s[%]>=0,std_deviation_r[%]>=0,_sam‐
5763 pling_s>=0,_sampling_r>=0 |
5764 std_deviation_s[%]>=0,std_deviation_r[%]>=0,_sampling_s>=0,_sam‐
5765 pling_r>=0
5766
5767 Blur selected images by anisotropic (eventually joint/cross) bilat‐
5768 eral filtering.
5769 If a guide image is provided, it is used for drive the smoothing
5770 filter.
5771 A guide image must be of the same xyz-size as the selected images.
5772 Set 'sampling' arguments to '0' for automatic adjustment.
5773
5774 Example:
5775 [#1] image.jpg repeat 5 bilateral 10,10 done
5776
5777 b (+):
5778 Shortcut for command 'blur'.
5779
5780 blur (+):
5781 std_deviation>=0[%],_boundary_conditions,_kernel |
5782 axes,std_deviation>=0[%],_boundary_conditions,_kernel
5783
5784 Blur selected images by a deriche or gaussian filter (recursive im‐
5785 plementation).
5786 (equivalent to shortcut command 'b').
5787
5788 'boundary_conditions' can be { 0=dirichlet | 1=neumann }.
5789 'kernel' can be { 0=deriche | 1=gaussian }.
5790 When specified, argument 'axes' is a sequence of { x | y | z | c }.
5791 Specifying one axis multiple times apply also the blur multiple
5792 times.
5793
5794 Default values: 'boundary_conditions=1' and 'kernel=1'.
5795
5796 Example:
5797 [#1] image.jpg +blur 5,0 +blur[0] 5,1
5798 [#2] image.jpg +blur y,10%
5799
5800 Tutorial: https://gmic.eu/oldtutorial/_blur.shtml
5801
5802 blur_angular:
5803 amplitude[%],_center_x[%],_center_y[%]
5804
5805 Apply angular blur on selected images.
5806
5807 Default values: 'center_x=center_y=50%'.
5808
5809 Example:
5810 [#1] image.jpg blur_angular 2%
5811
5812 Tutorial: https://gmic.eu/oldtutorial/_blur_angular.shtml
5813
5814 blur_bloom:
5815 _amplitude>=0,_ratio>=0,_nb_iter>=0,_blend_operator={ + | max |
5816 min },_kernel={ 0=deriche | 1=gaussian | 2=box | 3=triangle | 4=qua‐
5817 dratic },_normalize_scales={ 0 | 1 },_axes
5818
5819 Apply a bloom filter that blend multiple blur filters of different
5820 radii,
5821 resulting in a larger but sharper glare than a simple blur.
5822 When specified, argument 'axes' is a sequence of { x | y | z | c }.
5823 Specifying one axis multiple times apply also the blur multiple
5824 times.
5825 Reference: Masaki Kawase, "Practical Implementation of High Dynamic
5826 Range Rendering", GDC 2004.
5827
5828 Default values: 'amplitude=1', 'ratio=2', 'nb_iter=5', 'blend_oper‐
5829 ator=+', 'kernel=1', 'normalize_scales=0' and 'axes=(all)'
5830
5831 Example:
5832 [#1] image.jpg blur_bloom ,
5833
5834 blur_linear:
5835 amplitude1[%],_amplitude2[%],_angle,_boundary_conditions={
5836 0=dirichlet | 1=neumann }
5837
5838 Apply linear blur on selected images, with specified angle and am‐
5839 plitudes.
5840
5841 Default values: 'amplitude2=0', 'angle=0' and 'boundary_condi‐
5842 tions=1'.
5843
5844 Example:
5845 [#1] image.jpg blur_linear 10,0,45
5846
5847 Tutorial: https://gmic.eu/oldtutorial/_blur_linear.shtml
5848
5849 blur_radial:
5850 amplitude[%],_center_x[%],_center_y[%]
5851
5852 Apply radial blur on selected images.
5853
5854 Default values: 'center_x=center_y=50%'.
5855
5856 Example:
5857 [#1] image.jpg blur_radial 2%
5858
5859 Tutorial: https://gmic.eu/oldtutorial/_blur_radial.shtml
5860
5861 blur_selective:
5862 sigma>=0,_edges>0,_nb_scales>0
5863
5864 Blur selected images using selective gaussian scales.
5865
5866 Default values: 'sigma=5', 'edges=0.5' and 'nb_scales=5'.
5867
5868 Example:
5869 [#1] image.jpg noise 20 cut 0,255 +local[-1] repeat 4 blur_selec‐
5870 tive , done endlocal
5871
5872 Tutorial: https://gmic.eu/oldtutorial/_blur_selective.shtml
5873
5874 blur_x:
5875 amplitude[%]>=0,_boundary_conditions={ 0=dirichlet | 1=neumann }
5876
5877 Blur selected images along the x-axis.
5878
5879 Default value: 'boundary_conditions=1'.
5880
5881 Example:
5882 [#1] image.jpg +blur_x 6
5883
5884 Tutorial: https://gmic.eu/oldtutorial/_blur_x.shtml
5885
5886 blur_xy:
5887 amplitude_x[%],amplitude_y[%],_boundary_conditions={ 0=dirichlet
5888 | 1=neumann }
5889
5890 Blur selected images along the X and Y axes.
5891
5892 Default value: 'boundary_conditions=1'.
5893
5894 Example:
5895 [#1] image.jpg +blur_xy 6
5896
5897 Tutorial: https://gmic.eu/oldtutorial/_blur_xy.shtml
5898
5899 blur_xyz:
5900 amplitude_x[%],amplitude_y[%],amplitude_z,_boundary_conditions={
5901 0=dirichlet | 1=neumann }
5902
5903 Blur selected images along the X, Y and Z axes.
5904
5905 Default value: 'boundary_conditions=1'.
5906
5907 Tutorial: https://gmic.eu/oldtutorial/_blur_xyz.shtml
5908
5909 blur_y:
5910 amplitude[%]>=0,_boundary_conditions={ 0=dirichlet | 1=neumann }
5911
5912 Blur selected images along the y-axis.
5913
5914 Default value: 'boundary_conditions=1'.
5915
5916 Example:
5917 [#1] image.jpg +blur_y 6
5918
5919 Tutorial: https://gmic.eu/oldtutorial/_blur_y.shtml
5920
5921 blur_z:
5922 amplitude[%]>=0,_boundary_conditions={ 0=dirichlet | 1=neumann }
5923
5924 Blur selected images along the z-axis.
5925
5926 Default value: 'boundary_conditions=1'.
5927
5928 Tutorial: https://gmic.eu/oldtutorial/_blur_z.shtml
5929
5930 boxfilter (+):
5931 size>=0[%],_order,_boundary_conditions,_nb_iter>=0 |
5932 axes,size>=0[%],_order,_boundary_conditions,_nb_iter>=0
5933
5934 Blur selected images by a box filter of specified size (fast recur‐
5935 sive implementation).
5936 'order' can be { 0=smooth | 1=1st-derivative | 2=2nd-derivative }.
5937 'boundary_conditions' can be { 0=dirichlet | 1=neumann }.
5938 When specified, argument 'axes' is a sequence of { x | y | z | c }.
5939 Specifying one axis multiple times apply also the blur multiple
5940 times.
5941
5942 Default values: 'order=0', 'boundary_conditions=1' and 'nb_iter=1'.
5943
5944 Example:
5945 [#1] image.jpg +boxfilter 5%
5946 [#2] image.jpg +boxfilter y,3,1
5947
5948 bump2normal:
5949
5950 Convert selected bumpmaps to normalmaps.
5951
5952 Example:
5953 [#1] 300,300 circle 50%,50%,128,1,1 blur 5% bump2normal
5954
5955 compose_freq:
5956
5957 Compose selected low and high frequency parts into new images.
5958
5959 Example:
5960 [#1] image.jpg split_freq 2% mirror[-1] x compose_freq
5961
5962 convolve (+):
5963 [mask],_boundary_conditions,_is_normalized={ 0 | 1 },_chan‐
5964 nel_mode,_xcenter,_ycenter,_zcenter,_xstart,_ystart,_zs‐
5965 tart,_xend,_yend,_zend,_xstride,_ystride,_zstride,_xdilation,_ydila‐
5966 tion,_zdilation
5967
5968 Convolve selected images by specified mask.
5969 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
5970 | 3=mirror }.
5971 'channel_mode' can be { 0=sum input channels | 1=one-for-one |
5972 2=expand }.
5973
5974 Default values: 'boundary_conditions=1', 'is_normalized=0', 'chan‐
5975 nel_mode=1', 'xcenter=ycenter=zcenter=-1' (-1=centered), 'xstart=ys‐
5976 tart=zstart=0',
5977 'xend=yend=zend=-1' (-1=max coordinates),
5978 'xstride=ystride=zstride=1' and 'xdilation=ydilation=zdilation=1'.
5979
5980 Example:
5981 [#1] image.jpg (0,1,0;1,-4,1;0,1,0) convolve[-2] [-1] keep[-2]
5982 [#2] image.jpg (0,1,0) resize[-1] 130,1,1,1,3 +convolve[0] [1]
5983
5984 Tutorial: https://gmic.eu/oldtutorial/_convolve.shtml
5985
5986 convolve_fft:
5987 [mask],_boundary_conditions
5988
5989 Convolve selected images with specified mask, in the fourier do‐
5990 main.
5991 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
5992 | 3=mirror }.
5993
5994 Example:
5995 [#1] image.jpg 100%,100% gaussian[-1] 20,1,45 +convolve_fft[0]
5996 [1]
5997
5998 correlate (+):
5999 [mask],_boundary_conditions,_is_normalized={ 0 | 1 },_chan‐
6000 nel_mode,_xcenter,_ycenter,_zcenter,_xstart,_ystart,_zs‐
6001 tart,_xend,_yend,_zend,_xstride,_ystride,_zstride,_xdilation,_ydila‐
6002 tion,_zdilation
6003
6004 Correlate selected images by specified mask.
6005 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
6006 | 3=mirror }.
6007 'channel_mode' can be { 0=sum input channels | 1=one-for-one |
6008 2=expand }.
6009
6010 Default values: 'boundary_conditions=1', 'is_normalized=0', 'chan‐
6011 nel_mode=1', 'xcenter=ycenter=zcenter=-1' (-1=centered), 'xstart=ys‐
6012 tart=zstart=0',
6013 'xend=yend=zend=-1' (-1=max coordinates),
6014 'xstride=ystride=zstride=1' and 'xdilation=ydilation=zdilation=1'.
6015
6016 Example:
6017 [#1] image.jpg (0,1,0;1,-4,1;0,1,0) correlate[-2] [-1] keep[-2]
6018 [#2] image.jpg +crop 40%,40%,60%,60% +correlate[0] [-1],0,1
6019
6020 cross_correlation:
6021 [mask]
6022
6023 Compute cross-correlation of selected images with specified mask.
6024
6025 Example:
6026 [#1] image.jpg +shift -30,-20 +cross_correlation[0] [1]
6027
6028 curvature:
6029
6030 Compute isophote curvatures on selected images.
6031
6032 Example:
6033 [#1] image.jpg blur 10 curvature
6034
6035 dct:
6036 _{ x | y | z }...{ x | y | z } |
6037 (no arg)
6038
6039 Compute the discrete cosine transform of selected images, option‐
6040 ally along the specified axes only.
6041 Output images are always evenly sized, so this command may change
6042 the size of the selected images.
6043
6044 Default values: (no arg)
6045 See also: idct.
6046
6047 Example:
6048 [#1] image.jpg +dct +idct[-1] abs[-2] +[-2] 1 log[-2]
6049
6050 Tutorial: https://gmic.eu/oldtutorial/_dct-and-idct.shtml
6051
6052 deblur:
6053 amplitude[%]>=0,_nb_iter>=0,_dt>=0,_regul>=0,_regul_type={
6054 0=Tikhonov | 1=meancurv. | 2=TV }
6055
6056 Deblur image using a regularized Jansson-Van Cittert algorithm.
6057
6058 Default values: 'nb_iter=10', 'dt=20', 'regul=0.7' and
6059 'regul_type=1'.
6060
6061 Example:
6062 [#1] image.jpg blur 3 +deblur 3,40,20,0.01
6063
6064 deblur_goldmeinel:
6065 sigma>=0,_nb_iter>=0,_acceleration>=0,_kernel_type={ 0=deriche |
6066 1=gaussian }.
6067
6068 Deblur selected images using Gold-Meinel algorithm
6069
6070 Default values: 'nb_iter=8', 'acceleration=1' and 'kernel_type=1'.
6071
6072 Example:
6073 [#1] image.jpg +blur 1 +deblur_goldmeinel[-1] 1
6074
6075 deblur_richardsonlucy:
6076 sigma>=0, nb_iter>=0, _kernel_type={ 0=deriche | 1=gaussian }.
6077
6078 Deblur selected images using Richardson-Lucy algorithm.
6079
6080 Default values: 'nb_iter=50' and 'kernel_type=1'.
6081
6082 Example:
6083 [#1] image.jpg +blur 1 +deblur_richardsonlucy[-1] 1
6084
6085 deconvolve_fft:
6086 [kernel],_regularization>=0
6087
6088 Deconvolve selected images by specified mask in the fourier space.
6089
6090 Default value: 'regularization>=0'.
6091
6092 Example:
6093 [#1] image.jpg +gaussian 5 +convolve_fft[0] [1] +decon‐
6094 volve_fft[-1] [1]
6095
6096 deinterlace:
6097 _method={ 0 | 1 }
6098
6099 Deinterlace selected images ('method' can be { 0=standard or 1=mo‐
6100 tion-compensated }).
6101
6102 Default value: 'method=0'.
6103
6104 Example:
6105 [#1] image.jpg +rotate 3,1,1,50%,50% resize 100%,50% resize
6106 100%,200%,1,3,4 shift[-1] 0,1 add +deinterlace 1
6107
6108 denoise (+):
6109 [guide],std_deviation_s[%]>=0,_std_devia‐
6110 tion_r[%]>=0,_patch_size>0,_lookup_size>0,_smoothness,_fast_approx={ 0
6111 | 1 } |
6112 std_deviation_s[%]>=0,_std_devia‐
6113 tion_r[%]>=0,_patch_size>0,_lookup_size>0,_smoothness,_fast_approx={ 0
6114 | 1 }
6115
6116 Denoise selected images by non-local patch averaging.
6117
6118 Default values: 'std_deviation_p=10', 'patch_size=5',
6119 'lookup_size=6' and 'smoothness=1'.
6120
6121 Example:
6122 [#1] image.jpg +denoise 5,5,8
6123
6124 denoise_haar:
6125 _threshold>=0,_nb_scales>=0,_cycle_spinning>0
6126
6127 Denoise selected images using haar-wavelet thresholding with cycle
6128 spinning.
6129 Set 'nb_scales==0' to automatically determine the optimal number of
6130 scales.
6131
6132 Default values: 'threshold=1.4', 'nb_scale=0' and 'cycle_spin‐
6133 ning=10'.
6134
6135 Example:
6136 [#1] image.jpg noise 20 cut 0,255 +denoise_haar[-1] 0.8
6137
6138 denoise_patchpca:
6139 _strength>=0,_patch_size>0,_lookup_size>0,_spatial_sampling>0
6140
6141 Denoise selected images using the patch-pca algorithm.
6142
6143 Default values: 'patch_size=7', 'lookup_size=11', 'details=1.8' and
6144 'spatial_sampling=5'.
6145
6146 Example:
6147 [#1] image.jpg +noise 20 cut[-1] 0,255 +denoise_patchpca[-1] ,
6148
6149 deriche (+):
6150 std_deviation>=0[%],order={ 0 | 1 | 2 },axis={ x | y | z | c
6151 },_boundary_conditions
6152
6153 Apply Deriche recursive filter on selected images, along specified
6154 axis and with
6155 specified standard deviation, order and boundary conditions.
6156 'boundary_conditions' can be { 0=dirichlet | 1=neumann }.
6157
6158 Default value: 'boundary_conditions=1'.
6159
6160 Example:
6161 [#1] image.jpg deriche 3,1,x
6162 [#2] image.jpg +deriche 30,0,x deriche[-2] 30,0,y add
6163
6164 Tutorial: https://gmic.eu/oldtutorial/_deriche.shtml
6165
6166 dilate (+):
6167 size>=0 |
6168 size_x>=0,size_y>=0,size_z>=0 |
6169 [kernel],_boundary_conditions,_is_real={ 0=binary-mode | 1=real-
6170 mode }
6171
6172 Dilate selected images by a rectangular or the specified structur‐
6173 ing element.
6174 'boundary_conditions' can be { 0=dirichlet | 1=neumann }.
6175
6176 Default values: 'size_z=1', 'boundary_conditions=1' and
6177 'is_real=0'.
6178
6179 Example:
6180 [#1] image.jpg +dilate 10
6181
6182 dilate_circ:
6183 _size>=0,_boundary_conditions,_is_normalized={ 0 | 1 }
6184
6185 Apply circular dilation of selected images by specified size.
6186
6187 Default values: 'boundary_conditions=1' and 'is_normalized=0'.
6188
6189 Example:
6190 [#1] image.jpg +dilate_circ 7
6191
6192 dilate_oct:
6193 _size>=0,_boundary_conditions,_is_normalized={ 0 | 1 }
6194
6195 Apply octagonal dilation of selected images by specified size.
6196
6197 Default values: 'boundary_conditions=1' and 'is_normalized=0'.
6198
6199 Example:
6200 [#1] image.jpg +dilate_oct 7
6201
6202 dilate_threshold:
6203 size_x>=1,size_y>=1,size_z>=1,_threshold>=0,_boundary_conditions
6204
6205 Dilate selected images in the (X,Y,Z,I) space.
6206 'boundary_conditions' can be { 0=dirichlet | 1=neumann }.
6207
6208 Default values: 'size_y=size_x', 'size_z=1', 'threshold=255' and
6209 'boundary_conditions=1'.
6210
6211 divergence:
6212
6213 Compute divergence of selected vector fields.
6214
6215 Example:
6216 [#1] image.jpg luminance +gradient append[-2,-1] c divergence[-1]
6217
6218 dog:
6219 _sigma1>=0[%],_sigma2>=0[%]
6220
6221 Compute difference of gaussian on selected images.
6222
6223 Default values: 'sigma1=2%' and 'sigma2=3%'.
6224
6225 Example:
6226 [#1] image.jpg dog 2,3
6227
6228 diffusiontensors:
6229 _sharpness>=0,0<=_anisotropy<=1,_alpha[%],_sigma[%],is_sqrt={ 0 |
6230 1 }
6231
6232 Compute the diffusion tensors of selected images for edge-preserv‐
6233 ing smoothing algorithms.
6234
6235 Default values: 'sharpness=0.7', 'anisotropy=0.3', 'alpha=0.6',
6236 'sigma=1.1' and 'is_sqrt=0'.
6237
6238 Example:
6239 [#1] image.jpg diffusiontensors 0.8 abs pow 0.2
6240
6241 Tutorial: https://gmic.eu/oldtutorial/_diffusiontensors.shtml
6242
6243 edges:
6244 _threshold[%]>=0
6245
6246 Estimate contours of selected images.
6247
6248 Default value: 'edges=15%'
6249
6250 Example:
6251 [#1] image.jpg +edges 15%
6252
6253 erode (+):
6254 size>=0 |
6255 size_x>=0,size_y>=0,_size_z>=0 |
6256 [kernel],_boundary_conditions,_is_real={ 0=binary-mode | 1=real-
6257 mode }
6258
6259 Erode selected images by a rectangular or the specified structuring
6260 element.
6261 'boundary_conditions' can be { 0=dirichlet | 1=neumann }.
6262
6263 Default values: 'size_z=1', 'boundary_conditions=1' and
6264 'is_real=0'.
6265
6266 Example:
6267 [#1] image.jpg +erode 10
6268
6269 erode_circ:
6270 _size>=0,_boundary_conditions,_is_normalized={ 0 | 1 }
6271
6272 Apply circular erosion of selected images by specified size.
6273
6274 Default values: 'boundary_conditions=1' and 'is_normalized=0'.
6275
6276 Example:
6277 [#1] image.jpg +erode_circ 7
6278
6279 erode_oct:
6280 _size>=0,_boundary_conditions,_is_normalized={ 0 | 1 }
6281
6282 Apply octagonal erosion of selected images by specified size.
6283
6284 Default values: 'boundary_conditions=1' and 'is_normalized=0'.
6285
6286 Example:
6287 [#1] image.jpg +erode_oct 7
6288
6289 erode_threshold:
6290 size_x>=1,size_y>=1,size_z>=1,_threshold>=0,_boundary_conditions
6291
6292 Erode selected images in the (X,Y,Z,I) space.
6293 'boundary_conditions' can be { 0=dirichlet | 1=neumann }.
6294
6295 Default values: 'size_y=size_x', 'size_z=1', 'threshold=255' and
6296 'boundary_conditions=1'.
6297
6298 fft (+):
6299 _{ x | y | z }...{ x | y | z }
6300
6301 Compute the direct fourier transform (real and imaginary parts) of
6302 selected images,
6303 optionally along the specified axes only.
6304 See also: ifft.
6305
6306 Example:
6307 [#1] image.jpg luminance +fft append[-2,-1] c norm[-1] log[-1]
6308 shift[-1] 50%,50%,0,0,2
6309 [#2] image.jpg w2={int(w/2)} h2={int(h/2)} fft shift
6310 $w2,$h2,0,0,2 ellipse $w2,$h2,30,30,0,1,0 shift -$w2,-$h2,0,0,2 ifft
6311 remove[-1]
6312
6313 Tutorial: https://gmic.eu/oldtutorial/_fft.shtml
6314
6315 g (+):
6316 Shortcut for command 'gradient'.
6317
6318 gradient (+):
6319 { x | y | z }...{ x | y | z },_scheme |
6320 (no arg)
6321
6322 Compute the gradient components (first derivatives) of selected im‐
6323 ages.
6324 (equivalent to shortcut command 'g').
6325
6326 'scheme' can be { -1=backward | 0=centered | 1=forward | 2=sobel |
6327 3=rotation-invariant (default) | 4=deriche | 5=vanvliet }.
6328 (no arg) compute all significant components.
6329
6330 Default value: 'scheme=0'.
6331
6332 Example:
6333 [#1] image.jpg gradient
6334
6335 Tutorial: https://gmic.eu/oldtutorial/_gradient.shtml
6336
6337 gradient_norm:
6338
6339 Compute gradient norm of selected images.
6340
6341 Example:
6342 [#1] image.jpg gradient_norm equalize
6343
6344 Tutorial: https://gmic.eu/oldtutorial/_gradient_norm.shtml
6345
6346 gradient_orientation:
6347 _dimension={1,2,3}
6348
6349 Compute N-d gradient orientation of selected images.
6350
6351 Default value: 'dimension=3'.
6352
6353 Example:
6354 [#1] image.jpg +gradient_orientation 2
6355
6356 guided (+):
6357 [guide],radius[%]>=0,regularization[%]>=0 |
6358 radius[%]>=0,regularization[%]>=0
6359
6360 Blur selected images by guided image filtering.
6361 If a guide image is provided, it is used to drive the smoothing
6362 process.
6363 A guide image must be of the same xyz-size as the selected images.
6364 This command implements the filtering algorithm described in:
6365 He, Kaiming; Sun, Jian; Tang, Xiaoou, "Guided Image Filtering",
6366 IEEE Transactions on Pattern Analysis and Machine Intelligence,
6367 vol.35, no.6, pp.1397,1409, June 2013
6368
6369 Example:
6370 [#1] image.jpg +guided 5,400
6371
6372 haar:
6373 scale>0
6374
6375 Compute the direct haar multiscale wavelet transform of selected
6376 images.
6377 See also: ihaar.
6378
6379 Tutorial: https://gmic.eu/oldtutorial/_haar.shtml
6380
6381 heat_flow:
6382 _nb_iter>=0,_dt,_keep_sequence={ 0 | 1 }
6383
6384 Apply iterations of the heat flow on selected images.
6385
6386 Default values: 'nb_iter=10', 'dt=30' and 'keep_sequence=0'.
6387
6388 Example:
6389 [#1] image.jpg +heat_flow 20
6390
6391 hessian (+):
6392 { xx | xy | xz | yy | yz | zz }...{ xx | xy | xz | yy | yz | zz }
6393 |
6394 (no arg)
6395
6396 Compute the hessian components (second derivatives) of selected im‐
6397 ages.
6398 (no arg) compute all significant components.
6399
6400 Example:
6401 [#1] image.jpg hessian
6402
6403 idct:
6404 _{ x | y | z }...{ x | y | z } |
6405 (no arg)
6406
6407 Compute the inverse discrete cosine transform of selected images,
6408 optionally along the specified axes only.
6409 Output images are always evenly sized, so this command may change
6410 the size of the selected images.
6411 (dct images obtained with the 'dct' command are evenly sized any‐
6412 way).
6413
6414 Default values: (no arg)
6415 See also: dct.
6416
6417 Tutorial: https://gmic.eu/oldtutorial/_dct-and-idct.shtml
6418
6419 iee:
6420
6421 Compute gradient-orthogonal-directed 2nd derivative of image(s).
6422
6423 Example:
6424 [#1] image.jpg iee
6425
6426 ifft (+):
6427 _{ x | y | z }...{ x | y | z }
6428
6429 Compute the inverse fourier transform (real and imaginary parts) of
6430 selected images.
6431 optionally along the specified axes only.
6432 See also: fft.
6433
6434 Tutorial: https://gmic.eu/oldtutorial/_fft.shtml
6435
6436 ihaar:
6437 scale>0
6438
6439 Compute the inverse haar multiscale wavelet transform of selected
6440 images.
6441 See also: haar.
6442
6443 ilaplacian:
6444 { nb_iterations>0 | 0 },_[initial_estimate]
6445
6446 Invert selected Laplacian images.
6447 If given 'nb_iterations' is '0', inversion is done in Fourier space
6448 (single iteration),
6449 otherwise, by applying 'nb_iterations' of a Laplacian-inversion PDE
6450 flow.
6451 Note that the resulting inversions are just estimation of possi‐
6452 ble/approximated solutions.
6453
6454 Default values: 'nb_iterations=0' and '[initial_estimated]=(unde‐
6455 fined)'.
6456
6457 Example:
6458 [#1] image.jpg +laplacian +ilaplacian[-1] 0
6459
6460 inn:
6461
6462 Compute gradient-directed 2nd derivative of image(s).
6463
6464 Example:
6465 [#1] image.jpg inn
6466
6467 inpaint (+):
6468 [mask] |
6469 [mask],0,_fast_method |
6470 [mask],_patch_size>=1,_lookup_size>=1,_lookup_fac‐
6471 tor>=0,_lookup_increment!=0,_blend_size>=0,0<=_blend_thresh‐
6472 old<=1,_blend_decay>=0,_blend_scales>=1,_is_blend_outer={ 0 | 1 }
6473
6474 Inpaint selected images by specified mask.
6475 If no patch size (or 0) is specified, inpainting is done using a
6476 fast average or median algorithm.
6477 Otherwise, it used a patch-based reconstruction method, that can be
6478 very time consuming.
6479 'fast_method' can be { 0=low-connectivity average | 1=high-connec‐
6480 tivity average | 2=low-connectivity median | 3=high-connectivity median
6481 }.
6482
6483 Default values: 'patch_size=0', 'fast_method=1', 'lookup_size=22',
6484 'lookup_factor=0.5', 'lookup_increment=1', 'blend_size=0',
6485 'blend_threshold=0',
6486 'blend_decay=0.05', 'blend_scales=10' and 'is_blend_outer=1'.
6487
6488 Example:
6489 [#1] image.jpg 100%,100% ellipse 50%,50%,30,30,0,1,255 ellipse
6490 20%,20%,30,10,0,1,255 +inpaint[-2] [-1] remove[-2]
6491 [#2] image.jpg 100%,100% circle 30%,30%,30,1,255,0,255 circle
6492 70%,70%,50,1,255,0,255 +inpaint[0] [1],5,15,0.5,1,9,0 remove[1]
6493
6494 inpaint_pde:
6495 [mask],_nb_scales[%]>=0,_diffusion_type={ 0=isotropic | 1=delau‐
6496 nay-guided | 2=edge-guided | 3=mask-guided },_diffusion_iter>=0
6497
6498 Inpaint selected images by specified mask using a multiscale trans‐
6499 port-diffusion algorithm.
6500 If 'diffusion type==3', non-zero values of the mask (e.g. a dis‐
6501 tance function) are used
6502 to guide the diffusion process.
6503
6504 Default values: 'nb_scales=75%', 'diffusion_type=1' and 'diffu‐
6505 sion_iter=20'.
6506
6507 Example:
6508 [#1] image.jpg 100%,100% ellipse[-1] 30%,30%,40,30,0,1,255 +in‐
6509 paint_pde[0] [1]
6510
6511 inpaint_flow:
6512 [mask],_nb_global_iter>=0,_nb_local_iter>=0,_dt>0,_al‐
6513 pha>=0,_sigma>=0
6514
6515 Apply iteration of the inpainting flow on selected images.
6516
6517 Default values: 'nb_global_iter=10', 'nb_local_iter=100', 'dt=5',
6518 'alpha=1' and 'sigma=3'.
6519
6520 Example:
6521 [#1] image.jpg 100%,100% ellipse[-1] 30%,30%,40,30,0,1,255 in‐
6522 paint_flow[0] [1]
6523
6524 inpaint_holes:
6525 maximal_area[%]>=0,_tolerance>=0,_is_high_connectivity={ 0 | 1 }
6526
6527 Inpaint all connected regions having an area less than specified
6528 value.
6529
6530 Default values: 'maximal_area=4', 'tolerance=0' and 'is_high_con‐
6531 nectivity=0'.
6532
6533 Example:
6534 [#1] image.jpg noise 5%,2 +inpaint_holes 8,40
6535
6536 inpaint_morpho:
6537 [mask]
6538
6539 Inpaint selected images by specified mask using morphological oper‐
6540 ators.
6541
6542 Example:
6543 [#1] image.jpg 100%,100% ellipse[-1] 30%,30%,40,30,0,1,255 +in‐
6544 paint_morpho[0] [1]
6545
6546 inpaint_matchpatch:
6547 [mask],_nb_scales={ 0=auto | >0 },_patch_size>0,_nb_itera‐
6548 tions_per_scale>0,_blend_size>=0,_allow_outer_blending={ 0 | 1
6549 },_is_already_initialized={ 0 | 1 }
6550
6551 Inpaint selected images by specified binary mask, using a multi-
6552 scale matchpatch algorithm.
6553
6554 Default values: 'nb_scales=0', 'patch_size=9', 'nb_itera‐
6555 tions_per_scale=10', 'blend_size=5','allow_outer_blending=1' and
6556 'is_already_initialized=0'.
6557
6558 Example:
6559 [#1] image.jpg 100%,100% ellipse[-1] 30%,30%,40,30,0,1,255 +in‐
6560 paint_matchpatch[0] [1]
6561
6562 kuwahara:
6563 size>0
6564
6565 Apply Kuwahara filter of specified size on selected images.
6566
6567 Example:
6568 [#1] image.jpg kuwahara 9
6569
6570 laplacian:
6571
6572 Compute Laplacian of selected images.
6573
6574 Example:
6575 [#1] image.jpg laplacian
6576
6577 lic:
6578 _amplitude>0,_channels>0
6579
6580 Render LIC representation of selected vector fields.
6581
6582 Default values: 'amplitude=30' and 'channels=1'.
6583
6584 Example:
6585 [#1] 400,400,1,2,'if(c==0,x-w/2,y-h/2)' +lic 200,3 quiver[-2]
6586 [-2],10,1,1,1,255
6587
6588 map_tones:
6589 _threshold>=0,_gamma>=0,_smoothness>=0,nb_iter>=0
6590
6591 Apply tone mapping operator on selected images, based on Poisson
6592 equation.
6593
6594 Default values: 'threshold=0.1', 'gamma=0.8', 'smoothness=0.5' and
6595 'nb_iter=30'.
6596
6597 Example:
6598 [#1] image.jpg +map_tones ,
6599
6600 map_tones_fast:
6601 _radius[%]>=0,_power>=0
6602
6603 Apply fast tone mapping operator on selected images.
6604
6605 Default values: 'radius=3%' and 'power=0.3'.
6606
6607 Example:
6608 [#1] image.jpg +map_tones_fast ,
6609
6610 meancurvature_flow:
6611 _nb_iter>=0,_dt,_keep_sequence={ 0 | 1 }
6612
6613 Apply iterations of the mean curvature flow on selected images.
6614
6615 Default values: 'nb_iter=10', 'dt=30' and 'keep_sequence=0'.
6616
6617 Example:
6618 [#1] image.jpg +meancurvature_flow 20
6619
6620 median (+):
6621 size>=0,_threshold>0
6622
6623 Apply (opt. thresholded) median filter on selected images with
6624 structuring element size x size.
6625
6626 Example:
6627 [#1] image.jpg +median 5
6628
6629 nlmeans:
6630 [guide],_patch_radius>0,_spatial_bandwidth>0,_tonal_band‐
6631 width>0,_patch_measure_command |
6632 _patch_radius>0,_spatial_bandwidth>0,_tonal_band‐
6633 width>0,_patch_measure_command
6634
6635 Apply non local means denoising of Buades et al, 2005. on selected
6636 images.
6637 The patch is a gaussian function of 'std_patch_radius'.
6638 The spatial kernel is a rectangle of radius 'spatial_bandwidth'.
6639 The tonal kernel is exponential ('exp(-d^2/_tonal_bandwidth^2)')
6640 with 'd' the euclidean distance between image patches.
6641
6642 Default values: 'patch_radius=4', 'spatial_bandwidth=4',
6643 'tonal_bandwidth=10' and 'patch_measure_command=-norm'.
6644
6645 Example:
6646 [#1] image.jpg +noise 10 nlmeans[-1] 4,4,{0.6*${-std_noise}}
6647
6648 nlmeans_core:
6649 _reference_image,_scaling_map,_patch_radius>0,_spatial_band‐
6650 width>0
6651
6652 Apply non local means denoising using a image for weight and a map
6653 for scaling
6654
6655 normalize_local:
6656 _amplitude>=0,_radius>0,_n_smooth>=0[%],_a_smooth>=0[%],_is_cut={
6657 0 | 1 },_min=0,_max=255
6658
6659 Normalize selected images locally.
6660
6661 Default values: 'amplitude=3', 'radius=16', 'n_smooth=4%',
6662 'a_smooth=2%', 'is_cut=1', 'min=0' and 'max=255'.
6663
6664 Example:
6665 [#1] image.jpg normalize_local 8,10
6666
6667 normalized_cross_correlation:
6668 [mask]
6669
6670 Compute normalized cross-correlation of selected images with speci‐
6671 fied mask.
6672
6673 Example:
6674 [#1] image.jpg +shift -30,-20 +normalized_cross_correlation[0]
6675 [1]
6676
6677 percentile:
6678 [mask],0<=_min_percentile[%]<=100,0<=_max_percentile[%]<=100.
6679
6680 Apply percentile averaging filter to selected images.
6681
6682 Default values: 'min_percentile=0' and 'max_percentile=100'.
6683
6684 Example:
6685 [#1] image.jpg shape_circle 11,11 +percentile[0] [1],25,75
6686
6687 peronamalik_flow:
6688 K_factor>0,_nb_iter>=0,_dt,_keep_sequence={ 0 | 1 }
6689
6690 Apply iterations of the Perona-Malik flow on selected images.
6691
6692 Default values: 'K_factor=20', 'nb_iter=5', 'dt=5' and 'keep_se‐
6693 quence=0'.
6694
6695 Example:
6696 [#1] image.jpg +heat_flow 20
6697
6698 phase_correlation:
6699 [destination]
6700
6701 Estimate translation vector between selected source images and
6702 specified destination.
6703
6704 Example:
6705 [#1] image.jpg +shift -30,-20 +phase_correlation[0] [1] un‐
6706 roll[-1] y
6707
6708 pde_flow:
6709 _nb_iter>=0,_dt,_velocity_command,_keep_sequence={ 0 | 1 }
6710
6711 Apply iterations of a generic PDE flow on selected images.
6712
6713 Default values: 'nb_iter=10', 'dt=30', 'velocity_command=laplacian'
6714 and 'keep_sequence=0'.
6715
6716 Example:
6717 [#1] image.jpg +pde_flow 20
6718
6719 periodize_poisson:
6720
6721 Periodize selected images using a Poisson solver in Fourier space.
6722
6723 Example:
6724 [#1] image.jpg +periodize_poisson array 2,2,2
6725
6726 rbf:
6727 dx,_x0,_x1,_phi(r) |
6728 dx,dy,_x0,_y0,_x1,_y1,_phi(r) |
6729 dx,dy,dz,x0,y0,z0,x1,y1,z1,phi(r)
6730
6731 Reconstruct 1D/2D or 3D image from selected sets of keypoints, by
6732 RBF-interpolation.
6733 A set of keypoints is represented by a vector-valued image, where
6734 each pixel represents a single keypoint.
6735 Vector components of a keypoint have the following meaning:
6736 - For 1D reconstruction: [ x_k, f1(k),...fN(k) ].
6737 - For 2D reconstruction: [ x_k,y_k, f1(k),...,fN(k) ].
6738 - For 3D reconstruction: [ x_k,y_k,z_k, f1(k),...,fN(k) ].
6739 Values 'x_k','y_k' and 'z_k' are the spatial coordinates of key‐
6740 point 'k'.
6741 Values 'f1(k),..,fN(k)' are the 'N' components of the vector value
6742 of keypoint 'k'.
6743 The command reconstructs an image with specified size
6744 'dx'x'dy'x'dz', with 'N' channels.
6745
6746 Default values: 'x0=y0=z0=0', 'x1=dx-1', 'y1=dy-1', 'z1=dz-1',
6747 'phi(r)=r^2*log(1e-5+r)'.
6748
6749 Example:
6750 [#1] sp colorful r2dx 400 100%,100% noise_poissondisk. 10
6751 1,{is},1,5 eval[-2] "begin(p=0);i?(I[#-1,p++]=[x,y,I(#0)])" to_rgb[1]
6752 mul[0,1] dilate_circ[0] 5 +rbf[-1] {0,[w,h]} c[-1] 0,255
6753 [#2] 32,1,1,5,u([400,400,255,255,255]) rbf 400,400 c 0,255
6754
6755 red_eye:
6756 0<=_threshold<=100,_smoothness>=0,0<=attenuation<=1
6757
6758 Attenuate red-eye effect in selected images.
6759
6760 Default values: 'threshold=75', 'smoothness=3.5' and 'attenua‐
6761 tion=0.1'.
6762
6763 Example:
6764 [#1] image.jpg +red_eye ,
6765
6766 remove_hotpixels:
6767 _mask_size>0, _threshold[%]>0
6768
6769 Remove hot pixels in selected images.
6770
6771 Default values: 'mask_size=3' and 'threshold=10%'.
6772
6773 Example:
6774 [#1] image.jpg noise 10,2 +remove_hotpixels ,
6775
6776 remove_pixels:
6777 number_of_pixels[%]>=0
6778
6779 Remove specified number of pixels (i.e. set them to 0) from the set
6780 of non-zero pixels in selected images.
6781
6782 Example:
6783 [#1] image.jpg +remove_pixels 50%
6784
6785 rolling_guidance:
6786 std_deviation_s[%]>=0,std_deviation_r[%]>=0,_precision>=0
6787
6788 Apply the rolling guidance filter on selected image.
6789 Rolling guidance filter is a fast image abstraction filter, de‐
6790 scribed in:
6791 "Rolling Guidance Filter", Qi Zhang Xiaoyong, Shen Li, Xu Jiaya
6792 Jia, ECCV'2014.
6793
6794 Default values: 'std_deviation_s=4', 'std_deviation_r=10' and 'pre‐
6795 cision=0.5'.
6796
6797 Example:
6798 [#1] image.jpg +rolling_guidance , +-
6799
6800 sharpen (+):
6801 amplitude>=0 |
6802 amplitude>=0,edge>=0,_alpha,_sigma
6803
6804 Sharpen selected images by inverse diffusion or shock filters meth‐
6805 ods.
6806 'edge' must be specified to enable shock-filter method.
6807
6808 Default values: 'alpha=0' and 'sigma=0'.
6809
6810 Example:
6811 [#1] image.jpg sharpen 300
6812 [#2] image.jpg blur 5 sharpen 300,1
6813
6814 smooth (+):
6815 amplitude[%]>=0,_sharpness>=0,0<=_anisotropy<=1,_al‐
6816 pha[%],_sigma[%],_dl>0,_da>0,_precision>0,_interpolation,_fast_approx={
6817 0 | 1 } |
6818 nb_iterations>=0,_sharpness>=0,_anisotropy,_alpha,_sigma,_dt>0,0
6819 |
6820 [tensor_field],_amplitude>=0,_dl>0,_da>0,_precision>0,_interpola‐
6821 tion,_fast_approx={ 0 | 1 } |
6822 [tensor_field],_nb_iters>=0,_dt>0,0
6823
6824 Smooth selected images anisotropically using diffusion PDE's, with
6825 specified field of
6826 diffusion tensors.
6827 'interpolation' can be { 0=nearest | 1=linear | 2=runge-kutta }.
6828
6829 Default values: 'sharpness=0.7', 'anisotropy=0.3', 'alpha=0.6',
6830 'sigma=1.1', 'dl=0.8', 'da=30', 'precision=2', 'interpolation=0' and
6831 'fast_approx=1'.
6832
6833 Example:
6834 [#1] image.jpg repeat 3 smooth 40,0,1,1,2 done
6835 [#2] image.jpg 100%,100%,1,2 rand[-1] -100,100 repeat 2
6836 smooth[-1] 100,0.2,1,4,4 done warp[0] [-1],1,1
6837
6838 Tutorial: https://gmic.eu/oldtutorial/_smooth.shtml
6839
6840 split_freq:
6841 smoothness>0[%]
6842
6843 Split selected images into low and high frequency parts.
6844
6845 Example:
6846 [#1] image.jpg split_freq 2%
6847
6848 solve_poisson:
6849 "laplacian_command",_nb_iterations>=0,_time_step>0,_nb_scales>=0
6850
6851 Solve Poisson equation so that applying 'laplacian[n]' is close to
6852 the result of 'laplacian_command[n]'.
6853 Solving is performed using a multi-scale gradient descent algo‐
6854 rithm.
6855 If 'nb_scales=0', the number of scales is automatically determined.
6856
6857 Default values: 'nb_iterations=60', 'dt=5' and 'nb_scales=0'.
6858
6859 Example:
6860 [#1] image.jpg command "foo : gradient x" +solve_poisson foo
6861 +foo[0] +laplacian[1]
6862
6863 split_details:
6864 _nb_scales>0,_base_scale[%]>=0,_detail_scale[%]>=0
6865
6866 Split selected images into 'nb_scales' detail scales.
6867 If 'base_scale''detail_scale'0, the image decomposition is done
6868 with 'a trous' wavelets.
6869 Otherwise, it uses laplacian pyramids with linear standard devia‐
6870 tions.
6871
6872 Default values: 'nb_scales=4', 'base_scale=0' and 'detail_scale=0'.
6873
6874 Example:
6875 [#1] image.jpg split_details ,
6876
6877 structuretensors (+):
6878 _scheme={ 0=centered | 1=forward/backward }
6879
6880 Compute the structure tensor field of selected images.
6881
6882 Default value: 'scheme=1'.
6883
6884 Example:
6885 [#1] image.jpg structuretensors abs pow 0.2
6886
6887 Tutorial: https://gmic.eu/oldtutorial/_structuretensors.shtml
6888
6889 solidify:
6890 _smoothness[%]>=0,_diffusion_type={ 0=isotropic | 1=delaunay-ori‐
6891 ented | 2=edge-oriented },_diffusion_iter>=0
6892
6893 Solidify selected transparent images.
6894
6895 Default values: 'smoothness=75%', 'diffusion_type=1' and 'diffu‐
6896 sion_iter=20'.
6897
6898 Example:
6899 [#1] image.jpg 100%,100% circle[-1] 50%,50%,25%,1,255 append c
6900 +solidify , display_rgba
6901
6902 syntexturize:
6903 _width[%]>0,_height[%]>0
6904
6905 Resynthetize 'width'x'height' versions of selected micro-textures
6906 by phase randomization.
6907 The texture synthesis algorithm is a straightforward implementation
6908 of the method described in :
6909 http://www.ipol.im/pub/art/2011/ggm_rpn/.
6910
6911 Default values: 'width=height=100%'.
6912
6913 Example:
6914 [#1] image.jpg crop 2,282,50,328 +syntexturize 320,320
6915
6916 syntexturize_matchpatch:
6917 _width[%]>0,_height[%]>0,_nb_scales>=0,_patch_size>0,_blend‐
6918 ing_size>=0,_precision>=0
6919
6920 Resynthetize 'width'x'height' versions of selected micro-textures
6921 using a patch-matching algorithm.
6922 If 'nbscales==0', the number of scales used is estimated from the
6923 image size.
6924
6925 Default values: 'width=height=100%', 'nb_scales=0', 'patch_size=7',
6926 'blending_size=5' and 'precision=1'.
6927
6928 Example:
6929 [#1] image.jpg crop 25%,25%,75%,75% syntexturize_matchpatch
6930 512,512
6931
6932 tv_flow:
6933 _nb_iter>=0,_dt,_keep_sequence={ 0 | 1 }
6934
6935 Apply iterations of the total variation flow on selected images.
6936
6937 Default values: 'nb_iter=10', 'dt=30' and 'keep_sequence=0'.
6938
6939 Example:
6940 [#1] image.jpg +tv_flow 40
6941
6942 unsharp:
6943 radius[%]>=0,_amount>=0,_threshold[%]>=0
6944
6945 Apply unsharp mask on selected images.
6946
6947 Default values: 'amount=2' and 'threshold=0'.
6948
6949 Example:
6950 [#1] image.jpg blur 3 +unsharp 1.5,15 cut 0,255
6951
6952 unsharp_octave:
6953 _nb_scales>0,_radius[%]>=0,_amount>=0,threshold[%]>=0
6954
6955 Apply octave sharpening on selected images.
6956
6957 Default values: 'nb_scales=4', 'radius=1', 'amount=2' and 'thresh‐
6958 old=0'.
6959
6960 Example:
6961 [#1] image.jpg blur 3 +unsharp_octave 4,5,15 cut 0,255
6962
6963 vanvliet (+):
6964 std_deviation>=0[%],order={ 0 | 1 | 2 | 3 },axis={ x | y | z | c
6965 },_boundary_conditions
6966
6967 Apply Vanvliet recursive filter on selected images, along specified
6968 axis and with
6969 specified standard deviation, order and boundary conditions.
6970 'boundary_conditions' can be { 0=dirichlet | 1=neumann }.
6971
6972 Default value: 'boundary_conditions=1'.
6973
6974 Example:
6975 [#1] image.jpg +vanvliet 3,1,x
6976 [#2] image.jpg +vanvliet 30,0,x vanvliet[-2] 30,0,y add
6977
6978 voronoi:
6979
6980 Compute the discrete Voronoi diagram of non-zero pixels in selected
6981 images.
6982
6983 Example:
6984 [#1] 400,400 noise 0.2,2 eq 1 +label_fg 0 voronoi[-1] +gradi‐
6985 ent[-1] xy,1 append[-2,-1] c norm[-1] ==[-1] 0 map[-2] 2,2 mul[-2,-1]
6986 normalize[-2] 0,255 dilate_circ[-2] 4 reverse max
6987
6988 watermark_fourier:
6989 text,_size>0
6990
6991 Add a textual watermark in the frequency domain of selected images.
6992
6993 Default value: 'size=33'.
6994
6995 Example:
6996 [#1] image.jpg +watermark_fourier "Watermarked!" +display_fft re‐
6997 move[-3,-1] normalize 0,255 append[-4,-2] y append[-2,-1] y
6998
6999 watershed (+):
7000 [priority_image],_is_high_connectivity={ 0 | 1 }
7001
7002 Compute the watershed transform of selected images.
7003
7004 Default value: 'is_high_connectivity=1'.
7005
7006 Example:
7007 [#1] 400,400 noise 0.2,2 eq 1 +distance 1 mul[-1] -1 label[-2]
7008 watershed[-2] [-1] mod[-2] 256 map[-2] 0 reverse
7009
7010 12.9. Features Extraction
7011 -------------------
7012
7013 area:
7014 tolerance>=0,is_high_connectivity={ 0 | 1 }
7015
7016 Compute area of connected components in selected images.
7017
7018 Default values: 'is_high_connectivity=0'.
7019
7020 Example:
7021 [#1] image.jpg luminance stencil[-1] 1 +area 0
7022
7023 Tutorial: https://gmic.eu/oldtutorial/_area.shtml
7024
7025 area_fg:
7026 tolerance>=0,is_high_connectivity={ 0 | 1 }
7027
7028 Compute area of connected components for non-zero values in se‐
7029 lected images.
7030 Similar to 'area' except that 0-valued pixels are not considered.
7031
7032 Default values: 'is_high_connectivity=0'.
7033
7034 Example:
7035 [#1] image.jpg luminance stencil[-1] 1 +area_fg 0
7036
7037 at_line:
7038 x0[%],y0[%],z0[%],x1[%],y1[%],z1[%]
7039
7040 Retrieve pixels of the selected images belonging to the specified
7041 line (x0,y0,z0)-(x1,y1,z1).
7042
7043 Example:
7044 [#1] image.jpg +at_line 0,0,0,100%,100%,0 line[0]
7045 0,0,100%,100%,1,0xFF00FF00,255,0,0
7046
7047 at_quadrangle:
7048 x0[%],y0[%],x1[%],y1[%],x2[%],y2[%],x3[%],y3[%],_interpola‐
7049 tion,_boundary_conditions |
7050 x0[%],y0[%],z0[%],x1[%],y1[%],z1[%],x2[%],y2[%],z2[%],x3[%],y3[%],z3[%],_in‐
7051 terpolation,_boundary_conditions
7052
7053 Retrieve pixels of the selected images belonging to the specified
7054 2D or 3D quadrangle.
7055 'interpolation' can be { 0=nearest-neighbor | 1=linear | 2=cubic }.
7056 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
7057 | 3=mirror }.
7058
7059 Example:
7060 [#1] image.jpg params=5%,5%,95%,5%,60%,95%,40%,95% +at_quadrangle
7061 $params polygon.. 4,$params,0.5,255
7062
7063 barycenter:
7064
7065 Compute the barycenter vector of pixel values.
7066
7067 Example:
7068 [#1] 256,256 ellipse 50%,50%,20%,20%,0,1,1 deform 20 +barycenter
7069 +ellipse[-2] {@0,1},5,5,0,10
7070
7071 delaunay:
7072
7073 Generate discrete 2D Delaunay triangulation of non-zero pixels in
7074 selected images.
7075 Input images must be scalar.
7076 Each pixel of the output image is a triplet (a,b,c) meaning the
7077 pixel belongs to
7078 the Delaunay triangle 'ABC' where 'a','b','c' are the labels of the
7079 pixels 'A','B','C'.
7080
7081 Example:
7082 [#1] 400,400 rand 32,255 100%,100% noise. 0.4,2 eq. 1 mul +delau‐
7083 nay
7084 [#2] image.jpg b 1% 100%,100% noise. 0.8,2 eq. 1 mul +delaunay
7085 channels 0,2
7086
7087 detect_skin:
7088 0<=tolerance<=1,_skin_x,_skin_y,_skin_radius>=0
7089
7090 Detect skin in selected color images and output an appartenance
7091 probability map.
7092 Detection is performed using CbCr chromaticity data of skin pixels.
7093 If arguments 'skin_x', 'skin_y' and 'skin_radius' are provided,
7094 skin pixels are learnt
7095 from the sample pixels inside the circle located at
7096 ('skin_x','skin_y') with radius 'skin_radius'.
7097
7098 Default value: 'tolerance=0.5' and 'skin_x=skiny=radius=-1'.
7099
7100 displacement (+):
7101 [source_image],_smoothness,_precision>=0,_nb_scales>=0,_itera‐
7102 tion_max>=0,is_backward={ 0 | 1 },_[guide]
7103
7104 Estimate displacement field between specified source and selected
7105 target images.
7106 If 'smoothness>=0', regularization type is set to isotropic, else
7107 to anisotropic.
7108 If 'nbscales==0', the number of scales used is estimated from the
7109 image size.
7110
7111 Default values: 'smoothness=0.1', 'precision=5', 'nb_scales=0',
7112 'iteration_max=10000', 'is_backward=1' and '[guide]=(unused)'.
7113
7114 Example:
7115 [#1] image.jpg +rotate 3,1,0,50%,50% +displacement[-1] [-2]
7116 quiver[-1] [-1],15,1,1,1,{1.5*iM}
7117
7118 distance (+):
7119 isovalue[%],_metric |
7120 isovalue[%],[metric],_method
7121
7122 Compute the unsigned distance function to specified isovalue, opt.
7123 according to a custom metric.
7124 'metric' can be { 0=chebyshev | 1=manhattan | 2=euclidean |
7125 3=squared-euclidean }.
7126 'method' can be { 0=fast-marching | 1=low-connectivity dijkstra |
7127 2=high-connectivity dijkstra | 3=1+return path | 4=2+return path }.
7128
7129 Default value: 'metric=2' and 'method=0'.
7130
7131 Example:
7132 [#1] image.jpg threshold 20% distance 0 pow 0.3
7133 [#2] 400,400 set 1,50%,50% +distance[0] 1,2 +distance[0] 1,1 dis‐
7134 tance[0] 1,0 mod 32 threshold 16 append c
7135
7136 Tutorial: https://gmic.eu/oldtutorial/_distance.shtml
7137
7138 fftpolar:
7139
7140 Compute fourier transform of selected images, as centered magni‐
7141 tude/phase images.
7142
7143 Example:
7144 [#1] image.jpg fftpolar ellipse 50%,50%,10,10,0,1,0 ifftpolar
7145
7146 histogram (+):
7147 _nb_levels>0[%],_value0[%],_value1[%]
7148
7149 Compute the histogram of selected images.
7150 If value range is set, the histogram is estimated only for pixels
7151 in the specified
7152 value range. Argument 'value1' must be specified if 'value0' is
7153 set.
7154
7155 Default values: 'nb_levels=256', 'value0=0%' and 'value1=100%'.
7156
7157 Example:
7158 [#1] image.jpg +histogram 64 display_graph[-1] 400,300,3
7159
7160 histogram_nd:
7161 nb_levels>0[%],_value0[%],_value1[%]
7162
7163 Compute the 1D,2D or 3D histogram of selected multi-channels images
7164 (having 1,2 or 3 channels).
7165 If value range is set, the histogram is estimated only for pixels
7166 in the specified
7167 value range.
7168
7169 Default values: 'value0=0%' and 'value1=100%'.
7170
7171 Example:
7172 [#1] image.jpg channels 0,1 +histogram_nd 256
7173
7174 histogram_cumul:
7175 _nb_levels>0,_is_normalized={ 0 | 1 },_val0[%],_val1[%]
7176
7177 Compute cumulative histogram of selected images.
7178
7179 Default values: 'nb_levels=256', 'is_normalized=0', 'val0=0%' and
7180 'val1=100%'.
7181
7182 Example:
7183 [#1] image.jpg +histogram_cumul 256 histogram[0] 256 dis‐
7184 play_graph 400,300,3
7185
7186 histogram_pointwise:
7187 nb_levels>0[%],_value0[%],_value1[%]
7188
7189 Compute the histogram of each vector-valued point of selected im‐
7190 ages.
7191 If value range is set, the histogram is estimated only for values
7192 in the specified
7193 value range.
7194
7195 Default values: 'value0=0%' and 'value1=100%'.
7196
7197 hough:
7198 _width>0,_height>0,gradient_norm_voting={ 0 | 1 }
7199
7200 Compute hough transform (theta,rho) of selected images.
7201
7202 Default values: 'width=512', 'height=width' and 'gradient_norm_vot‐
7203 ing=1'.
7204
7205 Example:
7206 [#1] image.jpg +blur 1.5 hough[-1] 400,400 blur[-1] 0.5 add[-1] 1
7207 log[-1]
7208
7209 ifftpolar:
7210
7211 Compute inverse fourier transform of selected images, from centered
7212 magnitude/phase images.
7213
7214 isophotes:
7215 _nb_levels>0
7216
7217 Render isophotes of selected images on a transparent background.
7218
7219 Default value: 'nb_levels=64'
7220
7221 Example:
7222 [#1] image.jpg blur 2 isophotes 6 dilate_circ 5 display_rgba
7223
7224 label (+):
7225 _tolerance>=0,is_high_connectivity={ 0 | 1 },_is_L2_norm={ 0 | 1
7226 }
7227
7228 Label connected components in selected images.
7229
7230 Default values: 'tolerance=0', 'is_high_connectivity=0' and
7231 'is_L2_norm=1'.
7232
7233 Example:
7234 [#1] image.jpg luminance threshold 60% label normalize 0,255 map
7235 0
7236 [#2] 400,400 set 1,50%,50% distance 1 mod 16 threshold 8 label
7237 mod 255 map 2
7238
7239 Tutorial: https://gmic.eu/oldtutorial/_label.shtml
7240
7241 label_fg:
7242 tolerance>=0,is_high_connectivity={ 0 | 1 }
7243
7244 Label connected components for non-zero values (foreground) in se‐
7245 lected images.
7246 Similar to 'label' except that 0-valued pixels are not labeled.
7247
7248 Default value: 'is_high_connectivity=0'.
7249
7250 laar:
7251
7252 Extract the largest axis-aligned rectangle in non-zero areas of se‐
7253 lected images.
7254 Rectangle coordinates are returned in status, as a sequence of num‐
7255 bers x0,y0,x1,y1.
7256
7257 Example:
7258 [#1] shape_cupid 256 coords=${-laar} normalize 0,255 to_rgb rec‐
7259 tangle $coords,0.5,0,128,0
7260
7261 max_patch:
7262 _patch_size>=1
7263
7264 Return locations of maximal values in local patch-based neighbor‐
7265 hood of given size for selected images.
7266
7267 Default value: 'patch_size=16'.
7268
7269 Example:
7270 [#1] image.jpg norm +max_patch 16
7271
7272 min_patch:
7273 _patch_size>=1
7274
7275 Return locations of minimal values in local patch-based neighbor‐
7276 hood of given size for selected images.
7277
7278 Default value: 'patch_size=16'.
7279
7280 Example:
7281 [#1] image.jpg norm +min_patch 16
7282
7283 minimal_path:
7284 x0[%]>=0,y0[%]>=0,z0[%]>=0,x1[%]>=0,y1[%]>=0,z1[%]>=0,_is_high_con‐
7285 nectivity={ 0 | 1 }
7286
7287 Compute minimal path between two points on selected potential maps.
7288
7289 Default value: 'is_high_connectivity=0'.
7290
7291 Example:
7292 [#1] image.jpg +gradient_norm fill[-1] 1/(1+i) minimal_path[-1]
7293 0,0,0,100%,100%,0 pointcloud[-1] 0 *[-1] 280 to_rgb[-1] ri[-1] [-2],0
7294 or
7295
7296 mse (+):
7297
7298 Compute MSE (Mean-Squared Error) matrix between selected images.
7299
7300 Example:
7301 [#1] image.jpg +noise 30 +noise[0] 35 +noise[0] 38 cut. 0,255 mse
7302
7303 patches:
7304 patch_width>0,patch_height>0,patch_depth>0,x0,y0,z0,_x1,_y1,_z1,...,_xN,_yN,_zN
7305
7306 Extract N+1 patches from selected images, centered at specified lo‐
7307 cations.
7308
7309 Example:
7310 [#1] image.jpg +patches
7311 64,64,1,153,124,0,184,240,0,217,126,0,275,38,0
7312
7313 matchpatch (+):
7314 [patch_im‐
7315 age],patch_width>=1,_patch_height>=1,_patch_depth>=1,_nb_itera‐
7316 tions>=0,_nb_randoms>=0,_patch_penalization,_output_score={ 0 | 1
7317 },_[guide]
7318
7319 Estimate correspondence map between selected images and specified
7320 patch image, using
7321 a patch-matching algorithm.
7322 Each pixel of the returned correspondence map gives the location
7323 (p,q) of the closest patch in
7324 the specified patch image. If 'output_score=1', the third channel
7325 also gives the corresponding
7326 matching score for each patch as well.
7327 If 'patch_penalization' is >=0, SSD is penalized with patch occur‐
7328 rences.
7329 If 'patch_penalization' is <0, SSD is inf-penalized when distance
7330 between patches are less than '-patch_penalization'.
7331
7332 Default values: 'patch_height=patch_width', 'patch_depth=1',
7333 'nb_iterations=5', 'nb_randoms=5', 'patch_penalization=0', 'out‐
7334 put_score=0' and
7335 'guide=(undefined)'.
7336
7337 Example:
7338 [#1] image.jpg sample colorful +matchpatch[0] [1],3 +warp[-2]
7339 [-1],0
7340
7341 plot2value:
7342
7343 Retrieve values from selected 2D graph plots.
7344
7345 Example:
7346 [#1] 400,300,1,1,'if(y>300*abs(cos(x/10+2*u)),1,0)' +plot2value
7347 +display_graph[-1] 400,300
7348
7349 pointcloud:
7350 _type = { -X=-X-opacity | 0=binary | 1=cumulative | 2=label |
7351 3=retrieve coordinates },_width,_height>0,_depth>0
7352
7353 Render a set of point coordinates, as a point cloud in a 1D/2D or
7354 3D binary image
7355 (or do the reverse, i.e. retrieve coordinates of non-zero points
7356 from a rendered point cloud).
7357 Input point coordinates can be a NxMx1x1, Nx1x1xM or 1xNx1xM image,
7358 where 'N' is the number of points,
7359 and M the point coordinates.
7360 If 'M'>3, the 3-to-M components sets the (M-3)-dimensional color at
7361 each point.
7362 Parameters 'width','height' and 'depth' are related to the size of
7363 the final image :
7364 - If set to 0, the size is automatically set along the speci‐
7365 fied axis.
7366 - If set to N>0, the size along the specified axis is N.
7367 - If set to N<0, the size along the specified axis is at most
7368 N.
7369 Points with coordinates that are negative or higher than specified
7370 ('width','height','depth')
7371 are not plotted.
7372
7373 Default values: 'type=0' and 'max_width=max_height=max_depth=0'.
7374
7375 Example:
7376 [#1] 3000,2 rand 0,400 +pointcloud 0 dilate[-1] 3
7377 [#2] 3000,2 rand 0,400 {w} {w},3 rand[-1] 0,255 append y +point‐
7378 cloud 0 dilate[-1] 3
7379
7380 psnr:
7381 _max_value
7382
7383 Compute PSNR (Peak Signal-to-Noise Ratio) matrix between selected
7384 images.
7385
7386 Default value: 'max_value=255'.
7387
7388 Example:
7389 [#1] image.jpg +noise 30 +noise[0] 35 +noise[0] 38 cut[-1] 0,255
7390 psnr 255 replace_inf 0
7391
7392 segment_watershed:
7393 _threshold>=0
7394
7395 Apply watershed segmentation on selected images.
7396
7397 Default values: 'threshold=2'.
7398
7399 Example:
7400 [#1] image.jpg segment_watershed 2
7401
7402 shape2bump:
7403 _resolution>=0,0<=_weight_avg_max_avg<=1,_dilation,_smoothness>=0
7404
7405 Estimate bumpmap from binary shape in selected images.
7406
7407 Default value: 'resolution=256', 'weight_avg_max=0.75', 'dila‐
7408 tion=0' and 'smoothness=100'.
7409
7410 skeleton:
7411 _boundary_conditions={ 0=dirichlet | 1=neumann }
7412
7413 Compute skeleton of binary shapes using distance transform and con‐
7414 strained thinning.
7415
7416 Default value: 'boundary_conditions=1'.
7417
7418 Example:
7419 [#1] shape_cupid 320 +skeleton 0
7420
7421 slic:
7422 size>0,_regularity>=0,_nb_iterations>0
7423
7424 Segment selected 2D images with superpixels, using the SLIC algo‐
7425 rithm (Simple Linear Iterative Clustering).
7426 Scalar images of increasingly labeled pixels are returned.
7427 Reference paper: Achanta, R., Shaji, A., Smith, K., Lucchi, A.,
7428 Fua, P., & Susstrunk, S. (2010). SLIC Superpixels (No. EPFL-RE‐
7429 PORT-149300).
7430
7431 Default values: 'size=16', 'regularity=10' and 'nb_iterations=10'.
7432
7433 Example:
7434 [#1] image.jpg +srgb2lab slic[-1] 16 +blend shapeaverage f[-2]
7435 "j(1,0)==i && j(0,1)==i" *[-1] [-2]
7436
7437 ssd_patch:
7438 [patch],_use_fourier={ 0 | 1 },_boundary_conditions={ 0=dirichlet
7439 | 1=neumann }
7440
7441 Compute fields of SSD between selected images and specified patch.
7442 Argument 'boundary_conditions' is valid only when 'use_fourier=0'.
7443
7444 Default value: 'use_fourier=0' and 'boundary_conditions=0'.
7445
7446 Example:
7447 [#1] image.jpg +crop 20%,20%,35%,35% +ssd_patch[0] [1],0,0
7448
7449 thinning:
7450 _boundary_conditions={ 0=dirichlet | 1=neumann }
7451
7452 Compute skeleton of binary shapes using morphological thinning
7453 (beware, this is a quite slow iterative process)
7454
7455 Default value: 'boundary_conditions=1'.
7456
7457 Example:
7458 [#1] shape_cupid 320 +thinning
7459
7460 tones:
7461 N>0
7462
7463 Get N tones masks from selected images.
7464
7465 Example:
7466 [#1] image.jpg +tones 3
7467
7468 topographic_map:
7469 _nb_levels>0,_smoothness
7470
7471 Render selected images as topographic maps.
7472
7473 Default values: 'nb_levels=16' and 'smoothness=2'.
7474
7475 Example:
7476 [#1] image.jpg topographic_map 10
7477
7478 tsp:
7479 _precision>=0
7480
7481 Try to solve the 'travelling salesman' problem, using a combination
7482 of greedy search and 2-opt algorithms.
7483 Selected images must have dimensions Nx1x1xC to represent N cities
7484 each with C-dimensional coordinates.
7485 This command re-order the selected data along the x-axis so that
7486 the point sequence becomes a shortest path.
7487
7488 Default values: 'precision=256'.
7489
7490 Example:
7491 [#1] 256,1,1,2 rand 0,512 tsp , 512,512,1,3 repeat w#0 circle[-1]
7492 {0,I[$>]},2,1,255,255,255 line[-1] {0,bound‐
7493 ary=2;[I[$>],I[$>+1]]},1,255,128,0 done keep[-1]
7494
7495 variance_patch:
7496 _patch_size>=1
7497
7498 Compute variance of each images patch centered at (x,y), in se‐
7499 lected images.
7500
7501 Default value: 'patch_size=16'
7502
7503 Example:
7504 [#1] image.jpg +variance_patch
7505
7506 12.10. Image Drawing
7507 -------------
7508
7509 arrow:
7510 x0[%],y0[%],x1[%],y1[%],_thick‐
7511 ness[%]>=0,_head_length[%]>=0,_head_thickness[%]>=0,_opacity,_pat‐
7512 tern,_color1,...
7513
7514 Draw specified arrow on selected images.
7515 'pattern' is an hexadecimal number starting with '0x' which can be
7516 omitted
7517 even if a color is specified. If a pattern is specified, the arrow
7518 is
7519 drawn outlined instead of filled.
7520
7521 Default values: 'thickness=1%', 'head_length=10%', 'head_thick‐
7522 ness=3%', 'opacity=1', 'pattern=(undefined)' and 'color1=0'.
7523
7524 Example:
7525 [#1] 400,400,1,3 repeat 100 arrow
7526 50%,50%,{u(100)}%,{u(100)}%,3,20,10,0.3,${-rgb} done
7527
7528 axes:
7529 x0,x1,y0,y1,_font_height>=0,_opacity,_pattern,_color1,...
7530
7531 Draw xy-axes on selected images.
7532 'pattern' is an hexadecimal number starting with '0x' which can be
7533 omitted
7534 even if a color is specified.
7535 To draw only one x-axis at row Y, set both 'y0' and 'y1' to Y.
7536 To draw only one y-axis at column X, set both 'x0' and 'x1' to X.
7537
7538 Default values: 'font_height=14', 'opacity=1', 'pattern=(unde‐
7539 fined)' and 'color1=0'.
7540
7541 Example:
7542 [#1] 400,400,1,3,255 axes -1,1,1,-1
7543
7544 ball:
7545 _size>0, _R,_G,_B,0<=_specular_light<=8,0<=_specu‐
7546 lar_size<=8,_shadow>=0
7547
7548 Input a 2D RGBA colored ball sprite.
7549
7550 Default values: 'size=64', 'R=255', 'G=R', 'B=R', 'specu‐
7551 lar_light=0.8', 'specular_size=1' and 'shading=1.5'.
7552
7553 Example:
7554 [#1] repeat 9 ball {1.5^($>+2)},${-rgb} done append x
7555
7556 chessboard:
7557 size1>0,_size2>0,_offset1,_offset2,_angle,_opac‐
7558 ity,_color1,...,_color2,...
7559
7560 Draw chessboard on selected images.
7561
7562 Default values: 'size2=size1', 'offset1=offset2=0', 'angle=0',
7563 'opacity=1', 'color1=0' and 'color2=255'.
7564
7565 Example:
7566 [#1] image.jpg chessboard 32,32,0,0,25,0.3,255,128,0,0,128,255
7567
7568 cie1931:
7569
7570 Draw CIE-1931 chromaticity diagram on selected images.
7571
7572 Example:
7573 [#1] 500,400,1,3 cie1931
7574
7575 circle:
7576 x[%],y[%],R[%],_opacity,_pattern,_color1,...
7577
7578 Draw specified colored circle on selected images.
7579 A radius of '100%' stands for 'sqrt(width^2+height^2)'.
7580 'pattern' is an hexadecimal number starting with '0x' which can be
7581 omitted
7582 even if a color is specified. If a pattern is specified, the circle
7583 is
7584 drawn outlined instead of filled.
7585
7586 Default values: 'opacity=1', 'pattern=(undefined)' and 'color1=0'.
7587
7588 Example:
7589 [#1] image.jpg repeat 300 circle
7590 {u(100)}%,{u(100)}%,{u(30)},0.3,${-rgb} done circle 50%,50%,100,0.7,255
7591
7592 close_binary:
7593 0<=_endpoint_rate<=100,_endpoint_connectivity>=0,_spline_dist‐
7594 max>=0,_segment_distmax>=0,0<=_spline_anglemax<=180,_spline_round‐
7595 ness>=0,_area_min>=0,_allow_self_intersection={ 0 | 1 }
7596
7597 Automatically close open shapes in binary images (defining white
7598 strokes on black background).
7599
7600 Default values: 'endpoint_rate=75', 'endpoint_connectivity=2',
7601 'spline_distmax=80', 'segment_distmax=20', 'spline_anglemax=90',
7602 'spline_roundness=1',
7603 'area_min=100', 'allow_self_intersection=1'.
7604
7605 ellipse (+):
7606 x[%],y[%],R[%],r[%],_angle,_opacity,_pattern,_color1,...
7607
7608 Draw specified colored ellipse on selected images.
7609 A radius of '100%' stands for 'sqrt(width^2+height^2)'.
7610 'pattern' is an hexadecimal number starting with '0x' which can be
7611 omitted
7612 even if a color is specified. If a pattern is specified, the el‐
7613 lipse is
7614 drawn outlined instead of filled.
7615
7616 Default values: 'opacity=1', 'pattern=(undefined)' and 'color1=0'.
7617
7618 Example:
7619 [#1] image.jpg repeat 300 ellipse
7620 {u(100)}%,{u(100)}%,{u(30)},{u(30)},{u(180)},0.3,${-rgb} done ellipse
7621 50%,50%,100,100,0,0.7,255
7622
7623 flood (+):
7624 x[%],_y[%],_z[%],_tolerance>=0,_is_high_connectivity={ 0 | 1
7625 },_opacity,_color1,...
7626
7627 Flood-fill selected images using specified value and tolerance.
7628
7629 Default values: 'y=z=0', 'tolerance=0', 'is_high_connectivity=0',
7630 'opacity=1' and 'color1=0'.
7631
7632 Example:
7633 [#1] image.jpg repeat 1000 flood
7634 {u(100)}%,{u(100)}%,0,20,0,1,${-rgb} done
7635
7636 gaussian:
7637 _sigma1[%],_sigma2[%],_angle
7638
7639 Draw a centered gaussian on selected images, with specified stan‐
7640 dard deviations and orientation.
7641
7642 Default values: 'sigma1=3', 'sigma2=sigma1' and 'angle=0'.
7643
7644 Example:
7645 [#1] 400,400 gaussian 100,30,45
7646
7647 Tutorial: https://gmic.eu/oldtutorial/_gaussian.shtml
7648
7649 graph (+):
7650 [function_image],_plot_type,_vertex_type,_ymin,_ymax,_opac‐
7651 ity,_pattern,_color1,... |
7652 'formula',_resolution>=0,_plot_type,_ver‐
7653 tex_type,_xmin,xmax,_ymin,_ymax,_opacity,_pattern,_color1,...
7654
7655 Draw specified function graph on selected images.
7656 'plot_type' can be { 0=none | 1=lines | 2=splines | 3=bar }.
7657 'vertex_type' can be { 0=none | 1=points | 2,3=crosses | 4,5=cir‐
7658 cles | 6,7=squares }.
7659 'pattern' is an hexadecimal number starting with '0x' which can be
7660 omitted
7661 even if a color is specified.
7662
7663 Default values: 'plot_type=1', 'vertex_type=1', 'ymin=ymax=0
7664 (auto)', 'opacity=1', 'pattern=(undefined)'
7665 and 'color1=0'.
7666
7667 Example:
7668 [#1] image.jpg +rows 50% blur[-1] 3 split[-1] c div[0] 1.5
7669 graph[0] [1],2,0,0,0,1,255,0,0 graph[0] [2],2,0,0,0,1,0,255,0 graph[0]
7670 [3],2,0,0,0,1,0,0,255 keep[0]
7671
7672 grid:
7673 size_x[%]>=0,size_y[%]>=0,_offset_x[%],_offset_y[%],_opac‐
7674 ity,_pattern,_color1,...
7675
7676 Draw xy-grid on selected images.
7677 'pattern' is an hexadecimal number starting with '0x' which can be
7678 omitted
7679 even if a color is specified.
7680
7681 Default values: 'offset_x=offset_y=0', 'opacity=1', 'pattern=(unde‐
7682 fined)' and 'color1=0'.
7683
7684 Example:
7685 [#1] image.jpg grid 10%,10%,0,0,0.5,255
7686 [#2] 400,400,1,3,255 grid 10%,10%,0,0,0.3,0xCCCCCCCC,128,32,16
7687
7688 j (+):
7689 Shortcut for command 'image'.
7690
7691 image (+):
7692 [sprite],_x[%|~],_y[%|~],_z[%|~],_c[%|~],_opacity,_[opac‐
7693 ity_mask],_max_opacity_mask
7694
7695 Draw specified sprite image on selected images.
7696 (equivalent to shortcut command 'j').
7697
7698 If one of the x,y,z or c argument ends with a '~', its value is ex‐
7699 pected to be
7700 a centering ratio (in [0,1]) rather than a position.
7701 Usual centering ratio are { 0=left-justified | 0.5=centered |
7702 1=right-justified }.
7703
7704 Default values: 'x=y=z=c=0', 'opacity=1', 'opacity_mask=(unde‐
7705 fined)' and 'max_opacity_mask=1'.
7706
7707 Example:
7708 [#1] image.jpg +crop 40%,40%,60%,60% resize[-1] 200%,200%,1,3,5
7709 frame[-1] 2,2,0 image[0] [-1],30%,30% keep[0]
7710
7711 line (+):
7712 x0[%],y0[%],x1[%],y1[%],_opacity,_pattern,_color1,...
7713
7714 Draw specified colored line on selected images.
7715 'pattern' is an hexadecimal number starting with '0x' which can be
7716 omitted
7717 even if a color is specified.
7718
7719 Default values: 'opacity=1', 'pattern=(undefined)' and 'color1=0'.
7720
7721 Example:
7722 [#1] image.jpg repeat 500 line 50%,50%,{u(w)},{u(h)},0.5,${-rgb}
7723 done line 0,0,100%,100%,1,0xCCCCCCCC,255 line 100%,0,0,100%,1,0xCCCCC‐
7724 CCC,255
7725
7726 linethick:
7727 x0[%],y0[%],x1[%],y1[%],_thickness,_opacity,_color1
7728
7729 Draw specified colored thick line on selected images.
7730
7731 Default values: 'thickness=2', 'opacity=1' and 'color1=0'.
7732
7733 Example:
7734 [#1] 400,400,1,3 repeat 100 linethick
7735 {u([w,h,w,h,5])},0.5,${-rgb} done
7736
7737 mandelbrot (+):
7738 z0r,z0i,z1r,z1i,_iteration_max>=0,_is_julia={ 0 | 1
7739 },_c0r,_c0i,_opacity
7740
7741 Draw mandelbrot/julia fractal on selected images.
7742
7743 Default values: 'iteration_max=100', 'is_julia=0', 'c0r=c0i=0' and
7744 'opacity=1'.
7745
7746 Example:
7747 [#1] 400,400 mandelbrot -2.5,-2,2,2,1024 map 0 +blur 2 eleva‐
7748 tion3d[-1] -0.2
7749
7750 marble:
7751 _image_weight,_pattern_weight,_angle,_amplitude,_sharp‐
7752 ness>=0,_anisotropy>=0,_alpha,_sigma,_cut_low>=0,_cut_high>=0
7753
7754 Render marble like pattern on selected images.
7755
7756 Default values: 'image_weight=0.2', 'pattern_weight=0.1', 'an‐
7757 gle=45', 'amplitude=0', 'sharpness=0.4' and 'anisotropy=0.8',
7758 'alpha=0.6', 'sigma=1.1' and 'cut_low=cut_high=0'.
7759
7760 Example:
7761 [#1] image.jpg +marble ,
7762
7763 maze:
7764 _width>0,_height>0,_cell_size>0
7765
7766 Input maze with specified size.
7767
7768 Example:
7769 [#1] maze 30,20 negate normalize 0,255
7770
7771 maze_mask:
7772 _cellsize>0
7773
7774 Input maze according to size and shape of selected mask images.
7775 Mask may contain disconnected shapes.
7776
7777 Example:
7778 [#1] 0 text "G'MIC",0,0,53,1,1 dilate 3 autocrop 0 frame 1,1,0
7779 maze_mask 8 dilate 3 negate mul 255
7780
7781 newton_fractal:
7782 z0r,z0i,z1r,z1i,_angle,0<=_descent_method<=2,_itera‐
7783 tion_max>=0,_convergence_preci‐
7784 sion>0,_expr_p(z),_expr_dp(z),_expr_d2p(z)
7785
7786 Draw newton fractal on selected images, for complex numbers in
7787 range (z0r,z0i) - (z1r,z1i).
7788 Resulting images have 3 channels whose meaning is [ last_zr,
7789 last_zi, nb_iter_used_for_convergence ].
7790 'descent_method' can be { 0=secant | 1=newton | 2=householder }.
7791
7792 Default values: 'angle=0', 'descent_method=1', 'iteration_max=200',
7793 'convergence_precision=0.01', 'expr_p(z)=z^^3-1', 'expr_dp(z)=3*z^^2'
7794 and
7795 'expr_d2z(z)=6*z'.
7796
7797 Example:
7798 [#1] 400,400 newton_fractal -1.5,-1.5,1.5,1.5,0,2,200,0.01,"z^^6
7799 + z^^3 - 1","6*z^^5 + 3*z^^2","30*z^^4 + 6*z" f "[
7800 atan2(i1,i0)*90+20,1,cut(i2/30,0.2,0.7) ]" hsl2rgb
7801
7802 j3d (+):
7803 Shortcut for command 'object3d'.
7804
7805 object3d (+):
7806 [object3d],_x[%],_y[%],_z,_opacity,_rendering_mode,_is_dou‐
7807 ble_sided={ 0 | 1 },_is_zbuffer={ 0 | 1 },_fo‐
7808 cale,_light_x,_light_y,_light_z,_specular_lightness,_specular_shininess
7809
7810 Draw specified 3D object on selected images.
7811 (equivalent to shortcut command 'j3d').
7812
7813 'rendering_mode' can be { 0=dots | 1=wireframe | 2=flat | 3=flat-
7814 shaded | 4=gouraud-shaded | 5=phong-shaded }.
7815
7816 Default values: 'x=y=z=0', 'opacity=1' and 'is_zbuffer=1'. All
7817 other arguments take their default values
7818 from the 3D environment variables.
7819
7820 Example:
7821 [#1] image.jpg torus3d 100,10 cone3d 30,-120 add3d[-2,-1] ro‐
7822 tate3d. 1,1,0,60 object3d[0] [-1],50%,50% keep[0]
7823
7824 pack_sprites:
7825 _nb_scales>=0,0<=_min_scale<=100,_allow_rotation={ 0=0 deg. |
7826 1=180 deg. | 2=90 deg. | 3=any },_spacing,_precision>=0,max_itera‐
7827 tions>=0
7828
7829 Try to randomly pack as many sprites as possible onto the 'empty'
7830 areas of an image.
7831 Sprites can be eventually rotated and scaled during the packing
7832 process.
7833 First selected image is the canvas that will be filled with the
7834 sprites.
7835 Its last channel must be a binary mask whose zero values represent
7836 potential locations for drawing the sprites.
7837 All other selected images represent the sprites considered for
7838 packing.
7839 Their last channel must be a binary mask that represents the sprite
7840 shape (i.e. a 8-connected component).
7841 The order of sprite packing follows the order of specified sprites
7842 in the image list.
7843 Sprite packing is done on random locations and iteratively with de‐
7844 creasing scales.
7845 'nb_scales' sets the number of decreasing scales considered for all
7846 specified sprites to be packed.
7847 'min_scale' (in %) sets the minimal size considered for packing
7848 (specified as a percentage of the
7849 original sprite size).
7850 'spacing' can be positive or negative.
7851 'precision' tells about the desired number of failed trials before
7852 ending the filling process.
7853
7854 Default values: 'nb_scales=5', 'min_scale=25', 'allow_rotation=3',
7855 'spacing=1', 'precision=7' and 'max_iterations=256'.
7856
7857 Example:
7858 [#1] 512,512,1,3,"min(255,y*c/2)" 100%,100% circle
7859 50%,50%,100,1,255 append c image.jpg resize2dy[-1] 24 to_rgba
7860 pack_sprites 3,25
7861
7862 piechart:
7863 label_height>=0,label_R,label_G,label_B,"la‐
7864 bel1",value1,R1,G1,B1,...,"labelN",valueN,RN,GN,BN
7865
7866 Draw pie chart on selected (RGB) images.
7867
7868 Example:
7869 [#1] image.jpg piechart
7870 25,0,0,0,"Red",55,255,0,0,"Green",40,0,255,0,"Blue",30,128,128,255,"Other",5,128,128,128
7871
7872 plasma (+):
7873 _alpha,_beta,_scale>=0
7874
7875 Draw a random colored plasma fractal on selected images.
7876 This command implements the so-called 'Diamond-Square' algorithm.
7877
7878 Default values: 'alpha=1', 'beta=1' and 'scale=8'.
7879
7880 Example:
7881 [#1] 400,400,1,3 plasma
7882
7883 Tutorial: https://gmic.eu/oldtutorial/_plasma.shtml
7884
7885 point (+):
7886 x[%],y[%],_z[%],_opacity,_color1,...
7887
7888 Set specified colored pixel on selected images.
7889
7890 Default values: 'z=0', 'opacity=1' and 'color1=0'.
7891
7892 Example:
7893 [#1] image.jpg repeat 10000 point {u(100)}%,{u(100)}%,0,1,${-rgb}
7894 done
7895
7896 polka_dots:
7897 diameter>=0,_density,_offset1,_offset2,_angle,_aliasing,_shad‐
7898 ing,_opacity,_color,...
7899
7900 Draw dots pattern on selected images.
7901
7902 Default values: 'density=20', 'offset1=offset2=50', 'angle=0',
7903 'aliasing=10', 'shading=1', 'opacity=1' and 'color=255'.
7904
7905 Example:
7906 [#1] image.jpg polka_dots 10,15,0,0,20,10,1,0.5,0,128,255
7907
7908 polygon (+):
7909 N>=1,x1[%],y1[%],...,xN[%],yN[%],_opacity,_pattern,_color1,...
7910
7911 Draw specified colored N-vertices polygon on selected images.
7912 'pattern' is an hexadecimal number starting with '0x' which can be
7913 omitted
7914 even if a color is specified. If a pattern is specified, the poly‐
7915 gon is
7916 drawn outlined instead of filled.
7917
7918 Default values: 'opacity=1', 'pattern=(undefined)' and 'color1=0'.
7919
7920 Example:
7921 [#1] image.jpg polygon
7922 4,20%,20%,80%,30%,80%,70%,20%,80%,0.3,0,255,0 polygon
7923 4,20%,20%,80%,30%,80%,70%,20%,80%,1,0xCCCCCCCC,255
7924 [#2] image.jpg 2,16,1,1,'u(if(x,{h},{w}))' polygon[-2]
7925 {h},{^},0.6,255,0,255 remove[-1]
7926
7927 quiver:
7928 [function_image],_sampling[%]>0,_factor>=0,_is_arrow={ 0 | 1
7929 },_opacity,_color1,...
7930
7931 Draw specified 2D vector/orientation field on selected images.
7932
7933 Default values: 'sampling=5%', 'factor=1', 'is_arrow=1', 'opac‐
7934 ity=1', 'pattern=(undefined)'
7935 and 'color1=0'.
7936
7937 Example:
7938 [#1] 100,100,1,2,'if(c==0,x-w/2,y-h/2)' 500,500,1,3,255
7939 quiver[-1] [-2],10
7940 [#2] image.jpg +resize2dy 600 luminance[0] gradient[0] mul[1] -1
7941 reverse[0,1] append[0,1] c blur[0] 8 orientation[0] quiver[1]
7942 [0],20,1,1,0.8,255
7943
7944 rectangle:
7945 x0[%],y0[%],x1[%],y1[%],_opacity,_pattern,_color1,...
7946
7947 Draw specified colored rectangle on selected images.
7948 'pattern' is an hexadecimal number starting with '0x' which can be
7949 omitted
7950 even if a color is specified. If a pattern is specified, the rec‐
7951 tangle is
7952 drawn outlined instead of filled.
7953
7954 Default values: 'opacity=1', 'pattern=(undefined)' and 'color1=0'.
7955
7956 Example:
7957 [#1] image.jpg repeat 30 rectangle
7958 {u(100)}%,{u(100)}%,{u(100)}%,{u(100)}%,0.3,${-rgb} done
7959
7960 rorschach:
7961 'smoothness[%]>=0','mirroring={ 0=none | 1=x | 2=y | 3=xy }
7962
7963 Render rorschach-like inkblots on selected images.
7964
7965 Default values: 'smoothness=5%' and 'mirroring=1'.
7966
7967 Example:
7968 [#1] 400,400 rorschach 3%
7969
7970 sierpinski:
7971 recursion_level>=0
7972
7973 Draw Sierpinski triangle on selected images.
7974
7975 Default value: 'recursion_level=7'.
7976
7977 Example:
7978 [#1] image.jpg sierpinski 7
7979
7980 spiralbw:
7981 width>0,_height>0,_is_2dcoords={ 0 | 1 }
7982
7983 Input a 2D rectangular spiral image with specified size.
7984
7985 Default values: 'height=width' and 'is_2dcoords=0'.
7986
7987 Example:
7988 [#1] spiralbw 16
7989 [#2] image.jpg spiralbw {[w,h]},1 +warp[0] [1],0 +warp[2] [1],2
7990
7991 spline:
7992 x0[%],y0[%],u0[%],v0[%],x1[%],y1[%],u1[%],v1[%],_opac‐
7993 ity,_color1,...
7994
7995 Draw specified colored spline curve on selected images (cubic her‐
7996 mite spline).
7997
7998 Default values: 'opacity=1' and 'color1=0'.
7999
8000 Example:
8001 [#1] image.jpg repeat 30 spline
8002 {u(100)}%,{u(100)}%,{u(-600,600)},{u(-600,600)},{u(100)}%,{u(100)}%,{u(-600,600)},{u(-600,600)},0.6,255
8003 done
8004
8005 tetraedron_shade:
8006 x0,y0,z0,x1,y1,z1,x2,y2,z2,x3,y3,z3,R0,G0,B0,...,R1,G1,B1,...,R2,G2,B2,...,R3,G3,B3,...
8007
8008 Draw tetraedron with interpolated colors on selected (volumetric)
8009 images.
8010
8011 t (+):
8012 Shortcut for command 'text'.
8013
8014 text (+):
8015 text,_x[%|~],_y[%|~],_font_height[%]>=0,_opacity,_color1,...
8016
8017 Draw specified colored text string on selected images.
8018 (equivalent to shortcut command 't').
8019
8020 If one of the x or y argument ends with a '~', its value is ex‐
8021 pected to be
8022 a centering ratio (in [0,1]) rather than a position.
8023 Usual centering ratio are { 0=left-justified | 0.5=centered |
8024 1=right-justified }.
8025 Sizes '13' and '128' are special and correspond to binary fonts
8026 (no-antialiasing).
8027 Any other font size is rendered with anti-aliasing.
8028 Specifying an empty target image resizes it to new dimensions such
8029 that the image contains
8030 the entire text string.
8031
8032 Default values: 'x=y=0.01~', 'font_height=16', 'opacity=1' and
8033 'color1=0'.
8034
8035 Example:
8036 [#1] image.jpg resize2dy 600 y=0 repeat 30 text {2*$>}" : This is
8037 a nice text, isn't it ?",10,$y,{2*$>},0.9,255 y+={2*$>} done
8038 [#2] 0 text "G'MIC",0,0,23,1,255
8039
8040 to:
8041 Shortcut for command 'text_outline'.
8042
8043 text_outline:
8044 text,_x[%|~],_y[%|~],_font_height[%]>0,_outline>=0,_opac‐
8045 ity,_color1,...
8046
8047 Draw specified colored and outlined text string on selected images.
8048 If one of the x or y argument ends with a '~', its value is ex‐
8049 pected to be
8050 a centering ratio (in [0,1]) rather than a position.
8051 Usual centering ratio are { 0=left-justified | 0.5=centered |
8052 1=right-justified }.
8053
8054 Default values: 'x=y=0.01~', 'font_height=7.5%', 'outline=2',
8055 'opacity=1', 'color1=color2=color3=255' and 'color4=255'.
8056
8057 Example:
8058 [#1] image.jpg text_outline "Hi there!",10,10,63,3
8059
8060 triangle_shade:
8061 x0,y0,x1,y1,x2,y2,R0,G0,B0,...,R1,G1,B1,...,R2,G2,B2,...
8062
8063 Draw triangle with interpolated colors on selected images.
8064
8065 Example:
8066 [#1] image.jpg triangle_shade
8067 20,20,400,100,120,200,255,0,0,0,255,0,0,0,255
8068
8069 truchet:
8070 _scale>0,_radius>=0,_pattern_type={ 0=straight | 1=curved }
8071
8072 Fill selected images with random truchet patterns.
8073
8074 Default values: 'scale=32', 'radius=5' and 'pattern_type=1'.
8075
8076 Example:
8077 [#1] 400,300 truchet ,
8078
8079 turbulence:
8080 _radius>0,_octaves={1,2,3...,12},_alpha>0,_differ‐
8081 ence={-10,10},_mode={0,1,2,3}
8082
8083 Render fractal noise or turbulence on selected images.
8084
8085 Default values: 'radius=32', 'octaves=6', 'alpha=3', 'difference=0'
8086 and 'mode=0'.
8087
8088 Example:
8089 [#1] 400,400,1,3 turbulence 16
8090
8091 Tutorial: https://gmic.eu/oldtutorial/_turbulence.shtml
8092
8093 yinyang:
8094
8095 Draw a yin-yang symbol on selected images.
8096
8097 Example:
8098 [#1] 400,400 yinyang
8099
8100 12.11. Matrix Computation
8101 ------------------
8102
8103 dijkstra (+):
8104 starting_node>=0,ending_node>=0
8105
8106 Compute minimal distances and paths from specified adjacency matri‐
8107 ces by the Dijkstra algorithm.
8108
8109 eigen (+):
8110
8111 Compute the eigenvalues and eigenvectors of selected symmetric ma‐
8112 trices or matrix fields.
8113 If one selected image has 3 or 6 channels, it is regarded as a
8114 field of 2x2 or 3x3 symmetric matrices,
8115 whose eigen elements are computed at each point of the field.
8116
8117 Example:
8118 [#1] (1,0,0;0,2,0;0,0,3) +eigen
8119 [#2] image.jpg structuretensors blur 2 eigen split[0] c
8120
8121 Tutorial: https://gmic.eu/oldtutorial/_eigen.shtml
8122
8123 invert (+):
8124 solver={ 0=SVD | 1=LU }
8125
8126 Compute the inverse of the selected matrices.
8127 SVD solver is slower but less numerically instable than LU.
8128
8129 Default value: 'solver=1'.
8130
8131 Example:
8132 [#1] (0,1,0;0,0,1;1,0,0) +invert
8133
8134 orthogonalize:
8135 _mode = { 0=orthogonalize | 1=orthonormalize }
8136
8137 Orthogonalize or orthonormalize selected matrices, using Modified
8138 Gram-Schmidt process.
8139
8140 Default value: 'mode=0'.
8141
8142 mproj (+):
8143 [dictionary],_method,_max_iter={ 0=auto | >0 },_max_residual>=0
8144
8145 Find best matching projection of selected matrices onto the span of
8146 an over-complete
8147 dictionary D, using the orthogonal projection or Matching Pursuit
8148 algorithm.
8149 Selected images are 2D-matrices in which each column represent a
8150 signal to project.
8151 '[dictionary]' is a matrix in which each column is an element of
8152 the dictionary D.
8153 'method' tells what projection algorithm must be applied. It can
8154 be:
8155 - 0 = orthogonal projection (least-squares solution using LU-
8156 based solver).
8157 - 1 = matching pursuit.
8158 - 2 = matching pursuit, with a single orthogonal projection step
8159 at the end.
8160 - >=3 = orthogonal matching pursuit where an orthogonal projec‐
8161 tion step is performed
8162 every 'method-2' iterations.
8163 'max_iter' sets the max number of iterations processed for each
8164 signal.
8165 If set to '0' (default), 'max_iter' is equal to the number of col‐
8166 umns in D.
8167 (only meaningful for matching pursuit and its variants).
8168 'max_residual' gives a stopping criterion on signal reconstruction
8169 accuracy.
8170 (only meaningful for matching pursuit and its variants).
8171 For each selected image, the result is returned as a matrix W
8172 whose columns correspond to the weights associated to each column
8173 of D,
8174 such that the matrix product D*W is an approximation of the input
8175 matrix.
8176
8177 Default values: 'method=0', 'max_iter=0' and 'max_residual=1e-6'.
8178
8179 solve (+):
8180 [image]
8181
8182 Solve linear system AX = B for selected B-matrices and specified A-
8183 matrix.
8184 If the system is under- or over-determined, the least squares solu‐
8185 tion is returned
8186 (using SVD-based solver).
8187
8188 Example:
8189 [#1] (0,1,0;1,0,0;0,0,1) (1;2;3) +solve[-1] [-2]
8190
8191 svd (+):
8192
8193 Compute SVD decomposition of selected matrices.
8194
8195 Example:
8196 [#1] 10,10,1,1,'if(x==y,x+u(-0.2,0.2),0)' +svd
8197
8198 transpose:
8199
8200 Transpose selected matrices.
8201
8202 Example:
8203 [#1] image.jpg +transpose
8204
8205 trisolve (+):
8206 [image]
8207
8208 Solve tridiagonal system AX = B for selected B-vectors and speci‐
8209 fied tridiagonal A-matrix.
8210 Tridiagonal matrix must be stored as a 3 column vector, where 2nd
8211 column contains the
8212 diagonal coefficients, while 1st and 3rd columns contain the left
8213 and right coefficients.
8214
8215 Example:
8216 [#1] (0,0,1;1,0,0;0,1,0) (1;2;3) +trisolve[-1] [-2]
8217
8218 12.12. 3D Meshes
8219 ---------
8220
8221 +3d (+):
8222 Shortcut for command 'add3d'.
8223
8224 add3d (+):
8225 tx,_ty,_tz |
8226 [object3d] |
8227 (no arg)
8228
8229 Shift selected 3D objects with specified displacement vector, or
8230 merge them with specified
8231 3D object, or merge all selected 3D objects together.
8232 (equivalent to shortcut command '+3d').
8233
8234 Default values: 'ty=tz=0'.
8235
8236 Example:
8237 [#1] sphere3d 10 repeat 5 +add3d[-1] 10,{u(-10,10)},0 color3d[-1]
8238 ${-rgb} done add3d
8239 [#2] repeat 20 torus3d 15,2 color3d[-1] ${-rgb} mul3d[-1] 0.5,1
8240 if $>%2 rotate3d[-1] 0,1,0,90 fi add3d[-1] 70 add3d rotate3d[-1]
8241 0,0,1,18 done double3d 0
8242
8243 animate3d:
8244 _width>0,_height>0,_angle_dx,_angle_dy,_angle_dz,_zoom_fac‐
8245 tor>=0,_filename
8246
8247 Animate selected 3D objects in a window.
8248 If argument 'filename' is provided, each frame of the animation is
8249 saved as a numbered filename.
8250
8251 Default values: 'width=640', 'height=480', 'angle_dx=0', 'an‐
8252 gle_dy=1', 'angle_dz=0', 'zoom_factor=1' and 'filename=(undefined)'.
8253
8254 apply_camera3d:
8255 pos_x,pos_y,pos_z,target_x,target_y,target_z,up_x,up_y,up_z
8256
8257 Apply 3D camera matrix to selected 3D objects.
8258
8259 Default values: 'target_x=0', 'target_y=0', 'target_z=0', 'up_x=0',
8260 'up_y=-1' and 'up_z=0'.
8261
8262 apply_matrix3d:
8263 a11,a12,a13,...,a31,a32,a33
8264
8265 Apply specified 3D rotation matrix to selected 3D objects.
8266
8267 Example:
8268 [#1] torus3d 10,1 +apply_matrix3d
8269 {mul(rot(1,0,1,-15),[1,0,0,0,2,0,0,0,8],3)} double3d 0
8270
8271 array3d:
8272 size_x>=1,_size_y>=1,_size_z>=1,_offset_x[%],_offset_y[%],_off‐
8273 set_y[%]
8274
8275 Duplicate a 3D object along the X,Y and Z axes.
8276
8277 Default values: 'size_y=1', 'size_z=1' and 'offset_x=offset_y=off‐
8278 set_z=100%'.
8279
8280 Example:
8281 [#1] torus3d 10,1 +array3d 5,5,5,110%,110%,300%
8282
8283 arrow3d:
8284 x0,y0,z0,x1,y1,z1,_radius[%]>=0,_head_length[%]>=0,_head_ra‐
8285 dius[%]>=0
8286
8287 Input 3D arrow with specified starting and ending 3D points.
8288
8289 Default values: 'radius=5%', 'head_length=25%' and 'head_ra‐
8290 dius=15%'.
8291
8292 Example:
8293 [#1] repeat 10 a={$>*2*pi/10} arrow3d
8294 0,0,0,{cos($a)},{sin($a)},-0.5 done +3d
8295
8296 axes3d:
8297 _size_x,_size_y,_size_z,_font_size>0,_label_x,_label_y,_la‐
8298 bel_z,_is_origin={ 0=no | 1=yes }
8299
8300 Input 3D axes with specified sizes along the x,y and z orienta‐
8301 tions.
8302
8303 Default values: 'size_x=size_y=size_z=1', 'font_size=23', 'la‐
8304 bel_x=X', 'label_y=Y', 'label_z=Z' and 'is_origin=1'
8305
8306 Example:
8307 [#1] axes3d ,
8308
8309 boundingbox3d:
8310
8311 Replace selected 3D objects by their 3D bounding boxes.
8312
8313 Example:
8314 [#1] torus3d 100,30 +boundingbox3d +3d[-1] [-2]
8315
8316 box3d:
8317 _size_x,_size_y,_size_z
8318
8319 Input 3D box at (0,0,0), with specified geometry.
8320
8321 Default values: 'size_x=1' and 'size_z=size_y=size_x'.
8322
8323 Example:
8324 [#1] box3d 100,40,30 +primitives3d 1 color3d[-2] ${-rgb}
8325
8326 c3d:
8327 Shortcut for command 'center3d'.
8328
8329 center3d:
8330
8331 Center selected 3D objects at (0,0,0).
8332 (equivalent to shortcut command 'c3d').
8333
8334 Example:
8335 [#1] repeat 100 circle3d {u(100)},{u(100)},{u(100)},2 done add3d
8336 color3d[-1] 255,0,0 +center3d color3d[-1] 0,255,0 add3d
8337
8338 circle3d:
8339 _x0,_y0,_z0,_radius>=0
8340
8341 Input 3D circle at specified coordinates.
8342
8343 Default values: 'x0=y0=z0=0' and 'radius=1'.
8344
8345 Example:
8346 [#1] repeat 500 a={$>*pi/250} circle3d
8347 {cos(3*$a)},{sin(2*$a)},0,{$a/50} color3d[-1] ${-rgb},0.4 done add3d
8348
8349 circles3d:
8350 _radius>=0,_is_wireframe={ 0 | 1 }
8351
8352 Convert specified 3D objects to sets of 3D circles with specified
8353 radius.
8354
8355 Default values: 'radius=1' and 'is_wireframe=1'.
8356
8357 Example:
8358 [#1] image.jpg luminance resize2dy 40 threshold 50% * 255 point‐
8359 cloud3d color3d[-1] 255,255,255 circles3d 0.7
8360
8361 col3d (+):
8362 Shortcut for command 'color3d'.
8363
8364 color3d (+):
8365 R,_G,_B,_opacity |
8366 (no arg)
8367
8368 Set color and opacity of selected 3D objects.
8369 (equivalent to shortcut command 'col3d').
8370
8371 Default value: 'B=G=R' and 'opacity=(undefined)'.
8372
8373 Example:
8374 [#1] torus3d 100,10 double3d 0 repeat 7 +rotate3d[-1] 1,0,0,20
8375 color3d[-1] ${-rgb} done add3d
8376
8377 colorcube3d:
8378
8379 Input 3D color cube.
8380
8381 Example:
8382 [#1] colorcube3d mode3d 2 +primitives3d 1
8383
8384 cone3d:
8385 _radius,_height,_nb_subdivisions>0
8386
8387 Input 3D cone at (0,0,0), with specified geometry.
8388
8389 Default value: 'radius=1','height=1' and 'nb_subdivisions=24'.
8390
8391 Example:
8392 [#1] cone3d 10,40 +primitives3d 1 color3d[-2] ${-rgb}
8393
8394 cubes3d:
8395 _size>=0
8396
8397 Convert specified 3D objects to sets of 3D cubes with specified
8398 size.
8399
8400 Default value: 'size=1'.
8401
8402 Example:
8403 [#1] image.jpg luminance resize2dy 40 threshold 50% * 255 point‐
8404 cloud3d color3d[-1] 255,255,255 cubes3d 1
8405
8406 cup3d:
8407 _resolution>0
8408
8409 Input 3D cup object.
8410
8411 Default value: 'resolution=128'.
8412
8413 Example:
8414 [#1] cup3d ,
8415
8416 cylinder3d:
8417 _radius,_height,_nb_subdivisions>0
8418
8419 Input 3D cylinder at (0,0,0), with specified geometry.
8420
8421 Default value: 'radius=1','height=1' and 'nb_subdivisions=24'.
8422
8423 Example:
8424 [#1] cylinder3d 10,40 +primitives3d 1 color3d[-2] ${-rgb}
8425
8426 delaunay3d:
8427
8428 Generate 3D delaunay triangulations from selected images.
8429 One assumes that the selected input images are binary images con‐
8430 taining the set of points to mesh.
8431 The output 3D object is a mesh composed of non-oriented triangles.
8432
8433 Example:
8434 [#1] 500,500 noise 0.05,2 eq 1 * 255 +delaunay3d color3d[1]
8435 255,128,0 dilate_circ[0] 5 to_rgb[0] +object3d[0] [1],0,0,0,1,1 max[-1]
8436 [0]
8437
8438 distribution3d:
8439
8440 Get 3D color distribution of selected images.
8441
8442 Example:
8443 [#1] image.jpg distribution3d colorcube3d primitives3d[-1] 1
8444 add3d
8445
8446 /3d (+):
8447 Shortcut for command 'div3d'.
8448
8449 div3d (+):
8450 factor |
8451 factor_x,factor_y,_factor_z
8452
8453 Scale selected 3D objects isotropically or anisotropically, with
8454 the inverse of specified
8455 factors.
8456 (equivalent to shortcut command '/3d').
8457
8458 Default value: 'factor_z=0'.
8459
8460 Example:
8461 [#1] torus3d 5,2 repeat 5 +add3d[-1] 12,0,0 div3d[-1] 1.2
8462 color3d[-1] ${-rgb} done add3d
8463
8464 db3d (+):
8465 Shortcut for command 'double3d'.
8466
8467 double3d (+):
8468 _is_double_sided={ 0 | 1 }
8469
8470 Enable/disable double-sided mode for 3D rendering.
8471 (equivalent to shortcut command 'db3d').
8472
8473 Default value: 'is_double_sided=1'.
8474
8475 Example:
8476 [#1] mode3d 1 repeat 2 torus3d 100,30 rotate3d[-1] 1,1,0,60 dou‐
8477 ble3d $> snapshot3d[-1] 400 done
8478
8479 elevation3d:
8480 { z-factor | [elevation_map] | 'formula' },base_height={ -1 | >=0
8481 } |
8482 (no arg)
8483
8484 Generate 3D elevation of selected images, opt. with a specified el‐
8485 evation map.
8486 When invoked with (no arg) or 'z-factor', the elevation map is com‐
8487 puted as the pointwise L2 norm of the
8488 pixel values. Otherwise, the elevation map is taken from the speci‐
8489 fied image or formula.
8490
8491 Example:
8492 [#1] image.jpg +blur 5 elevation3d. 0.75
8493 [#2] 128,128,1,3,u(255) plasma 10,3 blur 4 sharpen 10000 n 0,255
8494 elevation3d[-1]
8495 'X=(x-64)/6;Y=(y-64)/6;-100*exp(-(X^2+Y^2)/30)*abs(cos(X)*sin(Y))'
8496
8497 empty3d:
8498
8499 Input empty 3D object.
8500
8501 Example:
8502 [#1] empty3d
8503
8504 extrude3d:
8505 _depth>0,_resolution>0,_smoothness[%]>=0
8506
8507 Generate extruded 3D object from selected binary XY-profiles.
8508
8509 Default values: 'depth=16', 'resolution=1024' and 'smooth‐
8510 ness=0.5%'.
8511
8512 Example:
8513 [#1] image.jpg threshold 50% extrude3d 16
8514
8515 f3d (+):
8516 Shortcut for command 'focale3d'.
8517
8518 focale3d (+):
8519 focale
8520
8521 Set 3D focale.
8522 (equivalent to shortcut command 'f3d').
8523
8524 Set 'focale' to 0 to enable parallel projection (instead of per‐
8525 spective).
8526 Set negative 'focale' will disable 3D sprite zooming.
8527
8528 Default value: 'focale=700'.
8529
8530 Example:
8531 [#1] repeat 5 torus3d 100,30 rotate3d[-1] 1,1,0,60 focale3d
8532 {$<*90} snapshot3d[-1] 400 done remove[0]
8533
8534 gaussians3d:
8535 _size>0,_opacity
8536
8537 Convert selected 3D objects into set of 3D gaussian-shaped sprites.
8538
8539 Example:
8540 [#1] image.jpg r2dy 32 distribution3d gaussians3d 20 colorcube3d
8541 primitives3d[-1] 1 +3d
8542
8543 gmic3d:
8544
8545 Input a 3D G'MIC logo.
8546
8547 Example:
8548 [#1] gmic3d +primitives3d 1
8549
8550 gyroid3d:
8551 _resolution>0,_zoom
8552
8553 Input 3D gyroid at (0,0,0), with specified resolution.
8554
8555 Default values: 'resolution=32' and 'zoom=5'.
8556
8557 Example:
8558 [#1] gyroid3d 48 +primitives3d 1
8559
8560 histogram3d:
8561
8562 Get 3D color histogram of selected images.
8563
8564 Example:
8565 [#1] image.jpg resize2dx 64 histogram3d circles3d 3 opacity3d.
8566 0.75 colorcube3d primitives3d[-1] 1 add3d
8567
8568 image6cube3d:
8569
8570 Generate 3D mapped cubes from 6-sets of selected images.
8571
8572 Example:
8573 [#1] image.jpg animate flower,"30,0","30,5",6 image6cube3d
8574
8575 imageblocks3d:
8576 _maximum_elevation,_smoothness[%]>=0
8577
8578 Generate 3D blocks from selected images.
8579 Transparency of selected images is taken into account.
8580
8581 Default values: 'maximum_elevation=10' and 'smoothness=0'.
8582
8583 Example:
8584 [#1] image.jpg resize2dy 32 imageblocks3d -20 mode3d 3
8585
8586 imagecube3d:
8587
8588 Generate 3D mapped cubes from selected images.
8589
8590 Example:
8591 [#1] image.jpg imagecube3d
8592
8593 imageplane3d:
8594
8595 Generate 3D mapped planes from selected images.
8596
8597 Example:
8598 [#1] image.jpg imageplane3d
8599
8600 imagepyramid3d:
8601
8602 Generate 3D mapped pyramids from selected images.
8603
8604 Example:
8605 [#1] image.jpg imagepyramid3d
8606
8607 imagerubik3d:
8608 _xy_tiles>=1,0<=xy_shift<=100,0<=z_shift<=100
8609
8610 Generate 3D mapped rubik's cubes from selected images.
8611
8612 Default values: 'xy_tiles=3', 'xy_shift=5' and 'z_shift=5'.
8613
8614 Example:
8615 [#1] image.jpg imagerubik3d ,
8616
8617 imagesphere3d:
8618 _resolution1>=3,_resolution2>=3
8619
8620 Generate 3D mapped sphere from selected images.
8621
8622 Default values: 'resolution1=32' and 'resolutions2=16'.
8623
8624 Example:
8625 [#1] image.jpg imagesphere3d 32,16
8626
8627 isoline3d (+):
8628 isovalue[%] |
8629 'formula',value,_x0,_y0,_x1,_y1,_size_x>0[%],_size_y>0[%]
8630
8631 Extract 3D isolines with specified value from selected images or
8632 from specified formula.
8633
8634 Default values: 'x0=y0=-3', 'x1=y1=3' and 'size_x=size_y=256'.
8635
8636 Example:
8637 [#1] image.jpg blur 1 isoline3d 50%
8638 [#2] isoline3d 'X=x-w/2;Y=y-h/2;(X^2+Y^2)%20',10,-10,-10,10,10
8639
8640 isosurface3d (+):
8641 isovalue[%] |
8642 'for‐
8643 mula',value,_x0,_y0,_z0,_x1,_y1,_z1,_size_x>0[%],_size_y>0[%],_size_z>0[%]
8644
8645 Extract 3D isosurfaces with specified value from selected images or
8646 from specified formula.
8647
8648 Default values: 'x0=y0=z0=-3', 'x1=y1=z1=3' and
8649 'size_x=size_y=size_z=32'.
8650
8651 Example:
8652 [#1] image.jpg resize2dy 128 luminance threshold 50% expand_z 2,0
8653 blur 1 isosurface3d 50% mul3d 1,1,30
8654 [#2] isosurface3d 'x^2+y^2+abs(z)^abs(4*cos(x*y*z*3))',3
8655
8656 label3d:
8657 "text",font_height>=0,_opacity,_color1,...
8658
8659 Generate 3D text label.
8660
8661 Default values: 'font_height=13', 'opacity=1' and
8662 'color=255,255,255'.
8663
8664 label_points3d:
8665 _label_size>0,_opacity
8666
8667 Add a numbered label to all vertices of selected 3D objects.
8668
8669 Default values: 'label_size=13' and 'opacity=0.8'.
8670
8671 Example:
8672 [#1] torus3d 100,40,6,6 label_points3d 23,1 mode3d 1
8673
8674 lathe3d:
8675 _resolution>0,_smoothness[%]>=0,_max_angle>=0
8676
8677 Generate 3D object from selected binary XY-profiles.
8678
8679 Default values: 'resolution=128', 'smoothness=0.5%' and 'max_an‐
8680 gle=361'.
8681
8682 Example:
8683 [#1] 300,300 rand -1,1 blur 40 sign normalize 0,255 lathe3d ,
8684
8685 l3d (+):
8686 Shortcut for command 'light3d'.
8687
8688 light3d (+):
8689 position_x,position_y,position_z |
8690 [texture] |
8691 (no arg)
8692
8693 Set the light coordinates or the light texture for 3D rendering.
8694 (equivalent to shortcut command 'l3d').
8695
8696 (no arg) resets the 3D light to default.
8697
8698 Example:
8699 [#1] torus3d 100,30 double3d 0 specs3d 1.2 repeat 5 light3d
8700 {$>*100},0,-300 +snapshot3d[0] 400 done remove[0]
8701
8702 line3d:
8703 x0,y0,z0,x1,y1,z1
8704
8705 Input 3D line at specified coordinates.
8706
8707 Example:
8708 [#1] repeat 100 a={$>*pi/50} line3d
8709 0,0,0,{cos(3*$a)},{sin(2*$a)},0 color3d. ${-rgb} done add3d
8710
8711 lissajous3d:
8712 resolution>1,a,A,b,B,c,C
8713
8714 Input 3D lissajous curves (x(t)=sin(at+A*2pi), y(t)=sin(bt+B*2pi),
8715 z(t)=sin(ct+C*2pi)).
8716
8717 Default values: 'resolution=1024', 'a=2', 'A=0', 'b=1', 'B=0',
8718 'c=0' and 'C=0'.
8719
8720 Example:
8721 [#1] lissajous3d ,
8722
8723 m3d (+):
8724 Shortcut for command 'mode3d'.
8725
8726 mode3d (+):
8727 _mode
8728
8729 Set static 3D rendering mode.
8730 (equivalent to shortcut command 'm3d').
8731
8732 'mode' can be { -1=bounding-box | 0=dots | 1=wireframe | 2=flat |
8733 3=flat-shaded | 4=gouraud-shaded | 5=phong-shaded }.");
8734 Bounding-box mode ('mode==-1') is active only for the interactive
8735 3D viewer.
8736
8737 Default value: 'mode=4'.
8738
8739 Example:
8740 [#1] (0,1,2,3,4,5) double3d 0 repeat w torus3d 100,30 ro‐
8741 tate3d[-1] 1,1,0,60 mode3d {0,@$>} snapshot3d[-1] 300 done remove[0]
8742
8743 md3d (+):
8744 Shortcut for command 'moded3d'.
8745
8746 moded3d (+):
8747 _mode
8748
8749 Set dynamic 3D rendering mode for interactive 3D viewer.
8750 (equivalent to shortcut command 'md3d').
8751
8752 'mode' can be { -1=bounding-box | 0=dots | 1=wireframe | 2=flat |
8753 3=flat-shaded | 4=gouraud-shaded | 5=phong-shaded }.
8754
8755 Default value: 'mode=-1'.
8756
8757 *3d (+):
8758 Shortcut for command 'mul3d'.
8759
8760 mul3d (+):
8761 factor |
8762 factor_x,factor_y,_factor_z
8763
8764 Scale selected 3D objects isotropically or anisotropically, with
8765 specified factors.
8766 (equivalent to shortcut command '*3d').
8767
8768 Default value: 'factor_z=0'.
8769
8770 Example:
8771 [#1] torus3d 5,2 repeat 5 +add3d[-1] 10,0,0 mul3d[-1] 1.2
8772 color3d[-1] ${-rgb} done add3d
8773
8774 n3d:
8775 Shortcut for command 'normalize3d'.
8776
8777 normalize3d:
8778
8779 Normalize selected 3D objects to unit size.
8780 (equivalent to shortcut command 'n3d').
8781
8782 Example:
8783 [#1] repeat 100 circle3d {u(3)},{u(3)},{u(3)},0.1 done add3d
8784 color3d[-1] 255,0,0 +normalize3d[-1] color3d[-1] 0,255,0 add3d
8785
8786 o3d (+):
8787 Shortcut for command 'opacity3d'.
8788
8789 opacity3d (+):
8790 _opacity
8791
8792 Set opacity of selected 3D objects.
8793 (equivalent to shortcut command 'o3d').
8794
8795 Default value: 'opacity=1'.
8796
8797 Example:
8798 [#1] torus3d 100,10 double3d 0 repeat 7 +rotate3d[-1] 1,0,0,20
8799 opacity3d[-1] {u} done add3d
8800
8801 parametric3d:
8802 _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‐
8803 ness>=0,_isovalue>=0
8804
8805 Input 3D object from specified parametric surface '(a,b) ⟶
8806 (x(a,b),y(a,b),z(a,b))'.
8807
8808 Default values: 'x=(2+cos(b))*sin(a)', 'y=(2+cos(b))*cos(a)',
8809 'c=sin(b)', 'amin=-pi', 'amax=pi', 'bmin=-pi', 'bmax=pi', 'res_a=512',
8810 'res_b=res_a', 'res_x=64', 'res_y=res_x', 'res_z=res_y', 'smooth‐
8811 ness=2%' and 'isovalue=10%'.
8812
8813 Example:
8814 [#1] parametric3d ,
8815
8816 pca_patch3d:
8817 _patch_size>0,_M>0,_N>0,_normalize_input={ 0 | 1 },_normal‐
8818 ize_output={ 0 | 1 },_lambda_xy
8819
8820 Get 3D patch-pca representation of selected images.
8821 The 3D patch-pca is estimated from M patches on the input image,
8822 and displayed as a cloud of N 3D points.
8823
8824 Default values: 'patch_size=7', 'M=1000', 'N=3000', 'normalize_in‐
8825 put=1', 'normalize_output=0', and 'lambda_xy=0'.
8826
8827 Example:
8828 [#1] image.jpg pca_patch3d 7
8829
8830 plane3d:
8831 _size_x,_size_y,_nb_subdivisions_x>0,_nb_subdisivions_y>0
8832
8833 Input 3D plane at (0,0,0), with specified geometry.
8834
8835 Default values: 'size_x=1', 'size_y=size_x' and 'nb_subdivi‐
8836 sions_x=nb_subdivisions_y=24'.
8837
8838 Example:
8839 [#1] plane3d 50,30 +primitives3d 1 color3d[-2] ${-rgb}
8840
8841 point3d:
8842 x0,y0,z0
8843
8844 Input 3D point at specified coordinates.
8845
8846 Example:
8847 [#1] repeat 1000 a={$>*pi/500} point3d {cos(3*$a)},{sin(2*$a)},0
8848 color3d[-1] ${-rgb} done add3d
8849
8850 pointcloud3d:
8851
8852 Convert selected planar or volumetric images to 3D point clouds.
8853
8854 Example:
8855 [#1] image.jpg luminance resize2dy 100 threshold 50% mul 255
8856 pointcloud3d color3d[-1] 255,255,255
8857
8858 pose3d:
8859 p1,...,p12
8860
8861 Apply 3D pose matrix to selected 3D objects.
8862
8863 Example:
8864 [#1] torus3d 100,20 pose3d
8865 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
8866 snapshot3d 400
8867
8868 p3d:
8869 Shortcut for command 'primitives3d'.
8870
8871 primitives3d:
8872 mode
8873
8874 Convert primitives of selected 3D objects.
8875 (equivalent to shortcut command 'p3d').
8876
8877 'mode' can be { 0=points | 1=outlines | 2=non-textured }.
8878
8879 Example:
8880 [#1] sphere3d 30 primitives3d 1 torus3d 50,10 color3d[-1] ${-rgb}
8881 add3d
8882
8883 projections3d:
8884 _x[%],_y[%],_z[%],_is_bounding_box={ 0 | 1 }
8885
8886 Generate 3D xy,xz,yz projection planes from specified volumetric
8887 images.
8888
8889 pyramid3d:
8890 width,height
8891
8892 Input 3D pyramid at (0,0,0), with specified geometry.
8893
8894 Example:
8895 [#1] pyramid3d 100,-100 +primitives3d 1 color3d[-2] ${-rgb}
8896
8897 quadrangle3d:
8898 x0,y0,z0,x1,y1,z1,x2,y2,z2,x3,y3,z3
8899
8900 Input 3D quadrangle at specified coordinates.
8901
8902 Example:
8903 [#1] quadrangle3d -10,-10,10,10,-10,10,10,10,10,-10,10,10 repeat
8904 10 +rotate3d[-1] 0,1,0,30 color3d[-1] ${-rgb},0.6 done add3d mode3d 2
8905
8906 random3d:
8907 nb_points>=0
8908
8909 Input random 3D point cloud in [0,1]^3.
8910
8911 Example:
8912 [#1] random3d 100 circles3d 0.1 opacity3d 0.5
8913
8914 rv3d (+):
8915 Shortcut for command 'reverse3d'.
8916
8917 reverse3d (+):
8918
8919 Reverse primitive orientations of selected 3D objects.
8920 (equivalent to shortcut command 'rv3d').
8921
8922 Example:
8923 [#1] torus3d 100,40 double3d 0 +reverse3d
8924
8925 r3d (+):
8926 Shortcut for command 'rotate3d'.
8927
8928 rotate3d (+):
8929 u,v,w,angle
8930
8931 Rotate selected 3D objects around specified axis with specified an‐
8932 gle (in deg.).
8933 (equivalent to shortcut command 'r3d').
8934
8935 Example:
8936 [#1] torus3d 100,10 double3d 0 repeat 7 +rotate3d[-1] 1,0,0,20
8937 done add3d
8938
8939 rotation3d:
8940 u,v,w,angle
8941
8942 Input 3x3 rotation matrix with specified axis and angle (in deg).
8943
8944 Example:
8945 [#1] rotation3d 1,0,0,0 rotation3d 1,0,0,90 rotation3d 1,0,0,180
8946
8947 sierpinski3d:
8948 _recursion_level>=0,_width,_height
8949
8950 Input 3d Sierpinski pyramid.
8951
8952 Example:
8953 [#1] sierpinski3d 3,100,-100 +primitives3d 1 color3d[-2] ${-rgb}
8954
8955 size3d:
8956
8957 Return bounding box size of the last selected 3D object.
8958
8959 skeleton3d:
8960 _metric,_frame_type={ 0=squares | 1=diamonds | 2=circles | 3=auto
8961 },_skeleton_opacity,_frame_opacity,_is_frame_wireframe={ 0 | 1 }
8962
8963 Build 3D skeletal structure object from 2d binary shapes located in
8964 selected images.
8965 'metric' can be { 0=chebyshev | 1=manhattan | 2=euclidean }.
8966
8967 Default values: 'metric=2', 'bones_type=3', 'skeleton_opacity=1'
8968 and 'frame_opacity=0.1'.
8969
8970 Example:
8971 [#1] shape_cupid 480 +skeleton3d ,
8972
8973 snapshot3d:
8974 _size>0,_zoom>=0,_backgroundR,_backgroundG,_backgroundB,_back‐
8975 groundA |
8976 [background_image],zoom>=0
8977
8978 Take 2d snapshots of selected 3D objects.
8979 Set 'zoom' to 0 to disable object auto-scaling.
8980
8981 Default values: 'size=512', 'zoom=1' and '[background_image]=(de‐
8982 fault)'.
8983
8984 Example:
8985 [#1] torus3d 100,20 rotate3d 1,1,0,60 snapshot3d
8986 400,1.2,128,64,32
8987 [#2] torus3d 100,20 rotate3d 1,1,0,60 sample ? +snapshot3d[0]
8988 [1],1.2
8989
8990 sl3d (+):
8991 Shortcut for command 'specl3d'.
8992
8993 specl3d (+):
8994 value>=0
8995
8996 Set lightness of 3D specular light.
8997 (equivalent to shortcut command 'sl3d').
8998
8999 Default value: 'value=0.15'.
9000
9001 Example:
9002 [#1] (0,0.3,0.6,0.9,1.2) repeat w torus3d 100,30 rotate3d[-1]
9003 1,1,0,60 color3d[-1] 255,0,0 specl3d {0,@$>} snapshot3d[-1] 400 done
9004 remove[0]
9005
9006 ss3d (+):
9007 Shortcut for command 'specs3d'.
9008
9009 specs3d (+):
9010 value>=0
9011
9012 Set shininess of 3D specular light.
9013 (equivalent to shortcut command 'ss3d').
9014
9015 Default value: 'value=0.8'.
9016
9017 Example:
9018 [#1] (0,0.3,0.6,0.9,1.2) repeat w torus3d 100,30 rotate3d[-1]
9019 1,1,0,60 color3d[-1] 255,0,0 specs3d {0,@$>} snapshot3d[-1] 400 done
9020 remove[0]
9021
9022 sphere3d (+):
9023 radius,_nb_recursions>=0
9024
9025 Input 3D sphere at (0,0,0), with specified geometry.
9026
9027 Default value: 'nb_recursions=3'.
9028
9029 Example:
9030 [#1] sphere3d 100 +primitives3d 1 color3d[-2] ${-rgb}
9031
9032 spherical3d:
9033 _nb_azimuth>=3,_nb_zenith>=3,_radius_function(phi,theta)
9034
9035 Input 3D spherical object at (0,0,0), with specified geometry.
9036
9037 Default values: 'nb_zenith=nb_azimut=64' and 'radius_func‐
9038 tion="abs(1+0.5*cos(3*phi)*sin(4*theta))"'.
9039
9040 Example:
9041 [#1] spherical3d 64 +primitives3d 1
9042
9043 spline3d:
9044 x0[%],y0[%],z0[%],u0[%],v0[%],w0[%],x1[%],y1[%],z1[%],u1[%],v1[%],w1[%],_nb_ver‐
9045 tices>=2
9046
9047 Input 3D spline with specified geometry.
9048
9049 Default values: 'nb_vertices=128'.
9050
9051 Example:
9052 [#1] repeat 100 spline3d
9053 {u},{u},{u},{u},{u},{u},{u},{u},{u},{u},{u},{u},128 color3d[-1] ${-rgb}
9054 done box3d 1 primitives3d[-1] 1 add3d
9055
9056 s3d (+):
9057 Shortcut for command 'split3d'.
9058
9059 split3d (+):
9060 _full_split={ 0 | 1 }
9061
9062 Split selected 3D objects into feature vectors :
9063 * If 'full_split==0', { header, sizes, vertices, primitives, col‐
9064 ors, opacities }.
9065 * If 'full_split==1', { header, sizes, vertices, p0,...,pP,
9066 c0,...,cP, o0,...,oP }.
9067 (equivalent to shortcut command 's3d').
9068
9069 To recreate the 3D object, append all produced images along the y-
9070 axis.
9071
9072 Default value: 'full_split=0'.
9073
9074 Example:
9075 [#1] box3d 100 +split3d
9076
9077 sprite3d:
9078
9079 Convert selected images as 3D sprites.
9080 Selected images with alpha channels are managed.
9081
9082 Example:
9083 [#1] image.jpg sprite3d
9084
9085 sprites3d:
9086 [sprite],_sprite_has_alpha_channel={ 0 | 1 }
9087
9088 Convert selected 3D objects as a sprite cloud.
9089 Set 'sprite_has_alpha_channel' to 1 to make the last channel of the
9090 selected sprite be a transparency mask.
9091
9092 Default value: 'mask_has_alpha_channel=0'.
9093
9094 Example:
9095 [#1] torus3d 100,20 image.jpg resize2dy[-1] 64 100%,100% gauss‐
9096 ian[-1] 30%,30% *[-1] 255 append[-2,-1] c +sprites3d[0] [1],1 dis‐
9097 play_rgba[-2]
9098
9099 star3d:
9100 _nb_branches>0,0<=_thickness<=1
9101
9102 Input 3D star at position '(0,0,0)', with specified geometry.
9103
9104 Default values: 'nb_branches=5' and 'thickness=0.38'.
9105
9106 Example:
9107 [#1] star3d , +primitives3d 1 color3d[-2] ${-rgb}
9108
9109 streamline3d (+):
9110 x[%],y[%],z[%],_L>=0,_dl>0,_interpolation,_is_backward={ 0 | 1
9111 },_is_oriented={ 0 | 1 } |
9112 'formula',x,y,z,_L>=0,_dl>0,_interpolation,_is_backward={ 0 | 1
9113 },_is_oriented={ 0 | 1 }
9114
9115 Extract 3D streamlines from selected vector fields or from speci‐
9116 fied formula.
9117 'interpolation' can be { 0=nearest integer | 1=1st-order | 2=2nd-
9118 order | 3=4th-order }.
9119
9120 Default values: 'dl=0.1', 'interpolation=2', 'is_backward=0' and
9121 'is_oriented=0'.
9122
9123 Example:
9124 [#1] 100,100,100,3 rand -10,10 blur 3 repeat 300 +streamline3d[0]
9125 {u(100)},{u(100)},{u(100)},1000,1,1 color3d[-1] ${-rgb} done remove[0]
9126 box3d 100 primitives3d[-1] 1 add3d
9127
9128 -3d (+):
9129 Shortcut for command 'sub3d'.
9130
9131 sub3d (+):
9132 tx,_ty,_tz
9133
9134 Shift selected 3D objects with the opposite of specified displace‐
9135 ment vector.
9136 (equivalent to shortcut command '3d').
9137
9138 Default values: 'ty=tz=0'.
9139
9140 Example:
9141 [#1] sphere3d 10 repeat 5 +sub3d[-1] 10,{u(-10,10)},0 color3d[-1]
9142 ${-rgb} done add3d
9143
9144 superformula3d:
9145 resolution>1,m>=1,n1,n2,n3
9146
9147 Input 2D superformula curve as a 3D object.
9148
9149 Default values: 'resolution=1024', 'm=8', 'n1=1', 'n2=5' and
9150 'n3=8'.
9151
9152 Example:
9153 [#1] superformula3d ,
9154
9155 tensors3d:
9156 _radius_factor>=0,_shape={ 0=box | >=N=ellipsoid },_radius_min>=0
9157
9158 Generate 3D tensor fields from selected images.
9159 when 'shape'>0, it gives the ellipsoid shape precision.
9160
9161 Default values: 'radius_factor=1', 'shape=2' and 'radius_min=0.05'.
9162
9163 Example:
9164 [#1] 6,6,6,9,"U = [x,y,z] - [w,h,d]/2; U/=norm(U); mul(U,U,3) +
9165 0.3*eye(3)" tensors3d 0.8
9166
9167 text_pointcloud3d:
9168 _"text1",_"text2",_smoothness
9169
9170 Input 3D text pointcloud from the two specified strings.
9171
9172 Default values: 'text1="text1"', 'text2="text2"' and 'smooth‐
9173 ness=1'.
9174
9175 Example:
9176 [#1] text_pointcloud3d "G'MIC","Rocks!"
9177
9178 text3d:
9179 text,_font_height>0,_depth>0,_smoothness
9180
9181 Input a 3D text object from specified text.
9182
9183 Default values: 'font_height=53', 'depth=10' and 'smoothness=1.5'.
9184
9185 Example:
9186 [#1] text3d "G'MIC as a0D logo!"
9187
9188 t3d:
9189 Shortcut for command 'texturize3d'.
9190
9191 texturize3d:
9192 [ind_texture],_[ind_coords]
9193
9194 Texturize selected 3D objects with specified texture and coordi‐
9195 nates.
9196 (equivalent to shortcut command 't3d').
9197
9198 When '[ind_coords]' is omitted, default XY texture projection is
9199 performed.
9200
9201 Default value: 'ind_coords=(undefined)'.
9202
9203 Example:
9204 [#1] image.jpg torus3d 100,30 texturize3d[-1] [-2] keep[-1]
9205
9206 torus3d:
9207 _radius1,_radius2,_nb_subdivisions1>2,_nb_subdivisions2>2
9208
9209 Input 3D torus at (0,0,0), with specified geometry.
9210
9211 Default values: 'radius1=1', 'radius2=0.3', 'nb_subdivisions1=24'
9212 and 'nb_subdivisions2=12'.
9213
9214 Example:
9215 [#1] torus3d 10,3 +primitives3d 1 color3d[-2] ${-rgb}
9216
9217 triangle3d:
9218 x0,y0,z0,x1,y1,z1,x2,y2,z2
9219
9220 Input 3D triangle at specified coordinates.
9221
9222 Example:
9223 [#1] repeat 100 a={$>*pi/50} triangle3d
9224 0,0,0,0,0,3,{cos(3*$a)},{sin(2*$a)},0 color3d[-1] ${-rgb} done add3d
9225
9226 volume3d:
9227
9228 Transform selected 3D volumetric images as 3D parallelepipedic ob‐
9229 jects.
9230
9231 Example:
9232 [#1] image.jpg animate blur,0,5,30 append z volume3d
9233
9234 weird3d:
9235 _resolution>0
9236
9237 Input 3D weird object at (0,0,0), with specified resolution.
9238
9239 Default value: 'resolution=32'.
9240
9241 Example:
9242 [#1] weird3d 48 +primitives3d 1 color3d[-2] ${-rgb}
9243
9244 12.13. Control Flow
9245 ------------
9246
9247 ap:
9248 Shortcut for command 'apply_parallel'.
9249
9250 apply_parallel:
9251 "command"
9252
9253 Apply specified command on each of the selected images, by paral‐
9254 lelizing it for all image of the list.
9255 (equivalent to shortcut command 'ap').
9256
9257 Example:
9258 [#1] image.jpg +mirror x +mirror y apply_parallel "blur 3"
9259
9260 apc:
9261 Shortcut for command 'apply_parallel_channels'.
9262
9263 apply_parallel_channels:
9264 "command"
9265
9266 Apply specified command on each of the selected images, by paral‐
9267 lelizing it for all channel
9268 of the images independently.
9269 (equivalent to shortcut command 'apc').
9270
9271 Example:
9272 [#1] image.jpg apply_parallel_channels "blur 3"
9273
9274 apo:
9275 Shortcut for command 'apply_parallel_overlap'.
9276
9277 apply_parallel_overlap:
9278 "command",overlap[%],nb_threads={ 0=auto | 1 | 2 | 4 | 8 | 16 }
9279
9280 Apply specified command on each of the selected images, by paral‐
9281 lelizing it on 'nb_threads'
9282 overlapped sub-images.
9283 (equivalent to shortcut command 'apo').
9284
9285 'nb_threads' must be a power of 2.
9286
9287 Default values: 'overlap=0','nb_threads=0'.
9288
9289 Example:
9290 [#1] image.jpg +apply_parallel_overlap "smooth 500,0,1",1
9291
9292 at:
9293 Shortcut for command 'apply_tiles'.
9294
9295 apply_tiles:
9296 "com‐
9297 mand",_tile_width[%]>0,_tile_height[%]>0,_tile_depth[%]>0,_over‐
9298 lap_width[%]>=0,_overlap_height[%]>=0,_overlap_depth[%]>=0,_bound‐
9299 ary_conditions={ 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }
9300
9301 Apply specified command on each tile (neighborhood) of the selected
9302 images, eventually with overlapping tiles.
9303 (equivalent to shortcut command 'at').
9304
9305 Default values: 'tile_width=tile_height=tile_depth=10%','over‐
9306 lap_width=overlap_height=overlap_depth=0' and 'boundary_conditions=1'.
9307
9308 Example:
9309 [#1] image.jpg +equalize[0] 256 +apply_tiles[0] "equalize
9310 256",16,16,1,50%,50%
9311
9312 apply_timeout:
9313 "command",_timeout={ 0=no timeout | >0=with specified timeout (in
9314 seconds) }
9315
9316 Apply a command with a timeout.
9317 Set variable '$_is_timeout' to '1' if timeout occurred, '0' other‐
9318 wise.
9319
9320 Default value: 'timeout=20'.
9321
9322 check (+):
9323 condition
9324
9325 Evaluate specified condition and display an error message if evalu‐
9326 ated to false.
9327 If 'expression' is not a math expression, it is regarded as a file‐
9328 name and checked if it exists.
9329
9330 check3d (+):
9331 _is_full_check={ 0 | 1 }
9332
9333 Check validity of selected 3D vector objects, and display an error
9334 message
9335 if one of the selected images is not a valid 3D vector object.
9336 Full 3D object check is slower but more precise.
9337
9338 Default value: 'is_full_check=1'.
9339
9340 continue (+):
9341
9342 Go to end of current 'repeat...done', 'do...while' or 'local...end‐
9343 local' block.
9344
9345 Example:
9346 [#1] image.jpg repeat 10 blur 1 if 1==1 continue fi deform 10
9347 done
9348
9349 break (+):
9350
9351 Break current 'repeat...done', 'do...while' or 'local...endlocal'
9352 block.
9353
9354 Example:
9355 [#1] image.jpg repeat 10 blur 1 if 1==1 break fi deform 10 done
9356
9357 do (+):
9358
9359 Start a 'do...while' block.
9360
9361 Example:
9362 [#1] image.jpg luminance i={ia+2} do set 255,{u(100)}%,{u(100)}%
9363 while ia<$i
9364
9365 done (+):
9366
9367 End a 'repeat/for...done' block, and go to associated 'repeat/for'
9368 position, if iterations remain.
9369
9370 elif (+):
9371 condition
9372
9373 Start a 'elif...[else]...fi' block if previous 'if' was not veri‐
9374 fied
9375 and test if specified condition holds
9376 'condition' is a mathematical expression, whose evaluation is in‐
9377 terpreted as { 0=false | other=true }..
9378
9379 else (+):
9380
9381 Execute following commands if previous 'if' or 'elif' conditions
9382 failed.
9383
9384 fi (+):
9385
9386 End a 'if...[elif]...[else]...fi' block.
9387 (equivalent to shortcut command 'fi').
9388
9389 endl (+):
9390 Shortcut for command 'endlocal'.
9391
9392 endlocal (+):
9393
9394 End a 'local...endlocal' block.
9395 (equivalent to shortcut command 'endl').
9396
9397 error (+):
9398 message
9399
9400 Print specified error message on the standard error (stderr) and
9401 exit interpreter, except
9402 if error is caught by a 'onfail' command.
9403 Command selection (if any) stands for displayed call stack subset
9404 instead of image indices.
9405
9406 eval (+):
9407 expression
9408
9409 Evaluate specified math expression.
9410 * If no command selection is specified, the expression is evalu‐
9411 ated once and its result is set to status.
9412 * If command selection is specified, the evaluation is looped over
9413 selected images. Status is not modified.
9414 (in this latter case, 'eval' is similar to 'fill' without assign‐
9415 ing the image values).
9416
9417 x (+):
9418 Shortcut for command 'exec'.
9419
9420 exec (+):
9421 _is_verbose={ 0 | 1 },"command"
9422
9423 Execute external command using a system call.
9424 The status value is then set to the error code returned by the sys‐
9425 tem call.
9426 If 'is_verbose=1', the executed command is allowed to output on
9427 stdout/stderr.
9428 (equivalent to shortcut command 'x').
9429
9430 Default value: 'is_verbose=1'.
9431
9432 xo:
9433 Shortcut for command 'exec_out'.
9434
9435 exec_out:
9436 _mode,"command"
9437
9438 Execute external command using a system call, and return resulting
9439 'stdout' and/or 'stderr'.
9440 'mode' can be { 0=stdout | 1=stderr | 2=stdout+stderr }.
9441
9442 for (+):
9443 condition
9444
9445 Start a 'for...done' block.
9446
9447 Example:
9448 [#1] image.jpg resize2dy 32 400,400,1,3 x=0 for $x<400 image[1]
9449 [0],$x,$x x+=40 done
9450
9451 if (+):
9452 condition
9453
9454 Start a 'if...[elif]...[else]...fi' block and test if specified
9455 condition holds.
9456 'condition' is a mathematical expression, whose evaluation is in‐
9457 terpreted as { 0=false | other=true }.
9458
9459 Example:
9460 [#1] image.jpg if ia<64 add 50% elif ia<128 add 25% elif ia<192
9461 sub 25% else sub 50% fi cut 0,255
9462
9463 l (+):
9464 Shortcut for command 'local'.
9465
9466 local (+):
9467
9468 Start a 'local...[onfail]...endlocal' block, with selected images.
9469 (equivalent to shortcut command 'l').
9470
9471 Example:
9472 [#1] image.jpg local[] 300,300,1,3 rand[0] 0,255 blur 4 sharpen
9473 1000 endlocal
9474 [#2] image.jpg +local repeat 3 deform 20 done endlocal
9475
9476 Tutorial: https://gmic.eu/oldtutorial/_local.shtml
9477
9478 mutex (+):
9479 index,_action={ 0=unlock | 1=lock }
9480
9481 Lock or unlock specified mutex for multi-threaded programming.
9482 A locked mutex can be unlocked only by the same thread. All mutexes
9483 are unlocked by default.
9484 'index' designates the mutex index, in [0,255].
9485
9486 Default value: 'action=1'.
9487
9488 noarg (+):
9489
9490 Used in a custom command, 'noarg' tells the command that its argu‐
9491 ment list have not been used
9492 finally, and so they must be evaluated next in the G'MIC pipeline,
9493 just as if the custom
9494 command takes no arguments at all.
9495 Use this command to write a custom command which can decide if it
9496 takes arguments or not.
9497
9498 onfail (+):
9499
9500 Execute following commands when an error is encountered in the body
9501 of the 'local...endlocal' block.
9502 The status value is set with the corresponding error message.
9503
9504 Example:
9505 [#1] image.jpg +local blur -3 onfail mirror x endlocal
9506
9507 parallel (+):
9508 _wait_threads,"command1","command2",...
9509
9510 Execute specified commands in parallel, each in a different thread.
9511 Parallel threads share the list of images.
9512 'wait_threads' can be { 0=when current environment ends | 1=immedi‐
9513 ately }.
9514
9515 Default value: 'wait_threads=1'.
9516
9517 Example:
9518 [#1] image.jpg [0] parallel "blur[0] 3","mirror[1] c"
9519
9520 progress (+):
9521 0<=value<=100 |
9522 -1
9523
9524 Set the progress index of the current processing pipeline.
9525 This command is useful only when G'MIC is used by an embedding ap‐
9526 plication.
9527
9528 q (+):
9529 Shortcut for command 'quit'.
9530
9531 quit (+):
9532
9533 Quit G'MIC interpreter.
9534 (equivalent to shortcut command 'q').
9535
9536 repeat (+):
9537 nb_iterations,_variable_name
9538
9539 Start 'nb_iterations' iterations of a 'repeat...done' block.
9540 'nb_iterations' is a mathematical expression that will be evalu‐
9541 ated.
9542
9543 Example:
9544 [#1] image.jpg split y repeat $!,n shift[$n] $<,0,0,0,2 done ap‐
9545 pend y
9546 [#2] image.jpg mode3d 2 repeat 4 imagecube3d rotate3d 1,1,0,40
9547 snapshot3d 400,1.4 done
9548
9549 Tutorial: https://gmic.eu/oldtutorial/_repeat.shtml
9550
9551 return (+):
9552
9553 Return from current custom command.
9554
9555 rprogress:
9556 0<=value<=100 | -1 | "com‐
9557 mand",0<=value_min<=100,0<=value_max<=100
9558
9559 Set the progress index of the current processing pipeline (rela‐
9560 tively to
9561 previously defined progress bounds), or call the specified command
9562 with
9563 specified progress bounds.
9564
9565 run:
9566 "G'MIC pipeline"
9567
9568 Run specified G'MIC pipeline.
9569 This is only useful when used from a shell, e.g. to avoid shell
9570 substitutions to happen in argument.
9571
9572 skip (+):
9573 item
9574
9575 Do nothing but skip specified item.
9576
9577 u (+):
9578 Shortcut for command 'status'.
9579
9580 status (+):
9581 status_string
9582
9583 Set the current status. Used to define a returning value from a
9584 function.
9585 (equivalent to shortcut command 'u').
9586
9587 Example:
9588 [#1] image.jpg command "foo : u0=Dark u1=Bright status
9589 ${u{ia>=128}}" text_outline ${-foo},2,2,23,2,1,255
9590
9591 while (+):
9592 condition
9593
9594 End a 'do...while' block and go back to associated 'do' if speci‐
9595 fied condition holds.
9596 'condition' is a mathematical expression, whose evaluation is in‐
9597 terpreted as { 0=false | other=true }.
9598
9599 12.14. Arrays, Tiles and Frames
9600 ------------------------
9601
9602 array:
9603 M>0,_N>0,_expand_type={ 0=min | 1=max | 2=all }
9604
9605 Create MxN array from selected images.
9606
9607 Default values: 'N=M' and 'expand_type=0'.
9608
9609 Example:
9610 [#1] image.jpg array 3,2,2
9611
9612 array_fade:
9613 M>0,_N>0,0<=_fade_start<=100,0<=_fade_end<=100,_ex‐
9614 pand_type={0=min | 1=max | 2=all}
9615
9616 Create MxN array from selected images.
9617
9618 Default values: 'N=M', 'fade_start=60', 'fade_end=90' and 'ex‐
9619 pand_type=1'.
9620
9621 Example:
9622 [#1] image.jpg array_fade 3,2
9623
9624 array_mirror:
9625 N>=0,_dir={ 0=x | 1=y | 2=xy | 3=tri-xy },_expand_type={ 0 | 1 }
9626
9627 Create 2^Nx2^N array from selected images.
9628
9629 Default values: 'dir=2' and 'expand_type=0'.
9630
9631 Example:
9632 [#1] image.jpg array_mirror 2
9633
9634 array_random:
9635 Ms>0,_Ns>0,_Md>0,_Nd>0
9636
9637 Create MdxNd array of tiles from selected MsxNs source arrays.
9638
9639 Default values: 'Ns=Ms', 'Md=Ms' and 'Nd=Ns'.
9640
9641 Example:
9642 [#1] image.jpg +array_random 8,8,15,10
9643
9644 frame:
9645 Shortcut for command 'frame_xy'.
9646
9647 frame_blur:
9648 _sharpness>0,_size>=0,_smoothness,_shading,_blur
9649
9650 Draw RGBA-colored round frame in selected images.
9651
9652 Default values: 'sharpness=10', 'size=30', 'smoothness=0', 'shad‐
9653 ing=1' and 'blur=3%'.
9654
9655 Example:
9656 [#1] image.jpg frame_blur 3,30,8,10%
9657
9658 frame_cube:
9659 _depth>=0,_centering_x,_centering_y,_left_side={0=normal | 1=mir‐
9660 ror-x | 2=mirror-y | 3=mirror-xy},_right_side,_lower_side,_upper_side
9661
9662 Insert 3D frames in selected images.
9663
9664 Default values: 'depth=1', 'centering_x=centering_y=0' and
9665 'left_side=right_side,lower_side=upper_side=0'.
9666
9667 Example:
9668 [#1] image.jpg frame_cube ,
9669
9670 frame_fuzzy:
9671 size_x[%]>=0,_size_y[%]>=0,_fuzzyness>=0,_smooth‐
9672 ness[%]>=0,_R,_G,_B,_A
9673
9674 Draw RGBA-colored fuzzy frame in selected images.
9675
9676 Default values: 'size_y=size_x', 'fuzzyness=5', 'smoothness=1' and
9677 'R=G=B=A=255'.
9678
9679 Example:
9680 [#1] image.jpg frame_fuzzy 20
9681
9682 frame_painting:
9683 _size[%]>=0,0<=_contrast<=1,_profile_smooth‐
9684 ness[%]>=0,_R,_G,_B,_vignette_size[%]>=0,_vignette_contrast>=0,_de‐
9685 fects_contrast>=0,0<=_defects_density<=100,_defects_size>=0,_de‐
9686 fects_smoothness[%]>=0,
9687 _serial_number
9688
9689 Add a painting frame to selected images.
9690
9691 Default values: 'size=10%', 'contrast=0.4', 'profile_smooth‐
9692 ness=6%', 'R=225', 'G=200', 'B=120', 'vignette_size=2%', 'vignette_con‐
9693 trast=400',
9694 'defects_contrast=50', 'defects_density=10', 'defects_size=1',
9695 'defects_smoothness=0.5%' and 'serial_number=123456789'.
9696
9697 Example:
9698 [#1] image.jpg frame_painting ,
9699
9700 frame_pattern:
9701 M>=3,_constrain_size={ 0 | 1 } |
9702 M>=3,_[frame_image],_constrain_size={ 0 | 1 }
9703
9704 Insert selected pattern frame in selected images.
9705
9706 Default values: 'pattern=0' and 'constrain_size=0'.
9707
9708 Example:
9709 [#1] image.jpg frame_pattern 8
9710
9711 frame_round:
9712 _sharpness>0,_size>=0,_smoothness,_shading,_R,_G,_B,_A
9713
9714 Draw RGBA-colored round frame in selected images.
9715
9716 Default values: 'sharpness=10', 'size=10', 'smoothness=0', 'shad‐
9717 ing=0' and 'R=G=B=A=255'.
9718
9719 Example:
9720 [#1] image.jpg frame_round 10
9721
9722 frame_seamless:
9723 frame_size>=0,_patch_size>0,_blend_size>=0,_frame_direction={
9724 0=inner (preserve image size) | 1=outer }
9725
9726 Insert frame in selected images, so that tiling the resulting image
9727 makes less visible seams.
9728
9729 Default values: 'patch_size=7', 'blend_size=5' and 'frame_direc‐
9730 tion=1'.
9731
9732 Example:
9733 [#1] image.jpg +frame_seamless 30 array 2,2
9734
9735 frame_x:
9736 size_x[%],_col1,...,_colN
9737
9738 Insert colored frame along the x-axis in selected images.
9739
9740 Default values: 'col1=col2=col3=255' and 'col4=255'.
9741
9742 Example:
9743 [#1] image.jpg frame_x 20,255,0,255
9744
9745 frame_xy:
9746 size_x[%],_size_y[%],_col1,...,_colN
9747
9748 Insert colored frame along the x-axis in selected images.
9749
9750 Default values: 'size_y=size_x', 'col1=col2=col3=255' and
9751 'col4=255'.
9752 (equivalent to shortcut command 'frame').
9753
9754 Example:
9755 [#1] image.jpg frame_xy 1,1,0 frame_xy 20,10,255,0,255
9756
9757 frame_xyz:
9758 size_x[%],_size_y[%],_size_z[%]_col1,...,_colN
9759
9760 Insert colored frame along the x-axis in selected images.
9761
9762 Default values: 'size_y=size_x=size_z', 'col1=col2=col3=255' and
9763 'col4=255'.
9764
9765 frame_y:
9766 size_y[%],_col1,...,_colN
9767
9768 Insert colored frame along the y-axis in selected images.
9769
9770 Default values: 'col1=col2=col3=255' and 'col4=255'.
9771
9772 Example:
9773 [#1] image.jpg frame_y 20,255,0,255
9774
9775 img2ascii:
9776 _charset,_analysis_scale>0,_analysis_smoothness[%]>=0,_synthe‐
9777 sis_scale>0,_output_ascii_filename
9778
9779 Render selected images as binary ascii art.
9780 This command returns the corresponding the list of widths and
9781 heights (expressed as a number of characters)
9782 for each selected image.
9783
9784 Default values: 'charset=[ascii charset]', 'analysis_scale=16',
9785 'analysis_smoothness=20%', 'synthesis_scale=16' and '_out‐
9786 put_ascii_filename=[undefined]'.
9787
9788 Example:
9789 [#1] image.jpg img2ascii ,
9790
9791 imagegrid:
9792 M>0,_N>0
9793
9794 Create MxN image grid from selected images.
9795
9796 Default value: 'N=M'.
9797
9798 Example:
9799 [#1] image.jpg imagegrid 16
9800
9801 imagegrid_hexagonal:
9802 _resolution>0,0<=_outline<=1
9803
9804 Create hexagonal grids from selected images.
9805
9806 Default values: 'resolution=32', 'outline=0.1' and 'is_an‐
9807 tialiased=1'.
9808
9809 Example:
9810 [#1] image.jpg imagegrid_hexagonal 24
9811
9812 imagegrid_triangular:
9813 pattern_width>=1,_pattern_height>=1,_pattern_type,0<=_out‐
9814 line_opacity<=1,_outline_color1,...
9815
9816 Create triangular grids from selected images.
9817 'pattern type' can be { 0=horizontal | 1=vertical | 2=crossed |
9818 3=cube | 4=decreasing | 5=increasing }.
9819
9820 Default values: 'pattern_width=24', 'pattern_height=pattern_width',
9821 'pattern_type=0', 'outline_opacity=0.1' and 'outline_color1=0'.
9822
9823 Example:
9824 [#1] image.jpg imagegrid_triangular 6,10,3,0.5
9825
9826 linearize_tiles:
9827 M>0,_N>0
9828
9829 Linearize MxN tiles on selected images.
9830
9831 Default value: 'N=M'.
9832
9833 Example:
9834 [#1] image.jpg +linearize_tiles 16
9835
9836 map_sprites:
9837 _nb_sprites>=1,_allow_rotation={ 0=none | 1=90 deg. | 2=180 deg.
9838 }
9839
9840 Map set of sprites (defined as the 'nb_sprites' latest images of
9841 the selection) to other selected images,
9842 according to the luminosity of their pixel values.
9843
9844 Example:
9845 [#1] image.jpg resize2dy 48 repeat 16 ball {8+2*$>},${-rgb}
9846 mul[-1] {(1+$>)/16} done map_sprites 16
9847
9848 pack:
9849 is_ratio_constraint={ 0 | 1 },_sort_criterion
9850
9851 Pack selected images into a single image.
9852 The returned status contains the list of new (x,y) offsets for each
9853 input image.
9854 Parameter 'is_ratio_constraint' tells if the resulting image must
9855 tend to a square image.
9856
9857 Default values: 'is_ratio_constraint=0' and 'sort_crite‐
9858 rion=max(w,h)'.
9859
9860 Example:
9861 [#1] image.jpg repeat 10 +resize2dx[-1] 75% balance_gamma[-1]
9862 ${-rgb} done pack 0
9863
9864 puzzle:
9865 _width>0,_height>0,_M>=1,_N>=1,_curvature,_centering,_connec‐
9866 tors_variability,_resolution>=1
9867
9868 Input puzzle binary mask with specified size and geometry.
9869
9870 Default values: 'width=height=512', 'M=N=5', 'curvature=0.5', 'cen‐
9871 tering=0.5', 'connectors_variability=0.5' and 'resolution=64'.
9872
9873 Example:
9874 [#1] puzzle ,
9875
9876 quadratize_tiles:
9877 M>0,_N>0
9878
9879 Quadratize MxN tiles on selected images.
9880
9881 Default value: 'N=M'.
9882
9883 Example:
9884 [#1] image.jpg +quadratize_tiles 16
9885
9886 rotate_tiles:
9887 angle,_M>0,N>0
9888
9889 Apply MxN tiled-rotation effect on selected images.
9890
9891 Default values: 'M=8' and 'N=M'.
9892
9893 Example:
9894 [#1] image.jpg to_rgba rotate_tiles 10,8 drop_shadow 10,10 dis‐
9895 play_rgba
9896
9897 shift_tiles:
9898 M>0,_N>0,_amplitude
9899
9900 Apply MxN tiled-shift effect on selected images.
9901
9902 Default values: 'N=M' and 'amplitude=20'.
9903
9904 Example:
9905 [#1] image.jpg +shift_tiles 8,8,10
9906
9907 taquin:
9908 M>0,_N>0,_remove_tile={ 0=none | 1=first | 2=last | 3=random
9909 },_relief,_border_thickness[%],_border_outline[%],_outline_color
9910
9911 Create MxN taquin puzzle from selected images.
9912
9913 Default value: 'N=M', 'relief=50', 'border_thickness=5', 'bor‐
9914 der_outline=0' and 'remove_tile=0'.
9915
9916 Example:
9917 [#1] image.jpg +taquin 8
9918
9919 tunnel:
9920 _level>=0,_factor>0,_centering_x,_centering_y,_opacity,_angle
9921
9922 Apply tunnel effect on selected images.
9923
9924 Default values: 'level=9', 'factor=80%', 'centering_x=center‐
9925 ing_y=0.5', 'opacity=1' and 'angle=0'
9926
9927 Example:
9928 [#1] image.jpg tunnel 20
9929
9930 12.15. Artistic
9931 --------
9932
9933 boxfitting:
9934 _min_box_size>=1,_max_box_size>=0,_initial_density>=0,_nb_at‐
9935 tempts>=1
9936
9937 Apply box fitting effect on selected images, as displayed the web
9938 page:
9939 http://www.complexification.net/gallery/machines/boxFittingImg/.
9940
9941 Default values: 'min_box_size=1', 'max_box_size=0', 'initial_den‐
9942 sity=0.1' and 'nb_attempts=3'.
9943
9944 Example:
9945 [#1] image.jpg boxfitting ,
9946
9947 brushify:
9948 [brush],_brush_nb_sizes>=1,0<=_brush_min_size_fac‐
9949 tor<=1,_brush_nb_orienta‐
9950 tions>=1,_brush_light_type,0<=_brush_light_strength<=1,_brush_opac‐
9951 ity,_painting_density[%]>=0,0<=_painting_contours_coherence<=1,
9952 0<=_painting_orientation_coherence<=1,_painting_coherence_al‐
9953 pha[%]>=0,_painting_coherence_sigma[%]>=0,_painting_primary_an‐
9954 gle,0<=_painting_angle_dispersion<=1
9955
9956 Apply specified brush to create painterly versions of specified im‐
9957 ages.
9958 'brush_light_type' can be { 0=none | 1=flat | 2=darken | 3=lighten
9959 | 4=full }.
9960
9961 Default values: 'brush_nb_sizes=3', 'brush_min_size_factor=0.66',
9962 'brush_nb_orientations=12', 'brush_light_type=0',
9963 'brush_light_strength=0.25',
9964 'brush_opacity=0.8', 'painting_density=20%', 'painting_con‐
9965 tours_coherence=0.9', 'painting_orientation_coherence=0.9', 'paint‐
9966 ing_coherence_alpha=1',
9967 'painting_coherence_sigma=1', 'painting_primary_angle=0', 'paint‐
9968 ing_angle_dispersion=0.2'
9969
9970 Example:
9971 [#1] image.jpg 40,40 gaussian[-1] 10,4 spread[-1] 10,0
9972 brushify[0] [1],1
9973
9974 cartoon:
9975 _smoothness,_sharpening,_threshold>=0,_thick‐
9976 ness>=0,_color>=0,quantization>0
9977
9978 Apply cartoon effect on selected images.
9979
9980 Default values: 'smoothness=3', 'sharpening=150', 'threshold=20',
9981 'thickness=0.25', 'color=1.5' and 'quantization=8'.
9982
9983 Example:
9984 [#1] image.jpg cartoon 3,50,10,0.25,3,16
9985
9986 color_ellipses:
9987 _count>0,_radius>=0,_opacity>=0
9988
9989 Add random color ellipses to selected images.
9990
9991 Default values: 'count=400', 'radius=5' and 'opacity=0.1'.
9992
9993 Example:
9994 [#1] image.jpg +color_ellipses ,,0.15
9995
9996 cubism:
9997 _density>=0,0<=_thickness<=50,_max_angle,_opacity,_smoothness>=0
9998
9999 Apply cubism effect on selected images.
10000
10001 Default values: 'density=50', 'thickness=10', 'max_angle=75',
10002 'opacity=0.7' and 'smoothness=0'.
10003
10004 Example:
10005 [#1] image.jpg cubism ,
10006
10007 draw_whirl:
10008 _amplitude>=0
10009
10010 Apply whirl drawing effect on selected images.
10011
10012 Default value: 'amplitude=100'.
10013
10014 Example:
10015 [#1] image.jpg draw_whirl ,
10016
10017 drawing:
10018 _amplitude>=0
10019
10020 Apply drawing effect on selected images.
10021
10022 Default value: 'amplitude=200'.
10023
10024 Example:
10025 [#1] image.jpg +drawing ,
10026
10027 drop_shadow:
10028 _offset_x[%],_offset_y[%],_smoothness[%]>=0,0<=_curvature<=1,_ex‐
10029 pand_size={ 0 | 1 }
10030
10031 Drop shadow behind selected images.
10032
10033 Default values: 'offset_x=20', 'offset_y=offset_x', 'smoothness=5',
10034 'curvature=0' and 'expand_size=1'.
10035
10036 Example:
10037 [#1] image.jpg drop_shadow 10,20,5,0.5 expand_xy 20,0 dis‐
10038 play_rgba
10039
10040 ellipsionism:
10041 _R>0[%],_r>0[%],_smoothness>=0[%],_opacity,_outline>0,_density>0
10042
10043 Apply ellipsionism filter to selected images.
10044
10045 Default values: 'R=10', 'r=3', 'smoothness=1%', 'opacity=0.7',
10046 'outline=8' and 'density=0.6'.
10047
10048 Example:
10049 [#1] image.jpg ellipsionism ,
10050
10051 fire_edges:
10052 _edges>=0,0<=_attenuation<=1,_smoothness>=0,_thresh‐
10053 old>=0,_nb_frames>0,_starting_frame>=0,frame_skip>=0
10054
10055 Generate fire effect from edges of selected images.
10056
10057 Default values: 'edges=0.7', 'attenuation=0.25', 'smoothness=0.5',
10058 'threshold=25', 'nb_frames=1', 'starting_frame=20' and 'frame_skip=0'.
10059
10060 Example:
10061 [#1] image.jpg fire_edges ,
10062
10063 fractalize:
10064 0<=detail_level<=1
10065
10066 Randomly fractalize selected images.
10067
10068 Default value: 'detail_level=0.8'
10069
10070 Example:
10071 [#1] image.jpg fractalize ,
10072
10073 glow:
10074 _amplitude>=0
10075
10076 Add soft glow on selected images.
10077
10078 Default value: 'amplitude=1%'.
10079
10080 Example:
10081 [#1] image.jpg glow ,
10082
10083 halftone:
10084 nb_levels>=2,_size_dark>=2,_size_bright>=2,_shape={ 0=square |
10085 1=diamond | 2=circle | 3=inv-square | 4=inv-diamond | 5=inv-circle
10086 },_smoothness[%]>=0
10087
10088 Apply halftone dithering to selected images.
10089
10090 Default values: 'nb_levels=5', 'size_dark=8', 'size_bright=8',
10091 'shape=5' and 'smoothnesss=0'.
10092
10093 Example:
10094 [#1] image.jpg halftone ,
10095
10096 hardsketchbw:
10097 _amplitude>=0,_density>=0,_opacity,0<=_edge_thresh‐
10098 old<=100,_is_fast={ 0 | 1 }
10099
10100 Apply hard B&W sketch effect on selected images.
10101
10102 Default values: 'amplitude=1000', 'sampling=3', 'opacity=0.1',
10103 'edge_threshold=20' and 'is_fast=0'.
10104
10105 Example:
10106 [#1] image.jpg +hardsketchbw 200,70,0.1,10 median[-1] 2 +local
10107 reverse blur[-1] 3 blend[-2,-1] overlay endlocal
10108
10109 hearts:
10110 _density>=0
10111
10112 Apply heart effect on selected images.
10113
10114 Default value: 'density=10'.
10115
10116 Example:
10117 [#1] image.jpg hearts ,
10118
10119 houghsketchbw:
10120 _density>=0,_radius>0,0<=_threshold<=100,0<=_opacity<=1,_vote‐
10121 size[%]>0
10122
10123 Apply hough B&W sketch effect on selected images.
10124
10125 Default values: 'density=100', 'radius=3', 'threshold=100', 'opac‐
10126 ity=0.1' and 'votesize=100%'.
10127
10128 Example:
10129 [#1] image.jpg +houghsketchbw ,
10130
10131 lightrays:
10132 100<=_density<=0,_center_x[%],_cen‐
10133 ter_y[%],_ray_length>=0,_ray_attenuation>=0
10134
10135 Generate ray lights from the edges of selected images.
10136
10137 Default values: 'density=50%', 'center_x=50%', 'center_y=50%',
10138 'ray_length=0.9' and 'ray_attenuation=0.5'.
10139
10140 Example:
10141 [#1] image.jpg +lightrays , + cut 0,255
10142
10143 light_relief:
10144 _ambient_light,_specular_lightness,_specular_size,_dark‐
10145 ness,_light_smoothness,_xl,_yl,_zl,_zscale,_opacity_is_heightmap={ 0 |
10146 1 }
10147
10148 Apply relief light to selected images.
10149 Default values(s) : 'ambient_light=0.3', 'specular_lightness=0.5',
10150 'specular_size=0.2', 'darkness=0', 'xl=0.2', 'yl=zl=0.5',
10151 'zscale=1', 'opacity=1' and 'opacity_is_heightmap=0'.
10152
10153 Example:
10154 [#1] image.jpg blur 2 light_relief 0.3,4,0.1,0
10155
10156 linify:
10157 0<=_density<=100,_spreading>=0,_resolution[%]>0,_line_opac‐
10158 ity>=0,_line_precision>0,_mode={ 0=subtractive | 1=additive }
10159
10160 Apply linify effect on selected images.
10161 The algorithm is inspired from the one described on the webpage
10162 http://linify.me/about.
10163
10164 Default values: 'density=50', 'spreading=2', 'resolution=40%',
10165 'line_opacity=10', 'line_precision=24' and 'mode=0'.
10166
10167 Example:
10168 [#1] image.jpg linify 60
10169
10170 mosaic:
10171 0<=_density<=100
10172
10173 Create random mosaic from selected images.
10174
10175 Default values: 'density=30'.
10176
10177 Example:
10178 [#1] image.jpg mosaic , +fill "I!=J(1) || I!=J(0,1)?[0,0,0]:I"
10179
10180 old_photo:
10181
10182 Apply old photo effect on selected images.
10183
10184 Example:
10185 [#1] image.jpg old_photo
10186
10187 pencilbw:
10188 _size>=0,_amplitude>=0
10189
10190 Apply B&W pencil effect on selected images.
10191
10192 Default values: 'size=0.3' and 'amplitude=60'.
10193
10194 Example:
10195 [#1] image.jpg pencilbw ,
10196
10197 pixelsort:
10198 _ordering={ + | - },_axis={ x | y | z | xy | yx },_[sorting_cri‐
10199 terion],_[mask]
10200
10201 Apply a 'pixel sorting' algorithm on selected images, as described
10202 in the page :
10203 http://satyarth.me/articles/pixel-sorting/.
10204
10205 Default values: 'ordering=+', 'axis=x' and 'sorting_crite‐
10206 rion=mask=(undefined)'.
10207
10208 Example:
10209 [#1] image.jpg +norm +ge[-1] 30% +pixelsort[0] +,y,[1],[2]
10210
10211 polaroid:
10212 _size1>=0,_size2>=0
10213
10214 Create polaroid effect in selected images.
10215
10216 Default values: 'size1=10' and 'size2=20'.
10217
10218 Example:
10219 [#1] image.jpg to_rgba polaroid 5,30 rotate 20 drop_shadow ,
10220 drgba
10221
10222 polygonize:
10223 _warp_amplitude>=0,_smoothness[%]>=0,_min_area[%]>=0,_resolu‐
10224 tion_x[%]>0,_resolution_y[%]>0
10225
10226 Apply polygon effect on selected images.
10227
10228 Default values: 'warp_amplitude=300', 'smoothness=2%',
10229 'min_area=0.1%', 'resolution_x=resolution_y=10%'.
10230
10231 Example:
10232 [#1] image.jpg image.jpg polygonize 100,10 +fill "I!=J(1) ||
10233 I!=J(0,1)?[0,0,0]:I"
10234
10235 poster_edges:
10236 0<=_edge_threshold<=100,0<=_edge_shade<=100,_edge_thick‐
10237 ness>=0,_edge_antialiasing>=0,0<=_posterization_level<=15,_posteriza‐
10238 tion_antialiasing>=0
10239
10240 Apply poster edges effect on selected images.
10241
10242 Default values: 'edge_threshold=40', 'edge_shade=5', 'edge_thick‐
10243 ness=0.5', 'edge_antialiasing=10', 'posterization_level=12' and 'pos‐
10244 terization_antialiasing=0'.
10245
10246 Example:
10247 [#1] image.jpg poster_edges ,
10248
10249 poster_hope:
10250 _smoothness>=0
10251
10252 Apply Hope stencil poster effect on selected images.
10253
10254 Default value: 'smoothness=3'.
10255
10256 Example:
10257 [#1] image.jpg poster_hope ,
10258
10259 rodilius:
10260 0<=_amplitude<=100,_0<=thickness<=100,_sharpness>=0,_nb_orienta‐
10261 tions>0,_offset,_color_mode={ 0=darker | 1=brighter }
10262
10263 Apply rodilius (fractalius-like) filter on selected images.
10264
10265 Default values: 'amplitude=10', 'thickness=10', 'sharpness=400',
10266 'nb_orientations=7', 'offset=0' and 'color_mode=1'.
10267
10268 Example:
10269 [#1] image.jpg rodilius 12,10,300,10 normalize_local 10,6
10270 [#2] image.jpg normalize_local 10,16 rodilius 10,4,400,16 smooth
10271 60,0,1,1,4 normalize_local 10,16
10272
10273 sketchbw:
10274 _nb_angles>0,_start_angle,_angle_range>=0,_length>=0,_thresh‐
10275 old>=0,_opacity,_bgfactor>=0,_density>0,_sharpness>=0,_anisot‐
10276 ropy>=0,_smoothness>=0,_coherence>=0,_is_boost={ 0 | 1 },_is_curved={ 0
10277 | 1 }
10278
10279 Apply sketch effect to selected images.
10280
10281 Default values: 'nb_angles=2', 'start_angle=45', 'angle_range=180',
10282 'length=30', 'threshold=3', 'opacity=0.03', 'bgfactor=0', 'den‐
10283 sity=0.6',
10284 'sharpness=0.1', 'anisotropy=0.6', 'smoothness=0.25', 'coher‐
10285 ence=1', 'is_boost=0' and 'is_curved=1'.
10286
10287 Example:
10288 [#1] image.jpg +sketchbw 1 reverse blur[-1] 3 blend[-2,-1] over‐
10289 lay
10290
10291 sponge:
10292 _size>0
10293
10294 Apply sponge effect on selected images.
10295
10296 Default value: 'size=13'.
10297
10298 Example:
10299 [#1] image.jpg sponge ,
10300
10301 stained_glass:
10302 _edges[%]>=0, shading>=0, is_thin_separators={ 0 | 1 }
10303
10304 Generate stained glass from selected images.
10305
10306 Default values: 'edges=40%', 'shading=0.2' and 'is_precise=0'.
10307
10308 Example:
10309 [#1] image.jpg stained_glass 20%,1 cut 0,20
10310
10311 stars:
10312 _density[%]>=0,_depth>=0,_size>0,_nb_branches>=1,0<=_thick‐
10313 ness<=1,_smoothness[%]>=0,_R,_G,_B,_opacity
10314
10315 Add random stars to selected images.
10316
10317 Default values: 'density=10%', 'depth=1', 'size=32',
10318 'nb_branches=5', 'thickness=0.38', 'smoothness=0.5', 'R=G=B=200' and
10319 'opacity=1'.
10320
10321 Example:
10322 [#1] image.jpg stars ,
10323
10324 stencil:
10325 _radius[%]>=0,_smoothness>=0,_iterations>=0
10326
10327 Apply stencil filter on selected images.
10328
10329 Default values: 'radius=3', 'smoothness=1' and 'iterations=8'.
10330
10331 Example:
10332 [#1] image.jpg +norm stencil. 2,1,4 +mul rm[0]
10333
10334 stencilbw:
10335 _edges>=0,_smoothness>=0
10336
10337 Apply B&W stencil effect on selected images.
10338
10339 Default values: 'edges=15' and 'smoothness=10'.
10340
10341 Example:
10342 [#1] image.jpg +stencilbw 40,4
10343
10344 stylize:
10345 [style_image],_fidelity_finest,_fidelity_coarsest,_fi‐
10346 delity_smoothness_finest>=0,_fidelity_smoothnes_coarsest>=0,0<=_fi‐
10347 delity_chroma<=1,_init_type,_init_resolution>=0,init_max_gradient>=0,
10348 _patchsize_analysis>0,_patchsize_synthesis>0,_patchsize_synthe‐
10349 sis_final>0,_nb_matches_finest>=0,_nb_matches_coarsest>=0,_penal‐
10350 ize_repetitions>=0,_matching_precision>=0,_scale_factor>1,
10351 _skip_finest_scales>=0,_"image_matching_command"
10352
10353 Transfer colors and textures from specified style image to selected
10354 images, using a multi-scale patch-mathing algorithm.
10355 If instant display window[0] is opened, the steps of the image syn‐
10356 thesis are displayed on it.
10357 'init_type' can be { 0=best-match | 1=identity | 2=randomized }.
10358
10359 Default values: 'fidelity_finest=0.5', 'fidelity_coarsest=2', 'fi‐
10360 delity_smoothness_finest=3', 'fidelity_smoothness_coarsest=0.5', 'fi‐
10361 delity_chroma=0.1',
10362 'init_type=0', 'init_resolution=16', 'init_max_gradient=0',
10363 'patchsize_analysis=5', 'patchsize_synthesis=5', 'patchsize_synthe‐
10364 sis_final=5',
10365 'nb_matches_finest=2', 'nb_matchesc_coarsest=30', 'penalize_repe‐
10366 titions=10', 'matching_precision=2', 'scale_factor=1.85',
10367 'skip_finest_scales=0' and
10368 'image_matching_command'="s c,-3 transfer_pca[0] [2] b[0,2] xy,0.7
10369 n[0,2] 0,255 n[1,2] 0,200 a[0,1] c a[1,2] c"'.
10370
10371 tetris:
10372 _scale>0
10373
10374 Apply tetris effect on selected images.
10375
10376 Default value: 'scale=10'.
10377
10378 Example:
10379 [#1] image.jpg +tetris 10
10380
10381 warhol:
10382 _M>0,_N>0,_smoothness>=0,_color>=0
10383
10384 Create MxN Andy Warhol-like artwork from selected images.
10385
10386 Default values: 'M=3', 'N=M', 'smoothness=2' and 'color=20'.
10387
10388 Example:
10389 [#1] image.jpg warhol 3,3,3,40
10390
10391 weave:
10392 _density>=0,0<=_thickness<=100,0<=_shadow<=100,_shad‐
10393 ing>=0,_fibers_amplitude>=0,_fibers_smoothness>=0,_angle,-1<=_x_curva‐
10394 ture<=1,-1<=_y_curvature<=1
10395
10396 Apply weave effect to the selected images.
10397 'angle' can be { 0=0 deg. | 1=22.5 deg. | 2=45 deg. | 3=67.5 deg.
10398 }.
10399
10400 Default values: 'density=6', 'thickness=65', 'shadow=40', 'shad‐
10401 ing=0.5', 'fibers_amplitude=0', _'fibers_smoothness=0', 'angle=0' and
10402 'curvature_x=curvature_y=0'
10403
10404 Example:
10405 [#1] image.jpg weave ,
10406
10407 whirls:
10408 _texture>=0,_smoothness>=0,_darkness>=0,_lightness>=0
10409
10410 Add random whirl texture to selected images.
10411
10412 Default values: 'texture=3', 'smoothness=6', 'darkness=0.5' and
10413 'lightness=1.8'.
10414
10415 Example:
10416 [#1] image.jpg whirls ,
10417
10418 12.16. Warpings
10419 --------
10420
10421 deform:
10422 _amplitude>=0,_interpolation
10423
10424 Apply random smooth deformation on selected images.
10425 'interpolation' can be { 0=none | 1=linear | 2=bicubic }.
10426
10427 Default value: 'amplitude=10'.
10428
10429 Example:
10430 [#1] image.jpg +deform[0] 10 +deform[0] 20
10431
10432 euclidean2polar:
10433 _center_x[%],_center_y[%],_stretch_factor>0,_boundary_condi‐
10434 tions={ 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }
10435
10436 Apply euclidean to polar transform on selected images.
10437
10438 Default values: 'center_x=center_y=50%', 'stretch_factor=1' and
10439 'boundary_conditions=1'.
10440
10441 Example:
10442 [#1] image.jpg +euclidean2polar ,
10443
10444 equirectangular2nadirzenith:
10445
10446 Transform selected equirectangular images to nadir/zenith rectilin‐
10447 ear projections.
10448
10449 fisheye:
10450 _center_x,_center_y,0<=_radius<=100,_amplitude>=0
10451
10452 Apply fish-eye deformation on selected images.
10453
10454 Default values: 'x=y=50', 'radius=50' and 'amplitude=1.2'.
10455
10456 Example:
10457 [#1] image.jpg +fisheye ,
10458
10459 flower:
10460 _amplitude,_frequency,_offset_r[%],_angle,_center_x[%],_cen‐
10461 ter_y[%],_boundary_conditions={ 0=dirichlet | 1=neumann | 2=periodic |
10462 3=mirror}
10463
10464 toto
10465 Apply flower deformation on selected images.
10466
10467 Default values: 'amplitude=30', 'frequency=6', 'offset_r=0', 'an‐
10468 gle=0', 'center_x=center_y=50%' and 'boundary_conditions=3'.
10469
10470 Example:
10471 [#1] image.jpg +flower ,
10472
10473 kaleidoscope:
10474 _center_x[%],_center_y[%],_radius,_angle,_boundary_conditions={
10475 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }
10476
10477 Create kaleidoscope effect from selected images.
10478
10479 Default values: 'center_x=center_y=50%', 'radius=100', 'angle=30'
10480 and 'boundary_conditions=3'.
10481
10482 Example:
10483 [#1] image.jpg kaleidoscope ,
10484
10485 map_sphere:
10486 _width>0,_height>0,_radius,_dilation>0,_fading>=0,_fad‐
10487 ing_power>=0
10488
10489 Map selected images on a sphere.
10490
10491 Default values: 'width=height=512', 'radius=100', 'dilation=0.5',
10492 'fading=0' and 'fading_power=0.5'.
10493
10494 Example:
10495 [#1] image.jpg map_sphere ,
10496
10497 nadirzenith2equirectangular:
10498
10499 Transform selected nadir/zenith rectilinear projections to
10500 equirectangular images.
10501
10502 polar2euclidean:
10503 _center_x[%],_center_y[%],_stretch_factor>0,_boundary_condi‐
10504 tions={ 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }
10505
10506 Apply euclidean to polar transform on selected images.
10507
10508 Default values: 'center_x=center_y=50%', 'stretch_factor=1' and
10509 'boundary_conditions=1'.
10510
10511 Example:
10512 [#1] image.jpg +euclidean2polar ,
10513
10514 raindrops:
10515 _amplitude,_density>=0,_wavelength>=0,_merging_steps>=0
10516
10517 Apply raindrops deformation on selected images.
10518
10519 Default values: 'amplitude=80','density=0.1', 'wavelength=1' and
10520 'merging_steps=0'.
10521
10522 Example:
10523 [#1] image.jpg +raindrops ,
10524
10525 ripple:
10526 _amplitude,_bandwidth,_shape={ 0=bloc | 1=triangle | 2=sine |
10527 3=sine+ | 4=random },_angle,_offset
10528
10529 Apply ripple deformation on selected images.
10530
10531 Default values: 'amplitude=10', 'bandwidth=10', 'shape=2', 'an‐
10532 gle=0' and 'offset=0'.
10533
10534 Example:
10535 [#1] image.jpg +ripple ,
10536
10537 rotoidoscope:
10538 _center_x[%],_center_y[%],_tiles>0,_smoothness[%]>=0,_bound‐
10539 ary_conditions={ 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }
10540
10541 Create rotational kaleidoscope effect from selected images.
10542
10543 Default values: 'center_x=center_y=50%', 'tiles=10', 'smoothness=1'
10544 and 'boundary_conditions=3'.
10545
10546 Example:
10547 [#1] image.jpg +rotoidoscope ,
10548
10549 spherize:
10550 _radius[%]>=0,_strength,_smoothness[%]>=0,_center_x[%],_cen‐
10551 ter_y[%],_ratio_x/y>0,_angle,_interpolation
10552
10553 Apply spherize effect on selected images.
10554
10555 Default values: 'radius=50%', 'strength=1', 'smoothness=0', 'cen‐
10556 ter_x=center_y=50%', 'ratio_x/y=1', 'angle=0' and 'interpolation=1'.
10557
10558 Example:
10559 [#1] image.jpg grid 5%,5%,0,0,0.6,255 spherize ,
10560
10561 symmetrize:
10562 _x[%],_y[%],_angle,_boundary_conditions={ 0=dirichlet | 1=neumann
10563 | 2=periodic | 3=mirror },_is_antisymmetry={ 0 | 1 },_swap_sides={ 0 |
10564 1 }
10565
10566 Symmetrize selected images regarding specified axis.
10567
10568 Default values: 'x=y=50%', 'angle=90', 'boundary_conditions=3',
10569 'is_antisymmetry=0' and 'swap_sides=0'.
10570
10571 Example:
10572 [#1] image.jpg +symmetrize 50%,50%,45 +symmetrize[-1] 50%,50%,-45
10573
10574 transform_polar:
10575 "expr_radius",_"expr_angle",_center_x[%],_center_y[%],_bound‐
10576 ary_conditions={ 0=dirichlet | 1=neumann }
10577
10578 Apply user-defined transform on polar representation of selected
10579 images.
10580
10581 Default values: 'expr_radius=R-r', 'expr_rangle=a', 'center_x=cen‐
10582 ter_y=50%' and 'boundary_conditions=1'.
10583
10584 Example:
10585 [#1] image.jpg +transform_polar[0] R*(r/R)^2,a +transform_po‐
10586 lar[0] r,2*a
10587
10588 twirl:
10589 _amplitude,_center_x[%],_center_y[%],_boundary_conditions={
10590 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }
10591
10592 Apply twirl deformation on selected images.
10593
10594 Default values: 'amplitude=1', 'center_x=center_y=50%' and 'bound‐
10595 ary_conditions=3'.
10596
10597 Example:
10598 [#1] image.jpg twirl 0.6
10599
10600 warp_perspective:
10601 _x-angle,_y-angle,_zoom>0,_x-center,_y-center,_boundary_condi‐
10602 tions={ 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }
10603
10604 Warp selected images with perspective deformation.
10605
10606 Default values: 'x-angle=1.5', 'y-angle=0', 'zoom=1', 'x-center=y-
10607 center=50' and 'boundary_conditions=2'.
10608
10609 Example:
10610 [#1] image.jpg warp_perspective ,
10611
10612 water:
10613 _amplitude,_smoothness>=0,_angle
10614
10615 Apply water deformation on selected images.
10616
10617 Default values: 'amplitude=30', 'smoothness=1.5' and 'angle=45'.
10618
10619 Example:
10620 [#1] image.jpg water ,
10621
10622 wave:
10623 _amplitude>=0,_frequency>=0,_center_x,_center_y
10624
10625 Apply wave deformation on selected images.
10626
10627 Default values: 'amplitude=4', 'frequency=0.4' and 'center_x=cen‐
10628 ter_y=50'.
10629
10630 Example:
10631 [#1] image.jpg wave ,
10632
10633 wind:
10634 _amplitude>=0,_angle,0<=_attenuation<=1,_threshold
10635
10636 Apply wind effect on selected images.
10637
10638 Default values: 'amplitude=20', 'angle=0', 'attenuation=0.7' and
10639 'threshold=20'.
10640
10641 Example:
10642 [#1] image.jpg +wind ,
10643
10644 zoom:
10645 _factor,_cx,_cy,_cz,_boundary_conditions={ 0=dirichlet | 1=neu‐
10646 mann | 2=periodic | 3=mirror }
10647
10648 Apply zoom factor to selected images.
10649
10650 Default values: 'factor=1', 'cx=cy=cz=0.5' and 'boundary_condi‐
10651 tions=0'.
10652
10653 Example:
10654 [#1] image.jpg +zoom[0] 0.6 +zoom[0] 1.5
10655
10656 12.17. Degradations
10657 ------------
10658
10659 cracks:
10660 0<=_density<=100,_is_relief={ 0 | 1 },_opacity,_color1,...
10661
10662 Draw random cracks on selected images with specified color.
10663
10664 Default values: 'density=25', 'is_relief=0', 'opacity=1' and
10665 'color1=0'.
10666
10667 Example:
10668 [#1] image.jpg +cracks ,
10669
10670 light_patch:
10671 _density>0,_darkness>=0,_lightness>=0
10672
10673 Add light patches to selected images.
10674
10675 Default values: 'density=10', 'darkness=0.9' and 'lightness=1.7'.
10676
10677 Example:
10678 [#1] image.jpg +light_patch 20,0.9,4
10679
10680 noise_hurl:
10681 _amplitude>=0
10682
10683 Add hurl noise to selected images.
10684
10685 Default value: 'amplitude=10'.
10686
10687 Example:
10688 [#1] image.jpg +noise_hurl ,
10689
10690 pixelize:
10691 _scale_x>0,_scale_y>0,_scale_z>0
10692
10693 Pixelize selected images with specified scales.
10694
10695 Default values: 'scale_x=20' and 'scale_y=scale_z=scale_x'.
10696
10697 Example:
10698 [#1] image.jpg +pixelize ,
10699
10700 scanlines:
10701 _amplitude,_bandwidth,_shape={ 0=bloc | 1=triangle | 2=sine |
10702 3=sine+ | 4=random },_angle,_offset
10703
10704 Apply ripple deformation on selected images.
10705
10706 Default values: 'amplitude=60', 'bandwidth=2', 'shape=0', 'angle=0'
10707 and 'offset=0'.
10708
10709 Example:
10710 [#1] image.jpg +scanlines ,
10711
10712 shade_stripes:
10713 _frequency>=0,_direction={ 0=horizontal | 1=vertical },_dark‐
10714 ness>=0,_lightness>=0
10715
10716 Add shade stripes to selected images.
10717
10718 Default values: 'frequency=5', 'direction=1', 'darkness=0.8' and
10719 'lightness=2'.
10720
10721 Example:
10722 [#1] image.jpg +shade_stripes 30
10723
10724 shadow_patch:
10725 _opacity>=0
10726
10727 Add shadow patches to selected images.
10728
10729 Default value: 'opacity=0.7'.
10730
10731 Example:
10732 [#1] image.jpg +shadow_patch 0.4
10733
10734 spread:
10735 _dx>=0,_dy>=0,_dz>=0
10736
10737 Spread pixel values of selected images randomly along x,y and z.
10738
10739 Default values: 'dx=3', 'dy=dx' and 'dz=0'.
10740
10741 Example:
10742 [#1] image.jpg +spread 3
10743
10744 stripes_y:
10745 _frequency>=0
10746
10747 Add vertical stripes to selected images.
10748
10749 Default value: 'frequency=10'.
10750
10751 Example:
10752 [#1] image.jpg +stripes_y ,
10753
10754 texturize_canvas:
10755 _amplitude>=0,_fibrousness>=0,_emboss_level>=0
10756
10757 Add paint canvas texture to selected images.
10758
10759 Default values: 'amplitude=20', 'fibrousness=3' and 'em‐
10760 boss_level=0.6'.
10761
10762 Example:
10763 [#1] image.jpg +texturize_canvas ,
10764
10765 texturize_paper:
10766
10767 Add paper texture to selected images.
10768
10769 Example:
10770 [#1] image.jpg +texturize_paper
10771
10772 vignette:
10773 _strength>=0,0<=_radius_min<=100,0<=_radius_max<=100
10774
10775 Add vignette effect to selected images.
10776
10777 Default values: 'strength=100', 'radius_min=70' and 'ra‐
10778 dius_max=90'.
10779
10780 Example:
10781 [#1] image.jpg vignette ,
10782
10783 watermark_visible:
10784 _text,0<_opacity<1,_size>0,_angle,_mode={ 0=remove | 1=add
10785 },_smoothness>=0
10786
10787 Add or remove a visible watermark on selected images (value range
10788 must be [0,255]).
10789
10790 Default values: 'text=(c) G'MIC', 'opacity=0.3', 'size=53', 'an‐
10791 gle=25', 'mode=1' and 'smoothness=0'.
10792
10793 Example:
10794 [#1] image.jpg watermark_visible ,0.7
10795
10796 12.18. Blending and Fading
10797 -------------------
10798
10799 blend:
10800 [layer],blending_mode,_opacity[%],_selection_is={ 0=base-layers |
10801 1=top-layers } |
10802 blending_mode,_opacity[%]
10803
10804 Blend selected G,GA,RGB or RGBA images by specified layer or blend
10805 all selected images together,
10806 using specified blending mode.
10807 'blending_mode' can be { add | alpha | and | average | blue | burn
10808 | darken | difference |
10809 divide | dodge | edges | exclusion | freeze | grainextract | grain‐
10810 merge | green | hardlight |
10811 hardmix | hue | interpolation | lchlightness | lighten | lightness
10812 | linearburn | linearlight | luminance |
10813 multiply | negation | or | overlay | pinlight | red | reflect |
10814 saturation | seamless | seamless_mixed |
10815 screen | shapeareamax | shapeareamax0 | shapeareamin | sha‐
10816 peareamin0 | shapeaverage | shapeaverage0 |
10817 shapemedian | shapemedian0 | shapemin | shapemin0 | shapemax |
10818 shapemax0 | softburn | softdodge |
10819 softlight | stamp | subtract | value | vividlight | xor }.
10820 'opacity' should be in '[0,1]', or '[0,100]' if expressed with a
10821 '%'.
10822
10823 Default values: 'blending_mode=alpha', 'opacity=1' and 'selec‐
10824 tion_is=0'.
10825
10826 Example:
10827 [#1] image.jpg +drop_shadow , resize2dy[-1] 200 rotate[-1] 20
10828 +blend alpha display_rgba[-2]
10829 [#2] image.jpg testimage2d {w},{h} blend overlay
10830 [#3] command "ex : $""=arg repeat $""# +blend[0,1] ${arg{$>+1}}
10831 text_outline[-1] Mode:
10832 [#4] command "ex : $""=arg repeat $""# +blend[0,1] ${arg{$>+1}}
10833 text_outline[-1] Mode:
10834 grainextract,grainmerge
10835 [#5] command "ex : $""=arg repeat $""# +blend[0,1] ${arg{$>+1}}
10836 text_outline[-1] Mode:
10837 lighten,lightness
10838 [#6] command "ex : $""=arg repeat $""# +blend[0,1] ${arg{$>+1}}
10839 text_outline[-1] Mode:
10840 negation,or,overlay
10841 [#7] command "ex : $""=arg repeat $""# +blend[0,1] ${arg{$>+1}}
10842 text_outline[-1] Mode:
10843 shapeaverage,softburn
10844 [#8] command "ex : $""=arg repeat $""# +blend[0,1] ${arg{$>+1}}
10845 text_outline[-1] Mode:
10846 vividlight,xor
10847
10848 blend_edges:
10849 smoothness[%]>=0
10850
10851 Blend selected images togethers using 'edges' mode.
10852
10853 Example:
10854 [#1] image.jpg testimage2d {w},{h} +blend_edges 0.8
10855
10856 blend_fade:
10857 [fading_shape]
10858
10859 Blend selected images together using specified fading shape.
10860
10861 Example:
10862 [#1] image.jpg testimage2d {w},{h} 100%,100%,1,1,'cos(y/10)' nor‐
10863 malize[-1] 0,1 +blend_fade[0,1] [2]
10864
10865 blend_median:
10866
10867 Blend selected images together using 'median' mode.
10868
10869 Example:
10870 [#1] image.jpg testimage2d {w},{h} +mirror[0] y +blend_median
10871
10872 blend_seamless:
10873 _is_mixed_mode={ 0 | 1 },_inner_fading[%]>=0,_outer_fading[%]>=0
10874
10875 Blend selected images using a seamless blending mode (Poisson-
10876 based).
10877
10878 Default values: 'is_mixed=0', 'inner_fading=0' and 'outer_fad‐
10879 ing=100%'.
10880
10881 fade_diamond:
10882 0<=_start<=100,0<=_end<=100
10883
10884 Create diamond fading from selected images.
10885
10886 Default values: 'start=80' and 'end=90'.
10887
10888 Example:
10889 [#1] image.jpg testimage2d {w},{h} +fade_diamond 80,85
10890
10891 fade_linear:
10892 _angle,0<=_start<=100,0<=_end<=100
10893
10894 Create linear fading from selected images.
10895
10896 Default values: 'angle=45', 'start=30' and 'end=70'.
10897
10898 Example:
10899 [#1] image.jpg testimage2d {w},{h} +fade_linear 45,48,52
10900
10901 fade_radial:
10902 0<=_start<=100,0<=_end<=100
10903
10904 Create radial fading from selected images.
10905
10906 Default values: 'start=30' and 'end=70'.
10907
10908 Example:
10909 [#1] image.jpg testimage2d {w},{h} +fade_radial 30,70
10910
10911 fade_x:
10912 0<=_start<=100,0<=_end<=100
10913
10914 Create horizontal fading from selected images.
10915
10916 Default values: 'start=30' and 'end=70'.
10917
10918 Example:
10919 [#1] image.jpg testimage2d {w},{h} +fade_x 30,70
10920
10921 fade_y:
10922 0<=_start<=100,0<=_end<=100
10923
10924 Create vertical fading from selected images.
10925
10926 Default values: 'start=30' and 'end=70'.
10927
10928 Example:
10929 [#1] image.jpg testimage2d {w},{h} +fade_y 30,70
10930
10931 fade_z:
10932 0<=_start<=100,0<=_end<=100
10933
10934 Create transversal fading from selected images.
10935
10936 Default values: 'start=30' and 'end=70'.
10937
10938 sub_alpha:
10939 [base_image],_opacity_gain>=1
10940
10941 Compute the minimal alpha-channel difference (opposite of alpha
10942 blending) between the selected images
10943 and the specified base image.
10944 The alpha difference A-B is defined as the image having minimal
10945 opacity, such that alpha_blend(B,A-B) = A.
10946
10947 Default value: 'opacity_gain=1'.
10948
10949 Example:
10950 [#1] image.jpg testimage2d {w},{h} +sub_alpha[0] [1] display_rgba
10951
10952 12.19. Image Sequences and Videos
10953 --------------------------
10954
10955 animate:
10956 fil‐
10957 ter_name,"param1_start,...,paramN_start","param1_end,...,paramN_end",nb_frames>=0,_out‐
10958 put_frames={ 0 | 1 },_output_filename |
10959 delay>0,_back and forth={ 0 | 1 }
10960
10961 Animate filter from starting parameters to ending parameters or an‐
10962 imate selected images
10963 in a display window.
10964
10965 Default value: 'delay=30'.
10966
10967 Example:
10968 [#1] image.jpg animate flower,"0,3","20,8",9
10969
10970 apply_camera:
10971 _"command",_camera_index>=0,_skip_frames>=0,_output_filename
10972
10973 Apply specified command on live camera stream, and display it on
10974 display window [0].
10975 This command requires features from the OpenCV library (not enabled
10976 in G'MIC by default).
10977
10978 Default values: 'command=""', 'camera_index=0' (default camera),
10979 'skip_frames=0' and 'output_filename=""'.
10980
10981 apply_files:
10982 "filename_pattern",_"command",_first_frame>=0,_last_frame={ >=0 |
10983 -1=last },_frame_step>=1,_output_filename
10984
10985 Apply a G'MIC command on specified input image files, in a streamed
10986 way.
10987 If a display window is opened, rendered frames are displayed in it
10988 during processing.
10989 The output filename may have extension '.avi' or '.mp4' (saved as a
10990 video), or any other usual image file
10991 extension (saved as a sequence of images).
10992
10993 Default values: 'command=(undefined)', 'first_frame=0',
10994 'last_frame=-1', 'frame_step=1' and 'output_filename=(undefined)'.
10995
10996 apply_video:
10997 video_filename,_"command",_first_frame>=0,_last_frame={ >=0 |
10998 -1=last },_frame_step>=1,_output_filename
10999
11000 Apply a G'MIC command on all frames of the specified input video
11001 file, in a streamed way.
11002 If a display window is opened, rendered frames are displayed in it
11003 during processing.
11004 The output filename may have extension '.avi' or '.mp4' (saved as a
11005 video), or any other usual image
11006 file extension (saved as a sequence of images).
11007 This command requires features from the OpenCV library (not enabled
11008 in G'MIC by default).
11009
11010 Default values: 'first_frame=0', 'last_frame=-1', 'frame_step=1'
11011 and 'output_filename=(undefined)'.
11012
11013 average_files:
11014 "filename_pattern",_first_frame>=0,_last_frame={ >=0 | -1=last
11015 },_frame_step>=1,_output_filename
11016
11017 Average specified input image files, in a streamed way.
11018 If a display window is opened, rendered frames are displayed in it
11019 during processing.
11020 The output filename may have extension '.avi' or '.mp4' (saved as a
11021 video), or any other usual image
11022 file extension (saved as a sequence of images).
11023
11024 Default values: 'first_frame=0', 'last_frame=-1', 'frame_step=1'
11025 and 'output_filename=(undefined)'.
11026
11027 average_video:
11028 video_filename,_first_frame>=0,_last_frame={ >=0 | -1=last
11029 },_frame_step>=1,_output_filename
11030
11031 Average frames of specified input video file, in a streamed way.
11032 If a display window is opened, rendered frames are displayed in it
11033 during processing.
11034 The output filename may have extension '.avi' or '.mp4' (saved as a
11035 video), or any other usual image
11036 file extension (saved as a sequence of images).
11037 This command requires features from the OpenCV library (not enabled
11038 in G'MIC by default).
11039
11040 Default values: 'first_frame=0', 'last_frame=-1', 'frame_step=1'
11041 and 'output_filename=(undefined)'.
11042
11043 fade_files:
11044 "filename_pattern",_nb_in‐
11045 ner_frames>0,_first_frame>=0,_last_frame={ >=0 | -1=last
11046 },_frame_step>=1,_output_filename
11047
11048 Generate a temporal fading from specified input image files, in a
11049 streamed way.
11050 If a display window is opened, rendered frames are displayed in it
11051 during processing.
11052 The output filename may have extension 'avi' or 'mp4' (saved as a
11053 video), or any other usual image
11054 file extension (saved as a sequence of images).
11055
11056 Default values: 'nb_inner_frames=10', 'first_frame=0',
11057 'last_frame=-1', 'frame_step=1' and 'output_filename=(undefined)'.
11058
11059 fade_video:
11060 video_filename,_nb_inner_frames>0,_first_frame>=0,_last_frame={
11061 >=0 | -1=last },_frame_step>=1,_output_filename
11062
11063 Create a temporal fading sequence from specified input video file,
11064 in a streamed way.
11065 If a display window is opened, rendered frames are displayed in it
11066 during processing.
11067 This command requires features from the OpenCV library (not enabled
11068 in G'MIC by default).
11069
11070 Default values: 'nb_inner_frames=10', 'first_frame=0',
11071 'last_frame=-1', 'frame_step=1' and 'output_filename=(undefined)'.
11072
11073 files2video:
11074 "filename_pattern",_output_filename,_fps>0,_codec
11075
11076 Convert several files into a single video file.
11077
11078 Default values: 'output_filename=output.mp4', 'fps=25' and
11079 'codec=mp4v'.
11080
11081 median_files:
11082 "filename_pattern",_first_frame>=0,_last_frame={ >=0 | -1=last
11083 },_frame_step>=1,_frame_rows[%]>=1,_is_fast_approximation={ 0 | 1 }
11084
11085 Compute the median frame of specified input image files, in a
11086 streamed way.
11087 If a display window is opened, rendered frame is displayed in it
11088 during processing.
11089
11090 Default values: 'first_frame=0', 'last_frame=-1', 'frame_step=1',
11091 'frame_rows=20%' and 'is_fast_approximation=0'.
11092
11093 median_video:
11094 video_filename,_first_frame>=0,_last_frame={ >=0 | -1=last
11095 },_frame_step>=1,_frame_rows[%]>=1,_is_fast_approximation={ 0 | 1 }
11096
11097 Compute the median of all frames of an input video file, in a
11098 streamed way.
11099 If a display window is opened, rendered frame is displayed in it
11100 during processing.
11101 This command requires features from the OpenCV library (not enabled
11102 in G'MIC by default).
11103
11104 Default values: 'first_frame=0', 'last_frame=-1', 'frame_step=1',
11105 'frame_rows=100%' and 'is_fast_approximation=1'.
11106
11107 morph:
11108 nb_inner_frames>=1,_smoothness>=0,_precision>=0
11109
11110 Create morphing sequence between selected images.
11111
11112 Default values: 'smoothness=0.1' and 'precision=4'.
11113
11114 Example:
11115 [#1] image.jpg +rotate 20,1,1,50%,50% morph 9
11116
11117 morph_files:
11118 "filename_pattern",_nb_inner_frames>0,_smoothness>=0,_preci‐
11119 sion>=0,_first_frame>=0,_last_frame={ >=0 | -1=last
11120 },_frame_step>=1,_output_filename
11121
11122 Generate a temporal morphing from specified input image files, in a
11123 streamed way.
11124 If a display window is opened, rendered frames are displayed in it
11125 during processing.
11126 The output filename may have extension '.avi' or '.mp4' (saved as a
11127 video), or any other usual image
11128 file extension (saved as a sequence of images).
11129
11130 Default values: 'nb_inner_frames=10', 'smoothness=0.1', 'preci‐
11131 sion=4', 'first_frame=0', 'last_frame=-1', 'frame_step=1' and 'out‐
11132 put_filename=(undefined)'.
11133
11134 morph_rbf:
11135 nb_in‐
11136 ner_frames>=1,xs0[%],ys0[%],xt0[%],yt0[%],...,xsN[%],ysN[%],xtN[%],ytN[%]
11137
11138 Create morphing sequence between selected images, using RBF-based
11139 interpolation.
11140 Each argument (xsk,ysk)-(xtk,ytk) corresponds to the coordinates of
11141 a keypoint
11142 respectively on the source and target images. The set of all key‐
11143 points define the overall image deformation.
11144
11145 morph_video:
11146 video_filename,_nb_inner_frames>0,_smoothness>=0,_preci‐
11147 sion>=0,_first_frame>=0,_last_frame={ >=0 | -1=last
11148 },_frame_step>=1,_output_filename
11149
11150 Generate a temporal morphing from specified input video file, in a
11151 streamed way.
11152 If a display window is opened, rendered frames are displayed in it
11153 during processing.
11154 The output filename may have extension '.avi' or '.mp4' (saved as a
11155 video), or any other usual image
11156 file extension (saved as a sequence of images).
11157 This command requires features from the OpenCV library (not enabled
11158 in G'MIC by default).
11159
11160 Default values: 'nb_inner_frames=10', 'smoothness=0.1', 'preci‐
11161 sion=4', 'first_frame=0', 'last_frame=-1', 'frame_step=1' and 'out‐
11162 put_filename=(undefined)'.
11163
11164 register_nonrigid:
11165 [destination],_smoothness>=0,_precision>0,_nb_scale>=0
11166
11167 Register selected source images with specified destination image,
11168 using non-rigid warp.
11169
11170 Default values: 'smoothness=0.2', 'precision=6' and
11171 'nb_scale=0(auto)'.
11172
11173 Example:
11174 [#1] image.jpg +rotate 20,1,1,50%,50% +register_nonrigid[0] [1]
11175
11176 register_rigid:
11177 [destination],_smoothness>=0,_boundary_conditions={ 0=dirichlet |
11178 1=neumann | 2=periodic | 3=mirror }
11179
11180 Register selected source images with specified destination image,
11181 using rigid warp (shift).
11182
11183 Default values: 'smoothness=0.1%' and 'boundary_conditions=0'.
11184
11185 Example:
11186 [#1] image.jpg +shift 30,20 +register_rigid[0] [1]
11187
11188 transition:
11189 [transition_shape],nb_added_frames>=0,100>=shading>=0,_sin‐
11190 gle_frame_only={ -1=disabled | >=0 }
11191
11192 Generate a transition sequence between selected images.
11193
11194 Default values: 'shading=0' and 'single_frame_only=-1'.
11195
11196 Example:
11197 [#1] image.jpg +mirror c 100%,100% plasma[-1] 1,1,6 transi‐
11198 tion[0,1] [2],5
11199
11200 transition3d:
11201 _nb_frames>=2,_nb_xtiles>0,_nb_ytiles>0,_axis_x,_axis_y,_axis_z,_is_an‐
11202 tialias={ 0 | 1 }
11203
11204 Create 3D transition sequence between selected consecutive images.
11205 'axis_x', 'axis_y' and 'axis_z' can be set as mathematical expres‐
11206 sions, depending on 'x' and 'y'.
11207
11208 Default values: 'nb_frames=10', 'nb_xtiles=nb_ytiles=3',
11209 'axis_x=1', 'axis_y=1', 'axis_z=0' and 'is_antialias=1'.
11210
11211 Example:
11212 [#1] image.jpg +blur 5 transition3d 9 display_rgba
11213
11214 video2files:
11215 input_filename,_output_filename,_first_frame>=0,_last_frame={ >=0
11216 | -1=last },_frame_step>=1
11217
11218 Split specified input video file into image files, one for each
11219 frame.
11220 First and last frames as well as step between frames can be speci‐
11221 fied.
11222
11223 Default values: 'output_filename=frame.png', 'first_frame=0',
11224 'last_frame=-1' and 'frame_step=1'.
11225
11226 12.20. Neural Networks
11227 ---------------
11228
11229 nn_new_input:
11230 module_name,width,_height,_spectrum
11231
11232 Add an input module with specified size to the neural network.
11233
11234 nn_new_output:
11235 module_name,previous_module_name
11236
11237 Add an output module to the neural network.
11238
11239 nn_new_fullyconnected:
11240 module_name,previous_module_name,nb_neurons,activation_function
11241
11242 Add a fully-connected module to the neural network.
11243
11244 nn_propagate_batch:
11245 module_name,[inputs_zstacked]
11246
11247 Batch propagate specified inputs through the neural network.
11248 Insert image of corresponding network outputs at the end of the
11249 list.
11250
11251 nn_propagate:
11252 module_name
11253
11254 Propagate input through the neural network.
11255
11256 nn_backpropagate_batch:
11257 module_name,[inputs_zstacked],[expected_outputs_zstacked],_in‐
11258 sert_network_outputs={ 0 | 1 },_loss_function
11259
11260 Batch propagate and backpropagate inputs and errors in neural net‐
11261 work.
11262 Optionnally insert image of corresponding network outputs at the
11263 end of the list.
11264 Return averaged loss.
11265
11266 nn_backpropagate:
11267 module_name,[expected_output],_loss_function
11268
11269 Propagate input, then back-propagate output error, through the neu‐
11270 ral network.
11271 This command set the network output.
11272 Return average loss.
11273
11274 nn_update:
11275 module_name,epsilon
11276
11277 Update neural network weights, after back-propagation of the error.
11278
11279 nn_output:
11280 module_name,filename
11281
11282 Output specified network as a file.
11283
11284 nn_serialize:
11285 module_name,_is_compressed={ 0 | 1 }
11286
11287 Serialize network into a single image, optionnally in a compressed
11288 form.
11289
11290 nn_unserialize:
11291
11292 Unserialize specified selection to retrieve a neural network.
11293
11294 nn_input:
11295 "filename"
11296
11297 Input neural network from file.
11298
11299 12.21. Convenience Functions
11300 ---------------------
11301
11302 alert:
11303 _title,_message,_label_button1,_label_button2,...
11304
11305 Display an alert box and wait for user's choice.
11306 If a single image is in the selection, it is used as an icon for
11307 the alert box.
11308
11309 Default values: 'title=[G'MIC Alert]' and 'message=This is an alert
11310 box.'.
11311
11312 arg:
11313 n>=1,_arg1,...,_argN
11314
11315 Return the n-th argument of the specified argument list.
11316
11317 arg0:
11318 n>=0,_arg0,...,_argN
11319
11320 Return the n-th argument of the specified argument list (where 'n'
11321 starts from '0').
11322
11323 arg2var:
11324 variable_name,argument_1,...,argument_N
11325
11326 For each i in [1...N], set 'variable_name$i=argument_i'.
11327 The variable name should be global to make this command useful
11328 (i.e. starts by an underscore).
11329
11330 autocrop_coords:
11331 value1,value2,... | auto
11332
11333 Return coordinates (x0,y0,z0,x1,y1,z1) of the autocrop that could
11334 be performed on the latest
11335 of the selected images.
11336
11337 Default value: 'auto'
11338
11339 average_colors:
11340
11341 Return the average vector-value of the latest of the selected im‐
11342 ages.
11343
11344 base642img:
11345 "base64_string"
11346
11347 Decode given base64-encoded string as a newly inserted image at the
11348 end of the list.
11349 The argument string must have been generated using command
11350 'img2base64'.
11351
11352 base642uchar:
11353 "base64_string"
11354
11355 Decode given base64-encoded string as a newly inserted 1-column im‐
11356 age at the end of the list.
11357 The argument string must have been generated using command
11358 'uchar2base64'.
11359
11360 basename:
11361 file_path,_variable_name_for_folder
11362
11363 Return the basename of a file path, and opt. its folder location.
11364 When specified 'variable_name_for_folder' must starts by an under‐
11365 score
11366 (global variable accessible from calling function).
11367
11368 bin:
11369 binary_int1,...
11370
11371 Print specified binary integers into their octal, decimal, hexadec‐
11372 imal and string representations.
11373
11374 bin2dec:
11375 binary_int1,...
11376
11377 Convert specified binary integers into their decimal representa‐
11378 tions.
11379
11380 covariance_colors:
11381 _avg_outvarname
11382
11383 Return the covariance matrix of the vector-valued colors in the
11384 latest of the selected images
11385 (for arbitrary number of channels).
11386 Parameter 'avg_outvarname' is used as a variable name that takes
11387 the value of the average vector-value.
11388
11389 dec:
11390 decimal_int1,...
11391
11392 Print specified decimal integers into their binary, octal, hexadec‐
11393 imal and string representations.
11394
11395 dec2str:
11396 decimal_int1,...
11397
11398 Convert specifial decimal integers into its string representation.
11399
11400 dec2bin:
11401 decimal_int1,...
11402
11403 Convert specified decimal integers into their binary representa‐
11404 tions.
11405
11406 dec2hex:
11407 decimal_int1,...
11408
11409 Convert specified decimal integers into their hexadecimal represen‐
11410 tations.
11411
11412 dec2oct:
11413 decimal_int1,...
11414
11415 Convert specified decimal integers into their octal representa‐
11416 tions.
11417
11418 fact:
11419 value
11420
11421 Return the factorial of the specified value.
11422
11423 fibonacci:
11424 N>=0
11425
11426 Return the Nth number of the Fibonacci sequence.
11427
11428 Example:
11429 [#1] echo ${"fibonacci 10"}
11430
11431
11432 [gmic]-0./ Start G'MIC interpreter.
11433 [gmic]-0./ 55
11434 [gmic]-0./ End G'MIC interpreter.
11435
11436 file_mv:
11437 filename_src,filename_dest
11438
11439 Rename or move a file from a location $1 to another location $2.
11440
11441 file_rand:
11442
11443 Return a random filename for storing temporary data.
11444
11445 filename:
11446 filename,_number1,_number2,...,_numberN
11447
11448 Return a filename numbered with specified indices.
11449
11450 files (+):
11451 _mode,path
11452
11453 Return the list of files and/or subfolders from specified path.
11454 'path' can be eventually a matching pattern.
11455 'mode' can be { 0=files only | 1=folders only | 2=files + folders
11456 }.
11457 Add '3' to 'mode' to return full paths instead of filenames only.
11458
11459 Default value: 'mode=5'.
11460
11461 fitratio_wh:
11462 min_width,min_height,ratio_wh
11463
11464 Return a 2D size 'width,height' which is bigger than
11465 'min_width,min_height' and has the specified w/h ratio.
11466
11467 fitscreen:
11468 width,height,_depth,_minimal_size[%],_maximal_size[%] |
11469 [image],_minimal_size[%],_maximal_size[%]
11470
11471 Return the 'ideal' size WxH for a window intended to display an im‐
11472 age of specified size on screen.
11473
11474 Default values: 'depth=1', 'minimal_size=128' and 'maxi‐
11475 mal_size=85%'.
11476
11477 fontchart:
11478
11479 Insert G'MIC font chart at the end of the image list.
11480
11481 Example:
11482 [#1] fontchart
11483
11484 fps:
11485
11486 Return the number of time this function is called per second, or -1
11487 if this info is not yet available.
11488 Useful to display the framerate when displaying animations.
11489
11490 gcd:
11491 a,b
11492
11493 Return the GCD (greatest common divisor) between a and b.
11494
11495 hex:
11496 hexadecimal_int1,...
11497
11498 Print specified hexadecimal integers into their binary, octal, dec‐
11499 imal and string representations.
11500
11501 hex2dec:
11502 hexadecimal_int1,...
11503
11504 Convert specified hexadecimal integers into their decimal represen‐
11505 tations.
11506
11507 hex2img:
11508 "hexadecimal_string"
11509
11510 Insert new image 1xN at the end of the list with values specified
11511 by the given hexadecimal-encoded string.
11512
11513 hex2str:
11514 hexadecimal_string
11515
11516 Convert specified hexadecimal string into a string.
11517 See also: str2hex.
11518
11519 img2base64:
11520 _encoding={ 0=base64 | 1=base64url },_store_names={ 0 | 1 }
11521
11522 Encode selected images as a base64-encoded string.
11523 The images can be then decoded using command 'base642img'.
11524
11525 Default values: 'encoding=0'.
11526
11527 img2hex:
11528
11529 Return representation of last image as an hexadecimal-encoded
11530 string.
11531 Input image must have values that are integers in [0,255].
11532
11533 img2str:
11534
11535 Return the content of the latest of the selected images as a spe‐
11536 cial G'MIC input string.
11537
11538 img2text:
11539 _line_separator
11540
11541 Return text contained in a multi-line image.
11542
11543 Default value: 'line_separator= '.
11544
11545 img82hex:
11546
11547 Convert selected 8bits-valued vectors into their hexadecimal repre‐
11548 sentations (ascii-encoded).
11549
11550 hex2img8:
11551
11552 Convert selected hexadecimal representations (ascii-encoded) into
11553 8bits-valued vectors.
11554
11555 is_3d:
11556
11557 Return 1 if all of the selected images are 3D objects, 0 otherwise.
11558
11559 is_change:
11560 _value={ 0=false | 1=true }
11561
11562 Set or unset the 'is_change' flag associated to the image list.
11563 This flag tells the interpreter whether or not the image list
11564 should be displayed when the pipeline ends.
11565
11566 Default value: 'value=1'.
11567
11568 is_half:
11569
11570 Return 1 if the type of image pixels is limited to half-float.
11571
11572 is_ext:
11573 filename,_extension
11574
11575 Return 1 if specified filename has a given extensioin.
11576
11577 is_image_arg:
11578 string
11579
11580 Return 1 if specified string looks like '[ind]'.
11581
11582 is_pattern:
11583 string
11584
11585 Return 1 if specified string looks like a drawing pattern
11586 '0x......'.
11587
11588 is_percent:
11589 string
11590
11591 Return 1 if specified string ends with a '%', 0 otherwise.
11592
11593 is_variable_name:
11594 "str"
11595
11596 Returns 1 if specified argument can be considered as a variable
11597 name, 0 otherwise.
11598
11599 is_videofilename:
11600
11601 Return 1 if extension of specified filename is typical from video
11602 files.
11603
11604 is_macos:
11605
11606 Return 1 if current computer OS is Darwin (MacOS), 0 otherwise.
11607
11608 is_windows:
11609
11610 Return 1 if current computer OS is Windows, 0 otherwise.
11611
11612 math_lib:
11613
11614 Return string that defines a set of several useful macros for the
11615 embedded math evaluator.
11616
11617 mad:
11618
11619 Return the MAD (Maximum Absolute Deviation) of the last selected
11620 image.
11621 The MAD is defined as MAD = med_i|x_i-med_j(x_j)|
11622
11623 max_w:
11624
11625 Return the maximal width between selected images.
11626
11627 max_h:
11628
11629 Return the maximal height between selected images.
11630
11631 max_d:
11632
11633 Return the maximal depth between selected images.
11634
11635 max_s:
11636
11637 Return the maximal spectrum between selected images.
11638
11639 max_wh:
11640
11641 Return the maximal wxh size of selected images.
11642
11643 max_whd:
11644
11645 Return the maximal wxhxd size of selected images.
11646
11647 max_whds:
11648
11649 Return the maximal wxhxdxs size of selected images.
11650
11651 median_color:
11652
11653 Return the median color value of the last selected image.
11654
11655 min_w:
11656
11657 Return the minimal width between selected images.
11658
11659 min_h:
11660
11661 Return the minimal height between selected images.
11662
11663 min_d:
11664
11665 Return the minimal depth between selected images.
11666
11667 min_s:
11668
11669 Return the minimal s size of selected images.
11670
11671 min_wh:
11672
11673 Return the minimal wxh size of selected images.
11674
11675 min_whd:
11676
11677 Return the minimal wxhxd size of selected images.
11678
11679 min_whds:
11680
11681 Return the minimal wxhxdxs size of selected images.
11682
11683 nmd (+):
11684 Shortcut for command 'named'.
11685
11686 named (+):
11687 _mode,"name1","name2",...
11688
11689 Return the set of indices corresponding to images of the selection
11690 with specified names.
11691 After this command returns, the status contains a list of indices
11692 (unsigned integers),
11693 separated by commas (or an empty string if no images with those
11694 names have been found).
11695 (equivalent to shortcut command 'nmd').
11696
11697 'mode' can be { 0=all indices (default) | 1=lowest index | 2=high‐
11698 est index | 3 = all indices (case insensitive) | 4 = lowest index (case
11699 insensitive) | 5 = highest index (case insensitive)}
11700
11701 normalize_filename:
11702 filename
11703
11704 Return a "normalized" version of the specified filename, without
11705 spaces and capital letters.
11706
11707 oct:
11708 octal_int1,...
11709
11710 Print specified octal integers into their binary, decimal, hexadec‐
11711 imal and string representations.
11712
11713 oct2dec:
11714 octal_int1,...
11715
11716 Convert specified octal integers into their decimal representa‐
11717 tions.
11718
11719 padint:
11720 number,_size>0
11721
11722 Return a integer with 'size' digits (eventually left-padded with
11723 '0').
11724
11725 path_cache:
11726
11727 Return a path to store G'MIC data files for one user (whose value
11728 is OS-dependent).
11729
11730 path_current:
11731
11732 Return current folder from where G'MIC has been run.
11733
11734 path_gimp:
11735
11736 Return a path to store GIMP configuration files for one user (whose
11737 value is OS-dependent).
11738
11739 path_tmp:
11740
11741 Return a path to store temporary files (whose value is OS-depen‐
11742 dent).
11743
11744 remove_copymark:
11745 "image_name"
11746
11747 Remove copy mark from names of selected images.
11748
11749 reset:
11750
11751 Reset global parameters of the interpreter environment.
11752
11753 rgb:
11754
11755 Return a random int-valued RGB color.
11756
11757 rgba:
11758
11759 Return a random int-valued RGBA color.
11760
11761 shell_cols:
11762
11763 Return the estimated number of columns of the current shell.
11764
11765 size_value:
11766
11767 Return the size (in bytes) of an image value.
11768
11769 std_noise:
11770
11771 Return the estimated noise standard deviation of the last selected
11772 image.
11773
11774 str:
11775 string
11776
11777 Print specified string into its binary, octal, decimal and hexadec‐
11778 imal representations.
11779
11780 str2hex:
11781 "string"
11782
11783 Convert specified string argument into a sequence of hexadecimal
11784 values (returned as a string).
11785 See also: hex2str.
11786
11787 Example:
11788 [#1] hex=${"str2hex
11789
11790
11791 [gmic]-0./ Start G'MIC interpreter.
11792 [gmic]-0./ 48656c6c6f206d7920667269656e6473
11793 [gmic]-0./ End G'MIC interpreter.
11794
11795 strcapitalize:
11796 string
11797
11798 Capitalize specified string.
11799
11800 strcontains:
11801 string1,string2
11802
11803 Return 1 if the first string contains the second one.
11804
11805 strlen:
11806 string1
11807
11808 Return the length of specified string argument.
11809
11810 strreplace:
11811 string,search,replace
11812
11813 Search and replace substrings in an input string.
11814
11815 strlowercase:
11816 string
11817
11818 Return a lower-case version of the specified string.
11819
11820 struppercase:
11821 string
11822
11823 Return an upper-case version of the specified string.
11824
11825 strvar:
11826 "string"
11827
11828 Return a simplified version of the specified string, that can be
11829 used as a variable name.
11830 (version that creates a lowercase result, no longer than 128
11831 chars).
11832
11833 strcasevar:
11834 "string"
11835
11836 Return a simplified version of the specified string, that can be
11837 used as a variable name.
11838 (version that keeps original case of specified string, no longer
11839 than 128 chars).
11840
11841 strver:
11842 _version
11843
11844 Return the specified version number of the G'MIC interpreter, as a
11845 string.
11846
11847 Default value: 'version=$_version'.
11848
11849 tic:
11850
11851 Initialize tic-toc timer.
11852 Use it in conjunction with 'toc'.
11853
11854 toc:
11855
11856 Display elapsed time of the tic-toc timer since the last call to
11857 'tic'.
11858 This command returns the elapsed time in the status value.
11859 Use it in conjunction with 'tic'.
11860
11861 to_clutname:
11862 "string"
11863
11864 Return simplified name that can be used as a CLUT name, from speci‐
11865 fied input string.
11866
11867 uchar2base64:
11868 _encoding={ 0=base64 | 1=base64url }
11869
11870 Encode the values of the latest of the selected images as a
11871 base64-encoded string.
11872 The string can be decoded using command 'base642uchar'.
11873 Selected images must have values that are integers in [0,255].
11874
11875 Default values: 'encoding=0'.
11876
11877 12.22. Other Interactive Commands
11878 --------------------------
11879
11880 demos:
11881 _run_in_parallel={ 0=no | 1=yes | 2=auto }
11882
11883 Show a menu to select and view all G'MIC interactive demos.
11884
11885 tixy:
11886 "expression"
11887
11888 Animate specified mathematical expression with a 16x16 grid of cir‐
11889 cles, using the rules described at https://tixy.land.
11890
11891 x_2048:
11892
11893 Launch the 2048 game.
11894
11895 x_blobs:
11896
11897 Launch the blobs editor.
11898 ../img/x_blobs.jpg [image: 'x_blobs']
11899
11900 x_bouncing:
11901
11902 Launch the bouncing balls demo.
11903
11904 x_color_curves:
11905 _colorspace={ rgb | cmy | cmyk | hsi | hsl | hsv | lab | lch |
11906 ycbcr | last }
11907
11908 Apply color curves on selected RGB[A] images, using an interactive
11909 window.
11910 Set 'colorspace' to 'last' to apply last defined color curves with‐
11911 out opening interactive windows.
11912
11913 Default value: 'colorspace=rgb'.
11914
11915 x_colorize:
11916 _is_lineart={ 0 | 1 },_max_resolution={ 0 | >=128 },_multichan‐
11917 nels_output={ 0 | 1 },_[palette1],_[palette2],_[grabber1]
11918
11919 Colorized selected B&W images, using an interactive window.
11920 When >0, argument 'max_resolution' defines the maximal image reso‐
11921 lution used in the interactive window.
11922
11923 Default values: 'is_lineart=1', 'max_resolution=1024' and 'multi‐
11924 channels_output=0'.
11925
11926 x_connect4:
11927
11928 Launch the Connect Four game.
11929
11930 xz:
11931 Shortcut for command 'x_crop'.
11932
11933 x_crop:
11934
11935 Crop selected images interactively.
11936 (equivalent to shortcut command 'xz').
11937
11938 x_cut:
11939
11940 Cut selected images interactively.
11941
11942 x_fire:
11943
11944 Launch the fire effect demo.
11945
11946 x_fireworks:
11947
11948 Launch the fireworks demo.
11949
11950 x_fisheye:
11951
11952 Launch the fish-eye effect demo.
11953
11954 x_fourier:
11955
11956 Launch the fourier filtering demo.
11957
11958 x_grab_color:
11959 _variable_name
11960
11961 Open a color grabber widget from the first selected image.
11962 Argument 'variable_name' specifies the variable that contains the
11963 selected color values at any time.
11964 Assigning '-1' to it forces the interactive window to close.
11965
11966 Default values: 'variable_name=xgc_variable'.
11967
11968 x_hanoi:
11969
11970 Launch the Tower of Hanoi game.
11971
11972 x_histogram:
11973
11974 Launch the histogram demo.
11975
11976 x_hough:
11977
11978 Launch the hough transform demo.
11979
11980 x_jawbreaker:
11981 0<_width<20,0<_height<20,0<_balls<=8
11982
11983 Launch the Jawbreaker game.
11984
11985 x_landscape:
11986
11987 Launch the virtual landscape demo.
11988
11989 x_life:
11990
11991 Launch the game of life.
11992
11993 x_light:
11994
11995 Launch the light effect demo.
11996
11997 x_mandelbrot:
11998 _julia={ 0 | 1 },_c0r,_c0i
11999
12000 Launch Mandelbrot/Julia explorer.
12001
12002 x_mask_color:
12003 _colorspace={ all | rgb | lrgb | ycbcr | lab | lch | hsv | hsi |
12004 hsl | cmy | cmyk | yiq },_spatial_tolerance>=0,_color_tolerance>=0
12005
12006 Interactively select a color, and add an alpha channel containing
12007 the corresponding color mask.
12008 Argument 'colorspace' refers to the color metric used to compute
12009 color similarities, and can be basically
12010 one of { rgb | lrgb | ycbcr | lab | lch | hsv | hsi | hsl | cmy |
12011 cmyk | yiq }.
12012 You can also select one one particular channel of this colorspace,
12013 by setting 'colorspace' as
12014 'colorspace_channel' (e.g. 'hsv_h' for the hue).
12015
12016 Default values: 'colorspace=all', 'spatial_tolerance=5' and
12017 'color_tolerance=5'.
12018
12019 x_metaballs3d:
12020
12021 Launch the 3D metaballs demo.
12022
12023 x_minesweeper:
12024 8<=_width=<20,8<=_height<=20
12025
12026 Launch the Minesweeper game.
12027
12028 x_minimal_path:
12029
12030 Launch the minimal path demo.
12031
12032 x_morph:
12033 _nb_frames>=2,_preview_fidelity={ 0=coarsest | 1=coarse | 2=nor‐
12034 mal | 3=fine | 4=finest }
12035
12036 Launch the interactive image morpher.
12037
12038 Default values: 'nb_frames=16' and 'preview_fidelity=3'.
12039
12040 x_pacman:
12041
12042 Launch pacman game.
12043
12044 x_paint:
12045
12046 Launch the interactive painter.
12047
12048 x_plasma:
12049
12050 Launch the plasma effect demo.
12051
12052 x_quantize_rgb:
12053 _nbcolors>=2
12054
12055 Launch the RGB color quantization demo.
12056
12057 x_reflection3d:
12058
12059 Launch the 3D reflection demo.
12060
12061 x_rubber3d:
12062
12063 Launch the 3D rubber object demo.
12064
12065 x_segment:
12066 _max_resolution={ 0 | >=128 }
12067
12068 Segment foreground from background in selected opaque RGB images,
12069 interactively.
12070 Return RGBA images with binary alpha-channels.
12071
12072 Default value: 'max_resolution=1024'.
12073
12074 x_select_color:
12075 _variable_name
12076
12077 Display a RGB or RGBA color selector.
12078 Argument 'variable_name' specifies the variable that contains the
12079 selected color values (as R,G,B,[A])
12080 at any time.
12081 Its value specifies the initial selected color. Assigning '-1' to
12082 it forces the interactive window to close.
12083
12084 Default value: 'variable_name=xsc_variable'.
12085
12086 x_select_function1d:
12087 _variable_name,_background_curve_R,_background_curve_G,_back‐
12088 ground_curve_B
12089
12090 Open an interactive window, where the user can defined its own 1D
12091 function.
12092 If an image is selected, it is used to display additional informa‐
12093 tion :
12094 - The first row defines the values of a background curve dis‐
12095 played on the window (e.g. an histogram).
12096 - The 2nd, 3rd and 4th rows define the R,G,B color components
12097 displayed beside the X and Y axes.
12098 Argument 'variable_name' specifies the variable that contains the
12099 selected function keypoints at any time.
12100 Assigning '-1' to it forces the interactive window to close.
12101
12102 Default values: 'variable_name=xsf_variable', 'back‐
12103 ground_curve_R=220', 'background_curve_G=background_curve_B=back‐
12104 ground_curve_T'.
12105
12106 x_select_palette:
12107 _variable_name,_number_of_columns={ 0=auto | >0 }
12108
12109 Open a RGB or RGBA color selector widget from a palette.
12110 The palette is given as a selected image.
12111 Argument 'variable_name' specifies the variable that contains the
12112 selected color values (as R,G,B,[A])
12113 at any time.
12114 Assigning '-1' to it forces the interactive window to close.
12115
12116 Default values: 'variable_name=xsp_variable' and 'number_of_col‐
12117 umns=2'.
12118
12119 x_shadebobs:
12120
12121 Launch the shade bobs demo.
12122
12123 x_spline:
12124
12125 Launch spline curve editor.
12126
12127 x_starfield3d:
12128
12129 Launch the 3D starfield demo.
12130
12131 x_tetris:
12132
12133 Launch tetris game.
12134
12135 x_threshold:
12136
12137 Threshold selected images interactively.
12138
12139 x_tictactoe:
12140
12141 Launch tic-tac-toe game.
12142
12143 x_warp:
12144 _nb_keypoints_xgrid>=2,_nb_keypoints_ygrid>=2,_nb_keypoints_con‐
12145 tours>=0,_preview_fidelity={ 0=coarsest | 1=coarse | 2=normal | 3=fine
12146 | 4=finest },_[background_image],0<=_background_opacity<=1
12147
12148 Launch the interactive image warper.
12149
12150 Default values: 'nb_keypoints_xgrid=nb_keypoints_ygrid=2', 'nb_key‐
12151 points_contours=0' and 'preview_fidelity=1'.
12152
12153 x_waves:
12154
12155 Launch the image waves demo.
12156
12157 x_whirl:
12158 _opacity>=0
12159
12160 Launch the fractal whirls demo.
12161
12162 Default values: 'opacity=0.2'.
12163
12164 13. Examples of Use
12165 ---------------
12166
12167 'gmic' is a generic image processing tool which can be used in a wide
12168 variety of situations. The few examples below illustrate possible uses
12169 of this tool:
12170
12171 ### View a list of images:
12172
12173 $ gmic file1.bmp file2.jpeg
12174
12175 ### Convert an image file:
12176
12177 $ gmic input.bmp output output.jpg
12178
12179 ### Create a volumetric image from a movie sequence:
12180
12181 $ gmic input.mpg append z output output.hdr
12182
12183 ### Compute image gradient norm:
12184
12185 $ gmic input.bmp gradient_norm
12186
12187 ### Denoise a color image:
12188
12189 $ gmic image.jpg denoise 30,10 output denoised.jpg
12190
12191 ### Compose two images using overlay layer blending:
12192
12193 $ gmic image1.jpg image2.jpg blend overlay output blended.jpg
12194
12195 ### Evaluate a mathematical expression:
12196
12197 $ gmic echo "cos(pi/4)^2+sin(pi/4)^2={cos(pi/4)^2+sin(pi/4)^2}"
12198
12199 ### Plot a 2D function:
12200
12201 $ gmic 1000,1,1,2 fill
12202 "X=3*(x-500)/500;X^2*sin(3*X^2)+if(c==0,u(0,-1),cos(X*10))" plot
12203
12204 ../img/exam‐
12205 ple_plot.png [image: '']
12206
12207 ### Plot a 3D elevated function in random colors:
12208
12209 $ gmic 128,128,1,3,"u(0,255)" plasma 10,3 blur 4 sharpen 10000 n
12210 0,255 elevation3d[-1]
12211 "'X=(x-64)/6;Y=(y-64)/6;100*exp(-(X^2+Y^2)/30)*abs(cos(X)*sin(Y))'"
12212
12213 0../img/exam‐
12214 ple_elevation3d.png [image: '']
12215
12216 ### Plot the isosurface of a 3D volume:
12217
12218 $ gmic mode3d 5 moded3d 5 double3d 0 isosurface3d
12219 "'x^2+y^2+abs(z)^abs(4*cos(x*y*z*3))'",3
12220
12221 ../img/exam‐
12222 ple_isosurface3d.png [image: '']
12223
12224 ### Render a G'MIC 3D logo:
12225
12226 $ gmic 0 text G´MIC,0,0,53,1,1,1,1 expand_xy 10,0 blur 1 normalize
12227 0,100 +plasma 0.4 add blur 1 elevation3d -0.1 moded3d 4
12228
12229 0../img/exam‐
12230 ple_logo.png [image: '']
12231
12232 ### Generate a 3D ring of torii:
12233
12234 $ gmic repeat 20 torus3d 15,2 color3d[-1]
12235 "{u(60,255)},{u(60,255)},{u(60,255)}" *3d[-1] 0.5,1 if "{$>%2}" ro‐
12236 tate3d[-1] 0,1,0,90 fi add3d[-1] 70 add3d rotate3d 0,0,1,18 done
12237 moded3d 3 mode3d 5 double3d
12238 0
12239
12240 ../img/exam‐
12241 ple_torii.png [image: '']
12242
12243 ### Create a vase from a 3D isosurface:
12244
12245 $ gmic moded3d 4 isosurface3d "'x^2+2*abs(y/2)*sin(2*y)^2+z^2-3',0"
12246 sphere3d 1.5 sub3d[-1] 0,5 plane3d 15,15 rotate3d[-1] 1,0,0,90 cen‐
12247 ter3d[-1] add3d[-1] 0,3.2 color3d[-1] 180,150,255 color3d[-2] 128,
12248 255,0 color3d[-3] 255,128,0 add3d
12249
12250 ../img/exam‐
12251 ple_vase.png [image: '']
12252
12253 ### Launch a set of interactive demos:
12254
12255 $ gmic demos
12256
12257
12258
12259 ** G'MIC comes with ABSOLUTELY NO WARRANTY; for details visit:
12260 https://gmic.eu **
12261
12262
12263
12264 G'MIC(1)