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 3.1.6
12 (https://gmic.eu)
13
14 Copyright (c) Since 2008, David Tschumperlé / GREYC / CNRS.
15 (https://www.greyc.fr)
16
17 1. Usage
18 -----
19
20 gmic [command1 [arg1_1,arg1_2,..]] .. [commandN [argN_1,argN_2,..]]
21
22 'gmic' is the open-source interpreter of the G'MIC language, a
23 script-based programming language dedicated to the design of possi‐
24 bly complex
25 image processing pipelines and operators.
26 It can be used to convert, manipulate, filter and visualize image
27 datasets made
28 of one or several 1D/2D or 3D multi-spectral images.
29
30 This reference documentation describes all the technical aspects of
31 the G'MIC
32 framework, in its current version 3.1.6.
33
34 As a starting point, you may want to visit our detailed tutorial
35 pages, at:
36 https://gmic.eu/tutorial/
37
38 2. Overall Context
39 ---------------
40
41 * At any time, G'MIC manages one list of numbered (and optionally
42 named)
43 pixel-based images, entirely stored in computer memory (uncom‐
44 pressed).
45 * The first image of the list has index '0' and is denoted by
46 '[0]'. The second image of the list is denoted by '[1]', the third
47 by '[2]' and so on.
48 * Negative indices are treated in a periodic way: '[-1]' refers to
49 the
50 last image of the list, '[-2]' to the penultimate one, etc. Thus, if
51 the
52 list has 4 images, '[1]' and '[-3]' both designate the second image
53 of the list.
54 * A named image may be also indicated by '[name]', if 'name' uses
55 the character set '[a-zA-Z0-9_]' and does not start with a number.
56 Image
57 names can be set or reassigned at any moment during the processing
58 pipeline
59 (see command name for this purpose).
60 * G'MIC defines a set of various commands and substitution mecha‐
61 nisms to allow
62 the design of complex pipelines and operators managing this list of
63 images, in
64 a very flexible way: You can insert or remove images in the list,
65 rearrange
66 image order, process images (individually or grouped), merge image
67 data
68 together, display and output image files, etc.
69 * Such a pipeline can define a new custom G'MIC command (stored in a
70 user
71 command file), and re-used afterwards as a regular command, in a
72 larger
73 pipeline if necessary.
74
75
76 3. Image Definition and Terminology
77 --------------------------------
78
79 * In G'MIC, each image is modeled as a 1D, 2D, 3D or 4D array of
80 scalar
81 values, uniformly discretized on a rectangular/parallelepipedic do‐
82 main.
83 * The four dimensions of this array are respectively denoted by:
84 - 'width', the number of image columns (size along the
85 'x-axis').
86 - 'height', the number of image rows (size along the 'y-axis').
87 - 'depth', the number of image slices (size along the
88 'z-axis'). The depth is equal to '1' for usual color or grayscale
89 2D images.
90 - 'spectrum', the number of image channels (size along the
91 'c-axis'). The spectrum is respectively equal to '3' and '4'
92 for usual 'RGB' and 'RGBA' color images.
93
94 * There are no hard limitations on the size of the image along each
95 dimension.
96 For instance, the number of image slices or channels can be of arbi‐
97 trary size
98 within the limits of the available memory.
99 * The 'width', 'height' and 'depth' of an image are
100 considered as spatial dimensions, while the 'spectrum' has a
101 multi-spectral meaning. Thus, a 4D image in G'MIC should be most of‐
102 ten regarded
103 as a 3D dataset of multi-spectral voxels. Most of the G'MIC commands
104 will stick
105 with this idea (e.g. command blur blurs images only along the spa‐
106 tial
107 'xyz'-axes).
108 * G'MIC stores all the image data as buffers of 'float' values (32
109 bits,
110 value range '[-3.4E38,+3.4E38]'. It performs all its image process‐
111 ing
112 operations with floating point numbers. Each image pixel takes then
113 32bits/channel (except if double-precision buffers have been enabled
114 during the
115 compilation of the software, in which case 64bits/channel can be the
116 default).
117 * Considering 'float'-valued pixels ensure to keep the numerical
118 precision when executing image processing pipelines. For image in‐
119 put/output
120 operations, you may want to prescribe the image datatype to be dif‐
121 ferent than
122 'float' (like 'bool', 'char', 'int', etc.). This is
123 possible by specifying it as a file option when using I/O commands.
124 (see
125 section Input/Output Properties to learn more about file options).
126
127
128 4. Items of a Processing Pipeline
129 ------------------------------
130
131 * In G'MIC, an image processing pipeline is described as a sequence
132 of
133 items separated by the space character. Such items are interpreted
134 and executed
135 from the left to the right. For instance, the expression:
136
137 filename.jpg blur 3,0 sharpen 10 resize 200%,200% output
138 file_out.jpg
139
140 defines a valid pipeline composed of nine G'MIC items.
141
142 * Each G'MIC item is a string that is either a command, a list of
143 command arguments, a filename or a special input string.
144 * Escape characters '' and double quotes '"' can be used to define
145 items
146 containing spaces or other special characters. For instance, the two
147 strings
148 'single item' and '"single item"' both define the same single item,
149 with a space in it.
150
151
152 5. Input Data Items
153 ----------------
154
155 * If a specified G'MIC item appears to be an existing filename, the
156 corresponding image data are loaded and inserted at the end of the
157 image list
158 (which is equivalent to the use of 'input filename').
159 * Special filenames '-' and '-.ext' stand for the standard
160 input/output streams, optionally forced to be in a specific 'ext'
161 file
162 format (e.g. '-.jpg' or '-.png').
163 * The following special input strings may be used as G'MIC items to
164 create and
165 insert new images with prescribed values, at the end of the image
166 list:
167 - '[selection]' or '[selection]xN': Insert 1 or N copies of
168 already existing images. 'selection' may represent one or several
169 images
170 (see section Command Items and Selections to learn more about selec‐
171 tions).
172 - 'width[%],_height[%],_depth[%],_spectrum[%],_values[xN]': In‐
173 sert
174 one or N images with specified size and values (adding '%' to a di‐
175 mension
176 means "percentage of the size along the same axis", taken from the
177 last
178 image '[-1]'). Any specified dimension can be also written as
179 '[image]', and is then set to the size (along the same axis) of the
180 existing specified image '[image]'. 'values' can be either a
181 sequence of numbers separated by commas ',', or a mathematical ex‐
182 pression,
183 as e.g. in input item '256,256,1,3,[x,y,128]' which creates a
184 '256x256' RGB color image with a spatial shading on the red and
185 green
186 channels. (see section Mathematical Expressions to learn more about
187 mathematical expressions).
188 - '(v1,v2,..)[xN]': Insert one or 'N' new images from specified
189 prescribed values. Value separator inside parentheses can be ','
190 (column
191 separator), ';' (row separator), '/' (slice separator) or '^'
192 (channel separator). For instance, expression '(1,2,3;4,5,6;7,8,9)'
193 creates a 3x3 matrix (scalar image), with values running from 1 to
194 9.
195 - '('string'[:delimiter])[xN]': Insert one or N new images from
196 specified string, by filling the images with the character codes
197 composing the
198 string. When specified, 'delimiter' tells about the main orientation
199 of
200 the image. Delimiter can be 'x' (eq. to ',' which is the default),
201 'y' (eq. to ';'), 'z' (eq. to '/') or 'c' (eq. to
202 '^'). When specified delimiter is ',', ';', '/' or
203 '^', the expression is actually equivalent to
204 '({'string'[:delimiter]})[xN]' (see section Substitution Rules for
205 more information on the syntax).
206 - '0[xN]': Insert one or N new 'empty' images, containing no
207 pixel data. Empty images are used only in rare occasions.
208
209 * Input item 'name=value' declares a new variable 'name', or
210 assign a new string value to an existing variable. Variable names
211 must use the
212 character set '[a-zA-Z0-9_]' and cannot start with a number.
213 * A variable definition is always local to the current command ex‐
214 cept when it
215 starts by the underscore character '_'. In that case, it becomes
216 also
217 accessible by any command invoked outside the current command scope
218 (global
219 variable).
220 * If a variable name starts with two underscores '__', the global
221 variable is also shared among different threads and can be read/set
222 by commands
223 running in parallel (see command parallel for this purpose). Other‐
224 wise,
225 it remains local to the thread that defined it.
226 * Numerical variables can be updated with the use of these special
227 operators:
228 '+=' (addition), '-=' (subtraction), '*=' (multiplication),
229 '/=' (division), '%=' (modulo), '&=' (bitwise and),
230 '|=' (bitwise or), '^=' (power), '<<=' and '>>'
231 (bitwise left and right shifts). For instance, 'foo=1' 'foo+=3'.
232 * Input item 'name.=string' appends specified 'string' at the end
233 of variable 'name'.
234 * Input item 'name..=string' prepends specified 'string' at the
235 beginning of variable 'name'.
236 * Multiple variable assignments and updates are allowed, with ex‐
237 pressions:
238 'name1,name2,...,nameN=value' or 'name1,name2,...,na‐
239 meN=value1,value2,
240 ...,valueN' where assignment operator '=' can be replaced by one of
241 the allowed operators (e.g. '+=').
242 * Variables usually store numbers or strings. Use command store to
243 assign variables from image data (and syntax 'input $variable' to
244 bring
245 them back on the image list afterwards).
246
247
248 6. Command Items and Selections
249 ----------------------------
250
251 * A G'MIC item that is not a filename nor a special input string
252 designates a 'command' most of the time. Generally, commands perform
253 image processing operations on one or several available images of
254 the list.
255 * Reccurent commands have two equivalent names ('regular' and
256 'short'). For instance, command names 'resize' and 'r' refer
257 to the same image resizing action.
258 * A G'MIC command may have mandatory or optional arguments. Command
259 arguments must be specified in the next item on the command line.
260 Commas ',
261 ' are used to separate multiple arguments of a single command, when
262 required.
263 * The execution of a G'MIC command may be restricted only to a sub‐
264 set of
265 the image list, by appending '[selection]' to the command name. Ex‐
266 amples
267 of valid syntaxes for 'selection' are:
268 - 'command[-2]': Apply command only on the penultimate image
269 '[-2]' of the list.
270 - 'command[0,1,3]': Apply command only on images '[0]',
271 '[1]' and '[3]'.
272 - 'command[3-6]': Apply command only on images '[3]' to
273 '[6]' (i.e, '[3]', '[4]', '[5]' and '[6]').
274 - 'command[50%-100%]': Apply command only on the second half of
275 the
276 image list.
277 - 'command[0,-4--1]': Apply command only on the first image and
278 the
279 last four images.
280 - 'command[0-9:3]': Apply command only on images '[0]' to
281 '[9]', with a step of 3 (i.e. on images '[0]', '[3]',
282 '[6]' and '[9]').
283 - 'command[0-9:25%]': Apply command only on images '[0]' to
284 '[9]', with a step of 25% (i.e. on images '[0]', '[3]',
285 '[6]' and '[9]').
286 - 'command[0--1:2]': Apply command only on images of the list
287 with
288 even indices.
289 - 'command[0,2-4,50%--1]': Apply command on images '[0]',
290 '[2]', '[3]', '[4]' and on the second half of the image list.
291 - 'command[^0,1]': Apply command on all images except the first
292 two.
293 - 'command[name1,name2]': Apply command on named images 'name1'
294 and 'name2'.
295
296 * Indices in selections are always sorted in increasing order, and
297 duplicate
298 indices are discarded. For instance, selections '[3-1,1-3]' and
299 '[1,1,
300 1,3,2]' are both equivalent to '[1-3]'. If you want to repeat a sin‐
301 gle
302 command multiple times on an image, use a 'repeat..done' loop in‐
303 stead.
304 Inverting the order of images for a command is achieved by explic‐
305 itly inverting
306 the order of the images in the list, with command 'reverse[selec‐
307 tion]'.
308 * Command selections '[-1]', '[-2]' and '[-3]' are so often
309 used they have their own shortcuts, respectively '.', '..' and
310 '...'. For instance, command 'blur..' is equivalent to
311 'blur[-2]'. These shortcuts work also when specifying command argu‐
312 ments.
313 * G'MIC commands invoked without '[selection]' are applied on all
314 images
315 of the list, i.e. the default selection is '[0--1]' (except for com‐
316 mand
317 input whose default selection is '[-1]'').
318 * Prepending a single hyphen '-' to a G'MIC command is allowed. This
319 may
320 be useful to recognize command items more easily in a one-liner
321 pipeline
322 (typically invoked from a shell).
323 * A G'MIC command prepended with a plus sign '+' does not act
324 in-place but inserts its result as one or several new images at the
325 end
326 of the image list.
327 * There are two different types of commands that can be run by the
328 G'MIC
329 interpreter:
330 - Built-in commands are the hard-coded functionalities in the
331 interpreter core. They are thus compiled as binary code and run
332 fast, most of
333 the time. Omitting an argument when invoking a built-in command is
334 not
335 permitted, except if all following arguments are also omitted. For
336 instance,
337 invoking 'plasma 10,,5' is invalid but 'plasma 10' is correct.
338 - Custom commands, are defined as G'MIC pipelines of built-in or
339 other custom commands. They are parsed by the G'MIC interpreter, and
340 thus run a
341 bit slower than built-in commands. Omitting arguments when invoking
342 a custom
343 command is permitted. For instance, expressions 'flower ,,,100,,2'
344 or
345 'flower ,' are correct.
346
347 * Most of the existing commands in G'MIC are actually defined as
348 custom
349 commands.
350 * A user can easily add its own custom commands to the G'MIC inter‐
351 preter (see
352 section Adding Custom Commands for more details). New built-in com‐
353 mands
354 cannot be added (unless you modify the G'MIC interpreter source code
355 and
356 recompile it).
357
358
359 7. Input/Output Properties
360 -----------------------
361
362 * G'MIC is able to read/write most of the classical image file for‐
363 mats,
364 including:
365 - 2D grayscale/color files: '.png', '.jpeg', '.gif',
366 '.pnm', '.tif', '.bmp', ...
367 - 3D volumetric files: '.dcm', '.hdr', '.nii',
368 '.cube', '.pan', '.inr', '.pnk', ...
369 - Video files: '.mpeg', '.avi', '.mp4', '.mov',
370 '.ogg', '.flv', ...
371 - Generic text or binary data files: '.gmz', '.cimg',
372 '.cimgz', 'flo', 'ggr', 'gpl', '.dlm',
373 '.asc', '.pfm', '.raw', '.txt', '.h'.
374 - 3D mesh files: '.off', '.obj'.
375
376 * When dealing with color images, G'MIC generally reads, writes and
377 displays
378 data using the usual sRGB color space.
379 * When loading a '.png' and '.tiff' file, the bit-depth of the
380 input image(s) is returned to the status.
381 * G'MIC is able to manage 3D objects that may be read from files or
382 generated by G'MIC commands. A 3D object is stored as a one-column
383 scalar image
384 containing the object data, in the following order: { magic_number;
385 sizes;
386 vertices; primitives; colors; opacities }. These 3D representations
387 can be
388 then processed as regular images (see command split3d for accessing
389 each
390 of these 3D object data separately).
391 * Be aware that usual file formats may be sometimes not adapted to
392 store all
393 the available image data, since G'MIC uses float-valued image buf‐
394 fers. For
395 instance, saving an image that was initially loaded as a
396 16bits/channel image,
397 as a '.jpg' file will result in a loss of information. Use the
398 G'MIC-specific file extension '.gmz' to ensure that all data preci‐
399 sion is
400 preserved when saving images.
401 * Sometimes, file options may/must be set for file formats:
402 - Video files: Only sub-frames of an image sequence may be
403 loaded,
404 using the input expression 'filename.ext,[first_frame[,last_frame[,
405 step]]]'. Set 'last_frame==-1' to tell it must be the last frame of
406 the video. Set 'step' to '0' to force an opened video file to be
407 opened/closed. Output framerate and codec can be also set by using
408 the output
409 expression 'filename.avi,_fps,_codec,_keep_open' where 'keep_open'
410 can be { 0 | 1 }. 'codec' is a 4-char string (see
411 http://www.fourcc.org/codecs.php ) or '0' for the default codec.
412 'keep_open' tells if the output video file must be kept open for
413 appending new frames afterwards.
414 - '.cimg[z]' files: Only crops and sub-images of .cimg files
415 can be loaded, using the input expressions 'filename.cimg,N0,N1',
416 'filename.cimg,N0,N1,x0,x1', 'filename.cimg,N0,N1,x0,y0,x1,y1',
417 'filename.cimg,N0,N1,x0,y0,z0,x1,y1,z1' or 'file‐
418 name.cimg,N0,N1,x0,y0,
419 z0,c0,x1,y1,z1,c1'. Specifying '-1' for one coordinates stands for
420 the
421 maximum possible value. Output expression 'file‐
422 name.cimg[z][,datatype]'
423 can be used to force the output pixel type. 'datatype' can be { auto
424 |
425 bool | uint8 | int8 | uint16 | int16 | uint32 | int32 | uint64 |
426 int64 |
427 float32 | float64 }.
428 - '.raw' binary files: Image dimensions and input pixel type
429 may be specified when loading '.raw' files with input expression
430 'filename.raw[,datatype][,width][,height[,depth[,dim[,offset]]]]]'.
431 If no
432 dimensions are specified, the resulting image is a one-column vector
433 with
434 maximum possible height. Pixel type can also be specified with the
435 output
436 expression 'filename.raw[,datatype]'. 'datatype' can be the same as
437 for '.cimg[z]' files.
438 - '.yuv' files: Image dimensions must be specified when loading,
439 and only sub-frames of an image sequence may be loaded, using the
440 input
441 expression 'filename.yuv,width,height[,chroma_subsam‐
442 pling[,first_frame[,
443 last_frame[,step]]]'. 'chroma_subsampling' can be { 420 | 422 | 444
444 }. When saving, chroma subsampling mode can be specified with output
445 expression 'filename.yuv[,chroma_subsampling]'.
446 - '.tiff' files: Only sub-images of multi-pages tiff files can
447 be loaded, using the input expression 'file‐
448 name.tif,_first_frame,_last_frame,
449 _step'. Output expression 'filename.tiff,_datatype,_compression,
450 _force_multipage,_use_bigtiff' can be used to specify the output
451 pixel type,
452 as well as the compression method. 'datatype' can be the same as for
453 '.cimg[z]' files. 'compression' can be { none (default) | lzw |
454 jpeg }. 'force_multipage' can be { 0=no (default) | 1=yes }.
455 'use_bigtiff' can be { 0=no | 1=yes (default) }.
456 - '.pdf' files: When loading a file, the rendering resolution
457 can be specified using the input expression 'filename.pdf,resolu‐
458 tion',
459 where 'resolution' is an unsigned integer value.
460 - '.gif' files: Animated gif files can be saved, using the
461 input expression 'filename.gif,fps>0,nb_loops'. Specify
462 'nb_loops=0' to get an infinite number of animation loops (this is
463 the
464 default behavior).
465 - '.jpeg' files: The output quality may be specified (in %),
466 using the output expression 'filename.jpg,30' (here, to get a 30%
467 quality
468 output). '100' is the default.
469 - '.mnc' files: The output header can set from another file,
470 using the output expression 'filename.mnc,header_template.mnc'.
471 - '.pan', '.cpp', '.hpp', '.c' and '.h'
472 files: The output datatype can be selected with output expression
473 'filename[,datatype]'. 'datatype' can be the same as for
474 '.cimg[z]' files.
475 - '.gmic' files: These filenames are assumed to be G'MIC custom
476 commands files. Loading such a file will add the commands it defines
477 to the
478 interpreter. Debug information can be enabled/disabled by the input
479 expression
480 'filename.gmic[,add_debug_info]' where 'debug_info' can be {
481 0=false | 1=true }.
482 - Inserting 'ext:' on the beginning of a filename (e.g.
483 'jpg:filename') forces G'MIC to read/write the file as it would have
484 been
485 done if it had the specified extension '.ext'.
486
487 * Some input/output formats and options may not be supported, de‐
488 pending on the
489 configuration flags that have been set during the build of the G'MIC
490 software.
491
492
493 8. Substitution Rules
494 ------------------
495
496 * G'MIC items containing '$' or '{}' are substituted before
497 being interpreted. Use these substituting expressions to access var‐
498 ious data
499 from the interpreter environment.
500 * '$name' and '${name}' are both substituted by the value of the
501 specified named variable (set previously by the item 'name=value').
502 If
503 this variable has not been already set, the expression is substi‐
504 tuted by the
505 highest positive index of the named image '[name]'. If no image has
506 this
507 name, the expression is substituted by the value of the OS environ‐
508 ment variable
509 with same name (it may be thus an empty string if it is not de‐
510 fined).
511 * The following reserved variables are predefined by the G'MIC in‐
512 terpreter:
513 - '$!': The current number of images in the list.
514 - '$>' and '$<': The increasing/decreasing index of the latest
515 (currently running) 'repeat...done' loop. '$>' goes from '0'
516 (first loop iteration) to 'nb_iterations - 1' (last iteration).
517 '$<' does the opposite.
518 - '$/': The current call stack. Stack items are separated by
519 slashes
520 '/'.
521 - '$|': The current value (expressed in seconds) of a millisecond
522 precision timer.
523 - '$^': The current verbosity level.
524 - '$_cpus': The number of computation cores available on your ma‐
525 chine.
526 - '$_flags': The list of enabled flags when G'MIC interpreter has
527 been compiled.
528 - '$_host': A string telling about the host running the G'MIC
529 interpreter (e.g. 'cli' or 'gimp').
530 - '$_os': A string describing the running operating system.
531 - '$_path_rc': The path to the G'MIC folder used to store
532 configuration files (its value is OS-dependent).
533 - '$_path_user': The path to the G'MIC user file '.gmic' or
534 'user.gmic' (its value is OS-dependent).
535 - '$_path_commands': A list of all imported command files (stored
536 as
537 an image list).
538 - '$_pid': The current process identifier, as an integer.
539 - '$_pixeltype': The type of image pixels (default: 'float32').
540 - '$_prerelease': For pre-releases, the date of the pre-release
541 as
542 'yymmdd'. For stable releases, this variable is set to '0'.
543 - '$_version': A 3-digits number telling about the current ver‐
544 sion of
545 the G'MIC interpreter (e.g. '316').
546 - '$_vt100': Set to '1' if colored text output is allowed on
547 the console. Otherwise, set to '0'.
548
549 * '$$name' and '$${name}' are both substituted by the G'MIC script
550 code of the specified named 'custom command', or by an empty string
551 if no
552 custom command with specified name exists.
553 * '${"-pipeline"}' is substituted by the status value after the
554 execution of the specified G'MIC pipeline (see command status).
555 Expression '${}' thus stands for the current status value.
556 * '{``string}' (starting with two backquotes) is substituted by a
557 double-quoted version of the specified string.
558 * '{/string}' is substituted by the escaped version of the specified
559 string.
560 * '{'string'[:delimiter]}' (between single quotes) is substituted by
561 the
562 sequence of character codes that composes the specified string, sep‐
563 arated by
564 specified delimiter. Possible delimiters are ',' (default), ';',
565 '/', '^' or ' '. For instance, item '{'foo'}' is substituted
566 by '102,111,111' and '{'foo':;}' by '102;111;111'.
567 * '{image,feature[:delimiter]}' is substituted by a specific feature
568 of
569 the image '[image]'. 'image' can be either an image number or an
570 image name. It can be also eluded, in which case, the last image
571 '[-1]'
572 of the list is considered for the requested feature. Specified 'fea‐
573 ture'
574 can be one of:
575 - 'b': The image basename (i.e. filename without the folder path
576 nor
577 extension).
578 - 'f': The image folder name.
579 - 'n': The image name or filename (if the image has been read
580 from a
581 file).
582 - 't': The text string from the image values regarded as charac‐
583 ter
584 codes.
585 - 'x': The image extension (i.e the characters after the last
586 '.' in the image name).
587 - '^': The sequence of all image values, separated by commas ',
588 '.
589 - '@subset': The sequence of image values corresponding to the
590 specified subset, and separated by commas ','.
591 - Any other 'feature' is considered as a mathematical
592 expression associated to the image '[image]' and is substituted by
593 the
594 result of its evaluation (float value). For instance, expression
595 '{0,
596 w+h}' is substituted by the sum of the width and height of the first
597 image
598 (see section Mathematical Expressions for more details). If a
599 mathematical expression starts with an underscore '_', the resulting
600 value is truncated to a readable format. For instance, item '{_pi}'
601 is
602 substituted by '3.14159' (while '{pi}' is substituted by
603 '3.141592653589793').
604 - A 'feature' delimited by backquotes is replaced by a string
605 whose
606 character codes correspond to the list of values resulting from the
607 evaluation
608 of the specified mathematical expression. For instance, item
609 '{`[102,111,
610 111]`}' is substituted by 'foo' and item '{`vector8(65)`}' by
611 'AAAAAAAA'.
612
613 * '{*}' is substituted by the visibility state of the instant dis‐
614 play
615 window '#0' (can be { 0=closed | 1=visible }.
616 * '{*[index],feature1,...,featureN[:delimiter]}' is substituted by a
617 specific set of features of the instant display window '#0' (or
618 '#index', if specified). Requested 'features' can be:
619 - 'u': screen width (actually independent on the window size).
620 - 'v': screen height (actually independent on the window size).
621 - 'uv': screen width x screen 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 - 'w': display width (i.e. width of the display area managed by
626 the
627 window).
628 - 'h': display height (i.e. height of the display area managed by
629 the
630 window).
631 - 'wh': display width x display height.
632 - 'i': X-coordinate of the display window.
633 - 'j': Y-coordinate of the display window.
634 - 'n': current normalization type of the instant display.
635 - 't': window title of the instant display.
636 - 'x': X-coordinate of the mouse position (or -1, if outside the
637 display area).
638 - 'y': Y-coordinate of the mouse position (or -1, if outside the
639 display area).
640 - 'b': state of the mouse buttons { 1=left-but. | 2=right-but. |
641 4=middle-but. }.
642 - 'o': state of the mouse wheel.
643 - 'k': decimal code of the pressed key if any, 0 otherwise.
644 - 'c': boolean (0 or 1) telling if the instant display has been
645 closed recently.
646 - 'r': boolean telling if the instant display has been resized
647 recently.
648 - 'm': boolean telling if the instant display has been moved re‐
649 cently.
650 - Any other 'feature' stands for a keycode name (in capital let‐
651 ters),
652 and is substituted by a boolean describing the current key state {
653 0=pressed
654 | 1=released }.
655 - You can also prepend a hyphen '-' to a 'feature' (that
656 supports it) to flush the corresponding event immediately after
657 reading its
658 state (works for keys, mouse and window events).
659
660 * Item substitution is never performed in items between double
661 quotes.
662 One must break the quotes to enable substitution if needed, as in
663 '"3+8 kg =
664 "{3+8}" kg"'. Using double quotes is then a convenient way to dis‐
665 able the
666 substitutions mechanism in items, when necessary.
667 * One can also disable the substitution mechanism on items outside
668 double
669 quotes, by escaping the '{', '}' or '$' characters, as in
670 '3+4 doesn't evaluate'.
671
672
673 9. Mathematical Expressions
674 ------------------------
675
676 * G'MIC has an embedded mathematical parser, used to evaluate
677 (possibly complex) math expressions specified inside braces '{}', or
678 formulas in commands that may take one as an argument (e.g. fill or
679 eval).
680 * When the context allows it, a formula is evaluated for each pixel
681 of
682 the selected images (e.g. fill or eval).
683 * A math expression may return a scalar or a vector-valued result
684 (with a fixed number of components).
685 The mathematical parser understands the following set of functions,
686 operators
687 and variables:
688
689 ## Usual operators:
690
691 '||' (logical or), '&&' (logical and), '|' (bitwise or),
692 '&' (bitwise and), '!=', '==', '<=', '>=',
693 '<', '>', '<<' (left bitwise shift), '>>' (right
694 bitwise shift), '-', '+', '*', '/', '%' (modulo),
695 '^' (power), '!' (logical not), '~' (bitwise not), '++',
696 '--', '+=', '-=', '*=', '/=', '%=',
697 '&=', '|=', '^=', '>>', '<<=' (in-place
698 operators).
699
700 ## Usual math functions:
701
702 'abs()', 'acos()', 'acosh()', 'arg()', 'arg0()',
703 'argkth()', 'argmax()', 'argmaxabs()', 'argmin()',
704 'argminabs()', 'asin()', 'asinh()', 'atan()',
705 'atan2()', 'atanh()', 'avg()', 'bool()', 'cbrt()',
706 'ceil()', 'cos()', 'cosh()', 'cut()',
707 'deg2rad()', 'erf()', 'erfinv()', 'exp()',
708 'fact()', 'fibo()', 'floor()', 'gauss()', 'gcd()',
709 'int()', 'isnan()', 'isnum()', 'isinf()',
710 'isint()', 'isbool()', 'isexpr()', 'isfile()',
711 'isdir()', 'isin()', 'kth()', 'log()', 'log2()',
712 'log10()', 'max()', 'maxabs()', 'med()', 'min()',
713 'minabs()', 'narg()', 'prod()', 'rad2deg()',
714 'rol()' (left bit rotation), 'ror()' (right bit rotation),
715 'round()', 'sign()', 'sin()', 'sinc()', 'sinh()',
716 'sqrt()', 'std()', 'srand(_seed)', 'sum()',
717 'tan()', 'tanh()', 'var()', 'xor()'.
718
719 * 'cov(A,B,_avgA,_avgB)' estimates the covariance between vectors
720 'A' and 'B' (estimated averages of these vectors may be specified
721 as arguments).
722 * 'mse(A,B)' returns the mean-squared error between vectors 'A'
723 and 'B'.
724 * 'atan2(y,x)' is the version of 'atan()' with two arguments
725 'y' and 'x' (as in C/C++).
726 * 'permut(k,n,with_order)' computes the number of permutations of
727 'k' objects from a set of 'n' objects.
728 * 'gauss(x,_sigma,_is_normalized)' returns
729 'exp(-x^2/(2*s^2))/(is_normalized?sqrt(2*pi*sigma^2):1)'.
730 * 'cut(value,min,max)' returns 'value' if it is in range '[min,
731 max]', or 'min' or 'max' otherwise.
732 * 'narg(a_1,...,a_N)' returns the number of specified arguments
733 (here,
734 'N').
735 * 'arg(i,a_1,..,a_N)' returns the 'i'-th argument 'a_i'.
736 * 'isnum()', 'isnan()', 'isinf()', 'isint()',
737 'isbool()' test the type of the given number or expression, and re‐
738 turn
739 '0' (false) or '1' (true).
740 * 'isfile('path')' (resp. 'isdir('path')') returns '0'
741 (false) or '1' (true) whether its string argument is a path to an
742 existing file (resp. to a directory) or not.
743 * 'isvarname('str')' returns '0' (false) or '1' (true)
744 whether its string argument would be a valid to name a variable or
745 not.
746 * 'isin(v,a_1,...,a_n)' returns '0' (false) or '1' (true)
747 whether the first argument 'v' appears in the set of other argument
748 'a_i'.
749 * 'inrange(value,m,M,include_m,include_M)' returns '0' (false) or
750 '1' (true) whether the specified value lies in range '[m,M]' or not
751 ('include_m' and 'includeM' tells how boundaries 'm' and
752 'M' are considered).
753 * 'argkth()', 'argmin()', 'argmax()', 'argminabs()',
754 'argmaxabs()'', 'avg()', 'kth()', 'min()',
755 'max()', 'minabs()', 'maxabs()', 'med()',
756 'prod()', 'std()', 'sum()' and 'var()' can be called
757 with an arbitrary number of scalar/vector arguments.
758 * 'vargkth()', 'vargmin()', 'vargmax()',
759 'vargminabs()', 'vargmaxabs()', 'vavg()', 'vkth()',
760 'vmin()', 'vmax()', 'vminabs()', 'vmaxabs()',
761 'vmed()', 'vprod()', 'vstd()', 'vsum()' and
762 'vvar()' are the versions of the previous function with vector-val‐
763 ued
764 arguments.
765 * 'round(value,rounding_value,direction)' returns a rounded value.
766 'direction' can be { -1=to-lowest | 0=to-nearest | 1=to-highest }.
767 * 'lerp(a,b,t)' returns 'a*(1-t)+b*t'.
768 * 'swap(a,b)' swaps the values of the given arguments.
769
770 ## Variable names:
771
772 Variable names below are pre-defined. They can be overridden.
773 * 'l': length of the associated list of images.
774 * 'k': index of the associated image, in '[0,l-1]'.
775 * 'w': width of the associated image, if any ('0' otherwise).
776 * 'h': height of the associated image, if any ('0' otherwise).
777 * 'd': depth of the associated image, if any ('0' otherwise).
778 * 's': spectrum of the associated image, if any ('0' otherwise).
779 * 'r': shared state of the associated image, if any ('0'
780 otherwise).
781 * 'wh': shortcut for width x height.
782 * 'whd': shortcut for width x height x depth.
783 * 'whds': shortcut for width x height x depth x spectrum (i.e. num‐
784 ber of
785 image values).
786 * 'im', 'iM', 'ia', 'iv', 'id', 'is',
787 'ip', 'ic', 'in': Respectively the minimum, maximum, average,
788 variance, standard deviation, sum, product, median value and L2-norm
789 of the
790 associated image, if any ('0' otherwise).
791 * 'xm', 'ym', 'zm', 'cm': The pixel coordinates of the
792 minimum value in the associated image, if any ('0' otherwise).
793 * 'xM', 'yM', 'zM', 'cM': The pixel coordinates of the
794 maximum value in the associated image, if any ('0' otherwise).
795 * All these variables are considered as constant values by the math
796 parser (for optimization purposes) which is indeed the case most of
797 the time.
798 Anyway, this might not be the case, if function 'resize(#ind,..)' is
799 used
800 in the math expression. If so, it is safer to invoke functions
801 'l()',
802 'w(_#ind)', 'h(_#ind)', ... 's(_#ind)' and 'in(_#ind)'
803 instead of the corresponding named variables.
804 * 'i': current processed pixel value (i.e. value located at '(x,y,z,
805 c)') in the associated image, if any ('0' otherwise).
806 * 'iN': N-th channel value of current processed pixel (i.e. value
807 located at '(x,y,z,N)' in the associated image, if any ('0'
808 otherwise). 'N' must be an integer in range '[0,9]'.
809 * 'R', 'G', 'B' and 'A' are equivalent to 'i0',
810 'i1', 'i2' and 'i3' respectively.
811 * 'I': current vector-valued processed pixel in the associated im‐
812 age, if
813 any ('0' otherwise). The number of vector components is equal to the
814 number of image channels (e.g. 'I' = '[ R,G,B ]' for a 'RGB'
815 image).
816 * You may add '#ind' to any of the variable name above to retrieve
817 the
818 information for any numbered image '[ind]' of the list (when this
819 makes
820 sense). For instance 'ia#0' denotes the average value of the first
821 image
822 of the list).
823 * 'x': current processed column of the associated image, if any
824 ('0' otherwise).
825 * 'y': current processed row of the associated image, if any ('0'
826 otherwise).
827 * 'z': current processed slice of the associated image, if any
828 ('0' otherwise).
829 * 'c': current processed channel of the associated image, if any
830 ('0' otherwise).
831 * 't': thread id when an expression is evaluated with multiple
832 threads
833 ('0' means master thread).
834 * 'n': maximum number of threads when expression is evaluated in
835 parallel (so that 't' goes from '0' to 'n-1').
836 * 'e': value of e, i.e. '2.71828...'.
837 * 'pi': value of pi, i.e. '3.1415926...'.
838 * 'u': a random value between '[0,1]', following a uniform
839 distribution.
840 * 'g': a random value, following a gaussian distribution of variance
841 1
842 (roughly in '[-6,6]').
843 * 'interpolation': value of the default interpolation mode used when
844 reading pixel values with the pixel access operators (i.e. when the
845 interpolation argument is not explicitly specified, see below for
846 more details
847 on pixel access operators). Its initial default value is '0'.
848 * 'boundary': value of the default boundary conditions used when
849 reading
850 pixel values with the pixel access operators (i.e. when the boundary
851 condition
852 argument is not explicitly specified, see below for more details on
853 pixel
854 access operators). Its initial default value is '0'.
855 * The last image of the list is always associated to the evaluations
856 of
857 'expressions', e.g. G'MIC sequence
858
859 256,128 fill {w}
860
861 will create a 256x128 image filled with value 256.
862
863 ## Vector calculus:
864
865 Most operators are also able to work with vector-valued elements.
866 * '[a0,a1,...,aN-1]' defines a 'N'-dimensional vector with scalar
867 coefficients 'ak'.
868 * 'vectorN(a0,a1,,...,aN-1)' does the same, with the 'ak' being
869 repeated periodically if only a few are specified.
870 * 'vector(#N,a0,a1,,...,aN-1)' does the same, and can be used for
871 any
872 constant expression 'N'.
873 * In previous expressions, the 'ak' can be vectors themselves, to be
874 concatenated into a single vector.
875 * The scalar element 'ak' of a vector 'X' is retrieved by
876 'X[k]'.
877 * The sub-vector '[X[p],X[p+s]...X[p+s*(q-1)]]' (of size 'q') of a
878 vector 'X' is retrieved by 'X[p,q,s]'.
879 * 'expr(formula,_w,_h,_d,_s)' outputs a vector of size 'w*h*d*s'
880 with values generated from the specified formula, as if one were
881 filling an
882 image with dimensions '(w,h,d,s)'.
883 * Equality/inequality comparisons between two vectors is done with
884 operators
885 '==' and '!='.
886 * Some vector-specific functions can be used on vector values:
887 'cross(X,
888 Y)' (cross product), 'dot(X,Y)' (dot product), 'size(X)' (vector
889 dimension), 'sort(X,_is_increasing,_nb_elts,_size_elt)' (sorted val‐
890 ues),
891 'reverse(A)' (reverse order of components), 'shift(A,_length,
892 _boundary_conditions)' and 'same(A,B,_nb_vals,_is_case_sensitive)'
893 (vector equality test).
894 * Function 'normP(u1,...,un)' computes the LP-norm of the specified
895 vector ('P' being an 'unsigned integer' constant or 'inf').
896 If 'P' is omitted, the L2 norm is calculated.
897 * Function 'resize(A,size,_interpolation,_boundary_conditions)' re‐
898 turns
899 a resized version of a vector 'A' with specified interpolation mode.
900 'interpolation' can be { -1=none (memory content) | 0=none | 1=near‐
901 est
902 | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }, and
903 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
904 |
905 3=mirror }.
906 * Function 'resize(A,ow,oh,od,os,nw,_nh,_nd,_ns,_interpolation,
907 _boundary_conditions,_ax,_ay,_az,_ac)' is an extended version of the
908 previous function. It allows to resize the vector 'A', seen as an
909 image
910 of size 'ow x oh x od x os' as a new image of size 'nw x nh x nd x
911 ns', with
912 specified resizing options.
913 * Function 'find(A,B,_starting_index,_search_step)' returns the in‐
914 dex
915 where sub-vector 'B' appears in vector 'A', (or '-1' if
916 'B' is not contained in 'A'). Argument 'A' can be also
917 replaced by an image index '#ind'.
918 * A '2'-dimensional vector may be seen as a complex number and used
919 in
920 those particular functions/operators: '**' (complex multiplication),
921 '//' (complex division), '^^' (complex exponentiation), '**='
922 (complex self-multiplication), '//=' (complex self-division), '^^='
923 (complex self-exponentiation), 'cabs()' (complex modulus), 'carg()'
924 (complex argument), 'cconj()' (complex conjugate), 'cexp()'
925 (complex exponential), 'clog()' (complex logarithm), 'ccos()'
926 (complex cosine), 'csin()' (complex sine), 'ctan()' (complex
927 tangent), 'ccosh()' (complex hyperpolic cosine), 'csinh()' (complex
928 hyperbolic sine) and 'ctanh()' (complex hyperbolic tangent).
929 * A 'MN'-dimensional vector may be seen as a 'M' x 'N'
930 matrix and used in those particular functions/operators: '*'
931 (matrix-vector multiplication), 'det(A)' (determinant), 'diag(V)'
932 (diagonal matrix from a vector), 'eig(A)' (eigenvalues/eigenvec‐
933 tors),
934 'eye(n)' (n x n identity matrix), 'invert(A,_solver)' (matrix
935 inverse), 'mul(A,B,_nb_colsB)' (matrix-matrix multiplication),
936 'pseudoinvert(A,_nb_colsA,_solver)', 'rot(u,v,w,angle)' (3D
937 rotation matrix), 'rot(angle)' (2D rotation matrix), 'solve(A,B,
938 _nb_colsB)' (solver of linear system A.X = B), 'svd(A,_nb_colsA)'
939 (singular value decomposition), 'trace(A)' (matrix trace) and
940 'transpose(A,nb_colsA)' (matrix transpose). Argument 'nb_colsB' may
941 be omitted if it is equal to '1'.
942 * 'mproj(S,nb_colsS,D,nb_colsD,method,max_iter,max_residual)'
943 projects a
944 matrix 'S' onto a dictionary (matrix) 'D'. Equivalent to command
945 mproj but inside the math evaluator.
946 * Specifying a vector-valued math expression as an argument of a
947 command that
948 operates on image values (e.g. 'fill') modifies the whole spectrum
949 range
950 of the processed image(s), for each spatial coordinates '(x,y,z)'.
951 The
952 command does not loop over the 'c'-axis in this case.
953
954 ## String manipulation:
955
956 Character strings are defined and managed as vectors objects. Dedi‐
957 cated
958 functions and initializers to manage strings are:
959 * '['string']' and ''string'' define a vector whose values are the
960 character codes of the specified 'character string' (e.g. ''foo''
961 is equal to '[ 102,111,111 ]').
962 * '_'character'' returns the (scalar) byte code of the specified
963 character (e.g. '_'A'' is equal to '65').
964 * A special case happens for empty strings: Values of both expres‐
965 sions
966 '['']' and '''' are '0'.
967 * Functions 'lowercase()' and 'uppercase()' return string with all
968 string characters lowercased or uppercased.
969 * Function 'stov(str,_starting_index,_is_strict)' parses specified
970 string 'str' and returns the value contained in it.
971 * Function 'vtos(expr,_nb_digits,_siz)' returns a vector of size
972 'siz' which contains the character representation of values de‐
973 scribed by
974 expression 'expr'. 'nb_digits' can be { -1=auto-reduced | 0=all
975 | >0=max number of digits }.
976 * Function 'echo(str1,str2,...,strN)' prints the concatenation of
977 given
978 string arguments on the console.
979 * Function 'string(_#siz,str1,str2,...,strN)' generates a vector
980 corresponding to the concatenation of given string/number arguments.
981
982 ## Dynamic arrays:
983
984 A dynamic array is defined as a one-column (or empty) image '[ind]'
985 in
986 the image list. It allows elements to be added or removed, each ele‐
987 ment having
988 the same dimension (which is actually the number of channels of im‐
989 age
990 '[ind]'). Dynamic arrays adapt their size to the number of elements
991 they
992 contain.
993
994 A dynamic array can be manipulated in a math expression, with the
995 following
996 functions:
997 * 'da_size(_#ind)': Return the number of elements in dynamic array
998 '[ind]'.
999 * 'da_back(_#ind)': Return the last element of the dynamic array
1000 '[ind]'.
1001 * 'da_insert(_#ind,pos,elt_1,_elt_2,...,_elt_N)': Insert 'N' new
1002 elements 'elt_k' starting from index 'pos' in dynamic array
1003 '[ind]'.
1004 * 'da_push(_#ind,elt1,_elt2,...,_eltN)': Insert 'N' new elements
1005 'elt_k' at the end of dynamic array '[ind]'.
1006 * 'da_pop(_#ind)': Same as 'da_back()' but also remove last
1007 element from the dynamic array '[ind]'.
1008 * 'da_remove(_#ind,_start,_end)': Remove elements located between
1009 indices 'start' and 'end' (included) in dynamic array '[ind]'.
1010 * 'da_freeze(_#ind)': Convert a dynamic array into a 1-column image
1011 with
1012 height 'da_size(#ind)'.
1013 * The value of the k-th element of dynamic array '[ind]' is re‐
1014 trieved
1015 with 'i[_#ind,k]' (if the element is a scalar value), or 'I[_#ind,
1016 k]' (if the element is a vector).
1017
1018 In the functions above, argument '#ind' may be omitted in which case
1019 it
1020 is assumed to be '#-1'.
1021
1022 ## Special operators:
1023
1024 * ';': expression separator. The returned value is always the last
1025 encountered expression. For instance expression '1;2;pi' is evalu‐
1026 ated as
1027 'pi'.
1028 * '=': variable assignment. Variables in mathematical parser can
1029 only
1030 refer to numerical values (vectors or scalars). Variable names are
1031 case-sensitive. Use this operator in conjunction with ';' to define
1032 more
1033 complex evaluable expressions, such as
1034
1035 t = cos(x); 3*t^2 + 2*t + 1
1036
1037 These variables remain local to the mathematical parser and cannot be
1038 accessed outside the evaluated expression.
1039 * Variables defined in math parser may have a constant property, by
1040 specifying keyword 'const' before the variable name (e.g. 'const foo
1041 =
1042 pi/4;'). The value set to such a variable must be indeed a constant
1043 scalar. Constant variables allows certain types of optimizations in
1044 the math
1045 JIT compiler.
1046
1047 ## Specific functions:
1048
1049 * 'addr(expr)': return the pointer address to the specified expres‐
1050 sion
1051 'expr'.
1052 * 'fill(target,expr)' or 'fill(target,index_name,expr)' fill the
1053 content of the specified target (often vector-valued) using a given
1054 expression,
1055 e.g. 'V = vector16(); fill(V,k,k^2 + k + 1);'. For a vector-valued
1056 target,
1057 it is basically equivalent to: 'for (index_name = 0,
1058 index_name<size(target), ++index_name, target[index_name] = expr);'.
1059 * 'u(max)' or 'u(min,max)': return a random value between '[0,
1060 max]' or '[min,max]', following a uniform distribution.
1061 * 'f2ui(value)' and 'ui2f(value)': Convert a large unsigned
1062 integer as a negative floating point value (and vice-versa), so that
1063 32bits
1064 floats can be used to store large integers while keeping a unitary
1065 precision.
1066 * 'i(_a,_b,_c,_d,_interpolation_type,_boundary_conditions)': return
1067 the
1068 value of the pixel located at position '(a,b,c,d)' in the associated
1069 image, if any ('0' otherwise). 'interpolation_type' can be {
1070 0=nearest neighbor | 1=linear | 2=cubic }. 'boundary_conditions' can
1071 be { 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }. Omitted
1072 coordinates are replaced by their default values which are respec‐
1073 tively
1074 'x', 'y', 'z', 'c', 'interpolation' and
1075 'boundary'. For instance command
1076
1077 fill 0.5*(i(x+1)-i(x-1))
1078
1079 will estimate the X-derivative of an image with a classical finite
1080 difference
1081 scheme.
1082 * 'j(_dx,_dy,_dz,_dc,_interpolation_type,_boundary_conditions)' does
1083 the
1084 same for the pixel located at position '(x+dx,y+dy,z+dz,c+dc)'
1085 (pixel
1086 access relative to the current coordinates).
1087 * 'i[offset,_boundary_conditions]' returns the value of the pixel
1088 located at specified 'offset' in the associated image buffer (or
1089 '0' if offset is out-of-bounds).
1090 * 'j[offset,_boundary_conditions]' does the same for an offset rela‐
1091 tive
1092 to the current pixel coordinates '(x,y,z,c)'.
1093 * 'i(#ind,_x,_y,_z,_c,_interpolation,_boundary_conditions)',
1094 'j(#ind,
1095 _dx,_dy,_dz,_dc,_interpolation,_boundary_conditions)', 'i[#ind,off‐
1096 set,
1097 _boundary_conditions]' and 'i[offset,_boundary_conditions]' are
1098 similar expressions used to access pixel values for any numbered im‐
1099 age
1100 '[ind]' of the list.
1101 * 'I/J[_#ind,offset,_boundary_conditions]' and 'I/J(_#ind,_x,_y,_z,
1102 _interpolation,_boundary_conditions)' do the same as 'i/j[_#ind,off‐
1103 set,
1104 _boundary_conditions]' and 'i/j(_#ind,_x,_y,_z,_c,_interpolation,
1105 _boundary_conditions)' but return a vector instead of a scalar (e.g.
1106 a
1107 vector '[ R,G,B ]' for a pixel at '(a,b,c)' in a color image).
1108 * 'crop(_#ind,_x,_y,_z,_c,_dx,_dy,_dz,_dc,_boundary_conditions)' re‐
1109 turns
1110 a vector whose values come from the cropped region of image '[ind]'
1111 (or
1112 from default image selected if 'ind' is not specified). Cropped re‐
1113 gion
1114 starts from point '(x,y,z,c)' and has a size of 'dx x dy x dz x
1115 dc'. Arguments for coordinates and sizes can be omitted if they are
1116 not
1117 ambiguous (e.g. 'crop(#ind,x,y,dx,dy)' is a valid invocation of this
1118 function).
1119 * 'draw(_#ind,S,x,y,z,c,dx,_dy,_dz,_dc,_opacity,_M,_max_M)' draws a
1120 sprite 'S' in image '[ind]' (or in default image selected if
1121 'ind' is not specified) at coordinates '(x,y,z,c)'. The size of the
1122 sprite 'dx x dy x dz x dc' must be specified. You can also specify a
1123 corresponding opacity mask 'M' if its size matches 'S'.
1124 * 'polygon(_#ind,nb_vertices,coords,_opacity,_color)' draws a filled
1125 polygon in image '[ind]' (or in default image selected if 'ind' is
1126 not specified) at specified coordinates. It draws a single line if
1127 'nb_vertices' is set to 2.
1128 * 'polygon(_#ind,-nb_vertices,coords,_opacity,_pattern,_color)'
1129 draws a
1130 outlined polygon in image '[ind]' (or in default image selected if
1131 'ind' is not specified) at specified coordinates and with specified
1132 line
1133 pattern. It draws a single line if 'nb_vertices' is set to 2.
1134 * 'ellipse(_#ind,xc,yc,radius1,_radius2,_angle,_opacity,_color)'
1135 draws a
1136 filled ellipse in image '[ind]' (or in default image selected if
1137 'ind' is not specified) with specified coordinates.
1138 * 'ellipse(_#ind,xc,yc,-radius1,-_radius2,_angle,_opacity,_pattern,
1139 _color)' draws an outlined ellipse in image '[ind]' (or in default
1140 image selected if 'ind' is not specified).
1141 * 'resize(#ind,w,_h,_d,_s,_interp,_boundary_condi‐
1142 tions,_cx,_cy,_cz,_cc)'
1143 resizes an image of the associated list with specified dimension and
1144 interpolation method. When using this function, you should consider
1145 retrieving
1146 the (non-constant) image dimensions using the dynamic functions
1147 'w(_#ind)', 'h(_#ind)', 'd(_#ind)', 's(_#ind)',
1148 'wh(_#ind)', 'whd(_#ind)' and 'whds(_#ind)' instead of the
1149 corresponding constant variables.
1150 * 'if(condition,expr_then,_expr_else)': return value of
1151 'expr_then' or 'expr_else', depending on the value of
1152 'condition' { 0=false | other=true }. 'expr_else' can be
1153 omitted in which case '0' is returned if the condition does not
1154 hold.
1155 Using the ternary operator 'condition?expr_then[:expr_else]' gives
1156 an
1157 equivalent expression. For instance, G'MIC commands
1158
1159 fill if(x%10==0,255,i)
1160
1161 and
1162
1163 fill x%10?i:255
1164
1165 both draw blank vertical lines on every 10th column of an image.
1166 * 'do(expression,_condition)' repeats the evaluation of
1167 'expression' until 'condition' vanishes (or until
1168 'expression' vanishes if no 'condition' is specified). For instance,
1169 the expression:
1170
1171 if(N<2,N,n=N-1;F0=0;F1=1;do(F2=F0+F1;F0=F1;F1=F2,n=n-1))
1172
1173 returns the N-th value of the Fibonacci sequence, for 'N>=0' (e.g.,
1174 '46368' for 'N=24'). 'do(expression,condition)' always
1175 evaluates the specified expression at least once, then check for the
1176 loop
1177 condition. When done, it returns the last value of 'expression'.
1178 * 'for(init,condition,_procedure,body)' first evaluates the expres‐
1179 sion
1180 'init', then iteratively evaluates 'body' (followed by
1181 'procedure' if specified) while 'condition' holds (i.e. not zero).
1182 It may happen that no iterations are done, in which case the func‐
1183 tion returns
1184 'nan'. Otherwise, it returns the last value of 'body'. For instance,
1185 the expression:
1186
1187 if(N<2,N,for(n=N;F0=0;F1=1,n=n-1,F2=F0+F1;F0=F1;F1=F2))
1188
1189 returns the 'N'-th value of the Fibonacci sequence, for 'N>=0'
1190 (e.g., '46368' for 'N=24').
1191 * 'while(condition,expression)' is exactly the same as 'for(init,
1192 condition,expression)' without the specification of an initializing
1193 expression.
1194 * 'repeat(nb_iters,expr)' or 'fill(nb_iters,iter_name,expr)' run
1195 'nb_iters' iterations of the specified expression 'expr', e.g.
1196 'V = vector16(); repeat(16,k,V[k] = k^2 + k + 1);'. It is basically
1197 equivalent to: 'for (iter_name = 0, iter_name<nb_iters, ++iter_name,
1198 expr);'.
1199 * 'break()' and 'continue()' respectively breaks and continues the
1200 current running block (loop, init or main environment).
1201 * 'fsize('filename')' returns the size of the specified 'filename'
1202 (or '-1' if file does not exist).
1203 * 'date(attr,'path')' returns the date attribute for the given
1204 'path' (file or directory), with 'attr' being { 0=year | 1=month
1205 | 2=day | 3=day of week | 4=hour | 5=minute | 6=second }, or a vec‐
1206 tor of
1207 those values.
1208 * 'date(_attr)' returns the specified attribute for the current (lo‐
1209 cale)
1210 date (attributes being { 0...6=same meaning as above | 7=millisec‐
1211 onds }).
1212 * 'print(expr1,expr2,...)' or 'print(#ind)' prints the value of
1213 the specified expressions (or image information) on the console, and
1214 returns
1215 the value of the last expression (or 'nan' in case of an image).
1216 Function
1217 'prints(expr)' also prints the string composed of the character
1218 codes
1219 defined by the vector-valued expression (e.g. 'prints('Hello')').
1220 * 'debug(expression)' prints detailed debug info about the sequence
1221 of
1222 operations done by the math parser to evaluate the expression (and
1223 returns its
1224 value).
1225 * 'display(_X,_w,_h,_d,_s)' or 'display(#ind)' display the
1226 contents of the vector 'X' (or specified image) and wait for user
1227 events.
1228 if no arguments are provided, a memory snapshot of the math parser
1229 environment
1230 is displayed instead.
1231 * 'begin(expression)' and 'end(expression)' evaluates the
1232 specified expressions only once, respectively at the beginning and
1233 end of the
1234 evaluation procedure, and this, even when multiple evaluations are
1235 required
1236 (e.g. in 'fill ">begin(foo = 0); ++foo"').
1237 * 'copy(dest,src,_nb_elts,_inc_d,_inc_s,_opacity)' copies an entire
1238 memory block of 'nb_elts' elements starting from a source value
1239 'src' to a specified destination 'dest', with increments defined by
1240 'inc_d' and 'inc_s' respectively for the destination and source
1241 pointers.
1242 * 'stats(_#ind)' returns the statistics vector of the running image
1243 '[ind]', i.e the vector '[ im,iM,ia,iv,xm,ym,zm,cm,xM,yM,zM,cM,is,ip
1244 ]' (14 values).
1245 * 'ref(expr,a)' references specified expression 'expr' as variable
1246 name 'a'.
1247 * 'unref(a,b,...)' destroys references to the named variable given
1248 as
1249 arguments.
1250 * 'breakpoint()' inserts a possible computation breakpoint (useless
1251 with
1252 the cli interface).
1253 * '_(comment) expr' just returns expression 'expr' (useful for in‐
1254 serting
1255 inline comments in math expressions).
1256 * 'run('pipeline')' executes the specified G'MIC pipeline as if it
1257 was
1258 called outside the currently evaluated expression.
1259 * 'set('variable_name',A)' set the G'MIC variable '$variable_name'
1260 with the value of expression 'A'. If 'A' is a vector-valued
1261 variable, it is assumed to encode a string.
1262 * 'store('variable_name',A,_w,_h,_d,_s,_is_compressed)' transfers
1263 the
1264 data of vector 'A' as a 'w x h x d x s' image to the G'MIC variable
1265 '$variable_name'. Thus, the data becomes available outside the math
1266 expression (that is equivalent to using the regular command store,
1267 but
1268 directly in the math expression).
1269 * 'get('variable_name',_size,_return_as_string)' returns the value
1270 of
1271 the specified variable, as a vector of 'size' values, or as a scalar
1272 (if
1273 'size' is zero or not specified).
1274 * 'name(_#ind,size)' returns a vector of size 'size', whose values
1275 are the characters codes of the name of image '[ind]' (or default
1276 image
1277 selected if 'ind' is not specified).
1278 * 'correlate(I,wI,hI,dI,sI,K,wK,hK,dK,sK,_boundary_conditions,
1279 _is_normalized,_channel_mode,_xcenter,_ycenter,_zcenter,_xstart,_ys‐
1280 tart,_zstart,
1281 _xend,_yend,_zend,_xstride,_ystride,_zstride,_xdilation,_ydila‐
1282 tion,_zdilation,
1283 _interpolation_type)' returns the correlation, unrolled as a vector,
1284 of the
1285 'wI x hI x dI x sI'-sized image 'I' with the 'wK x hK x dK x
1286 sK'-sized kernel 'K' (the meaning of the other arguments are the
1287 same
1288 as in command 'correlate'). Similar function 'convolve(...)' is
1289 also defined for computing the convolution between 'I' and 'K'.
1290
1291 ## User-defined macros:
1292
1293 * Custom macro functions can be defined in a math expression, using
1294 the
1295 assignment operator '=', e.g.
1296
1297 foo(x,y) = cos(x + y); result = foo(1,2) + foo(2,3)
1298
1299 * Trying to override a built-in function (e.g. 'abs()') has no ef‐
1300 fect.
1301 * Overloading macros with different number of arguments is possible.
1302 Re-defining a previously defined macro with the same number of argu‐
1303 ments
1304 discards its previous definition.
1305 * Macro functions are indeed processed as macros by the mathematical
1306 evaluator. You should avoid invoking them with arguments that are
1307 themselves
1308 results of assignments or self-operations. For instance,
1309
1310 foo(x) = x + x; z = 0; foo(++z)
1311
1312 returns '4' rather than expected value '2'.
1313 * When substituted, macro arguments are placed inside parentheses,
1314 except if a
1315 number sign '#' is located just before or after the argument name.
1316 For
1317 instance, expression
1318
1319 foo(x,y) = x*y; foo(1+2,3)
1320
1321 returns '9' (being substituted as '(1+2)*(3)'), while expression
1322
1323 foo(x,y) = x#*y#; foo(1+2,3)
1324
1325 returns '7' (being substituted as '1+2*3').
1326 * Number signs appearing between macro arguments function actually
1327 count for
1328 empty separators. They may be used to force the substitution of
1329 macro
1330 arguments in unusual places, e.g. as in
1331
1332 str(N) = ['I like N#'];
1333
1334 * Macros with variadic arguments can be defined, by specifying a
1335 single
1336 argument name followed by '...'. For instance,
1337
1338 foo(args...) = sum([ args ]^2);
1339
1340 defines a macro that returns the sum of its squared arguments, so
1341 'foo(1,2,
1342 3)' returns '14' and 'foo(4,5)' returns '41'.
1343
1344 ## Multi-threaded and in-place evaluation:
1345
1346 * If your image data are large enough and you have several CPUs
1347 available, it
1348 is likely that the math expression passed to a 'fill', 'eval' or
1349 'input' commands is evaluated in parallel, using multiple computa‐
1350 tion
1351 threads.
1352 * Starting an expression with ':' or '*' forces the evaluations
1353 required for an image to be run in parallel, even if the amount of
1354 data to
1355 process is small (beware, it may be slower to evaluate in this
1356 case!). Specify
1357 ':' (rather than '*') to avoid possible image copy done before
1358 evaluating the expression (this saves memory, but do this only if
1359 you are sure
1360 this step is not required!)
1361 * If the specified expression starts with '>' or '<', the pixel
1362 access operators 'i()', 'i[]', 'j()' and 'j[]' return
1363 values of the image being currently modified, in forward ('>') or
1364 backward ('<') order. The multi-threading evaluation of the expres‐
1365 sion is
1366 disabled in this case.
1367 * Function 'critical(expr)' forces the execution of the given ex‐
1368 pression
1369 in a single thread at a time.
1370 * 'begin_t(expr)' and 'end_t(expr)' evaluates the specified
1371 expression once for each running thread (so possibly several times)
1372 at the
1373 beginning and the end of the evaluation procedure.
1374 * 'merge(variable,operator)' tells to merge the local variable value
1375 computed by threads, with the specified operator, when all threads
1376 have
1377 finished computing.
1378 * Expressions 'i(_#ind,x,_y,_z,_c)=value', 'j(_#ind,x,_y,_z,
1379 _c)=value', 'i[_#ind,offset]=value' and 'j[_#ind,offset]=value'
1380 set a pixel value at a different location than the running one in
1381 the image
1382 '[ind]' (or in the associated image if argument '#ind' is omitted),
1383 either with global coordinates/offsets (with 'i(...)' and 'i[...]'),
1384 or relatively to the current position '(x,y,z,c)' (with 'j(...)'
1385 and 'j[...]'). These expressions always return 'value'.
1386
1387
1388 10. Image and Data Viewers
1389 ----------------------
1390
1391 * G'MIC has some very handy embedded visualization modules, for 1D
1392 signals (command plot), 1D/2D/3D images (command display) and 3D
1393 vector objects (command display3d). It manages interactive views of
1394 the
1395 selected image data.
1396 * The following actions are available in the interactive viewers:
1397 - '(mousewheel)': Zoom in/out.
1398 - 'ESC': Close window.
1399 - 'CTRL+D': Increase window size.
1400 - 'CTRL+C': Decrease window size.
1401 - 'CTRL+R': Reset window size.
1402 - 'CTRL+F': Toggle fullscreen mode.
1403 - 'CTRL+S': Save current view as a numbered file
1404 'gmic_xxxx.ext'.
1405 - 'CTRL+O': Save copy of the viewed data, as a numbered file
1406 'gmic_xxxx.ext'.
1407
1408 * Actions specific to the 1D/2D image viewer (command display) are:
1409 - 'Left mouse button': Create an image selection and zoom into
1410 it.
1411 - 'Middle mouse button', or 'CTRL+left mouse button': Move
1412 image.
1413 - 'Mouse wheel' or 'PADD+/-': Zoom in/out.
1414 - 'Arrow keys': Move image left/right/up/down.
1415 - 'CTRL+A': Enable/disable transparency (show alpha channel).
1416 - 'CTRL+N': Change normalization mode (can be { none | normal |
1417 channel-by-channel }).
1418 - 'CTRL+SPACE': Reset view.
1419 - 'CTRL+X': Show/hide axes.
1420 - 'CTRL+Z': Hold/release aspect ratio.
1421
1422 * Actions specific to the 3D volumetric image viewer (command
1423 display) are:
1424 - 'CTRL+P': Play z-stack of frames as a movie.
1425 - 'CTRL+V': Show/hide 3D view on bottom right zone.
1426 - 'CTRL+X': Show/hide axes.
1427 - 'CTRL+(mousewheel)': Go up/down.
1428 - 'SHIFT+(mousewheel)': Go left/right.
1429 - 'Numeric PAD': Zoom in/out ('+'/'-') and move through
1430 zoomed image (digits).
1431 - 'BACKSPACE': Reset zoom scale.
1432
1433 * Actions specific to the 3D object viewer (command display3d) are:
1434 - '(mouse)+(left mouse button)': Rotate 3D object.
1435 - '(mouse)+(right mouse button)': Zoom 3D object.
1436 - '(mouse)+(middle mouse button)': Shift 3D object.
1437 - 'F1 ... F6': Toggle between different 3D rendering modes.
1438 - 'F7/F8': Decrease/increase focale.
1439 - 'F9': Select animation mode.
1440 - 'F10': Select animation speed.
1441 - 'SPACE': Start/stop animation.
1442 - 'CTRL+A': Show/hide 3D axes.
1443 - 'CTRL+B': Switch between available background.
1444 - 'CTRL+G': Save 3D object, as numbered file 'gmic_xxxx.obj'.
1445 - 'CTRL+L': Show/hide outline.
1446 - 'CTRL+P': Print current 3D pose on stderr.
1447 - 'CTRL+T': Switch between single/double-sided 3D modes.
1448 - 'CTRL+V': Start animation with video output.
1449 - 'CTRL+X': Show/hide 3D bounding box.
1450 - 'CTRL+Z': Enable/disable z-buffered rendering.
1451
1452
1453 11. Adding Custom Commands
1454 ----------------------
1455
1456 * New custom commands can be added by the user, through the use of
1457 G'MIC
1458 custom commands files.
1459 * A command file is a simple text file, where each line starts ei‐
1460 ther by
1461
1462 command_name: command_definition
1463
1464 or
1465
1466 command_definition (continuation)
1467
1468 * At startup, G'MIC automatically includes user's command file
1469 '$HOME/.gmic' (on Unix) or '%APPDATA%/user.gmic' (on
1470 Windows). The CLI tool 'gmic' automatically runs the command
1471 'cli_start' if defined.
1472 * Custom command names must use character set '[a-zA-Z0-9_]' and
1473 cannot
1474 start with a number.
1475 * Any '# comment' expression found in a custom commands file is
1476 discarded by the G'MIC parser, wherever it is located in a line.
1477 * In a custom command, the following '$-expressions' are recognized
1478 and
1479 substituted:
1480 - '$*' is substituted by a copy of the specified string of argu‐
1481 ments.
1482 - '$"*"' is substituted by a copy of the specified string of
1483 arguments, each being double-quoted.
1484 - '$#' is substituted by the maximum index of known arguments
1485 (either
1486 specified by the user or set to a default value in the custom com‐
1487 mand).
1488 - '$[]' is substituted by the list of selected image indices that
1489 have been specified in the command invocation.
1490 - '$?' is substituted by a printable version of '$[]' to be
1491 used in command descriptions.
1492 - '$i' and '${i}' are both substituted by the 'i'-th
1493 specified argument. Negative indices such as '${-j}' are allowed and
1494 refer to the 'j'-th latest argument. '$0' is substituted by the
1495 custom command name.
1496 - '${i=default}' is substituted by the value of '$i' (if
1497 defined) or by its new value set to 'default' otherwise ('default'
1498 may be a '$-expression' as well).
1499 - '${subset}' is substituted by the argument values (separated by
1500 commas ',') of a specified argument subset. For instance expression
1501 '${2--2}' is substituted by all specified command arguments except
1502 the
1503 first and the last one. Expression '${^0}' is then substituted by
1504 all
1505 arguments of the invoked command (eq. to '$*' if all arguments have
1506 been
1507 indeed specified).
1508 - '$=var' is substituted by the set of instructions that will as‐
1509 sign
1510 each argument '$i' to the named variable 'var$i' (for i in
1511 '[0...$#]'. This is particularly useful when a custom command want
1512 to
1513 manage variable numbers of arguments. Variables names must use char‐
1514 acter set
1515 '[a-zA-Z0-9_]' and cannot start with a number.
1516
1517 * These particular '$-expressions' for custom commands are always
1518 substituted, even in double-quoted items or when the dollar sign '$'
1519 is escaped with a backslash '$'. To avoid substitution, place an
1520 empty
1521 double quoted string just after the '$' (as in '$""1').
1522 * Specifying arguments may be skipped when invoking a custom com‐
1523 mand, by
1524 replacing them by commas ',' as in expression
1525
1526 flower ,,3
1527
1528 Omitted arguments are set to their default values, which must be
1529 thus
1530 explicitly defined in the code of the corresponding custom command
1531 (using
1532 default argument expressions as '${1=default}').
1533 * If one numbered argument required by a custom command misses a
1534 value, an
1535 error is thrown by the G'MIC interpreter.
1536 * It is possible to specialize the invocation of a '+command' by
1537 defining it as
1538
1539 +command_name: command_definition
1540
1541 * A +-specialization takes priority over the regular command defini‐
1542 tion when
1543 the command is invoked with a prepended '+'.
1544 * When only a +-specialization of a command is defined, invoking
1545 'command' is actually equivalent to '+command'.
1546
1547
1548 12. List of Commands
1549 ----------------
1550
1551 All available G'MIC commands are listed below, by categories. An ar‐
1552 gument
1553 specified between '[]' or starting by '_' is optional except when
1554 standing for an existing image '[image]', where 'image' can be
1555 either an index number or an image name. In this case, the '[]'
1556 characters are mandatory when writing the item. Note that all images
1557 that serve
1558 as illustrations in this reference documentation are normalized in
1559 range '[0,
1560 255]' before being displayed. You may need to do this explicitly
1561 (command
1562 'normalize 0,255') if you want to save and view images with the same
1563 aspect than those illustrated in the example codes.
1564
1565 12.1. Global Options
1566 --------------
1567
1568 debug (+):
1569
1570 Activate debug mode.
1571 When activated, the G'MIC interpreter becomes very verbose and out‐
1572 puts additional log
1573 messages about its internal state on the standard output (stdout).
1574 This option is useful for developers or to report possible bugs of
1575 the interpreter.
1576
1577 h:
1578 Shortcut for command 'help'.
1579
1580 help:
1581 command |
1582 (no arg)
1583
1584 Display help (optionally for specified command only) and exit.
1585 (equivalent to shortcut command 'h').
1586
1587 version:
1588
1589 Display current version number on stdout.
1590
1591 12.2. Input / Output
1592 --------------
1593
1594 camera (+):
1595 _camera_index>=0,_nb_frames>0,_skip_frames>=0,_cap‐
1596 ture_width>=0,_capture_height>=0
1597
1598 Insert one or several frames from specified camera.
1599 When 'nb_frames==0', the camera stream is released instead of cap‐
1600 turing new images.
1601 This command requires features from the OpenCV library (not enabled
1602 in G'MIC by default).
1603
1604 Default values: 'camera_index=0' (default camera), 'nb_frames=1',
1605 'skip_frames=0' and 'capture_width=capture_height=0' (default size).
1606
1607 clut:
1608 "clut_name",_resolution>0,_cut_and_round={ 0=no | 1=yes }
1609
1610 Insert one of the 958 pre-defined CLUTs at the end of the image
1611 list.
1612
1613 'clut_name' can be { 2-strip-process | 60s | 60s_faded |
1614 60s_faded_alt | 7drk_21 | action_magenta_01 | action_red_01 | adven‐
1615 ture_1453 | agfa_apx_100 | agfa_apx_25 | agfa_precisa_100 |
1616 agfa_ultra_color_100 | agfa_vista_200 | agressive_highligjtes_re‐
1617 covery_5 | alberto_street | alien_green | amstragram | amstragram+ |
1618 analog_film_1 | analogfx_anno_1870_color | analogfx_old_style_i |
1619 analogfx_old_style_ii | analogfx_old_style_iii |
1620 analogfx_sepia_color | analogfx_soft_sepia_i | analogfx_soft_sepia_ii |
1621 anime | apocalypse_this_very_moment | aqua | aqua_and_orange_dark |
1622 arabica_12 |
1623 atomic_pink | autumn | ava_614 | avalanche | azrael_93 | bboyz_2 |
1624 bc_darkum | beach_aqua_orange | beach_faded_analog | berlin_sky |
1625 black_and_white | black_star | black_white_01 | black_white_02 |
1626 black_white_03 | black_white_04 | black_white_05 | black_white_06
1627 | blade_runner | bleach_bypass | bleachbypass_1 | bleachbypass_2 |
1628 bleachbypass_3 | bleachbypass_4 | bleech_bypass_green |
1629 bleech_bypass_yellow_01 | blue_cold_fade | blue_dark | blue_house
1630 | blue_ice | blue_mono | blue_shadows_01 | blues | bob_ford | bour‐
1631 bon_64 | bright_green_01 | bright_teal_orange | bright_warm |
1632 brightgreen | brown_mobster | brownbm | brownish | bw_1 | bw_10 |
1633 bw_2 | bw_3 | bw_4 | bw_5 | bw_6 | bw_7 | bw_8 | bw_9 | bw_but_yellow |
1634 byers_11 | candlelight | caribe | chemical_168 | chrome_01 |
1635 cineblue | cinebm_4k | cinema | cinema_2 | cinema_3 | cinema_4 |
1636 cinema_5 | cinema_noir | cinematic-1 | cinematic-10 | cinematic-2 |
1637 cinematic-3 | cinematic-4 | cinematic-5 | cinematic-6 | cinematic-7 |
1638 cinematic-8 | cinematic-9 | cinematic_01 | cinematic_02 | cine‐
1639 matic_03 | cinematic_for_flog | cinematic_forest | cinematic_lady_bird
1640 | cinematic_mexico | city | city_7 | city_dust | classic_films_01 |
1641 classic_films_02 | classic_films_03 | classic_films_04 | clas‐
1642 sic_films_05 | classic_teal_and_orange | clayton_33 | clear_teal_fade |
1643 clouseau_54 | cobi_3 | coffee_44 | cold_clear_blue |
1644 cold_clear_blue_1 | cold_ice | cold_simplicity_2 | color_rich |
1645 colorful_0209 | colornegative | conflict_01 | contrail_35 | con‐
1646 trast_with_highlights_protection | contrasty_afternoon | con‐
1647 trasty_green |
1648 crispromance | crispwarm | crispwinter | cross_process_cp_130 |
1649 cross_process_cp_14 | cross_process_cp_15 | cross_process_cp_16 |
1650 cross_process_cp_18 | cross_process_cp_3 | cross_process_cp_4 |
1651 cross_process_cp_6 | crushin | cubicle_99 | d_o_1 |
1652 dark_blues_in_sunlight | dark_green_02 | dark_green_1 | dark_man_x |
1653 dark_orange_teal | dark_place_01 | darkness | date_39 | day_4nite |
1654 day_for_night
1655 | day_to_night_kings_blue | deep | deep_blue | deep_dark_warm |
1656 deep_high_contrast | deep_teal_fade | deep_warm_fade | deepskintones_2
1657 | deepskintones_3 | delicatessen | denoiser_simple_40 |
1658 desert_gold_37 | dimension | directions_23 | django_25 |
1659 domingo_145 | dream_1 | dream_85 | drop_green_tint_14 | dropblues |
1660 duotone_blue_red | earth_tone_boost | edgyember | elegance_38 | en‐
1661 chanted |
1662 eterna_for_flog | expired_69 | expired_fade | expired_polaroid |
1663 extreme | fade | fade_to_green | faded | faded_47 | faded_alt |
1664 faded_analog | faded_extreme | faded_green | faded_pink-ish |
1665 faded_print
1666 | faded_retro_01 | faded_retro_02 | faded_vivid | fadedlook |
1667 fallcolors | faux_infrared | faux_infrared_bw_1 | faux_in‐
1668 frared_color_p_2 | faux_infrared_color_p_3 | faux_infrared_color_r_0a |
1669 faux_infrared_color_r_0b | faux_infrared_color_yp_1 | fgcinebasic
1670 | fgcinebright | fgcinecold | fgcinedrama | fgcinetealorange_1 |
1671 fgcinetealorange_2 | fgcinevibrant | fgcinewarm | film_0987 | film_9879
1672 | film_gb-19 | film_high_contrast | film_print_01 | film_print_02
1673 | filmic | flat_30 | flat_blue_moon | flavin | foggynight | folger_50 |
1674 formula_b | french_comedy | frosted | frostedbeachpicnic |
1675 fuji_160c | fuji_160c_+ | fuji_160c_++ | fuji_160c_- |
1676 fuji_3510_constlclip | fuji_3510_constlmap | fuji_3510_cuspclip |
1677 fuji_3513_constlclip | fuji_3513_constlmap | fuji_3513_cuspclip |
1678 fuji_400h |
1679 fuji_400h_+ | fuji_400h_++ | fuji_400h_- | fuji_800z | fuji_800z_+
1680 | fuji_800z_++ | fuji_800z_- | fuji_astia_100_generic | fuji_astia_100f
1681 | fuji_fp-100c | fuji_fp-100c_+ | fuji_fp-100c_++ |
1682 fuji_fp-100c_+++ | fuji_fp-100c_++_alt | fuji_fp-100c_- |
1683 fuji_fp-100c_-- | fuji_fp-100c_alt | fuji_fp-100c_cool |
1684 fuji_fp-100c_cool_+ | fuji_fp-100c_cool_++ | fuji_fp-100c_cool_- |
1685 fuji_fp-100c_cool_--
1686 | fuji_fp-100c_negative | fuji_fp-100c_negative_+ |
1687 fuji_fp-100c_negative_++ | fuji_fp-100c_negative_+++ |
1688 fuji_fp-100c_negative_++_alt | fuji_fp-100c_negative_- |
1689 fuji_fp-100c_negative_-- |
1690 fuji_fp-3000b | fuji_fp-3000b_+ | fuji_fp-3000b_++ |
1691 fuji_fp-3000b_+++ | fuji_fp-3000b_- | fuji_fp-3000b_-- |
1692 fuji_fp-3000b_hc | fuji_fp-3000b_negative | fuji_fp-3000b_negative_+ |
1693 fuji_fp-3000b_negative_++ | fuji_fp-3000b_negative_+++ |
1694 fuji_fp-3000b_negative_- | fuji_fp-3000b_negative_-- |
1695 fuji_fp-3000b_negative_early | fuji_fp_100c | fuji_hdr |
1696 fuji_neopan_1600 |
1697 fuji_neopan_1600_+ | fuji_neopan_1600_++ | fuji_neopan_1600_- |
1698 fuji_neopan_acros_100 | fuji_provia_100_generic | fuji_provia_100f |
1699 fuji_provia_400f | fuji_provia_400x | fuji_sensia_100 |
1700 fuji_superia_100 | fuji_superia_100_+ | fuji_superia_100_++ |
1701 fuji_superia_100_- | fuji_superia_1600 | fuji_superia_1600_+ | fuji_su‐
1702 peria_1600_++ | fuji_superia_1600_- | fuji_superia_200 |
1703 fuji_superia_200_xpro | fuji_superia_400 | fuji_superia_400_+ |
1704 fuji_superia_400_++ | fuji_superia_400_- | fuji_superia_800 | fuji_su‐
1705 peria_800_+ | fuji_superia_800_++ | fuji_superia_800_- |
1706 fuji_superia_hg_1600 | fuji_superia_reala_100 | fuji_superia_x-
1707 tra_800 | fuji_velvia_100_generic | fuji_velvia_50 |
1708 fuji_xtrans_iii_acros | fuji_xtrans_iii_acros+g |
1709 fuji_xtrans_iii_acros+r |
1710 fuji_xtrans_iii_acros+ye | fuji_xtrans_iii_astia |
1711 fuji_xtrans_iii_classic_chrome | fuji_xtrans_iii_mono |
1712 fuji_xtrans_iii_mono+g | fuji_xtrans_iii_mono+r |
1713 fuji_xtrans_iii_mono+ye |
1714 fuji_xtrans_iii_pro_neg_hi | fuji_xtrans_iii_pro_neg_std |
1715 fuji_xtrans_iii_provia | fuji_xtrans_iii_sepia | fuji_xtrans_iii_velvia
1716 | fusion_88 | futuristicbleak_1 | futuristicbleak_2 | futuristicbleak_3
1717 | futuristicbleak_4 | going_for_a_walk | golden | golden_bright |
1718 golden_fade | golden_mono | golden_night_softner_43 | golden_sony_37 |
1719 golden_vibrant | goldengate | goldentime |
1720 goldfx_bright_spring_breeze | goldfx_bright_summer_heat |
1721 goldfx_hot_summer_heat | goldfx_perfect_sunset_01min | goldfx_per‐
1722 fect_sunset_05min | goldfx_perfect_sunset_10min | goldfx_spring_breeze
1723 |
1724 goldfx_summer_heat | good_morning | green_15 | green_2025 |
1725 green_action | green_afternoon | green_and_orange | green_blues |
1726 green_conflict | green_day_01 | green_day_02 | green_g_09 | green_in‐
1727 door |
1728 green_light | green_mono | green_yellow | greenish_contrasty |
1729 greenish_fade | greenish_fade_1 | gremerta | hackmanite | hallowen_dark
1730 | happyness_133 | hard_teal_orange | harsh_day | harsh_sunset |
1731 helios | herderite | heulandite | hiddenite | highlights_protec‐
1732 tion | hilutite | hitman | hlg_1_1 | honey_light | hong_kong | horror‐
1733 blue | howlite | hydracore | hyla_68 | hypersthene | hypnosis |
1734 hypressen | ilford_delta_100 | ilford_delta_3200 | il‐
1735 ford_delta_3200_+ | ilford_delta_3200_++ | ilford_delta_3200_- | il‐
1736 ford_delta_400 | ilford_fp_4_plus_125 | ilford_hp_5 | ilford_hp_5_+ |
1737 ilford_hp_5_++ | ilford_hp_5_- | ilford_hp_5_plus_400 | il‐
1738 ford_hps_800 | ilford_pan_f_plus_50 | ilford_xp_2 | indoor_blue | in‐
1739 dustrial_33 | infrared_-_dust_pink | instantc | justpeachy | jwick_21 |
1740 k_tone_vintage_kodachrome | kh_1 | kh_10 | kh_2 | kh_3 | kh_4 |
1741 kh_5 | kh_6 | kh_7 | kh_8 | kh_9 | killstreak | kodak_2383_constlclip |
1742 kodak_2383_constlmap | kodak_2383_cuspclip | kodak_2393_constlclip
1743 | kodak_2393_constlmap | kodak_2393_cuspclip | kodak_bw_400_cn |
1744 kodak_e-100_gx_ektachrome_100 | kodak_ektachrome_100_vs | kodak_ek‐
1745 tachrome_100_vs_generic | kodak_ektar_100 | kodak_elite_100_xpro |
1746 kodak_elite_chrome_200 | kodak_elite_chrome_400 | ko‐
1747 dak_elite_color_200 | kodak_elite_color_400 | kodak_elite_extra‐
1748 color_100 | kodak_hie_hs_infra | kodak_kodachrome_200 | kodak_ko‐
1749 dachrome_25 |
1750 kodak_kodachrome_64 | kodak_kodachrome_64_generic | kodak_por‐
1751 tra_160 | kodak_portra_160_+ | kodak_portra_160_++ | kodak_portra_160_-
1752 | kodak_portra_160_nc | kodak_portra_160_nc_+ |
1753 kodak_portra_160_nc_++ | kodak_portra_160_nc_- | kodak_por‐
1754 tra_160_vc | kodak_portra_160_vc_+ | kodak_portra_160_vc_++ | ko‐
1755 dak_portra_160_vc_- | kodak_portra_400 | kodak_portra_400_+ |
1756 kodak_portra_400_++ | kodak_portra_400_- | kodak_portra_400_nc |
1757 kodak_portra_400_nc_+ | kodak_portra_400_nc_++ | kodak_portra_400_nc_-
1758 | kodak_portra_400_uc | kodak_portra_400_uc_+ |
1759 kodak_portra_400_uc_++ | kodak_portra_400_uc_- | kodak_por‐
1760 tra_400_vc | kodak_portra_400_vc_+ | kodak_portra_400_vc_++ | ko‐
1761 dak_portra_400_vc_- | kodak_portra_800 | kodak_portra_800_+ |
1762 kodak_portra_800_++ | kodak_portra_800_- | kodak_portra_800_hc |
1763 kodak_t-max_100 | kodak_t-max_3200 | kodak_t-max_400 | kodak_tmax_3200
1764 | kodak_tmax_3200_+ | kodak_tmax_3200_++ | kodak_tmax_3200_- |
1765 kodak_tmax_3200_alt | kodak_tri-x_400 | kodak_tri-x_400_+ | ko‐
1766 dak_tri-x_400_++ | kodak_tri-x_400_- | kodak_tri-x_400_alt | korben_214
1767 | landscape_01 | landscape_02 | landscape_03 | landscape_04 |
1768 landscape_05 | landscape_1 | landscape_10 | landscape_2 | land‐
1769 scape_3 | landscape_4 | landscape_5 | landscape_6 | landscape_7 | land‐
1770 scape_8 | landscape_9 | lateafternoonwanderlust | latesunset | lc_1 |
1771 lc_10 | lc_2 | lc_3 | lc_4 | lc_5 | lc_6 | lc_7 | lc_8 | lc_9 |
1772 lenox_340 | life_giving_tree | light_blown | lomo | lomography_red‐
1773 scale_100 | lomography_x-pro_slide_200 | london_nights | louetta |
1774 low_contrast_blue | low_key_01 | lucky_64 | lushgreensummer | ma‐
1775 genta_day | magenta_day_01 | magenta_dream | magenta_yellow | magenta‐
1776 coffee | matrix | mckinnon_75 | memories | metropolis | milo_5 |
1777 minimalistcaffeination | modern_film | modern_films_01 | mod‐
1778 ern_films_02 | modern_films_03 | modern_films_04 | modern_films_05 |
1779 modern_films_06 | modern_films_07 | mono_tinted | monochrome |
1780 monochrome_1 | monochrome_2 | moody_1 | moody_10 | moody_2 |
1781 moody_3 | moody_4 | moody_5 | moody_6 | moody_7 | moody_8 | moody_9 |
1782 moonlight | moonlight_01 | moonrise | morning_6 | morroco_16 |
1783 mostly_blue | moviz_1 | moviz_10 | moviz_11 | moviz_12 | moviz_13
1784 | moviz_14 | moviz_15 | moviz_16 | moviz_17 | moviz_18 | moviz_19 |
1785 moviz_2 | moviz_20 | moviz_21 | moviz_22 | moviz_23 | moviz_24 |
1786 moviz_25 | moviz_26 | moviz_27 | moviz_28 | moviz_29 | moviz_3 |
1787 moviz_30 | moviz_31 | moviz_32 | moviz_33 | moviz_34 | moviz_35 |
1788 moviz_36 | moviz_37 | moviz_38 | moviz_39 | moviz_4 | moviz_40 |
1789 moviz_41 | moviz_42 | moviz_43 | moviz_44 | moviz_45 | moviz_46 |
1790 moviz_47 | moviz_48 | moviz_5 | moviz_6 | moviz_7 | moviz_8 | moviz_9 |
1791 mute_shift | muted_01 | muted_fade | mysticpurplesunset | nah |
1792 natural_vivid | nemesis | neon_770 | neutral_pump | neu‐
1793 tral_teal_orange | neutral_warm_fade | newspaper | night_01 |
1794 night_blade_4 | night_king_141 | night_spy | nightfromday | nightlife |
1795 nostalgiahoney | nostalgic | nw-1 | nw-10 | nw-2 | nw-3 | nw-4 |
1796 nw-5 | nw-6 | nw-7 | nw-8 | nw-9 | old_west | once_upon_a_time |
1797 only_red | only_red_and_blue | operation_yellow | orange_dark_4 |
1798 orange_dark_7 | orange_dark_look | orange_tone | orange_underex‐
1799 posed | oranges | paladin | paladin_1875 | pasadena_21 | passing_by |
1800 pink_fade | pitaya_15 | pmcinematic_01 | pmcinematic_02 |
1801 pmcinematic_03 | pmcinematic_04 | pmcinematic_05 | pmcinematic_06
1802 | pmcinematic_07 | pmnight_01 | pmnight_02 | pmnight_03 | pmnight_04 |
1803 pmnight_05 | polaroid_664 | polaroid_665 | polaroid_665_+ |
1804 polaroid_665_++ | polaroid_665_- | polaroid_665_-- | po‐
1805 laroid_665_negative | polaroid_665_negative_+ | polaroid_665_negative_-
1806 | polaroid_665_negative_hc | polaroid_667 | polaroid_669 | po‐
1807 laroid_669_+ |
1808 polaroid_669_++ | polaroid_669_+++ | polaroid_669_- | po‐
1809 laroid_669_-- | polaroid_669_cold | polaroid_669_cold_+ | po‐
1810 laroid_669_cold_- | polaroid_669_cold_-- | polaroid_672 | polaroid_690
1811 |
1812 polaroid_690_+ | polaroid_690_++ | polaroid_690_- | po‐
1813 laroid_690_-- | polaroid_690_cold | polaroid_690_cold_+ | po‐
1814 laroid_690_cold_++ | polaroid_690_cold_- | polaroid_690_cold_-- | po‐
1815 laroid_690_warm |
1816 polaroid_690_warm_+ | polaroid_690_warm_++ | polaroid_690_warm_- |
1817 polaroid_690_warm_-- | polaroid_polachrome | polaroid_px-100uv+_cold |
1818 polaroid_px-100uv+_cold_+ | polaroid_px-100uv+_cold_++ |
1819 polaroid_px-100uv+_cold_+++ | polaroid_px-100uv+_cold_- | po‐
1820 laroid_px-100uv+_cold_-- | polaroid_px-100uv+_warm | po‐
1821 laroid_px-100uv+_warm_+ | polaroid_px-100uv+_warm_++ | po‐
1822 laroid_px-100uv+_warm_+++ |
1823 polaroid_px-100uv+_warm_- | polaroid_px-100uv+_warm_-- | po‐
1824 laroid_px-680 | polaroid_px-680_+ | polaroid_px-680_++ | po‐
1825 laroid_px-680_- | polaroid_px-680_-- | polaroid_px-680_cold | po‐
1826 laroid_px-680_cold_+
1827 | polaroid_px-680_cold_++ | polaroid_px-680_cold_++_alt | po‐
1828 laroid_px-680_cold_- | polaroid_px-680_cold_-- | polaroid_px-680_warm |
1829 polaroid_px-680_warm_+ | polaroid_px-680_warm_++ |
1830 polaroid_px-680_warm_- | polaroid_px-680_warm_-- | polaroid_px-70
1831 | polaroid_px-70_+ | polaroid_px-70_++ | polaroid_px-70_+++ | po‐
1832 laroid_px-70_- | polaroid_px-70_-- | polaroid_px-70_cold |
1833 polaroid_px-70_cold_+ | polaroid_px-70_cold_++ | po‐
1834 laroid_px-70_cold_- | polaroid_px-70_cold_-- | polaroid_px-70_warm |
1835 polaroid_px-70_warm_+ | polaroid_px-70_warm_++ | polaroid_px-70_warm_-
1836 |
1837 polaroid_px-70_warm_-- | polaroid_time_zero_expired | po‐
1838 laroid_time_zero_expired_+ | polaroid_time_zero_expired_++ | po‐
1839 laroid_time_zero_expired_- | polaroid_time_zero_expired_-- |
1840 polaroid_time_zero_expired_--- | polaroid_time_zero_expired_cold |
1841 polaroid_time_zero_expired_cold_- | polaroid_time_zero_expired_cold_--
1842 | polaroid_time_zero_expired_cold_--- | portrait_1 | portrait_10
1843 | portrait_2 | portrait_3 | portrait_4 | portrait_5 | portrait_6 |
1844 portrait_7 | portrait_8 | portrait_9 | progressen | protect_high‐
1845 lights_01 | prussian_blue | pseudogrey | purple | purple_2 |
1846 red_afternoon_01 | red_day_01 | red_dream_01 | redblueyellow |
1847 reds | reds_oranges_yellows | reeve_38 | remy_24 | rest_33 | retro |
1848 retro_brown_01 | retro_magenta_01 | retro_summer_3 | retro_yellow_01 |
1849 rollei_ir_400 | rollei_ortho_25 | rollei_retro_100_tonal |
1850 rollei_retro_80s | rotate_muted | rotate_vibrant | rotated | ro‐
1851 tated_crush | saturated_blue | saving_private_damon | science_fiction |
1852 sea |
1853 serenity | seringe_4 | serpent | seventies_magazine | sevsuz |
1854 shade_kings_ink | shadow_king_39 | shine | skin_tones | smart_contrast
1855 | smokey | smooth_clear | smooth_cromeish | smooth_fade |
1856 smooth_green_orange | smooth_sailing | smooth_teal_orange |
1857 soft_fade | softwarming | solarized_color | solarized_color_2 | spring‐
1858 morning | sprocket_231 | spy_29 | street | studio_skin_tone_shaper |
1859 subtle_blue | subtle_green | subtle_yellow | summer | summer_alt |
1860 sunlightlove | sunny | sunny_alt | sunny_rich | sunny_warm | sun‐
1861 set_aqua_orange | sunset_intense_violet_blue | sunset_violet_mood |
1862 super_warm | super_warm_rich | sutro_fx | sweet_bubblegum |
1863 sweet_gelatto | taiga | tarraco | teal_fade | teal_moonlight | tealma‐
1864 gentagold | tealorange | tealorange_1 | tealorange_2 | tealorange_3 |
1865 technicalfx_backlight_filter | teigen_28 | tensiongreen_1 | ten‐
1866 siongreen_2 | tensiongreen_3 | tensiongreen_4 | terra_4 | the_matrices
1867 | thriller_2 | toastedgarden | trent_18 | true_colors_8 |
1868 turkiest_42 | tweed_71 | ultra_water | undeniable | undeniable_2 |
1869 unknown | urban_01 | urban_02 | urban_03 | urban_04 | urban_05 | ur‐
1870 ban_cowboy | uzbek_bukhara | uzbek_marriage | uzbek_samarcande |
1871 velvetia | very_warm_greenish | vfb_21 | vibrant | vibrant_alien |
1872 vibrant_contrast | vibrant_cromeish | victory | vintage | vintage_01 |
1873 vintage_02 | vintage_03 | vintage_04 | vintage_05 | vintage_163
1874 | vintage_alt | vintage_brighter | vintage_chrome | vintage_mob |
1875 vintage_warmth_1 | violet_taste | vireo_37 | warm | warm_dark_contrasty
1876 | warm_fade | warm_fade_1 | warm_highlight | warm_neutral |
1877 warm_sunset_red | warm_teal | warm_vintage | warm_yellow |
1878 well_see | western | westernlut_2 | whiter_whites | winterlighthouse |
1879 wipe | wooden_gold_20 | yellow_55b | yellow_film_01 | yellowstone |
1880 you_can_do_it | zed_32 | zeke_39 | zilverfx_bw_solarization | zil‐
1881 verfx_infrared | zilverfx_vintage_bw } : Default values: 'resolu‐
1882 tion=33' and 'cut_and_round=1'.
1883
1884 Example:
1885 [#1] clut summer clut alien_green,17 clut orange_dark4,48
1886
1887 m (+):
1888 Shortcut for command 'command'.
1889
1890 command (+):
1891 _add_debug_info={ 0 | 1 },{ filename | http[s]://URL | "string" }
1892
1893 Import G'MIC custom commands from specified file, URL or string.
1894 (equivalent to shortcut command 'm').
1895
1896 Imported commands are available directly after the 'command' invo‐
1897 cation.
1898
1899 Default value: 'add_debug_info=1'.
1900
1901 Example:
1902 [#1] image.jpg command "foo : mirror y deform $""1" +foo[0] 5
1903 +foo[0] 15
1904
1905 cursor (+):
1906 _mode = { 0=hide | 1=show }
1907
1908 Show or hide mouse cursor for selected instant display windows.
1909 Command selection (if any) stands for instant display window in‐
1910 dices instead of image indices.
1911
1912 Default value: 'mode=1'.
1913
1914 delete (+):
1915 filename1[,filename2,...]
1916
1917 Delete specified filenames on disk. Multiple filenames must be sep‐
1918 arated by commas.
1919
1920 d (+):
1921 Shortcut for command 'display'.
1922
1923 display (+):
1924 _X[%]>=0,_Y[%]>=0,_Z[%]>=0,_exit_on_anykey={ 0 | 1 }
1925
1926 Display selected images in an interactive viewer (use the instant
1927 display window [0] if opened).
1928 (equivalent to shortcut command 'd').
1929
1930 Arguments 'X','Y','Z' determine the initial selection view, for 3D
1931 volumetric images.
1932
1933 Default value: 'X=Y=Z=0' and 'exit_on_anykey=0'.
1934
1935 Tutorial: https://gmic.eu/oldtutorial/_display
1936
1937 d0:
1938 Shortcut for command 'display0'.
1939
1940 display0:
1941
1942 Display selected images without value normalization.
1943 (equivalent to shortcut command 'd0').
1944
1945 d2d:
1946 Shortcut for command 'display2d'.
1947
1948 display2d:
1949
1950 Display selected 2d images in an interactive window.
1951 (equivalent to shortcut command 'd2d').
1952
1953 This command is used by default by command 'display' when display‐
1954 ing 2d images.
1955 If selected image is a volumetric image, each slice is displayed on
1956 a separate display
1957 window (up to 10 images can be displayed simultaneously this way),
1958 with synchronized moves.
1959 When interactive window is opened, the following actions are possi‐
1960 ble:
1961 * Left mouse button: Create an image selection and zoom into it.
1962 * Middle mouse button, or CTRL+left mouse button: Move image.
1963 * Mouse wheel or PADD+/-: Zoom in/out.
1964 * Arrow keys: Move image left/right/up/down.
1965 * 'CTRL + A': Enable/disable transparency (show/hide alpha chan‐
1966 nel).
1967 * 'CTRL + C': Decrease window size.
1968 * 'CTRL + D': Increase window size.
1969 * 'CTRL + F': Toggle fullscreen mode.
1970 * 'CTRL + N': Change normalization mode (can be { none | normal |
1971 channel-by-channel }).
1972 * 'CTRL + O': Save a copy of the input image, as a numbered file
1973 'gmic_xxxxxx.gmz'.
1974 * 'CTRL + R': Reset both window size and view.
1975 * 'CTRL + S': Save a screenshot of the current view, as a numbered
1976 file 'gmic_xxxxxx.png'.
1977 * 'CTRL + SPACE': Reset view.
1978 * 'CTRL + X': Show/hide axes.
1979 * 'CTRL + Z': Hold/release aspect ratio.
1980
1981 d3d:
1982 Shortcut for command 'display3d'.
1983
1984 display3d:
1985 _[background_image],_exit_on_anykey={ 0 | 1 } |
1986 _exit_on_anykey={ 0 | 1 }
1987
1988 Display selected 3D objects in an interactive viewer (use the in‐
1989 stant display window [0] if opened).
1990 (equivalent to shortcut command 'd3d').
1991
1992 Default values: '[background_image]=(default)' and
1993 'exit_on_anykey=0'.
1994
1995 da:
1996 Shortcut for command 'display_array'.
1997
1998 display_array:
1999 _width>0,_height>0
2000
2001 Display images in interactive windows where pixel neighborhoods can
2002 be explored.
2003
2004 Default values: 'width=13' and 'height=width'.
2005
2006 dc:
2007 Shortcut for command 'display_camera'.
2008
2009 display_camera:
2010
2011 Open camera viewer.
2012 This command requires features from the OpenCV library (not enabled
2013 in G'MIC by default).
2014
2015 dfft:
2016 Shortcut for command 'display_fft'.
2017
2018 display_fft:
2019
2020 Display fourier transform of selected images, with centered log-
2021 module and argument.
2022 (equivalent to shortcut command 'dfft').
2023
2024 Example:
2025 [#1] image.jpg +display_fft
2026
2027 dg:
2028 Shortcut for command 'display_graph'.
2029
2030 display_graph:
2031 _width>=0,_height>=0,_plot_type,_ver‐
2032 tex_type,_xmin,_xmax,_ymin,_ymax,_xlabel,_ylabel
2033
2034 Render graph plot from selected image data.
2035 'plot_type' can be { 0=none | 1=lines | 2=splines | 3=bar }.
2036 'vertex_type' can be { 0=none | 1=points | 2,3=crosses | 4,5=cir‐
2037 cles | 6,7=squares }.
2038 'xmin','xmax','ymin','ymax' set the coordinates of the displayed
2039 xy-axes.
2040 if specified 'width' or 'height' is '0', then image size is set to
2041 half the screen size.
2042
2043 Default values: 'width=0', 'height=0', 'plot_type=1', 'ver‐
2044 tex_type=1', 'xmin=xmax=ymin=ymax=0 (auto)', 'xlabel="x-axis"' and
2045 'ylabel="y-axis"'.
2046
2047 Example:
2048 [#1] 128,1,1,1,'cos(x/10+u)' +display_graph 400,300,3
2049
2050 dh:
2051 Shortcut for command 'display_histogram'.
2052
2053 display_histogram:
2054 _width>=0,_height>=0,_clus‐
2055 ters>0,_min_value[%],_max_value[%],_show_axes={ 0 | 1 },_expression.
2056
2057 Render a channel-by-channel histogram.
2058 If selected images have several slices, the rendering is performed
2059 for all input slices.
2060 'expression' is a mathematical expression used to transform the
2061 histogram data for visualization purpose.
2062 (equivalent to shortcut command 'dh').
2063
2064 if specified 'width' or 'height' is '0', then image size is set to
2065 half the screen size.
2066
2067 Default values: 'width=0', 'height=0', 'clusters=256',
2068 'min_value=0%', 'max_value=100%', 'show_axes=1' and 'expression=i'.
2069
2070 Example:
2071 [#1] image.jpg +display_histogram 512,300
2072
2073 display_parametric:
2074 _width>0,_height>0,_outline_opacity,_vertex_radius>=0,_is_an‐
2075 tialiased={ 0 | 1 },_is_decorated={ 0 | 1 },_xlabel,_ylabel
2076
2077 Render 2D or 3D parametric curve or point clouds from selected im‐
2078 age data.
2079 Curve points are defined as pixels of a 2 or 3-channel image.
2080 If the point image contains more than 3 channels, additional chan‐
2081 nels define the (R,G,B) color for each vertex.
2082 If 'outline_opacity>1', the outline is colored according to the
2083 specified vertex colors and
2084 'outline_opacity-1' is used as the actual drawing opacity.
2085
2086 Default values: 'width=512', 'height=width', 'outline_opacity=3',
2087 'vertex_radius=0', 'is_antialiased=1','is_decorated=1', 'xlabel="x-
2088 axis"' and
2089 'ylabel="y-axis"'.
2090
2091 Example:
2092 [#1]
2093 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)'
2094 display_parametric 512,512
2095 [#2] 1000,1,1,2,u(-100,100) quantize 4,1 noise 12 channels 0,2
2096 +normalize 0,255 append c display_parametric 512,512,0.1,8
2097
2098 dp:
2099 Shortcut for command 'display_parallel'.
2100
2101 display_parallel:
2102
2103 Display each selected image in a separate interactive display win‐
2104 dow.
2105 (equivalent to shortcut command 'dp').
2106
2107 dp0:
2108 Shortcut for command 'display_parallel0'.
2109
2110 display_parallel0:
2111
2112 Display each selected image in a separate interactive display win‐
2113 dow, without value normalization.
2114 (equivalent to shortcut command 'dp0').
2115
2116 display_polar:
2117 _width>32,_height>32,_out‐
2118 line_type,_fill_R,_fill_G,_fill_B,_theta_start,_theta_end,_xlabel,_yla‐
2119 bel
2120
2121 Render polar curve from selected image data.
2122 'outline_type' can be { r<0=dots with radius -r | 0=no outline |
2123 r>0=lines+dots with radius r }.
2124 'fill_color' can be { -1=no fill | R,G,B=fill with specified color
2125 }.
2126
2127 Default values: 'width=500', 'height=width', 'outline_type=1',
2128 'fill_R=fill_G=fill_B=200', 'theta_start=0', 'theta_end=360', 'xla‐
2129 bel="x-axis"' and
2130 'ylabel="y-axis"'.
2131
2132 Example:
2133 [#1] 300,1,1,1,'0.3+abs(cos(10*pi*x/w))+u(0.4)' display_polar
2134 512,512,4,200,255,200
2135 [#2] 3000,1,1,1,'x^3/1e10' display_polar
2136 400,400,1,-1,,,0,{15*360}
2137
2138 dq:
2139 Shortcut for command 'display_quiver'.
2140
2141 display_quiver:
2142 _size_factor>0,_arrow_size>=0,_color_mode={ 0=monochrome |
2143 1=grayscale | 2=color }
2144
2145 Render selected images of 2D vectors as a field of 2D arrows.
2146 (equivalent to shortcut command 'dq').
2147
2148 Default values: 'size_factor=16', 'arrow_size=1.5' and
2149 'color_mode=1'.
2150
2151 Example:
2152 [#1] image.jpg +luminance gradient[-1] xy rv[-2,-1] *[-2] -1
2153 a[-2,-1] c crop 60,10,90,30 +display_quiver[1] ,
2154
2155 drgba:
2156 Shortcut for command 'display_rgba'.
2157
2158 display_rgba:
2159 _background_RGB_color
2160
2161 Render selected RGBA images over a checkerboard or colored back‐
2162 ground.
2163 (equivalent to shortcut command 'drgba').
2164
2165 Default values: 'background_RGB_color=undefined' (checkerboard).
2166
2167 Example:
2168 [#1] image.jpg +norm threshold[-1] 40% blur[-1] 3 normalize[-1]
2169 0,255 append c display_rgba
2170
2171 dt:
2172 Shortcut for command 'display_tensors'.
2173
2174 display_tensors:
2175 _size_factor>0,_ellipse_size>=0,_color_mode={ 0=monochrome |
2176 1=grayscale | 2=color },_outline>=0
2177
2178 Render selected images of tensors as a field of 2D ellipses.
2179 (equivalent to shortcut command 'dt').
2180
2181 Default values: 'size_factor=16', 'ellipse_size=1.5',
2182 'color_mode=2' and 'outline=2'.
2183
2184 Example:
2185 [#1] image.jpg +diffusiontensors 0.1,0.9 resize2dx. 32 +dis‐
2186 play_tensors. 64,2
2187
2188 Tutorial: https://gmic.eu/oldtutorial/_display_tensors
2189
2190 dw:
2191 Shortcut for command 'display_warp'.
2192
2193 display_warp:
2194 _cell_size>0
2195
2196 Render selected 2D warping fields.
2197 (equivalent to shortcut command 'dw').
2198
2199 Default value: 'cell_size=15'.
2200
2201 Example:
2202 [#1] 400,400,1,2,'x=x-w/2;y=y-
2203 h/2;r=sqrt(x*x+y*y);a=atan2(y,x);5*sin(r/10)*[cos(a),sin(a)]' +dis‐
2204 play_warp 10
2205
2206 e (+):
2207 Shortcut for command 'echo'.
2208
2209 echo (+):
2210 message
2211
2212 Output specified message on the error output.
2213 (equivalent to shortcut command 'e').
2214
2215 Command selection (if any) stands for displayed call stack subset
2216 instead of image indices.
2217 When invoked with a '+' prefix (i.e. '+echo'), the command output
2218 its message on stdout rather than stderr.
2219
2220 echo_file:
2221 filename,message
2222
2223 Output specified message, appending it to specified output file.
2224 (similar to 'echo' for specified output file stream).
2225
2226 function1d:
2227 0<=smoothness<=1,x0>=0,y0,x1>=0,y1,...,xn>=0,yn
2228
2229 Insert continuous 1D function from specified list of keypoints
2230 (xk,yk)
2231 in range [0,max(xk)] (xk are positive integers).
2232
2233 Example:
2234 [#1] function1d 1,0,0,10,30,40,20,70,30,80,0 +display_graph
2235 400,300
2236
2237 identity:
2238 _width>=0,_height>=0,_depth>=0
2239
2240 Insert an identity map of given size at the end of the image list.
2241
2242 Default values: 'height=width' and 'depth=1'.
2243
2244 Example:
2245 [#1] identity 5,1 identity 8,8
2246
2247 i (+):
2248 Shortcut for command 'input'.
2249
2250 input (+):
2251 [type:]filename |
2252 [type:]http://URL |
2253 [selection]x_nb_copies>0 |
2254 { width>0[%] | [image_w] },{ _height>0[%] | [image_h] },{
2255 _depth>0[%] | [image_d] },{ _spectrum>0[%] | [image_s] },_{
2256 value1,_value2,... | 'formula' } |
2257 (value1{,|;|/|^}value2{,|;|/|^}...[:{x|y|z|c|,|;|/|^}]) |
2258 0
2259
2260 Insert a new image taken from a filename or from a copy of an ex‐
2261 isting image [index],
2262 or insert new image with specified dimensions and values. Single
2263 quotes may be omitted in
2264 'formula'. Specifying argument '0' inserts an 'empty' image.
2265 (equivalent to shortcut command 'i').
2266
2267 Default values: 'nb_copies=1', 'height=depth=spectrum=1' and
2268 'value1=0'.
2269
2270 Example:
2271 [#1] input image.jpg
2272 [#2] input (1,2,3;4,5,6;7,8,9^9,8,7;6,5,4;3,2,1)
2273 [#3] image.jpg (1,2,3;4,5,6;7,8,9) (255^128^64)
2274 400,400,1,3,'(x>w/2?x:y)*c'
2275
2276 Tutorial: https://gmic.eu/tutorial/input
2277
2278 input_565:
2279 filename,width>0,height>0,reverse_endianness={ 0 | 1 }
2280
2281 Insert image data from a raw RGB-565 file, at the end of the list.
2282
2283 Default value: 'reverse_endianness=0'.
2284
2285 input_csv:
2286 "filename",_read_data_as={ 0=numbers | 1=strings | _variable_name
2287 }
2288
2289 Insert number of string array from specified .csv file.
2290 If 'variable_name' is provided, the string of each cell is stored
2291 in a numbered variable '_variable_name_x_y', where 'x' and 'y' are the
2292 indices of the cell column and row
2293 respectively (starting from '0').
2294 Otherwise, a 'WxH' image is inserted at the end of the list, with
2295 each vector-valued pixel 'I(x,y)' encoding the number or the string of
2296 each cell.
2297 This command returns the 'W,H' dimension of the read array, as the
2298 status.
2299
2300 Default value: 'read_data_as=1'.
2301
2302 input_cube:
2303 "filename",_convert_1d_cluts_to_3d={ 0 | 1 }.
2304
2305 Insert CLUT data from a .cube filename (Adobe CLUT file format).
2306
2307 Default value: 'convert_1d_cluts_to_3d=1'.
2308
2309 input_flo:
2310 "filename"
2311
2312 Insert optical flow data from a .flo filename (vision.middle‐
2313 bury.edu file format).
2314
2315 ig:
2316 Shortcut for command 'input_glob'.
2317
2318 input_glob:
2319 pattern
2320
2321 Insert new images from several filenames that match the specified
2322 glob pattern.
2323 (equivalent to shortcut command 'ig').
2324
2325 input_gpl:
2326 filename
2327
2328 Input specified filename as a .gpl palette data file.
2329
2330 input_cached:
2331 "basename.ext",_try_downloading_from_gmic_server={ 0 | 1 }
2332
2333 Input specified filename, assumed to be stored in one of the G'MIC
2334 resource folder.
2335 If file not found and 'try_downloading=1', file is downloaded from
2336 the G'MIC server and stored
2337 in the '${-path_cache}' folder.
2338
2339 Default value: 'try_downloading_from_gmic_server=1'.
2340
2341 input_obj:
2342 filename
2343
2344 Input specified 3D mesh from a .obj Wavefront file.
2345
2346 it:
2347 Shortcut for command 'input_text'.
2348
2349 input_text:
2350 filename
2351
2352 Input specified text-data filename as a new image.
2353 (equivalent to shortcut command 'it').
2354
2355 lorem:
2356 _width>0,_height>0
2357
2358 Input random image of specified size, retrieved from Internet.
2359
2360 Default values: 'width=height=800'.
2361
2362 network (+):
2363 mode={ -1=disabled | 0=enabled w/o timeout | >0=enabled w/ speci‐
2364 fied timeout in seconds }
2365
2366 Enable/disable load-from-network and set corresponding timeout.
2367 (Default mode is 'enabled w/o timeout').
2368
2369 o (+):
2370 Shortcut for command 'output'.
2371
2372 output (+):
2373 [type:]filename,_format_options
2374
2375 Output selected images as one or several numbered file(s).
2376 (equivalent to shortcut command 'o').
2377
2378 Default value: 'format_options'=(undefined).
2379
2380 output_565:
2381 "filename",reverse_endianness={ 0=false | 1=true }
2382
2383 Output selected images as raw RGB-565 files.
2384
2385 Default value: 'reverse_endianness=0'.
2386
2387 output_cube:
2388 "filename"
2389
2390 Output selected CLUTs as a .cube file (Adobe CLUT format).
2391
2392 output_flo:
2393 "filename"
2394
2395 Output selected optical flow as a .flo file (vision.middlebury.edu
2396 file format).
2397
2398 output_ggr:
2399 filename,_gradient_name
2400
2401 Output selected images as .ggr gradient files (GIMP).
2402 If no gradient name is specified, it is deduced from the filename.
2403
2404 output_gmz:
2405 filename,_datatype
2406
2407 Output selected images as .gmz files (G'MIC native file format).
2408 'datatype' can be { bool | uint8 | int8 | uint16 | int16 | uint32 |
2409 int32 | uint64 | int64 | float32 | float64 }.
2410
2411 output_obj:
2412 filename,_save_materials={ 0=no | 1=yes }
2413
2414 Output selected 3D meshes as Wavefront 3D object files.
2415 Set 'save_materials' to '1' to produce a corresponding material
2416 file ('.mtl') and eventually texture files.
2417 Beware, the export to '.obj' files may be quite slow for large 3D
2418 objects.
2419
2420 Default value: 'save_materials=1'.
2421
2422 ot:
2423 Shortcut for command 'output_text'.
2424
2425 output_text:
2426 filename
2427
2428 Output selected images as text-data filenames.
2429 (equivalent to shortcut command 'ot').
2430
2431 on:
2432 Shortcut for command 'outputn'.
2433
2434 outputn:
2435 filename,_index
2436
2437 Output selected images as automatically numbered filenames in re‐
2438 peat...done loops.
2439 (equivalent to shortcut command 'on').
2440
2441 op:
2442 Shortcut for command 'outputp'.
2443
2444 outputp:
2445 prefix
2446
2447 Output selected images as prefixed versions of their original file‐
2448 names.
2449 (equivalent to shortcut command 'op').
2450
2451 Default value: 'prefix=_'.
2452
2453 ow:
2454 Shortcut for command 'outputw'.
2455
2456 outputw:
2457
2458 Output selected images by overwriting their original location.
2459 (equivalent to shortcut command 'ow').
2460
2461 ox:
2462 Shortcut for command 'outputx'.
2463
2464 outputx:
2465 extension1,_extension2,_...,_extensionN,_output_at_same_loca‐
2466 tion={ 0 | 1 }
2467
2468 Output selected images with same base filenames but for N different
2469 extensions.
2470 (equivalent to shortcut command 'ox').
2471
2472 Default value: 'output_at_same_location=0'.
2473
2474 parse_cli:
2475 _output_mode,_{ * | command_name }
2476
2477 Parse definition of ''-documented commands and output info about
2478 them in specified output mode.
2479 'output_mode' can be { ascii | bashcompletion | html | images |
2480 print }.
2481
2482 Default values: 'output_mode=print' and 'command_name=*'.
2483
2484 parse_gmd:
2485
2486 Parse and tokenize selected images, viewed as text strings format‐
2487 ted with the G'MIC markdown syntax.
2488
2489 gmd2html:
2490 _include_default_header_footer={ 0=none | 1=Reference | 2=Tuto‐
2491 rial | 3=News } |
2492 (no arg)
2493
2494 Convert selected gmd-formatted text images to html format.
2495
2496 Default values: 'include_default_header_footer=1'.
2497
2498 gmd2ascii:
2499 _max_line_length>0,_indent_forced_newlines>=0 |
2500 (no arg)
2501
2502 Convert selected gmd-formatted text images to ascii format.
2503
2504 Default values: 'max_line_length=80' and 'indent_forced_newline=0'.
2505
2506 parse_gui:
2507 _outputmode,_{ * | filter_name}
2508
2509 Parse selected filter definitions and generate info about filters
2510 in selected output mode.
2511 'outputmode' can be { gmicol | json | list | print | strings | up‐
2512 date | zart }.
2513 It is possible to define a custom output mode, by implementing the
2514 following commands
2515 ('outputmode' must be replaced by the name of the custom user out‐
2516 put mode):
2517 . 'parse_gui_outputmode' : A command that outputs the parsing in‐
2518 formation with a custom format.
2519 . 'parse_gui_parseparams_outputmode' (optional): A simple command
2520 that returns 0 or 1. It tells the parser whether parameters of matching
2521 filter must be analyzed (slower) or not.
2522 . 'parse_gui_trigger_outputmode' (optional): A command that is
2523 called by the parser just before parsing the set of each matching fil‐
2524 ters.
2525 Here is the list of global variables set by the parser, accessible
2526 in command 'parse_gui_outputmode':
2527 '$_nb_filters': Number of matching filters.
2528 '$_nongui' (stored as an image): All merged lines in the file that
2529 do not correspond to '#@gui' lines.
2530 For each filter ' * '$_fF_name' : Filter name.
2531 * '$_fF_path' : Full path.
2532 * '$_fF_locale' : Filter locale (empty, if not specified).
2533 * '$_fF_command' : Filter command.
2534 * '$_fF_command_preview' : Filter preview command (empty, if not
2535 specified).
2536 * '$_fF_zoom_factor' : Default zoom factor (empty, if not speci‐
2537 fied).
2538 * '$_fF_preview_accuracy' : Preview accuracy (can be { 0=does not
2539 support zoom in/out | 1=support zoom in/out | 2=pixel-perfect }).
2540 * '$_fF_input_mode' : Default preferred input mode (empty, if not
2541 specified).
2542 * '$_fF_hide' : Path of filter hid by current filter (for local‐
2543 ized filters, empty if not specified).
2544 * '$_fF_nb_params' : Number of parameters.
2545 For each parameter ' * '$_fF_pP_name' : Parameter name.
2546 * '$_fF_pP_type' : Parameter type.
2547 * '$_fF_pP_responsivity' : Parameter responsivity (can be { 0 | 1
2548 }).
2549 * '$_fF_pP_visibility' : Parameter visibility.
2550 * '$_fF_pP_propagation' : Propagation of the parameter visibility.
2551 * '$_fF_pP_nb_args' : Number of parameter arguments.
2552 For each argument ' * '$_fF_pP_aA' : Argument value
2553 Default parameters: 'filter_name=*' and 'output_format=print'.
2554
2555 pass (+):
2556 _shared_state={ -1=status only | 0=non-shared (copy) | 1=shared |
2557 2=adaptive }
2558
2559 Insert images from parent context of a custom command or a local
2560 environment.
2561 Command selection (if any) stands for a selection of images in the
2562 parent context.
2563 By default (adaptive shared state), selected images are inserted in
2564 a shared state if they do not belong
2565 to the context (selection) of the current custom command or local
2566 environment as well.
2567 Typical use of command 'pass' concerns the design of custom com‐
2568 mands that take images as arguments.
2569 This commands return the list of corresponding indices in the sta‐
2570 tus.
2571
2572 Default value: 'shared_state=2'.
2573
2574 Example:
2575 [#1] command "average : pass$""1 add[^-1] [-1] remove[-1] div 2"
2576 sample ? +mirror y +average[0] [1]
2577
2578 plot (+):
2579 _plot_type,_vertex_type,_xmin,_xmax,_ymin,_ymax,_exit_on_anykey={
2580 0 | 1 } |
2581 'formula',_resolution>=0,_plot_type,_ver‐
2582 tex_type,_xmin,xmax,_ymin,_ymax,_exit_on_anykey={ 0 | 1 }
2583
2584 Display selected images or formula in an interactive viewer (use
2585 the instant display window [0] if opened).
2586 'plot_type' can be { 0=none | 1=lines | 2=splines | 3=bar }.
2587 'vertex_type' can be { 0=none | 1=points | 2,3=crosses | 4,5=cir‐
2588 cles | 6,7=squares }.
2589 'xmin', 'xmax', 'ymin', 'ymax' set the coordinates of the displayed
2590 xy-axes.
2591
2592 Default values: 'plot_type=1', 'vertex_type=1',
2593 'xmin=xmax=ymin=ymax=0 (auto)' and 'exit_on_anykey=0'.
2594
2595 portrait:
2596 _size>0
2597
2598 Input random portrait image of specified size, retrieved from In‐
2599 ternet.
2600
2601 Default values: 'size=800'.
2602
2603 p (+):
2604 Shortcut for command 'print'.
2605
2606 print (+):
2607
2608 Output information on selected images, on the standard error
2609 (stderr).
2610 (equivalent to shortcut command 'p').
2611
2612 When invoked with a '+' prefix (i.e. '+print'), the command output
2613 its message on stdout rather than stderr.
2614
2615 random_pattern:
2616 _width>0,_height>0,_min_detail_level>=0
2617
2618 Insert a new RGB image of specified size at the end of the image
2619 list, rendered with a random pattern.
2620
2621 Default values: 'width=height=512' and 'min_detail_level=2'.
2622
2623 Example:
2624 [#1] repeat 6 { random_pattern 256 }
2625
2626 screen (+):
2627 _x0[%],_y0[%],_x1[%],_y1[%]
2628
2629 Take screenshot, optionally grabbed with specified coordinates, and
2630 insert it
2631 at the end of the image list.
2632
2633 select (+):
2634 feature_type,_X[%]>=0,_Y[%]>=0,_Z[%]>=0,_exit_on_anykey={ 0 | 1
2635 },_is_deep_selection={ 0 | 1 }
2636
2637 Interactively select a feature from selected images (use the in‐
2638 stant display window [0] if opened).
2639 'feature_type' can be { 0=point | 1=segment | 2=rectangle | 3=el‐
2640 lipse }.
2641 Arguments 'X','Y','Z' determine the initial selection view, for 3D
2642 volumetric images.
2643 The retrieved feature is returned as a 3D vector (if 'fea‐
2644 ture_type==0') or as a 6d vector
2645 (if 'feature_type!=0') containing the feature coordinates.
2646
2647 Default values: 'X=Y=Z=(undefined)', 'exit_on_anykey=0' and
2648 'is_deep_selection=0'.
2649
2650 serialize (+):
2651 _datatype,_is_compressed={ 0 | 1 },_store_names={ 0 | 1 }
2652
2653 Serialize selected list of images into a single image, optionally
2654 in a compressed form.
2655 'datatype' can be { auto | uint8 | int8 | uint16 | int16 | uint32 |
2656 int32 | uint64 | int64 | float32 | float64 }.
2657 Specify 'datatype' if all selected images have a range of values
2658 constrained to a particular datatype,
2659 in order to minimize the memory footprint.
2660 The resulting image has only integers values in [0,255] and can
2661 then be saved as a raw image of
2662 unsigned chars (doing so will output a valid .cimg[z] or .gmz
2663 file).
2664 If 'store_names' is set to '1', serialization uses the .gmz format
2665 to store data in memory
2666 (otherwise the .cimg[z] format).
2667
2668 Default values: 'datatype=auto', 'is_compressed=1' and
2669 'store_names=1'.
2670
2671 Example:
2672 [#1] image.jpg +serialize uint8 +unserialize[-1]
2673
2674 shape_circle:
2675 _size>=0
2676
2677 Input a 2D circle binary shape with specified size.
2678
2679 Default value: 'size=512'.
2680
2681 Example:
2682 [#1] shape_circle ,
2683
2684 shape_cupid:
2685 _size>=0
2686
2687 Input a 2D cupid binary shape with specified size.
2688
2689 Default value: 'size=512'.
2690
2691 Example:
2692 [#1] shape_cupid ,
2693
2694 shape_diamond:
2695 _size>=0
2696
2697 Input a 2D diamond binary shape with specified size.
2698
2699 Default value: 'size=512'.
2700
2701 Example:
2702 [#1] shape_diamond ,
2703
2704 shape_dragon:
2705 _size>=0,_recursion_level>=0,_angle
2706
2707 Input a 2D Dragon curve with specified size.
2708
2709 Default value: 'size=512', 'recursion_level=18' and 'angle=0'.
2710
2711 Example:
2712 [#1] shape_dragon ,
2713
2714 shape_fern:
2715 _size>=0,_density[%]>=0,_angle,0<=_opacity<=1,_type={ 0=Asplenium
2716 adiantum-nigrum | 1=Thelypteridaceae }
2717
2718 Input a 2D Barnsley fern with specified size.
2719
2720 Default value: 'size=512', 'density=50%', 'angle=30', 'opacity=0.3'
2721 and 'type=0'.
2722
2723 Example:
2724 [#1] shape_fern ,
2725
2726 shape_gear:
2727 _size>=0,_nb_teeth>0,0<=_height_teeth<=100,0<=_off‐
2728 set_teeth<=100,0<=_inner_radius<=100
2729
2730 Input a 2D gear binary shape with specified size.
2731
2732 Default value: 'size=512', 'nb_teeth=12', 'height_teeth=20', 'off‐
2733 set_teeth=0' and 'inner_radius=40'.
2734
2735 Example:
2736 [#1] shape_gear ,
2737
2738 shape_heart:
2739 _size>=0
2740
2741 Input a 2D heart binary shape with specified size.
2742
2743 Default value: 'size=512'.
2744
2745 Example:
2746 [#1] shape_heart ,
2747
2748 shape_polygon:
2749 _size>=0,_nb_vertices>=3,_angle
2750
2751 Input a 2D polygonal binary shape with specified geometry.
2752
2753 Default value: 'size=512', 'nb_vertices=5' and 'angle=0'.
2754
2755 Example:
2756 [#1] repeat 6 { shape_polygon 256,{3+$>} }
2757
2758 shape_snowflake:
2759 size>=0,0<=_nb_recursions<=6
2760
2761 Input a 2D snowflake binary shape with specified size.
2762
2763 Default values: 'size=512' and 'nb_recursions=5'.
2764
2765 Example:
2766 [#1] repeat 6 { shape_snowflake 256,$> }
2767
2768 shape_star:
2769 _size>=0,_nb_branches>0,0<=_thickness<=1
2770
2771 Input a 2D star binary shape with specified size.
2772
2773 Default values: 'size=512', 'nb_branches=5' and 'thickness=0.38'.
2774
2775 Example:
2776 [#1] repeat 9 { shape_star 256,{$>+2} }
2777
2778 sh (+):
2779 Shortcut for command 'shared'.
2780
2781 shared (+):
2782 x0[%],x1[%],y[%],z[%],c[%] |
2783 y0[%],y1[%],z[%],c[%] |
2784 z0[%],z1[%],c[%] |
2785 c0[%],c1[%] |
2786 c0[%] |
2787 (no arg)
2788
2789 Insert shared buffers from (opt. points/rows/planes/channels of)
2790 selected images.
2791 Shared buffers cannot be returned by a command, nor a local envi‐
2792 ronment.
2793 (equivalent to shortcut command 'sh').
2794
2795 Example:
2796 [#1] image.jpg shared 1 blur[-1] 3 remove[-1]
2797 [#2] image.jpg repeat s { shared 25%,75%,0,$> mirror[-1] x re‐
2798 move[-1] }
2799
2800 Tutorial: https://gmic.eu/oldtutorial/_shared
2801
2802 sp:
2803 Shortcut for command 'sample'.
2804
2805 sample:
2806 _name1={ ? | apples | balloons | barbara | boats | bottles | but‐
2807 terfly | cameraman | car | cat | cliff | chick | colorful | david | dog
2808 | duck | eagle | elephant | earth | flower | fruits | gmicky |
2809 gmicky_mahvin | gmicky_wilber | greece | gummy | house | inside
2810 | landscape | leaf | lena | leno | lion | mandrill | monalisa | monkey
2811 | parrots | pencils | peppers | portrait0 | portrait1 |
2812 portrait2 | portrait3 | portrait4 | portrait5 | portrait6 |
2813 portrait7 | portrait8 | portrait9 | roddy | rooster | rose | square |
2814 swan | teddy | tiger | tulips | wall | waterfall | zelda },_name2,...,
2815 _nameN,_width={ >=0 | 0 (auto) },_height = { >=0 | 0 (auto) } |
2816 (no arg)
2817
2818 Input a new sample RGB image (opt. with specified size).
2819 (equivalent to shortcut command 'sp').
2820
2821 Argument 'name' can be replaced by an integer which serves as a
2822 sample index.
2823
2824 Example:
2825 [#1] repeat 6 { sample }
2826
2827 srand (+):
2828 value |
2829 (no arg)
2830
2831 Set random generator seed.
2832 If no argument is specified, a random value is used as the random
2833 generator seed.
2834
2835 store (+):
2836 _is_compressed={ 0 | 1 },variable_name1,_variable_name2,...
2837
2838 Store selected images into one or several named variables.
2839 Selected images are transferred to the variables, and are so re‐
2840 moved from the image list.
2841 (except if the prepended variant of the command '+store[selection]'
2842 is used).
2843 If a single variable name is specified, all images of the selection
2844 are assigned
2845 to the named variable. Otherwise, there must be as many variable
2846 names as images
2847 in the selection, and each selected image is assigned to each spec‐
2848 ified named variable.
2849 Use command 'input $variable_name' to bring the stored images back
2850 in the list.
2851
2852 Default value: 'is_compressed=0'.
2853
2854 Example:
2855 [#1] sample eagle,earth store img1,img2 input $img2 $img1
2856
2857 Tutorial: https://gmic.eu/tutorial/store
2858
2859 testimage2d:
2860 _width>0,_height>0,_spectrum>0
2861
2862 Input a 2D synthetic image.
2863
2864 Default values: 'width=512', 'height=width' and 'spectrum=3'.
2865
2866 Example:
2867 [#1] testimage2d 512
2868
2869 um:
2870 Shortcut for command 'uncommand'.
2871
2872 uncommand (+):
2873 command_name[,_command_name2,...] |
2874 *
2875
2876 Discard definition of specified custom commands.
2877 Set argument to '*' for discarding all existing custom commands.
2878 (equivalent to shortcut command 'um').
2879
2880 uniform_distribution:
2881 nb_levels>=1,spectrum>=1
2882
2883 Input set of uniformly distributed spectrum-d points in [0,1]^spec‐
2884 trum.
2885
2886 Example:
2887 [#1] uniform_distribution 64,3 * 255 +distribution3d cir‐
2888 cles3d[-1] 10
2889
2890 unserialize (+):
2891
2892 Recreate lists of images from serialized image buffers, obtained
2893 with command 'serialize'.
2894
2895 up:
2896 Shortcut for command 'update'.
2897
2898 update:
2899
2900 Update commands from the latest definition file on the G'MIC
2901 server.
2902 (equivalent to shortcut command 'up').
2903
2904 v (+):
2905 Shortcut for command 'verbose'.
2906
2907 verbose (+):
2908 level |
2909 { + | - }
2910
2911 Set or increment/decrement the verbosity level. Default level is 0.
2912 (equivalent to shortcut command 'v').
2913
2914 When 'level>0', G'MIC log messages are displayed on the standard
2915 error (stderr).
2916
2917 Default value: 'level=1'.
2918
2919 wait (+):
2920 delay |
2921 (no arg)
2922
2923 Wait for a given delay (in ms), optionally since the last call to
2924 'wait'.
2925 or wait for a user event occurring on the selected instant display
2926 windows.
2927 'delay' can be { <0=delay+flush events | 0=event | >0=delay }.
2928 Command selection (if any) stands for instant display window in‐
2929 dices instead of image indices.
2930 If no window indices are specified and if 'delay' is positive, the
2931 command results
2932 in a 'hard' sleep during specified delay.
2933
2934 Default value: 'delay=0'.
2935
2936 warn (+):
2937 _force_visible={ 0 | 1 },_message
2938
2939 Print specified warning message, on the standard error (stderr).
2940 Command selection (if any) stands for displayed call stack subset
2941 instead of image indices.
2942
2943 w (+):
2944 Shortcut for command 'window'.
2945
2946 window (+):
2947 _width[%]>=-1,_height[%]>=-1,_normaliza‐
2948 tion,_fullscreen,_pos_x[%],_pos_y[%],_title
2949
2950 Display selected images into an instant display window with speci‐
2951 fied size, normalization type,
2952 fullscreen mode and title.
2953 (equivalent to shortcut command 'w').
2954
2955 If 'width' or 'height' is set to -1, the corresponding dimension is
2956 adjusted to the window
2957 or image size.
2958 Specify 'pos_x' and 'pos_y' arguments only if the window has to be
2959 moved to the specified
2960 coordinates. Otherwise, they can be avoided.
2961 'width'=0 or 'height'=0 closes the instant display window.
2962 'normalization' can be { -1=keep same | 0=none | 1=always | 2=1st-
2963 time | 3=auto }.
2964 'fullscreen' can be { -1=keep same | 0=no | 1=yes }.
2965 You can manage up to 10 different instant display windows by using
2966 the numbered variants
2967 'w0' (default, eq. to 'w'),'w1',...,'w9' of the command 'w'.
2968 Invoke 'window' with no selection to make the window visible, if it
2969 has been closed by the user.
2970
2971 Default values: 'width=height=normalization=fullscreen=-1' and 'ti‐
2972 tle=(undefined)'.
2973
2974 12.3. List Manipulation
2975 -----------------
2976
2977 k (+):
2978 Shortcut for command 'keep'.
2979
2980 keep (+):
2981
2982 Keep only selected images.
2983 (equivalent to shortcut command 'k').
2984
2985 Example:
2986 [#1] image.jpg split x keep[0-50%:2] append x
2987 [#2] image.jpg split x keep[^30%-70%] append x
2988
2989 kn:
2990 Shortcut for command 'keep_named'.
2991
2992 keep_named:
2993 "name1","name2",...
2994
2995 Keep all images with specified names from the list of images.
2996 Remove all images if no images with those names exist.
2997 (equivalent to shortcut command 'kmn').
2998
2999 mv (+):
3000 Shortcut for command 'move'.
3001
3002 move (+):
3003 position[%]
3004
3005 Move selected images at specified position.
3006 Images are actually inserted between current positions 'position-1'
3007 and 'position'.
3008 (equivalent to shortcut command 'mv').
3009
3010 Example:
3011 [#1] image.jpg split x,3 move[1] 0
3012 [#2] image.jpg split x move[50%--1:2] 0 append x
3013
3014 nm (+):
3015 Shortcut for command 'name'.
3016
3017 => (+):
3018 Shortcut for command 'name'.
3019
3020 name (+):
3021 "name1","name2",...
3022
3023 Set names of selected images.
3024 * If selection is empty or not explicitely specified, it repre‐
3025 sents the last 'N' images of the list, where'N' is the number of speci‐
3026 fied arguments to the command 'name'.
3027 * If the selection contains a single image, then it is assumed the
3028 command has a single name argument (possibly containing multiple com‐
3029 mas).
3030 * If the selection contains more than one image, each command ar‐
3031 gument defines a single image name for each image of the selection.
3032 (equivalent to shortcut command '=>').
3033
3034 Example:
3035 [#1] image.jpg name image blur[image] 2
3036
3037 Tutorial: https://gmic.eu/tutorial/name
3038
3039 rm (+):
3040 Shortcut for command 'remove'.
3041
3042 remove (+):
3043
3044 Remove selected images.
3045 (equivalent to shortcut command 'rm').
3046
3047 Example:
3048 [#1] image.jpg split x remove[30%-70%] append x
3049 [#2] image.jpg split x remove[0-50%:2] append x
3050
3051 remove_duplicates:
3052
3053 Remove duplicates images in the selected images list.
3054
3055 Example:
3056 [#1] (1,2,3,4,2,4,3,1,3,4,2,1) split x remove_duplicates append x
3057
3058 remove_empty:
3059
3060 Remove empty images in the selected image list.
3061
3062 rmn:
3063 Shortcut for command 'remove_named'.
3064
3065 remove_named:
3066 "name1","name2",...
3067
3068 Remove all images with specified names from the list of images.
3069 Does nothing if no images with those names exist.
3070 (equivalent to shortcut command 'rmn').
3071
3072 rv (+):
3073 Shortcut for command 'reverse'.
3074
3075 reverse (+):
3076
3077 Reverse positions of selected images.
3078 (equivalent to shortcut command 'rv').
3079
3080 Example:
3081 [#1] image.jpg split x,3 reverse[-2,-1]
3082 [#2] image.jpg split x,-16 reverse[50%-100%] append x
3083
3084 sort_list:
3085 _ordering={ + | - },_criterion
3086
3087 Sort list of selected images according to the specified image cri‐
3088 terion.
3089
3090 Default values: 'ordering=+', 'criterion=i'.
3091
3092 Example:
3093 [#1] (1;4;7;3;9;2;4;7;6;3;9;1;0;3;3;2) split y sort_list +,i ap‐
3094 pend y
3095
3096 12.4. Mathematical Operators
3097 ----------------------
3098
3099 abs (+):
3100
3101 Compute the pointwise absolute values of selected images.
3102
3103 Example:
3104 [#1] image.jpg +sub {ia} abs[-1]
3105 [#2] 300,1,1,1,'cos(20*x/w)' +abs display_graph 400,300
3106
3107 acos (+):
3108
3109 Compute the pointwise arccosine of selected images.
3110
3111 Example:
3112 [#1] image.jpg +normalize -1,1 acos[-1]
3113 [#2] 300,1,1,1,'cut(x/w+0.1*u,0,1)' +acos display_graph 400,300
3114
3115 Tutorial: https://gmic.eu/oldtutorial/trigometric-and-inverse-
3116 trigometric-commands
3117
3118 acosh (+):
3119
3120 Compute the pointwise hyperbolic arccosine of selected images.
3121
3122 + (+):
3123 Shortcut for command 'add'.
3124
3125 add (+):
3126 value[%] |
3127 [image] |
3128 'formula' |
3129 (no arg)
3130
3131 Add specified value, image or mathematical expression to selected
3132 images, or compute the pointwise sum of selected images.
3133 (equivalent to shortcut command '+').
3134
3135 Example:
3136 [#1] image.jpg +add 30% cut 0,255
3137 [#2] image.jpg +blur 5 normalize 0,255 add[1] [0]
3138 [#3] image.jpg add '80*cos(80*(x/w-0.5)*(y/w-0.5)+c)' cut 0,255
3139 [#4] image.jpg repeat 9 { +rotate[0] {$>*36},1,0,50%,50% } add
3140 div 10
3141
3142 & (+):
3143 Shortcut for command 'and'.
3144
3145 and (+):
3146 value[%] |
3147 [image] |
3148 'formula' |
3149 (no arg)
3150
3151 Compute the bitwise AND of selected images with specified value,
3152 image or mathematical expression, or compute the pointwise sequential
3153 bitwise AND of selected images.
3154 (equivalent to shortcut command '&').
3155
3156 Example:
3157 [#1] image.jpg and {128+64}
3158 [#2] image.jpg +mirror x and
3159
3160 argmax:
3161
3162 Compute the argmax of selected images. Returns a single image
3163 with each pixel value being the index of the input image with maxi‐
3164 mal value.
3165
3166 Example:
3167 [#1] image.jpg sample lena,lion,square +argmax
3168
3169 argmaxabs:
3170
3171 Compute the argmaxabs of selected images. Returns a single image
3172 with each pixel value being the index of the input image with max‐
3173 abs value.
3174
3175 argmin:
3176
3177 Compute the argmin of selected images. Returns a single image
3178 with each pixel value being the index of the input image with mini‐
3179 mal value.
3180
3181 Example:
3182 [#1] image.jpg sample lena,lion,square +argmin
3183
3184 argminabs:
3185
3186 Compute the argminabs of selected images. Returns a single image
3187 with each pixel value being the index of the input image with
3188 minabs value.
3189
3190 asin (+):
3191
3192 Compute the pointwise arcsine of selected images.
3193
3194 Example:
3195 [#1] image.jpg +normalize -1,1 asin[-1]
3196 [#2] 300,1,1,1,'cut(x/w+0.1*u,0,1)' +asin display_graph 400,300
3197
3198 Tutorial: https://gmic.eu/oldtutorial/trigometric-and-inverse-
3199 trigometric-commands
3200
3201 asinh (+):
3202
3203 Compute the pointwise hyperbolic arcsine of selected images.
3204
3205 atan (+):
3206
3207 Compute the pointwise arctangent of selected images.
3208
3209 Example:
3210 [#1] image.jpg +normalize 0,8 atan[-1]
3211 [#2] 300,1,1,1,'4*x/w+u' +atan display_graph 400,300
3212
3213 Tutorial: https://gmic.eu/oldtutorial/trigometric-and-inverse-
3214 trigometric-commands
3215
3216 atan2 (+):
3217 [x_argument]
3218
3219 Compute the pointwise oriented arctangent of selected images.
3220 Each selected image is regarded as the y-argument of the arctangent
3221 function, while the
3222 specified image gives the corresponding x-argument.
3223
3224 Example:
3225 [#1] (-1,1) (-1;1) resize 400,400,1,1,3 atan2[1] [0] keep[1] mod
3226 {pi/8}
3227
3228 Tutorial: https://gmic.eu/oldtutorial/trigometric-and-inverse-
3229 trigometric-commands
3230
3231 atanh (+):
3232
3233 Compute the pointwise hyperbolic arctangent of selected images.
3234
3235 << (+):
3236 Shortcut for command 'bsl'.
3237
3238 bsl (+):
3239 value[%] |
3240 [image] |
3241 'formula' |
3242 (no arg)
3243
3244 Compute the bitwise left shift of selected images with specified
3245 value, image or mathematical expression, or compute the pointwise se‐
3246 quential bitwise left shift of selected images.
3247 (equivalent to shortcut command '<<').
3248
3249 Example:
3250 [#1] image.jpg bsl 'round(3*x/w,0)' cut 0,255
3251
3252 >> (+):
3253 Shortcut for command 'bsr'.
3254
3255 bsr (+):
3256 value[%] |
3257 [image] |
3258 'formula' |
3259 (no arg)
3260
3261 Compute the bitwise right shift of selected images with specified
3262 value, image or mathematical expression, or compute the pointwise se‐
3263 quential bitwise right shift of selected images.
3264 (equivalent to shortcut command '>>').
3265
3266 Example:
3267 [#1] image.jpg bsr 'round(3*x/w,0)' cut 0,255
3268
3269 cos (+):
3270
3271 Compute the pointwise cosine of selected images.
3272
3273 Example:
3274 [#1] image.jpg +normalize 0,{2*pi} cos[-1]
3275 [#2] 300,1,1,1,'20*x/w+u' +cos display_graph 400,300
3276
3277 Tutorial: https://gmic.eu/oldtutorial/trigometric-and-inverse-
3278 trigometric-commands
3279
3280 cosh (+):
3281
3282 Compute the pointwise hyperbolic cosine of selected images.
3283
3284 Example:
3285 [#1] image.jpg +normalize -3,3 cosh[-1]
3286 [#2] 300,1,1,1,'4*x/w+u' +cosh display_graph 400,300
3287
3288 deg2rad:
3289
3290 Convert pointwise angle values of selected images, from degrees to
3291 radians (apply 'i*pi/180').
3292
3293 / (+):
3294 Shortcut for command 'div'.
3295
3296 div (+):
3297 value[%] |
3298 [image] |
3299 'formula' |
3300 (no arg)
3301
3302 Divide selected images by specified value, image or mathematical
3303 expression, or compute the pointwise quotient of selected images.
3304 (equivalent to shortcut command '/').
3305
3306 Example:
3307 [#1] image.jpg div '1+abs(cos(x/10)*sin(y/10))'
3308 [#2] image.jpg +norm add[-1] 1 +div
3309
3310 div_complex:
3311 [divider_real,divider_imag],_epsilon>=0
3312
3313 Perform division of the selected complex pairs (real1,imag1,...,re‐
3314 alN,imagN) of images by
3315 specified complex pair of images (divider_real,divider_imag).
3316 In complex pairs, the real image must be always located before the
3317 imaginary image in the image list.
3318
3319 Default value: 'epsilon=1e-8'.
3320
3321 == (+):
3322 Shortcut for command 'eq'.
3323
3324 eq (+):
3325 value[%] |
3326 [image] |
3327 'formula' |
3328 (no arg)
3329
3330 Compute the boolean equality of selected images with specified
3331 value, image or mathematical expression, or compute the boolean equal‐
3332 ity of selected images.
3333 (equivalent to shortcut command '==').
3334
3335 Example:
3336 [#1] image.jpg round 40 eq {round(ia,40)}
3337 [#2] image.jpg +mirror x eq
3338
3339 erf (+):
3340
3341 Compute the pointwise error function of selected images.
3342
3343 Example:
3344 [#1] image.jpg +normalize 0,2 erf[-1]
3345 [#2] 300,1,1,1,'7*x/w-3.5+u' +erf display_graph 400,300
3346
3347 exp (+):
3348
3349 Compute the pointwise exponential of selected images.
3350
3351 Example:
3352 [#1] image.jpg +normalize 0,2 exp[-1]
3353 [#2] 300,1,1,1,'7*x/w+u' +exp display_graph 400,300
3354
3355 >= (+):
3356 Shortcut for command 'ge'.
3357
3358 ge (+):
3359 value[%] |
3360 [image] |
3361 'formula' |
3362 (no arg)
3363
3364 Compute the boolean 'greater or equal than' of selected images with
3365 specified value, image
3366 or mathematical expression, or compute the boolean 'greater or
3367 equal than' of selected images.
3368 (equivalent to shortcut command '>=').
3369
3370 Example:
3371 [#1] image.jpg ge {ia}
3372 [#2] image.jpg +mirror x ge
3373
3374 > (+):
3375 Shortcut for command 'gt'.
3376
3377 gt (+):
3378 value[%] |
3379 [image] |
3380 'formula' |
3381 (no arg)
3382
3383 Compute the boolean 'greater than' of selected images with speci‐
3384 fied value, image or mathematical expression, or compute the boolean
3385 'greater than' of selected images.
3386 (equivalent to shortcut command '>').
3387
3388 Example:
3389 [#1] image.jpg gt {ia}
3390 [#2] image.jpg +mirror x gt
3391
3392 <= (+):
3393 Shortcut for command 'le'.
3394
3395 le (+):
3396 value[%] |
3397 [image] |
3398 'formula' |
3399 (no arg)
3400
3401 Compute the boolean 'less or equal than' of selected images with
3402 specified value, image or mathematical expression, or compute the bool‐
3403 ean 'less or equal than' of selected images.
3404 (equivalent to shortcut command '<=').
3405
3406 Example:
3407 [#1] image.jpg le {ia}
3408 [#2] image.jpg +mirror x le
3409
3410 < (+):
3411 Shortcut for command 'lt'.
3412
3413 lt (+):
3414 value[%] |
3415 [image] |
3416 'formula' |
3417 (no arg)
3418
3419 Compute the boolean 'less than' of selected images with specified
3420 value, image or mathematical expression, or compute the boolean 'less
3421 than' of selected images.
3422 (equivalent to shortcut command '<').
3423
3424 Example:
3425 [#1] image.jpg lt {ia}
3426 [#2] image.jpg +mirror x lt
3427
3428 log (+):
3429
3430 Compute the pointwise base-e logarithm of selected images.
3431
3432 Example:
3433 [#1] image.jpg +add 1 log[-1]
3434 [#2] 300,1,1,1,'7*x/w+u' +log display_graph 400,300
3435
3436 log10 (+):
3437
3438 Compute the pointwise base-10 logarithm of selected images.
3439
3440 Example:
3441 [#1] image.jpg +add 1 log10[-1]
3442 [#2] 300,1,1,1,'7*x/w+u' +log10 display_graph 400,300
3443
3444 log2 (+):
3445
3446 Compute the pointwise base-2 logarithm of selected images
3447
3448 Example:
3449 [#1] image.jpg +add 1 log2[-1]
3450 [#2] 300,1,1,1,'7*x/w+u' +log2 display_graph 400,300
3451
3452 max (+):
3453 value[%] |
3454 [image] |
3455 'formula' |
3456 (no arg)
3457
3458 Compute the maximum between selected images and specified value,
3459 image or mathematical expression, or compute the pointwise maxima be‐
3460 tween selected images.
3461
3462 Example:
3463 [#1] image.jpg +mirror x max
3464 [#2] image.jpg max 'R=((x/w-0.5)^2+(y/h-0.5)^2)^0.5;255*R'
3465
3466 maxabs (+):
3467 value[%] |
3468 [image] |
3469 'formula' |
3470 (no arg)
3471
3472 Compute the maxabs between selected images and specified value, im‐
3473 age or mathematical expression, or compute the pointwise maxabs between
3474 selected images.
3475
3476 m/ (+):
3477 Shortcut for command 'mdiv'.
3478
3479 mdiv (+):
3480 value[%] |
3481 [image] |
3482 'formula' |
3483 (no arg)
3484
3485 Compute the matrix division of selected matrices/vectors by speci‐
3486 fied value, image or mathematical expression, or compute the matrix di‐
3487 vision of selected images.
3488 (equivalent to shortcut command 'm/').
3489
3490 med:
3491
3492 Compute the median of selected images.
3493
3494 Example:
3495 [#1] image.jpg sample lena,lion,square +med
3496
3497 min (+):
3498 value[%] |
3499 [image] |
3500 'formula' |
3501 (no arg)
3502
3503 Compute the minimum between selected images and specified value,
3504 image or mathematical expression, or compute the pointwise minima be‐
3505 tween selected images.
3506
3507 Example:
3508 [#1] image.jpg +mirror x min
3509 [#2] image.jpg min 'R=((x/w-0.5)^2+(y/h-0.5)^2)^0.5;255*R'
3510
3511 minabs (+):
3512 value[%] |
3513 [image] |
3514 'formula' |
3515 (no arg)
3516
3517 Compute the minabs between selected images and specified value, im‐
3518 age or mathematical expression, or compute the pointwise minabs between
3519 selected images.
3520
3521 % (+):
3522 Shortcut for command 'mod'.
3523
3524 mod (+):
3525 value[%] |
3526 [image] |
3527 'formula' |
3528 (no arg)
3529
3530 Compute the modulo of selected images with specified value, image
3531 or mathematical expression, or compute the pointwise sequential modulo
3532 of selected images.
3533 (equivalent to shortcut command '%').
3534
3535 Example:
3536 [#1] image.jpg +mirror x mod
3537 [#2] image.jpg mod 'R=((x/w-0.5)^2+(y/h-0.5)^2)^0.5;255*R'
3538
3539 m* (+):
3540 Shortcut for command 'mmul'.
3541
3542 mmul (+):
3543 value[%] |
3544 [image] |
3545 'formula' |
3546 (no arg)
3547
3548 Compute the matrix right multiplication of selected matrices/vec‐
3549 tors by specified value, image or mathematical expression, or compute
3550 the matrix right multiplication of selected images.
3551 (equivalent to shortcut command 'm*').
3552
3553 Example:
3554 [#1] (0,1,0;0,0,1;1,0,0) (1;2;3) +mmul
3555
3556 * (+):
3557 Shortcut for command 'mul'.
3558
3559 mul (+):
3560 value[%] |
3561 [image] |
3562 'formula' |
3563 (no arg)
3564
3565 Multiply selected images by specified value, image or mathematical
3566 expression, or compute the pointwise product of selected images.
3567 (equivalent to shortcut command '*').
3568
3569 See also: add, sub, div.
3570
3571 Example:
3572 [#1] image.jpg +mul 2 cut 0,255
3573 [#2] image.jpg (1,2,3,4,5,6,7,8) ri[-1] [0] mul[0] [-1]
3574 [#3] image.jpg mul '1-3*abs(x/w-0.5)' cut 0,255
3575 [#4] image.jpg +luminance negate[-1] +mul
3576
3577 mul_channels:
3578 value1,_value2,...,_valueN
3579
3580 Multiply channels of selected images by specified sequence of val‐
3581 ues.
3582
3583 Example:
3584 [#1] image.jpg +mul_channels 1,0.5,0.8
3585
3586 mul_complex:
3587 [multiplier_real,multiplier_imag]
3588
3589 Perform multiplication of the selected complex pairs
3590 (real1,imag1,...,realN,imagN) of images by
3591 specified complex pair of images (multiplier_real,multiplier_imag).
3592 In complex pairs, the real image must be always located before the
3593 imaginary image in the image list.
3594
3595 != (+):
3596 Shortcut for command 'neq'.
3597
3598 neq (+):
3599 value[%] |
3600 [image] |
3601 'formula' |
3602 (no arg)
3603
3604 Compute the boolean inequality of selected images with specified
3605 value, image or mathematical expression, or compute the boolean in‐
3606 equality of selected images.
3607 (equivalent to shortcut command '!=').
3608
3609 Example:
3610 [#1] image.jpg round 40 neq {round(ia,40)}
3611
3612 | (+):
3613 Shortcut for command 'or'.
3614
3615 or (+):
3616 value[%] |
3617 [image] |
3618 'formula' |
3619 (no arg)
3620
3621 Compute the bitwise OR of selected images with specified value, im‐
3622 age or mathematical expression, or compute the pointwise sequential
3623 bitwise OR of selected images.
3624 (equivalent to shortcut command '|').
3625
3626 Example:
3627 [#1] image.jpg or 128
3628 [#2] image.jpg +mirror x or
3629
3630 ^ (+):
3631 Shortcut for command 'pow'.
3632
3633 pow (+):
3634 value[%] |
3635 [image] |
3636 'formula' |
3637 (no arg)
3638
3639 Raise selected images to the power of specified value, image or
3640 mathematical expression, or compute the pointwise sequential powers of
3641 selected images.
3642 (equivalent to shortcut command '^').
3643
3644 Example:
3645 [#1] image.jpg div 255 +pow 0.5 mul 255
3646 [#2] image.jpg gradient pow 2 add pow 0.2
3647
3648 rad2deg:
3649
3650 Convert pointwise angle values of selected images, from radians to
3651 degrees (apply 'i*180/pi').
3652
3653 rol (+):
3654 value[%] |
3655 [image] |
3656 'formula' |
3657 (no arg)
3658
3659 Compute the bitwise left rotation of selected images with specified
3660 value, image or mathematical expression, or compute the pointwise se‐
3661 quential bitwise left rotation of selected images.
3662
3663 Example:
3664 [#1] image.jpg rol 'round(3*x/w,0)' cut 0,255
3665
3666 ror (+):
3667 value[%] |
3668 [image] |
3669 'formula' |
3670 (no arg)
3671
3672 Compute the bitwise right rotation of selected images with speci‐
3673 fied value, image or mathematical expression, or compute the pointwise
3674 sequential bitwise right rotation of selected images.
3675
3676 Example:
3677 [#1] image.jpg ror 'round(3*x/w,0)' cut 0,255
3678
3679 sign (+):
3680
3681 Compute the pointwise sign of selected images.
3682
3683 Example:
3684 [#1] image.jpg +sub {ia} sign[-1]
3685 [#2] 300,1,1,1,'cos(20*x/w+u)' +sign display_graph 400,300
3686
3687 sin (+):
3688
3689 Compute the pointwise sine of selected images.
3690
3691 Example:
3692 [#1] image.jpg +normalize 0,{2*pi} sin[-1]
3693 [#2] 300,1,1,1,'20*x/w+u' +sin display_graph 400,300
3694
3695 Tutorial: https://gmic.eu/oldtutorial/trigometric-and-inverse-
3696 trigometric-commands
3697
3698 sinc (+):
3699
3700 Compute the pointwise sinc function of selected images.
3701
3702 Example:
3703 [#1] image.jpg +normalize {-2*pi},{2*pi} sinc[-1]
3704 [#2] 300,1,1,1,'20*x/w+u' +sinc display_graph 400,300
3705
3706 sinh (+):
3707
3708 Compute the pointwise hyperbolic sine of selected images.
3709
3710 Example:
3711 [#1] image.jpg +normalize -3,3 sinh[-1]
3712 [#2] 300,1,1,1,'4*x/w+u' +sinh display_graph 400,300
3713
3714 sqr (+):
3715
3716 Compute the pointwise square function of selected images.
3717
3718 Example:
3719 [#1] image.jpg +sqr
3720 [#2] 300,1,1,1,'40*x/w+u' +sqr display_graph 400,300
3721
3722 sqrt (+):
3723
3724 Compute the pointwise square root of selected images.
3725
3726 Example:
3727 [#1] image.jpg +sqrt
3728 [#2] 300,1,1,1,'40*x/w+u' +sqrt display_graph 400,300
3729
3730 - (+):
3731 Shortcut for command 'sub'.
3732
3733 sub (+):
3734 value[%] |
3735 [image] |
3736 'formula' |
3737 (no arg)
3738
3739 Subtract specified value, image or mathematical expression to se‐
3740 lected images, or compute the pointwise difference of selected images.
3741 (equivalent to shortcut command '-').
3742
3743 Example:
3744 [#1] image.jpg +sub 30% cut 0,255
3745 [#2] image.jpg +mirror x sub[-1] [0]
3746 [#3] image.jpg sub 'i(w/2+0.9*(x-w/2),y)'
3747 [#4] image.jpg +mirror x sub
3748
3749 tan (+):
3750
3751 Compute the pointwise tangent of selected images.
3752
3753 Example:
3754 [#1] image.jpg +normalize {-0.47*pi},{0.47*pi} tan[-1]
3755 [#2] 300,1,1,1,'20*x/w+u' +tan display_graph 400,300
3756
3757 Tutorial: https://gmic.eu/oldtutorial/trigometric-and-inverse-
3758 trigometric-commands
3759
3760 tanh (+):
3761
3762 Compute the pointwise hyperbolic tangent of selected images.
3763
3764 Example:
3765 [#1] image.jpg +normalize -3,3 tanh[-1]
3766 [#2] 300,1,1,1,'4*x/w+u' +tanh display_graph 400,300
3767
3768 xor (+):
3769 value[%] |
3770 [image] |
3771 'formula' |
3772 (no arg)
3773
3774 Compute the bitwise XOR of selected images with specified value,
3775 image or mathematical expression, or compute the pointwise sequential
3776 bitwise XOR of selected images.
3777
3778 Example:
3779 [#1] image.jpg xor 128
3780 [#2] image.jpg +mirror x xor
3781
3782 12.5. Values Manipulation
3783 -------------------
3784
3785 apply_curve:
3786 0<=smoothness<=1,x0,y0,x1,y1,x2,y2,...,xN,yN
3787
3788 Apply curve transformation to image values.
3789
3790 Default values: 'smoothness=1', 'x0=0', 'y0=100'.
3791
3792 Example:
3793 [#1] image.jpg +apply_curve 1,0,0,128,255,255,0
3794
3795 apply_gamma:
3796 gamma>=0
3797
3798 Apply gamma correction to selected images.
3799
3800 Example:
3801 [#1] image.jpg +apply_gamma 2
3802
3803 balance_gamma:
3804 _ref_color1,...
3805
3806 Compute gamma-corrected color balance of selected image, with re‐
3807 spect to specified reference color.
3808
3809 Default value: 'ref_color1=128'.
3810
3811 Example:
3812 [#1] image.jpg +balance_gamma 128,64,64
3813
3814 cast:
3815 datatype_source,datatype_target
3816
3817 Cast datatype of image buffer from specified source type to speci‐
3818 fied target type.
3819 'datatype_source' and 'datatype_target' can be { uint8 | int8 |
3820 uint16 | int16 | uint32 | int32 | uint64 | int64 | float32 | float64 }.
3821
3822 complex2polar:
3823
3824 Compute complex to polar transforms of selected images.
3825
3826 Example:
3827 [#1] image.jpg +fft complex2polar[-2,-1] log[-2] shift[-2]
3828 50%,50%,0,0,2 remove[-1]
3829
3830 compress_clut:
3831 _max_error>0,_avg_error>0,_max_nbpoints>=8 | 0 (unlimited),_er‐
3832 ror_metric={ 0=L2-norm | 1=deltaE_1976 | 2=deltaE_2000 },_reconstruc‐
3833 tion_colorspace={ 0=srgb | 1=rgb | 2=lab },_try_rbf_first={ 0 | 1 }
3834
3835 Compress selected color LUTs as sequences of colored keypoints.
3836
3837 Default values: 'max_error=1.5', 'avg_error=0.75',
3838 'max_nb_points=2048', 'error_metric=2', 'reconstruction_colorspace=0'
3839 and 'try_rbf_first=1'.
3840
3841 compress_rle:
3842 _is_binary_data={ 0 | 1 },_maximum_sequence_length>=0
3843
3844 Compress selected images as 2xN data matrices, using RLE algorithm.
3845 Set 'maximum_sequence_length=0' to disable maximum length con‐
3846 straint.
3847
3848 Default values: 'is_binary_data=0' and 'maximum_sequence_length=0'.
3849
3850 Example:
3851 [#1] image.jpg resize2dy 100 quantize 4 round +compress_rle ,
3852 +decompress_rle[-1]
3853
3854 cumulate (+):
3855 { x | y | z | c }...{ x | y | z | c } |
3856 (no arg)
3857
3858 Compute the cumulative function of specified image data, optionally
3859 along the specified axes.
3860
3861 Example:
3862 [#1] image.jpg +histogram 256 +cumulate[-1] display_graph[-2,-1]
3863 400,300,3
3864
3865 c (+):
3866 Shortcut for command 'cut'.
3867
3868 cut (+):
3869 { value0[%] | [image0] },{ value1[%] | [image1] } |
3870 [image]
3871
3872 Cut values of selected images in specified range.
3873 (equivalent to shortcut command 'c').
3874
3875 Example:
3876 [#1] image.jpg +add 30% cut[-1] 0,255
3877 [#2] image.jpg +cut 25%,75%
3878
3879 decompress_clut:
3880 _width>0,_height>0,_depth>0,_reconstruction_colorspace={ 0=srgb |
3881 1=rgb | 2=lab }
3882
3883 Decompress selected colored keypoints into 3D CLUTs, using a mixed
3884 RBF/PDE approach.
3885
3886 Default values: 'width=height=depth=33' and 'reconstruction_col‐
3887 orspace=0'.
3888
3889 decompress_clut_rbf:
3890 _width>0,_height>0,_depth>0,_reconstruction_colorspace={ 0=srgb |
3891 1=rgb | 2=lab }
3892
3893 Decompress selected colored keypoints into 3D CLUTs, using RBF thin
3894 plate spline interpolation.
3895
3896 Default value: 'width=height=depth=33' and 'reconstruction_col‐
3897 orspace=0'.
3898
3899 decompress_clut_pde:
3900 _width>0,_height>0,_depth>0,_reconstruction_colorspace={ 0=srgb |
3901 1=rgb | 2=lab }
3902
3903 Decompress selected colored keypoints into 3D CLUTs, using multi‐
3904 scale diffusion PDE's.
3905
3906 Default values: 'width=height=depth=33' and 'reconstruction_col‐
3907 orspace=0'.
3908
3909 decompress_rle:
3910
3911 Decompress selected data vectors, using RLE algorithm.
3912
3913 discard (+):
3914 _value1,_value2,... |
3915 { x | y | z | c}...{ x | y | z | c},_value1,_value2,... |
3916 (no arg)
3917
3918 Discard specified values in selected images or discard neighboring
3919 duplicate values,
3920 optionally only for the values along the first of a specified axis.
3921 If no arguments are specified, neighboring duplicate values are
3922 discarded.
3923 If all pixels of a selected image are discarded, an empty image is
3924 returned.
3925
3926 Example:
3927 [#1] (1;2;3;4;3;2;1) +discard 2
3928 [#2] (1,2,2,3,3,3,4,4,4,4) +discard x
3929
3930 eigen2tensor:
3931
3932 Recompose selected pairs of eigenvalues/eigenvectors as 2x2 or 3x3
3933 tensor fields.
3934
3935 Tutorial: https://gmic.eu/tutorial/eigen2tensor
3936
3937 endian (+):
3938 _datatype
3939
3940 Reverse data endianness of selected images, eventually considering
3941 the pixel being of the specified datatype.
3942 'datatype' can be { bool | uint8 | int8 | uint16 | int16 | uint32 |
3943 int32 | uint64 | int64 | float32 | float64 }.
3944 This command does nothing for 'bool', 'uint8' and 'int8' datatypes.
3945
3946 equalize (+):
3947 _nb_levels>0[%],_value_min[%],_value_max[%]
3948
3949 Equalize histograms of selected images.
3950 If value range is specified, the equalization is done only for pix‐
3951 els in the specified
3952 value range.
3953
3954 Default values: 'nb_levels=256', 'value_min=0%' and
3955 'value_max=100%'.
3956
3957 Example:
3958 [#1] image.jpg +equalize
3959 [#2] image.jpg +equalize 4,0,128
3960
3961 f (+):
3962 Shortcut for command 'fill'.
3963
3964 fill (+):
3965 value1,_value2,... |
3966 [image] |
3967 'formula'
3968
3969 Fill selected images with values read from the specified value
3970 list, existing image
3971 or mathematical expression. Single quotes may be omitted in 'for‐
3972 mula'.
3973 (equivalent to shortcut command 'f').
3974
3975 Example:
3976 [#1] 4,4 fill 1,2,3,4,5,6,7
3977 [#2] 4,4 (1,2,3,4,5,6,7) fill[-2] [-1]
3978 [#3] 400,400,1,3 fill "X=x-w/2; Y=y-h/2; R=sqrt(X^2+Y^2);
3979 a=atan2(Y,X);
3980 if(R<=180,255*abs(cos(c+200*(x/w-0.5)*(y/h-0.5))),850*(a%(0.1*(c+1))))"
3981
3982 Tutorial: https://gmic.eu/tutorial/fill
3983
3984 index (+):
3985 { [palette] | palette_name },0<=_dithering<=1,_map_palette={ 0 |
3986 1 }
3987
3988 Index selected vector-valued images by specified vector-valued pal‐
3989 ette.
3990 'palette_name' can be { default | hsv | lines | hot | cool | jet |
3991 flag | cube | rainbow | algae | amp |balance | curl | deep | delta |
3992 dense | diff | haline | ice | matter | oxy | phase | rain |
3993 solar | speed | tarn |tempo | thermal | topo | turbid | aurora |
3994 hocuspocus | srb2 | uzebox }
3995
3996 Default values: 'dithering=0' and 'map_palette=0'.
3997
3998 Example:
3999 [#1] image.jpg +index 1,1,1
4000 [#2] image.jpg (0;255;255^0;128;255^0;0;255) +index[-2] [-1],1,1
4001
4002 Tutorial: https://gmic.eu/tutorial/gindex
4003
4004 ir:
4005 Shortcut for command 'inrange'.
4006
4007 inrange:
4008 min[%],max[%],_include_min_boundary={ 0=no | 1=yes },_in‐
4009 clude_max_boundary={ 0=no | 1=yes }
4010
4011 Detect pixels whose values are in specified range '[min,max]', in
4012 selected images.
4013 (equivalent to shortcut command 'ir').
4014
4015 Default value: 'include_min_boundary=include_max_boundary=1'.
4016
4017 Example:
4018 [#1] image.jpg +inrange 25%,75%
4019
4020 map (+):
4021 [palette],_boundary_conditions |
4022 palette_name,_boundary_conditions
4023
4024 Map specified vector-valued palette to selected indexed scalar im‐
4025 ages.
4026 'palette_name' can be { default | hsv | lines | hot | cool | jet |
4027 flag | cube | rainbow | algae | amp | balance | curl | deep | delta |
4028 dense | diff | gray | haline | ice | matter | oxy | phase |
4029 rain | solar | speed | tarn | tempo | thermal | topo | turbid | au‐
4030 rora | hocuspocus | srb2 | uzebox }
4031 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
4032 | 3=mirror }.
4033
4034 Default value: 'boundary_conditions=0'.
4035
4036 Example:
4037 [#1] image.jpg +luminance map[-1] 3
4038 [#2] image.jpg +rgb2ycbcr split[-1] c (0,255,0) resize[-1]
4039 256,1,1,1,3 map[-4] [-1] remove[-1] append[-3--1] c ycbcr2rgb[-1]
4040
4041 Tutorial: https://gmic.eu/tutorial/map
4042
4043 mix_channels:
4044 (a00,...,aMN) |
4045 [matrix]
4046
4047 Apply specified matrix to channels of selected images.
4048
4049 Example:
4050 [#1] image.jpg +mix_channels (0,1,0;1,0,0;0,0,1)
4051
4052 negate:
4053 base_value |
4054 (no arg)
4055
4056 Negate image values.
4057
4058 Default value: 'base_value=(undefined)'.
4059
4060 Example:
4061 [#1] image.jpg +negate
4062
4063 noise (+):
4064 std_deviation>=0[%],_noise_type
4065
4066 Add random noise to selected images.
4067 'noise_type' can be { 0=gaussian | 1=uniform | 2=salt&pepper |
4068 3=poisson | 4=rice }.
4069
4070 Default value: 'noise_type=0'.
4071
4072 Example:
4073 [#1] image.jpg +noise[0] 50,0 +noise[0] 50,1 +noise[0] 10,2 cut
4074 0,255
4075 [#2] 300,300,1,3 [0] noise[0] 20,0 noise[1] 20,1 +histogram 100
4076 display_graph[-2,-1] 400,300,3
4077
4078 noise_perlin:
4079 _scale_x[%]>0,_scale_y[%]>0,_scale_z[%]>0,_seed_x,_seed_y,_seed_z
4080
4081 Render 2D or 3D Perlin noise on selected images, from specified co‐
4082 ordinates.
4083 The Perlin noise is a specific type of smooth noise,
4084 described here : https://en.wikipedia.org/wiki/Perlin_noise.
4085
4086 Default values: 'scale_x=scale_y=scale_z=16' and
4087 'seed_x=seed_y=seed_z=0'.
4088
4089 Example:
4090 [#1] 500,500,1,3 noise_perlin ,
4091
4092 noise_poissondisk:
4093 _radius[%]>0,_max_sample_attempts>0,_p_norm>0
4094
4095 Add poisson disk sampling noise to selected images.
4096 Implements the algorithm from the article "Fast Poisson Disk Sam‐
4097 pling in Arbitrary Dimensions",
4098 by Robert Bridson (SIGGRAPH'2007).
4099
4100 Default values: 'radius=8', 'max_sample_attempts=30' and
4101 'p_norm=2'.
4102
4103 Example:
4104 [#1] 300,300 noise_poissondisk 8
4105
4106 normp:
4107 p>=0
4108
4109 Compute the pointwise Lp-norm norm of vector-valued pixels in se‐
4110 lected images.
4111
4112 Default value: 'p=2'.
4113
4114 Example:
4115 [#1] image.jpg +normp[0] 0 +normp[0] 1 +normp[0] 2 +normp[0] inf
4116
4117 norm:
4118
4119 Compute the pointwise euclidean norm of vector-valued pixels in se‐
4120 lected images.
4121
4122 Example:
4123 [#1] image.jpg +norm
4124
4125 Tutorial: https://gmic.eu/tutorial/norm
4126
4127 n (+):
4128 Shortcut for command 'normalize'.
4129
4130 normalize (+):
4131 { value0[%] | [image0] },{ value1[%] | [image1] },_con‐
4132 stant_case_ratio |
4133 [image]
4134
4135 Linearly normalize values of selected images in specified range.
4136 (equivalent to shortcut command 'n').
4137
4138 Example:
4139 [#1] image.jpg split x,2 normalize[-1] 64,196 append x
4140
4141 Tutorial: https://gmic.eu/tutorial/normalize
4142
4143 normalize_l2:
4144
4145 Normalize selected images such that they have a unit L2 norm.
4146
4147 normalize_sum:
4148
4149 Normalize selected images such that they have a unit sum.
4150
4151 Example:
4152 [#1] image.jpg +histogram 256 normalize_sum[-1] display_graph[-1]
4153 400,300
4154
4155 not:
4156
4157 Apply boolean not operation on selected images.
4158
4159 Example:
4160 [#1] image.jpg +ge 50% +not[-1]
4161
4162 orientation:
4163
4164 Compute the pointwise orientation of vector-valued pixels in se‐
4165 lected images.
4166
4167 Example:
4168 [#1] image.jpg +orientation +norm[-2] negate[-1] mul[-2] [-1] re‐
4169 verse[-2,-1]
4170
4171 Tutorial: https://gmic.eu/tutorial/orientation
4172
4173 oneminus:
4174
4175 For each selected image, compute one minus image.
4176
4177 Example:
4178 [#1] image.jpg normalize 0,1 +oneminus
4179
4180 otsu:
4181 _nb_levels>0
4182
4183 Hard-threshold selected images using Otsu's method.
4184 The computed thresholds are returned as a list of values in the
4185 status.
4186
4187 Default value: 'nb_levels=256'.
4188
4189 Example:
4190 [#1] image.jpg luminance +otsu ,
4191
4192 polar2complex:
4193
4194 Compute polar to complex transforms of selected images.
4195
4196 quantize:
4197 nb_levels>=1,_keep_values={ 0 | 1 },_quantization_type={ -1=me‐
4198 dian-cut | 0=k-means | 1=uniform }
4199
4200 Quantize selected images.
4201
4202 Default value: 'keep_values=1' and 'quantization_type=0'.
4203
4204 Example:
4205 [#1] image.jpg luminance +quantize 3
4206 [#2] 200,200,1,1,'cos(x/10)*sin(y/10)' +quantize[0] 6 +quan‐
4207 tize[0] 4 +quantize[0] 3 +quantize[0] 2
4208
4209 quantize_area:
4210 _min_area>0
4211
4212 Quantize selected images such that each flat region has an area
4213 greater or equal to 'min_area'.
4214
4215 Default value: 'min_area=10'.
4216
4217 Example:
4218 [#1] image.jpg quantize 3 +blur 1 round[-1] +quantize_area[-1] 2
4219
4220 rand (+):
4221 { value0[%] | [image0] },_{ value1[%] | [image1] } |
4222 [image]
4223
4224 Fill selected images with random values uniformly distributed in
4225 the specified range.
4226
4227 Example:
4228 [#1] 400,400,1,3 rand -10,10 +blur 10 sign[-1]
4229
4230 replace:
4231 source,target
4232
4233 Replace pixel values in selected images.
4234
4235 Example:
4236 [#1] (1;2;3;4) +replace 2,3
4237
4238 replace_inf:
4239 _expression
4240
4241 Replace all infinite values in selected images by specified expres‐
4242 sion.
4243
4244 Example:
4245 [#1] (0;1;2) log +replace_inf 2
4246
4247 replace_nan:
4248 _expression
4249
4250 Replace all NaN values in selected images by specified expression.
4251
4252 Example:
4253 [#1] (-1;0;2) sqrt +replace_nan 2
4254
4255 replace_naninf:
4256 _expression
4257
4258 Replace all NaN and infinite values in selected images by specified
4259 expression.
4260
4261 replace_seq:
4262 "search_seq","replace_seq"
4263
4264 Search and replace a sequence of values in selected images.
4265
4266 Example:
4267 [#1] (1;2;3;4;5) +replace_seq "2,3,4","7,8"
4268
4269 replace_str:
4270 "search_str","replace_str"
4271
4272 Search and replace a string in selected images (viewed as strings,
4273 i.e. sequences of character codes).
4274
4275 Example:
4276 [#1] ('"Hello there, how are you ?"') +replace_str "Hello
4277 there","Hi David"
4278
4279 round (+):
4280 rounding_value>=0,_rounding_type |
4281 (no arg)
4282
4283 Round values of selected images.
4284 'rounding_type' can be { -1=backward | 0=nearest | 1=forward }.
4285
4286 Default value: 'rounding_type=0'.
4287
4288 Example:
4289 [#1] image.jpg +round 100
4290 [#2] image.jpg mul {pi/180} sin +round
4291
4292 roundify:
4293 gamma>=0
4294
4295 Apply roundify transformation on float-valued data, with specified
4296 gamma.
4297
4298 Default value: 'gamma=0'.
4299
4300 Example:
4301 [#1] 1000 fill '4*x/w' repeat 5 { +roundify[0] {$>*0.2} } append
4302 c display_graph 400,300
4303
4304 = (+):
4305 Shortcut for command 'set'.
4306
4307 set (+):
4308 value,_x[%],_y[%],_z[%],_c[%]
4309
4310 Set pixel value in selected images, at specified coordinates.
4311 (equivalent to shortcut command '=').
4312
4313 If specified coordinates are outside the image bounds, no action is
4314 performed.
4315
4316 Default values: 'x=y=z=c=0'.
4317
4318 Example:
4319 [#1] 2,2 set 1,0,0 set 2,1,0 set 3,0,1 set 4,1,1
4320 [#2] image.jpg repeat 10000 { set
4321 255,{u(100)}%,{u(100)}%,0,{u(100)}% }
4322
4323 threshold:
4324 value[%],_is_soft={ 0 | 1 } :
4325
4326 Threshold values of selected images.
4327 'soft' can be { 0=hard-thresholding | 1=soft-thresholding }.
4328
4329 Default value: 'is_soft=0'.
4330
4331 Example:
4332 [#1] image.jpg +threshold[0] 50% +threshold[0] 50%,1
4333
4334 Tutorial: https://gmic.eu/tutorial/threshold
4335
4336 vector2tensor:
4337
4338 Convert selected vector fields to corresponding tensor fields.
4339
4340 12.6. Colors
4341 ------
4342
4343 adjust_colors:
4344 -100<=_brightness<=100,-100<=_con‐
4345 trast<=100,-100<=_gamma<=100,-100<=_hue_shift<=100,-100<=_satura‐
4346 tion<=100,_value_min,_value_max
4347
4348 Perform a global adjustment of colors on selected images.
4349 Range of correct image values are considered to be in
4350 [value_min,value_max] (e.g. [0,255]).
4351 If 'value_min==value_max==0', value range is estimated from min/max
4352 values of selected images.
4353 Processed images have pixel values constrained in
4354 [value_min,value_max].
4355
4356 Default values: 'brightness=0', 'contrast=0', 'gamma=0',
4357 'hue_shift=0', 'saturation=0', 'value_min=value_max=0'.
4358
4359 Example:
4360 [#1] image.jpg +adjust_colors 0,30,0,0,30
4361
4362 ac:
4363 Shortcut for command 'apply_channels'.
4364
4365 apply_channels:
4366 "command",color_channels,_value_action={ 0=none | 1=cut | 2=nor‐
4367 malize }
4368
4369 Apply specified command on the chosen color channel(s) of each se‐
4370 lected images.
4371 (equivalent to shortcut command 'ac').
4372
4373 Argument 'color_channels' refers to a colorspace, and can be basi‐
4374 cally one of
4375 { all | rgba | [s]rgb | ryb | lrgb | ycbcr | lab | lch | hsv | hsi
4376 | hsl | cmy | cmyk | yiq }.
4377 You can also make the processing focus on a few particular channels
4378 of this colorspace,
4379 by setting 'color_channels' as 'colorspace_channel' (e.g. 'hsv_h'
4380 for the hue).
4381 All channel values are considered to be provided in the [0,255]
4382 range.
4383
4384 Default value: 'value_action=0'.
4385
4386 Example:
4387 [#1] image.jpg +apply_channels "equalize blur 2",ycbcr_cbcr
4388
4389 autoindex:
4390 nb_colors>0,0<=_dithering<=1,_method={ 0=median-cut | 1=k-means }
4391
4392 Index selected vector-valued images by adapted colormaps.
4393
4394 Default values: 'dithering=0' and 'method=1'.
4395
4396 Example:
4397 [#1] image.jpg +autoindex[0] 4 +autoindex[0] 8 +autoindex[0] 16
4398
4399 bayer2rgb:
4400 _GM_smoothness,_RB_smoothness1,_RB_smoothness2
4401
4402 Transform selected RGB-Bayer sampled images to color images.
4403
4404 Default values: 'GM_smoothness=RB_smoothness=1' and 'RB_smooth‐
4405 ness2=0.5'.
4406
4407 Example:
4408 [#1] image.jpg rgb2bayer 0 +bayer2rgb 1,1,0.5
4409
4410 deltaE:
4411 [image],_metric={ 0=deltaE_1976 | 1=deltaE_2000 },"_to_Lab_com‐
4412 mand"
4413
4414 Compute the CIE DeltaE color difference between selected images and
4415 specified [image].
4416 Argument 'to_Lab_command' is a command able to convert colors of
4417 [image] into a Lab representation.
4418
4419 Default values: 'metric=1' and 'to_Lab_command="srgb2lab"'.
4420
4421 Example:
4422 [#1] image.jpg +blur 2 +deltaE[0] [1],1,srgb2lab
4423
4424 cmy2rgb:
4425
4426 Convert color representation of selected images from CMY to RGB.
4427
4428 cmyk2rgb:
4429
4430 Convert color representation of selected images from CMYK to RGB.
4431
4432 colorblind:
4433 type={ 0=protanopia | 1=protanomaly | 2=deuteranopia | 3=deutera‐
4434 nomaly | 4=tritanopia | 5=tritanomaly | 6=achromatopsia | 7=achro‐
4435 matomaly }
4436
4437 Simulate color blindness vision.
4438 Simulation method of Vienot, Brettel & Mollon 1999, "Digital video
4439 colourmaps for checking the legibility of displays by dichromats".
4440 The dichromacy matrices of the paper were adapted to sRGB
4441 (RGB->XYZ).
4442 Anomalous trichromacy simulated via linear interpolation with the
4443 identity and a factor of 0.6.
4444
4445 Example:
4446 [#1] image.jpg +colorblind 0
4447
4448 colormap:
4449 nb_levels>=0,_method={ 0=median-cut | 1=k-means },_sort_vectors
4450
4451 Estimate best-fitting colormap with 'nb_colors' entries, to index
4452 selected images.
4453 Set 'nb_levels==0' to extract all existing colors of an image.
4454 'sort_vectors' can be { 0=unsorted | 1=by increasing norm | 2=by
4455 decreasing occurrence }.
4456
4457 Default value: 'method=1' and 'sort_vectors=1'.
4458
4459 Example:
4460 [#1] image.jpg +colormap[0] 4 +colormap[0] 8 +colormap[0] 16
4461
4462 Tutorial: https://gmic.eu/oldtutorial/_colormap
4463
4464 compose_channels:
4465
4466 Compose all channels of each selected image, using specified arith‐
4467 metic operator (+,-,or,min,...).
4468
4469 Default value: '1=+'.
4470
4471 Example:
4472 [#1] image.jpg +compose_channels and
4473
4474 Tutorial: https://gmic.eu/tutorial/compose_channels
4475
4476 direction2rgb:
4477
4478 Compute RGB representation of selected 2D direction fields.
4479
4480 Example:
4481 [#1] image.jpg luminance gradient append c blur 2 orientation
4482 +direction2rgb
4483
4484 ditheredbw:
4485
4486 Create dithered B&W version of selected images.
4487
4488 Example:
4489 [#1] image.jpg +equalize ditheredbw[-1]
4490
4491 fc:
4492 Shortcut for command 'fill_color'.
4493
4494 fill_color:
4495 col1,...,colN
4496
4497 Fill selected images with specified color.
4498 (equivalent to shortcut command 'fc').
4499
4500 Example:
4501 [#1] image.jpg +fill_color 255,0,255
4502
4503 Tutorial: https://gmic.eu/oldtutorial/_fill_color
4504
4505 gradient2rgb:
4506 _is_orientation={ 0 | 1 }
4507
4508 Compute RGB representation of 2D gradient of selected images.
4509
4510 Default value: 'is_orientation=0'.
4511
4512 Example:
4513 [#1] image.jpg +gradient2rgb 0 equalize[-1]
4514
4515 hcy2rgb:
4516
4517 Convert color representation of selected images from HCY to RGB.
4518
4519 hsi2rgb:
4520
4521 Convert color representation of selected images from HSI to RGB.
4522
4523 hsi82rgb:
4524
4525 Convert color representation of selected images from HSI8 to RGB.
4526
4527 hsl2rgb:
4528
4529 Convert color representation of selected images from HSL to RGB.
4530
4531 hsl82rgb:
4532
4533 Convert color representation of selected images from HSL8 to RGB.
4534
4535 hsv2rgb:
4536
4537 Convert color representation of selected images from HSV to RGB.
4538
4539 Example:
4540 [#1] (0,360;0,360^0,0;1,1^1,1;1,1) resize 400,400,1,3,3 hsv2rgb
4541
4542 hsv82rgb:
4543
4544 Convert color representation of selected images from HSV8 to RGB.
4545
4546 int2rgb:
4547
4548 Convert color representation of selected images from INT24 to RGB.
4549
4550 ipremula:
4551
4552 Convert selected images with premultiplied alpha colors to normal
4553 colors.
4554 See also: premula.
4555
4556 jzazbz2rgb:
4557 illuminant={ 0=D50 | 1=D65 | 2=E } |
4558 (no arg)
4559
4560 Convert color representation of selected images from RGB to Jzazbz.
4561
4562 Default value: 'illuminant=2'.
4563
4564 jzazbz2xyz:
4565
4566 Convert color representation of selected images from RGB to XYZ.
4567
4568 lab2lch:
4569
4570 Convert color representation of selected images from Lab to Lch.
4571
4572 lab2rgb:
4573 illuminant={ 0=D50 | 1=D65 | 2=E } |
4574 (no arg)
4575
4576 Convert color representation of selected images from Lab to RGB.
4577
4578 Default value: 'illuminant=2'.
4579
4580 Example:
4581 [#1] (50,50;50,50^-3,3;-3,3^-3,-3;3,3) resize 400,400,1,3,3
4582 lab2rgb
4583
4584 lab2srgb:
4585 illuminant={ 0=D50 | 1=D65 | 2=E } |
4586 (no arg)
4587
4588 Convert color representation of selected images from Lab to sRGB.
4589
4590 Default value: 'illuminant=2'.
4591
4592 Example:
4593 [#1] (50,50;50,50^-3,3;-3,3^-3,-3;3,3) resize 400,400,1,3,3
4594 lab2rgb
4595
4596 lab82srgb:
4597 illuminant={ 0=D50 | 1=D65 | 2=E } |
4598 (no arg)
4599
4600 Convert color representation of selected images from Lab8 to sRGB.
4601
4602 Default value: 'illuminant=2'.
4603
4604 Example:
4605 [#1] (50,50;50,50^-3,3;-3,3^-3,-3;3,3) resize 400,400,1,3,3
4606 lab2rgb
4607
4608 lab2xyz:
4609 illuminant={ 0=D50 | 1=D65 | 2=E } |
4610 (no arg)
4611
4612 Convert color representation of selected images from Lab to XYZ.
4613
4614 Default value: 'illuminant=2'.
4615
4616 lab82rgb:
4617 illuminant={ 0=D50 | 1=D65 | 2=E } |
4618 (no arg)
4619
4620 Convert color representation of selected images from Lab8 to RGB.
4621
4622 Default value: 'illuminant=2'.
4623
4624 lch2lab:
4625
4626 Convert color representation of selected images from Lch to Lab.
4627
4628 lch2rgb:
4629 illuminant={ 0=D50 | 1=D65 | 2=E } |
4630 (no arg)
4631
4632 Convert color representation of selected images from Lch to RGB.
4633
4634 Default value: 'illuminant=2'.
4635
4636 lch82rgb:
4637 illuminant={ 0=D50 | 1=D65 | 2=E } |
4638 (no arg)
4639
4640 Convert color representation of selected images from Lch8 to RGB.
4641
4642 Default value: 'illuminant=2'.
4643
4644 luminance:
4645
4646 Compute luminance of selected sRGB images.
4647
4648 Example:
4649 [#1] image.jpg +luminance
4650
4651 Tutorial: https://gmic.eu/tutorial/luminance
4652
4653 lightness:
4654
4655 Compute lightness of selected sRGB images.
4656
4657 Example:
4658 [#1] image.jpg +lightness
4659
4660 lut_contrast:
4661 _nb_colors>1,_min_rgb_value
4662
4663 Generate a RGB colormap where consecutive colors have high con‐
4664 trast.
4665 This function performs a specific score maximization to generate
4666 the result, so
4667 it may take some time when 'nb_colors' is high.
4668
4669 Default values: 'nb_colors=256' and 'min_rgb_value=64'.
4670
4671 map_clut:
4672 [clut] | "clut_name"
4673
4674 Map specified RGB color LUT to selected images.
4675
4676 Example:
4677 [#1] image.jpg uniform_distribution {2^6},3 mirror[-1] x
4678 +map_clut[0] [1]
4679
4680 mix_rgb:
4681 a11,a12,a13,a21,a22,a23,a31,a32,a33
4682
4683 Apply 3x3 specified matrix to RGB colors of selected images.
4684
4685 Default values: 'a11=1', 'a12=a13=a21=0', 'a22=1', 'a23=a31=a32=0'
4686 and 'a33=1'.
4687
4688 Example:
4689 [#1] image.jpg +mix_rgb 0,1,0,1,0,0,0,0,1
4690
4691 Tutorial: https://gmic.eu/tutorial/mix_rgb
4692
4693 oklab2rgb:
4694
4695 Convert color representation of selected images from OKlab to RGB.
4696 (see colorspace definition at: https://bottos‐
4697 son.github.io/posts/oklab/ ).
4698 See also: rgb2oklab.
4699
4700 palette:
4701 palette_name | palette_number
4702
4703 Input specified color palette at the end of the image list.
4704 'palette_name' can be { default | hsv | lines | hot | cool | jet |
4705 flag | cube | rainbow | parula | spring | summer | autumn | winter |
4706 bone | copper | pink | vga | algae | amp | balance | curl |
4707 deep | delta | dense | diff | gray | haline | ice | matter | oxy |
4708 phase | rain | solar | speed | tarn | tempo | thermal | topo | turbid |
4709 aurora | hocuspocus | srb2 | uzebox | amiga7800 | amiga7800mess |
4710 fornaxvoid1 }
4711
4712 Example:
4713 [#1] palette hsv
4714
4715 premula:
4716
4717 Convert selected images with normal colors to premultiplied alpha
4718 colors.
4719 After conversion, alpha channel of resulting images has value in
4720 [0,1] range.
4721 See also: ipremula.
4722
4723 pseudogray:
4724 _max_increment>=0,_JND_threshold>=0,_bits_depth>0
4725
4726 Generate pseudogray colormap with specified increment and percep‐
4727 tual threshold.
4728 If 'JND_threshold' is 0, no perceptual constraints are applied.
4729
4730 Default values: 'max_increment=5', 'JND_threshold=2.3' and
4731 'bits_depth=8'.
4732
4733 Example:
4734 [#1] pseudogray 5
4735
4736 replace_color:
4737 tolerance[%]>=0,smoothness[%]>=0,src1,src2,...,dest1,dest2,...
4738
4739 Replace pixels from/to specified colors in selected images.
4740
4741 Example:
4742 [#1] image.jpg +replace_color 40,3,204,153,110,255,0,0
4743
4744 retinex:
4745 _value_offset>0,_colorspace={ hsi | hsv | lab | lrgb | rgb |
4746 ycbcr
4747 },0<=_min_cut<=100,0<=_max_cut<=100,_sigma_low>0,_sigma_mid>0,_sigma_high>0
4748
4749 Apply multi-scale retinex algorithm on selected images to improve
4750 color consistency.
4751 (as described in the page http://www.ipol.im/pub/art/2014/107/).
4752
4753 Default values: 'offset=1', 'colorspace=hsv', 'min_cut=1',
4754 'max_cut=1', 'sigma_low=15','sigma_mid=80' and 'sigma_high=250'.
4755
4756 rgb2bayer:
4757 _start_pattern=0,_color_grid=0
4758
4759 Transform selected color images to RGB-Bayer sampled images.
4760
4761 Default values: 'start_pattern=0' and 'color_grid=0'.
4762
4763 Example:
4764 [#1] image.jpg +rgb2bayer 0
4765
4766 rgb2cmy:
4767
4768 Convert color representation of selected images from RGB to CMY.
4769
4770 Example:
4771 [#1] image.jpg rgb2cmy split c
4772
4773 rgb2cmyk:
4774
4775 Convert color representation of selected images from RGB to CMYK.
4776
4777 Example:
4778 [#1] image.jpg rgb2cmyk split c
4779 [#2] image.jpg rgb2cmyk split c fill[3] 0 append c cmyk2rgb
4780
4781 rgb2hcy:
4782
4783 Convert color representation of selected images from RGB to HCY.
4784
4785 Example:
4786 [#1] image.jpg rgb2hcy split c
4787
4788 rgb2hsi:
4789
4790 Convert color representation of selected images from RGB to HSI.
4791
4792 Example:
4793 [#1] image.jpg rgb2hsi split c
4794
4795 rgb2hsi8:
4796
4797 Convert color representation of selected images from RGB to HSI8.
4798
4799 Example:
4800 [#1] image.jpg rgb2hsi8 split c
4801
4802 rgb2hsl:
4803
4804 Convert color representation of selected images from RGB to HSL.
4805
4806 Example:
4807 [#1] image.jpg rgb2hsl split c
4808 [#2] image.jpg rgb2hsl +split c add[-3] 100 mod[-3] 360 ap‐
4809 pend[-3--1] c hsl2rgb
4810
4811 rgb2hsl8:
4812
4813 Convert color representation of selected images from RGB to HSL8.
4814
4815 Example:
4816 [#1] image.jpg rgb2hsl8 split c
4817
4818 rgb2hsv:
4819
4820 Convert color representation of selected images from RGB to HSV.
4821
4822 Example:
4823 [#1] image.jpg rgb2hsv split c
4824 [#2] image.jpg rgb2hsv +split c add[-2] 0.3 cut[-2] 0,1 ap‐
4825 pend[-3--1] c hsv2rgb
4826
4827 rgb2hsv8:
4828
4829 Convert color representation of selected images from RGB to HSV8.
4830
4831 Example:
4832 [#1] image.jpg rgb2hsv8 split c
4833
4834 rgb2int:
4835
4836 Convert color representation of selected images from RGB to INT24
4837 scalars.
4838
4839 Example:
4840 [#1] image.jpg rgb2int
4841
4842 rgb2jzazbz:
4843 illuminant={ 0=D50 | 1=D65 | 2=E } |
4844 (no arg)
4845
4846 Convert color representation of selected images from RGB to Jzazbz.
4847
4848 Default value: 'illuminant=2'.
4849
4850 rgb2lab:
4851 illuminant={ 0=D50 | 1=D65 | 2=E } |
4852 (no arg)
4853
4854 Convert color representation of selected images from RGB to Lab.
4855
4856 Default value: 'illuminant=2'.
4857
4858 rgb2lab8:
4859 illuminant={ 0=D50 | 1=D65 | 2=E } |
4860 (no arg)
4861
4862 Convert color representation of selected images from RGB to Lab8.
4863
4864 Default value: 'illuminant=2'.
4865
4866 Example:
4867 [#1] image.jpg rgb2lab8 split c
4868
4869 rgb2lch:
4870 illuminant={ 0=D50 | 1=D65 | 2=E } |
4871 (no arg)
4872
4873 Convert color representation of selected images from RGB to Lch.
4874
4875 Default value: 'illuminant=2'.
4876
4877 Example:
4878 [#1] image.jpg rgb2lch split c
4879
4880 rgb2lch8:
4881 illuminant={ 0=D50 | 1=D65 | 2=E } |
4882 (no arg)
4883
4884 Convert color representation of selected images from RGB to Lch8.
4885
4886 Default value: 'illuminant=2'.
4887
4888 Example:
4889 [#1] image.jpg rgb2lch8 split c
4890
4891 rgb2luv:
4892
4893 Convert color representation of selected images from RGB to LUV.
4894
4895 Example:
4896 [#1] image.jpg rgb2luv split c
4897
4898 rgb2oklab:
4899
4900 Convert color representation of selected images from RGB to Oklab.
4901 (see colorspace definition at: https://bottos‐
4902 son.github.io/posts/oklab/ ).
4903 See also: oklab2rgb.
4904
4905 rgb2ryb:
4906
4907 Convert color representation of selected images from RGB to RYB.
4908
4909 Example:
4910 [#1] image.jpg rgb2ryb split c
4911
4912 rgb2srgb:
4913
4914 Convert color representation of selected images from linear RGB to
4915 sRGB.
4916
4917 rgb2xyz:
4918 illuminant={ 0=D50 | 1=D65 | 2=E } |
4919 (no arg)
4920
4921 Convert color representation of selected images from RGB to XYZ.
4922
4923 Default value: 'illuminant=2'.
4924
4925 Example:
4926 [#1] image.jpg rgb2xyz split c
4927
4928 rgb2xyz8:
4929 illuminant={ 0=D50 | 1=D65 | 2=E } |
4930 (no arg)
4931
4932 Convert color representation of selected images from RGB to XYZ8.
4933
4934 Default value: 'illuminant=2'.
4935
4936 Example:
4937 [#1] image.jpg rgb2xyz8 split c
4938
4939 rgb2yiq:
4940
4941 Convert color representation of selected images from RGB to YIQ.
4942
4943 Example:
4944 [#1] image.jpg rgb2yiq split c
4945
4946 rgb2yiq8:
4947
4948 Convert color representation of selected images from RGB to YIQ8.
4949
4950 Example:
4951 [#1] image.jpg rgb2yiq8 split c
4952
4953 rgb2ycbcr:
4954
4955 Convert color representation of selected images from RGB to YCbCr.
4956
4957 Example:
4958 [#1] image.jpg rgb2ycbcr split c
4959
4960 rgb2yuv:
4961
4962 Convert color representation of selected images from RGB to YUV.
4963
4964 Example:
4965 [#1] image.jpg rgb2yuv split c
4966
4967 rgb2yuv8:
4968
4969 Convert color representation of selected images from RGB to YUV8.
4970
4971 Example:
4972 [#1] image.jpg rgb2yuv8 split c
4973
4974 remove_opacity:
4975
4976 Remove opacity channel of selected images.
4977
4978 ryb2rgb:
4979
4980 Convert color representation of selected images from RYB to RGB.
4981
4982 select_color:
4983 tolerance[%]>=0,col1,...,colN
4984
4985 Select pixels with specified color in selected images.
4986
4987 Example:
4988 [#1] image.jpg +select_color 40,204,153,110
4989
4990 Tutorial: https://gmic.eu/oldtutorial/_select_color
4991
4992 sepia:
4993
4994 Apply sepia tones effect on selected images.
4995
4996 Example:
4997 [#1] image.jpg sepia
4998
4999 solarize:
5000
5001 Solarize selected images.
5002
5003 Example:
5004 [#1] image.jpg solarize
5005
5006 split_colors:
5007 _tolerance>=0,_max_nb_outputs>0,_min_area>0
5008
5009 Split selected images as several image containing a single color.
5010 One selected image can be split as at most 'max_nb_outputs' images.
5011 Output images are sorted by decreasing area of extracted color re‐
5012 gions and have an additional alpha-channel.
5013
5014 Default values: 'tolerance=0', 'max_nb_outputs=256' and
5015 'min_area=8'.
5016
5017 Example:
5018 [#1] image.jpg quantize 5 +split_colors , display_rgba
5019
5020 split_opacity:
5021
5022 Split color and opacity parts of selected images.
5023 This command returns 1 or 2 images for each selected image, whether
5024 it has an opacity channel or not.
5025
5026 srgb2lab:
5027 illuminant={ 0=D50 | 1=D65 | 2=E } |
5028 (no arg)
5029
5030 Convert color representation of selected images from sRGB to Lab.
5031
5032 Default value: 'illuminant=2'.
5033
5034 Example:
5035 [#1] image.jpg srgb2lab split c
5036 [#2] image.jpg srgb2lab +split c mul[-2,-1] 2.5 append[-3--1] c
5037 lab2srgb
5038
5039 srgb2lab8:
5040 illuminant={ 0=D50 | 1=D65 | 2=E } |
5041 (no arg)
5042
5043 Convert color representation of selected images from sRGB to Lab8.
5044
5045 Default value: 'illuminant=2'.
5046
5047 srgb2rgb:
5048
5049 Convert color representation of selected images from sRGB to linear
5050 RGB.
5051
5052 to_a:
5053
5054 Force selected images to have an alpha channel.
5055
5056 to_color:
5057
5058 Force selected images to be in color mode (RGB or RGBA).
5059
5060 to_colormode:
5061 mode={ 0=adaptive | 1=G | 2=GA | 3=RGB | 4=RGBA }
5062
5063 Force selected images to be in a given color mode.
5064
5065 Default value: 'mode=0'.
5066
5067 to_gray:
5068
5069 Force selected images to be in GRAY mode.
5070
5071 Example:
5072 [#1] image.jpg +to_gray
5073
5074 to_graya:
5075
5076 Force selected images to be in GRAYA mode.
5077
5078 to_pseudogray:
5079 _max_step>=0,_is_perceptual_constraint={ 0 | 1 },_bits_depth>0
5080
5081 Convert selected scalar images ([0-255]-valued) to pseudo-gray
5082 color images.
5083
5084 Default values: 'max_step=5', 'is_perceptual_constraint=1' and
5085 'bits_depth=8'.
5086 The original pseudo-gray technique has been introduced by Rich
5087 Franzen http://r0k.us/graphics/pseudoGrey.html.
5088 Extension of this technique to arbitrary increments for more tones,
5089 has been done by David Tschumperlé.
5090
5091 to_rgb:
5092
5093 Force selected images to be in RGB mode.
5094
5095 to_rgba:
5096
5097 Force selected images to be in RGBA mode.
5098
5099 transfer_histogram:
5100 [reference_image],_nb_levels>0,_color_channels
5101
5102 Transfer histogram of the specified reference image to selected im‐
5103 ages.
5104 Argument 'color channels' is the same as with command 'apply_chan‐
5105 nels'.
5106
5107 Default value: 'nb_levels=256' and 'color_channels=all'.
5108
5109 Example:
5110 [#1] image.jpg 100,100,1,3,"u([256,200,100])" +transfer_his‐
5111 togram[0] [1]
5112
5113 transfer_pca:
5114 [reference_image],_color_channels
5115
5116 Transfer mean and covariance matrix of specified vector-valued ref‐
5117 erence image to selected images.
5118 Argument 'color channels' is the same as with command 'apply_chan‐
5119 nels'.
5120
5121 Default value: 'color_channels=all'.
5122
5123 Example:
5124 [#1] sample lena,earth +transfer_pca[0] [1]
5125
5126 transfer_rgb:
5127 [target],_gamma>=0,_regularization>=0,_luminosity_con‐
5128 straints>=0,_rgb_resolution>=0,_is_constraints={ 0 | 1 }
5129
5130 Transfer colors from selected source images to selected reference
5131 image (given as argument).
5132 'gamma' determines the importance of color occurrences in the
5133 matching process (0=none to 1=huge).
5134 'regularization' determines the number of guided filter iterations
5135 to remove quantization effects.
5136 'luminosity_constraints' tells if luminosity constraints must be
5137 applied on non-confident matched colors.
5138 'is_constraints' tells if additional hard color constraints must be
5139 set (opens an interactive window).
5140
5141 Default values: 'gamma=0.3','regularization=8', 'luminosity_con‐
5142 straints=0.1', 'rgb_resolution=64' and 'is_constraints=0'.
5143
5144 Example:
5145 [#1] sample pencils,wall +transfer_rgb[0] [1],0,0.01
5146
5147 xyz2jzazbz:
5148
5149 Convert color representation of selected images from XYZ to RGB.
5150
5151 xyz2lab:
5152 illuminant={ 0=D50 | 1=D65 | 2=E } |
5153 (no arg)
5154
5155 Convert color representation of selected images from XYZ to Lab.
5156
5157 Default value: 'illuminant=2'.
5158
5159 xyz2rgb:
5160 illuminant={ 0=D50 | 1=D65 | 2=E } |
5161 (no arg)
5162
5163 Convert color representation of selected images from XYZ to RGB.
5164
5165 Default value: 'illuminant=2'.
5166
5167 xyz82rgb:
5168 illuminant={ 0=D50 | 1=D65 | 2=E } |
5169 (no arg)
5170
5171 Convert color representation of selected images from XYZ8 to RGB.
5172
5173 Default value: 'illuminant=2'.
5174
5175 ycbcr2rgb:
5176
5177 Convert color representation of selected images from YCbCr to RGB.
5178
5179 yiq2rgb:
5180
5181 Convert color representation of selected images from YIQ to RGB.
5182
5183 yiq82rgb:
5184
5185 Convert color representation of selected images from YIQ8 to RGB.
5186
5187 yuv2rgb:
5188
5189 Convert color representation of selected images from YUV to RGB.
5190
5191 yuv82rgb:
5192
5193 Convert selected images from YUV8 to RGB color bases.
5194
5195 12.7. Geometry Manipulation
5196 ---------------------
5197
5198 a (+):
5199 Shortcut for command 'append'.
5200
5201 append (+):
5202 [image],axis,_centering |
5203 axis,_centering
5204
5205 Append specified image to selected images, or all selected images
5206 together, along specified axis.
5207 (equivalent to shortcut command 'a').
5208
5209 'axis' can be { x | y | z | c }.
5210 Usual 'centering' values are { 0=left-justified | 0.5=centered |
5211 1=right-justified }.
5212
5213 Default value: 'centering=0'.
5214
5215 Example:
5216 [#1] image.jpg split y,10 reverse append y
5217 [#2] image.jpg repeat 5 { +rows[0] 0,{10+18*$>}% } remove[0] ap‐
5218 pend x,0.5
5219 [#3] image.jpg append[0] [0],y
5220
5221 append_tiles:
5222 _M>=0,_N>=0,0<=_centering_x<=1,0<=_centering_y<=1
5223
5224 Append MxN selected tiles as new images.
5225 If 'N' is set to 0, number of rows is estimated automatically.
5226 If 'M' is set to 0, number of columns is estimated automatically.
5227 If 'M' and 'N' are both set to '0', auto-mode is used.
5228 If 'M' or 'N' is set to 0, only a single image is produced.
5229 'centering_x' and 'centering_y' tells about the centering of tiles
5230 when they have different sizes.
5231
5232 Default values: 'M=0', 'N=0', 'centering_x=centering_y=0.5'.
5233
5234 Example:
5235 [#1] image.jpg split xy,4 append_tiles ,
5236
5237 apply_scales:
5238 "command",num‐
5239 ber_of_scales>0,_min_scale[%]>=0,_max_scale[%]>=0,_scale_gamma>0,_in‐
5240 terpolation
5241
5242 Apply specified command on different scales of selected images.
5243 'interpolation' can be { 0=none | 1=nearest | 2=average | 3=linear
5244 | 4=grid | 5=bicubic | 6=lanczos }.
5245
5246 Default value: 'min_scale=25%', 'max_scale=100%' and 'interpola‐
5247 tion=3'.
5248
5249 Example:
5250 [#1] image.jpg apply_scales "blur 5 sharpen 1000",4
5251
5252 autocrop (+):
5253 value1,value2,... |
5254 (no arg)
5255
5256 Autocrop selected images by specified vector-valued intensity.
5257 If no arguments are provided, cropping value is guessed.
5258
5259 Example:
5260 [#1] 400,400,1,3 fill_color 64,128,255 ellipse
5261 50%,50%,120,120,0,1,255 +autocrop
5262
5263 autocrop_components:
5264 _threshold[%],_min_area[%]>=0,_is_high_connectivity={ 0 | 1
5265 },_output_type={ 0=crop | 1=segmentation | 2=coordinates }
5266
5267 Autocrop and extract connected components in selected images, ac‐
5268 cording to a mask given as the last channel of
5269 each of the selected image (e.g. alpha-channel).
5270
5271 Default values: 'threshold=0%', 'min_area=0.1%', 'is_high_connec‐
5272 tivity=0' and 'output_type=1'.
5273
5274 Example:
5275 [#1] 256,256 noise 0.1,2 eq 1 dilate_circ 20 label_fg 0,1 normal‐
5276 ize 0,255 +neq 0 *[-1] 255 append c +autocrop_components ,
5277
5278 autocrop_seq:
5279 value1,value2,... | auto
5280
5281 Autocrop selected images using the crop geometry of the last one by
5282 specified vector-valued intensity,
5283 or by automatic guessing the cropping value.
5284
5285 Default value: auto mode.
5286
5287 Example:
5288 [#1] image.jpg +fill[-1] 0 ellipse[-1] 50%,50%,30%,20%,0,1,1 au‐
5289 tocrop_seq 0
5290
5291 channels:
5292 c0[%],_c1[%]
5293
5294 Keep only specified channels of selected images.
5295 Dirichlet boundary is used when specified channels are out of
5296 range.
5297
5298 Default value: 'c1=c0'.
5299
5300 Example:
5301 [#1] image.jpg channels 0,1
5302 [#2] image.jpg luminance channels 0,2
5303
5304 columns:
5305 x0[%],_x1[%]
5306
5307 Keep only specified columns of selected images.
5308 Dirichlet boundary is used when specified columns are out of range.
5309
5310 Default value: 'x1=x0'.
5311
5312 Example:
5313 [#1] image.jpg columns -25%,50%
5314
5315 z (+):
5316 Shortcut for command 'crop'.
5317
5318 crop (+):
5319 x0[%],x1[%],_boundary_conditions |
5320 x0[%],y0[%],x1[%],y1[%],_boundary_conditions |
5321 x0[%],y0[%],z0[%],x1[%],y1[%],z1[%],_boundary_conditions |
5322 x0[%],y0[%],z0[%],c0[%],x1[%],y1[%],z1[%],c1[%],_boundary_condi‐
5323 tions
5324
5325 Crop selected images with specified region coordinates.
5326 (equivalent to shortcut command 'z').
5327
5328 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
5329 | 3=mirror }.
5330
5331 Default value: 'boundary_conditions=0'.
5332
5333 Example:
5334 [#1] image.jpg +crop -230,-230,280,280,1 crop[0]
5335 -230,-230,280,280,0
5336 [#2] image.jpg crop 25%,25%,75%,75%
5337
5338 diagonal:
5339
5340 Transform selected vectors as diagonal matrices.
5341
5342 Example:
5343 [#1] 1,10,1,1,'y' +diagonal
5344
5345 edgels:
5346 x0,y0 |
5347 (no arg)
5348
5349 Retrieve list of edgels (and their normals) that go around a 2D bi‐
5350 nary silhouette.
5351 When specified, arguments 'x0,y0' are the 2D coordinates of the
5352 starting point (must be located at the edge of the binary silhouette).
5353 Output image has 3 channels '[x,y,n]' where 'x' and 'y' are the 2D
5354 coordinates of the edgel point, and 'n' is the orientation of its asso‐
5355 ciated canonical normal (can be { 0=[1,0]
5356 | 1=[0,1] | 2=[-1,0] | 3=[0,-1] }.
5357
5358 elevate:
5359 _depth,_is_plain={ 0 | 1 },_is_colored={ 0 | 1 }
5360
5361 Elevate selected 2D images into 3D volumes.
5362
5363 Default values: 'depth=64', 'is_plain=1' and 'is_colored=1'.
5364
5365 expand_x:
5366 size_x>=0,_boundary_conditions={ 0=dirichlet | 1=neumann | 2=pe‐
5367 riodic | 3=mirror }
5368
5369 Expand selected images along the x-axis.
5370
5371 Default value: 'boundary_conditions=0'.
5372
5373 Example:
5374 [#1] image.jpg expand_x 30,0
5375
5376 expand_xy:
5377 size>=0,_boundary_conditions={ 0=dirichlet | 1=neumann | 2=peri‐
5378 odic | 3=mirror }
5379
5380 Expand selected images along the xy-axes.
5381
5382 Default value: 'boundary_conditions=0'.
5383
5384 Example:
5385 [#1] image.jpg expand_xy 30,0
5386
5387 expand_xyz:
5388 size>=0,_boundary_conditions={ 0=dirichlet | 1=neumann | 2=peri‐
5389 odic | 3=mirror }
5390
5391 Expand selected images along the xyz-axes.
5392
5393 Default value: 'boundary_conditions=0'.
5394
5395 expand_y:
5396 size_y>=0,_boundary_conditions={ 0=dirichlet | 1=neumann | 2=pe‐
5397 riodic | 3=mirror }
5398
5399 Expand selected images along the y-axis.
5400
5401 Default value: 'boundary_conditions=0'.
5402
5403 Example:
5404 [#1] image.jpg expand_y 30,0
5405
5406 expand_z:
5407 size_z>=0,_boundary_conditions={ 0=dirichlet | 1=neumann | 2=pe‐
5408 riodic | 3=mirror }
5409
5410 Expand selected images along the z-axis.
5411
5412 Default value: 'boundary_conditions=0'.
5413
5414 extract:
5415 "condition",_output_type={ 0=xyzc-coordinates | 1=xyz-coordinates
5416 | 2=scalar-values | 3=vector-values }
5417
5418 Extract a list of coordinates or values from selected image, where
5419 specified mathematical condition holds.
5420 For N coordinates matching, result is a 1xNx1x4 image.
5421
5422 Default values: 'output_type=0'.
5423
5424 Example:
5425 [#1] sp lena +extract "norm(I)>128",3
5426
5427 extract_region:
5428 [label_image],_extract_xyz_coordinates={ 0 | 1 },_la‐
5429 bel_1,...,_label_M
5430
5431 Extract all pixels of selected images whose corresponding label in
5432 '[label_image]' is equal to 'label_m',
5433 and output them as M column images.
5434
5435 Default value: 'extract_xyz_coordinates=0'.
5436
5437 Example:
5438 [#1] image.jpg +blur 3 quantize. 4,0 +extract_region[0] [1],0,1,3
5439
5440 montage:
5441 "_layout_code",_montage_mode={ 0<=centering<=1 | 2<=scale+2<=3
5442 },_output_mode={ 0=single layer | 1=multiple layers },"_processing_com‐
5443 mand"
5444
5445 Create a single image montage from selected images, according to
5446 specified layout code :
5447 * 'X' to assemble all images using an automatically estimated lay‐
5448 out.
5449 * 'H' to assemble all images horizontally.
5450 * 'V' to assemble all images vertically.
5451 * 'A' to assemble all images as an horizontal array.
5452 * 'B' to assemble all images as a vertical array.
5453 * 'Ha:b' to assemble two blocks 'a' and 'b' horizontally.
5454 * 'Va:b' to assemble two blocks 'a' and 'b' vertically.
5455 * 'Ra' to rotate a block 'a' by 90 deg. ('RRa' for 180 deg. and
5456 'RRRa' for 270 deg.).
5457 * 'Ma' to mirror a block 'a' along the X-axis ('MRRa' for the Y-
5458 axis).
5459 A block 'a' can be an image index (treated periodically) or a
5460 nested layout expression 'Hb:c','Vb:c','Rb' or
5461 'Mb' itself.
5462 For example, layout code 'H0:V1:2' creates an image where image [0]
5463 is on the left, and images [1] and [2]
5464 vertically packed on the right.
5465
5466 Default values: 'layout_code=X', 'montage_mode=2', output_mode='0'
5467 and 'processing_command=""'.
5468
5469 Example:
5470 [#1] image.jpg sample ? +plasma[0] shape_cupid 256 normalize
5471 0,255 frame 3,3,0 frame 10,10,255 to_rgb +montage A +montage[^-1]
5472 H1:V0:VH2:1H0:3
5473
5474 mirror (+):
5475 { x | y | z }...{ x | y | z }
5476
5477 Mirror selected images along specified axes.
5478
5479 Example:
5480 [#1] image.jpg +mirror y +mirror[0] c
5481 [#2] image.jpg +mirror x +mirror y append_tiles 2,2
5482
5483 permute (+):
5484 permutation_string
5485
5486 Permute selected image axes by specified permutation.
5487 'permutation' is a combination of the character set {x|y|z|c},
5488 e.g. 'xycz', 'cxyz', ...
5489
5490 Example:
5491 [#1] image.jpg permute yxzc
5492
5493 r (+):
5494 Shortcut for command 'resize'.
5495
5496 resize (+):
5497 {[image_w] | width>0[%]},_{[image_h] | height>0[%]},_{[image_d] |
5498 depth>0[%]},_{[image_s] | spectrum>0[%]},_interpolation,_boundary_con‐
5499 ditions,_ax,_ay,_az,_ac
5500
5501 Resize selected images with specified geometry.
5502 (equivalent to shortcut command 'r').
5503
5504 'interpolation' can be { -1=none (memory content) | 0=none |
5505 1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }.
5506 'boundary_conditions' has different meanings, according to the cho‐
5507 sen 'interpolation' mode :
5508 . When 'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions'
5509 is meaningless.
5510 . When 'interpolation==0', 'boundary_conditions' can be { 0=dirich‐
5511 let | 1=neumann | 2=periodic | 3=mirror }.
5512 . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be
5513 { 0=none | 1=neumann }.
5514 'ax,ay,az,ac' set the centering along each axis when 'interpola‐
5515 tion=0 or 4'
5516 (set to '0' by default, must be defined in range [0,1]).
5517
5518 Default values: 'interpolation=1', 'boundary_conditions=0' and
5519 'ax=ay=az=ac=0'.
5520
5521 Example:
5522 [#1] image.jpg +resize[-1] 256,128,1,3,2 +resize[-1]
5523 120%,120%,1,3,0,1,0.5,0.5 +resize[-1] 120%,120%,1,3,0,0,0.2,0.2 +re‐
5524 size[-1] [0],[0],1,3,4
5525
5526 ri:
5527 Shortcut for command 'resize_as_image'.
5528
5529 resize_as_image:
5530 [reference],_interpolation,_boundary_conditions,_ax,_ay,_az,_ac
5531
5532 Resize selected images to the geometry of specified [reference] im‐
5533 age.
5534 (equivalent to shortcut command 'ri').
5535
5536 Default values: 'interpolation=1', 'boundary_conditions=0' and
5537 'ax=ay=az=ac=0'.
5538
5539 Example:
5540 [#1] image.jpg sample duck +resize_as_image[-1] [-2]
5541
5542 resize_mn:
5543 width[%]>=0,_height[%]>=0,_depth[%]>=0,_B_value,_C_value
5544
5545 Resize selected images with Mitchell-Netravali filter (cubic).
5546 For details about the method, see:
5547 https://de.wikipedia.org/wiki/Mitchell-Netravali-Filter.
5548
5549 Default values: 'height=100%', 'depth=100%', 'B=0.3333' and
5550 'C=0.3333'.
5551
5552 Example:
5553 [#1] image.jpg resize2dx 32 resize_mn 800%,800%
5554
5555 resize_pow2:
5556 _interpolation,_boundary_conditions,_ax,_ay,_az,_ac
5557
5558 Resize selected images so that each dimension is a power of 2.
5559 'interpolation' can be { -1=none (memory content) | 0=none |
5560 1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }.
5561 'boundary_conditions' has different meanings, according to the cho‐
5562 sen 'interpolation' mode :
5563 . When 'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions'
5564 is meaningless.
5565 . When 'interpolation==0', 'boundary_conditions' can be { 0=dirich‐
5566 let | 1=neumann | 2=periodic | 3=mirror }.
5567 . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be
5568 { 0=none | 1=neumann }.
5569 'ax,ay,az,ac' set the centering along each axis when 'interpola‐
5570 tion=0'
5571 (set to '0' by default, must be defined in range [0,1]).
5572
5573 Default values: 'interpolation=0', 'boundary_conditions=0' and
5574 'ax=ay=az=ac=0'.
5575
5576 Example:
5577 [#1] image.jpg +resize_pow2[-1] 0
5578
5579 rr2d:
5580 Shortcut for command 'resize_ratio2d'.
5581
5582 resize_ratio2d:
5583 width>0,height>0,_mode={ 0=inside | 1=outside | 2=padded
5584 },0=<_interpolation<=6
5585
5586 Resize selected images while preserving their aspect ratio.
5587 (equivalent to shortcut command 'rr2d').
5588
5589 Default values: 'mode=0' and 'interpolation=6'.
5590
5591 r2din:
5592 Shortcut for command 'resize2din'.
5593
5594 resize2din:
5595 width[%]>0,_height[%]>0,_interpolation,_boundary_condi‐
5596 tions,_ax,_ay,_az,_ac
5597
5598 Resize selected images so the size is not larger than
5599 'width'x'height' while preserving 2D ratio.
5600 (equivalent to shortcut command 'r2din').
5601
5602 'interpolation' can be { -1=none (memory content) | 0=none |
5603 1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }.
5604 'boundary_conditions' has different meanings, according to the cho‐
5605 sen 'interpolation' mode :
5606 . When 'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions'
5607 is meaningless.
5608 . When 'interpolation==0', 'boundary_conditions' can be { 0=dirich‐
5609 let | 1=neumann | 2=periodic | 3=mirror }.
5610 . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be
5611 { 0=none | 1=neumann }.
5612 'ax,ay,az,ac' set the centering along each axis when 'interpola‐
5613 tion=0'
5614 (set to '0' by default, must be defined in range [0,1]).
5615
5616 Default values: 'height=100%', 'interpolation=3', 'boundary_condi‐
5617 tions=0' and 'ax=ay=az=ac=0'.
5618
5619 Example:
5620 [#1] image.jpg +resize2din 100,100 append x
5621
5622 r3din:
5623 Shortcut for command 'resize3din'.
5624
5625 resize3din:
5626 width[%]>0,_height[%]>0,_depth[%]>0,_interpolation,_boundary_con‐
5627 ditions,_ax,_ay,_az,_ac
5628
5629 Resize selected images so the size is not larger than
5630 'width'x'height'x'depth' while preserving 3D ratio.
5631 (equivalent to shortcut command 'r3din').
5632
5633 'interpolation' can be { -1=none (memory content) | 0=none |
5634 1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }.
5635 'boundary_conditions' has different meanings, according to the cho‐
5636 sen 'interpolation' mode :
5637 . When 'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions'
5638 is meaningless.
5639 . When 'interpolation==0', 'boundary_conditions' can be { 0=dirich‐
5640 let | 1=neumann | 2=periodic | 3=mirror }.
5641 . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be
5642 { 0=none | 1=neumann }.
5643 'ax,ay,az,ac' set the centering along each axis when 'interpola‐
5644 tion=0'
5645 (set to '0' by default, must be defined in range [0,1]).
5646
5647 Default values: 'height=100%', 'depth=100%', 'interpolation=3',
5648 'boundary_conditions=0' and 'ax=ay=az=ac=0'.
5649
5650 r2dout:
5651 Shortcut for command 'resize2dout'.
5652
5653 resize2dout:
5654 width[%]>0,_height[%]>0,_interpolation,_boundary_condi‐
5655 tions,_ax,_ay,_az,_ac
5656
5657 Resize selected images so the size is not smaller than
5658 'width'x'height' while preserving 2D ratio.
5659 (equivalent to shortcut command 'r2dout').
5660
5661 'interpolation' can be { -1=none (memory content) | 0=none |
5662 1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }.
5663 'boundary_conditions' has different meanings, according to the cho‐
5664 sen 'interpolation' mode :
5665 . When 'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions'
5666 is meaningless.
5667 . When 'interpolation==0', 'boundary_conditions' can be { 0=dirich‐
5668 let | 1=neumann | 2=periodic | 3=mirror }.
5669 . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be
5670 { 0=none | 1=neumann }.
5671 'ax,ay,az,ac' set the centering along each axis when 'interpola‐
5672 tion=0'
5673 (set to '0' by default, must be defined in range [0,1]).
5674
5675 Default values: 'height=100%', 'interpolation=3', 'boundary_condi‐
5676 tions=0' and 'ax=ay=az=ac=0'.
5677
5678 Example:
5679 [#1] image.jpg +resize2dout 100,100 append x
5680
5681 r3dout:
5682 Shortcut for command 'resize3dout'.
5683
5684 resize3dout:
5685 width[%]>0,_height[%]>0,_depth[%]>0,_interpolation,_boundary_con‐
5686 ditions,_ax,_ay,_az,_ac
5687
5688 Resize selected images so the size is not smaller than
5689 'width'x'height'x'depth' while preserving 3D ratio.
5690 (equivalent to shortcut command 'r3dout').
5691
5692 'interpolation' can be { -1=none (memory content) | 0=none |
5693 1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }.
5694 'boundary_conditions' has different meanings, according to the cho‐
5695 sen 'interpolation' mode :
5696 . When 'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions'
5697 is meaningless.
5698 . When 'interpolation==0', 'boundary_conditions' can be { 0=dirich‐
5699 let | 1=neumann | 2=periodic | 3=mirror }.
5700 . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be
5701 { 0=none | 1=neumann }.
5702 'ax,ay,az,ac' set the centering along each axis when 'interpola‐
5703 tion=0'
5704 (set to '0' by default, must be defined in range [0,1]).
5705
5706 Default values: 'height=100%', 'depth=100%', 'interpolation=3',
5707 'boundary_conditions=0' and 'ax=ay=az=ac=0'.
5708
5709 r2dx:
5710 Shortcut for command 'resize2dx'.
5711
5712 resize2dx:
5713 width[%]>0,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac
5714
5715 Resize selected images along the x-axis, while preserving 2D ratio.
5716 (equivalent to shortcut command 'r2dx').
5717
5718 'interpolation' can be { -1=none (memory content) | 0=none |
5719 1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }.
5720 'boundary_conditions' has different meanings, according to the cho‐
5721 sen 'interpolation' mode :
5722 . When 'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions'
5723 is meaningless.
5724 . When 'interpolation==0', 'boundary_conditions' can be { 0=dirich‐
5725 let | 1=neumann | 2=periodic | 3=mirror }.
5726 . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be
5727 { 0=none | 1=neumann }.
5728 'ax,ay,az,ac' set the centering along each axis when 'interpola‐
5729 tion=0'
5730 (set to '0' by default, must be defined in range [0,1]).
5731
5732 Default values: 'interpolation=3', 'boundary_conditions=0' and
5733 'ax=ay=az=ac=0'.
5734
5735 Example:
5736 [#1] image.jpg +resize2dx 100,2 append x
5737
5738 r2dy:
5739 Shortcut for command 'resize2dy'.
5740
5741 resize2dy:
5742 height[%]>=0,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac
5743
5744 Resize selected images along the y-axis, while preserving 2D ratio.
5745 (equivalent to shortcut command 'r2dy').
5746
5747 'interpolation' can be { -1=none (memory content) | 0=none |
5748 1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }.
5749 'boundary_conditions' has different meanings, according to the cho‐
5750 sen 'interpolation' mode :
5751 . When 'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions'
5752 is meaningless.
5753 . When 'interpolation==0', 'boundary_conditions' can be { 0=dirich‐
5754 let | 1=neumann | 2=periodic | 3=mirror }.
5755 . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be
5756 { 0=none | 1=neumann }.
5757 'ax,ay,az,ac' set the centering along each axis when 'interpola‐
5758 tion=0'
5759 (set to '0' by default, must be defined in range [0,1]).
5760
5761 Default values: 'interpolation=3', 'boundary_conditions=0' and
5762 'ax=ay=az=ac=0'.
5763
5764 Example:
5765 [#1] image.jpg +resize2dy 100,2 append x
5766
5767 r3dx:
5768 Shortcut for command 'resize3dx'.
5769
5770 resize3dx:
5771 width[%]>0,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac
5772
5773 Resize selected images along the x-axis, while preserving 3D ratio.
5774 (equivalent to shortcut command 'r3dx').
5775
5776 'interpolation' can be { -1=none (memory content) | 0=none |
5777 1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }.
5778 'boundary_conditions' has different meanings, according to the cho‐
5779 sen 'interpolation' mode :
5780 . When 'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions'
5781 is meaningless.
5782 . When 'interpolation==0', 'boundary_conditions' can be { 0=dirich‐
5783 let | 1=neumann | 2=periodic | 3=mirror }.
5784 . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be
5785 { 0=none | 1=neumann }.
5786 'ax,ay,az,ac' set the centering along each axis when 'interpola‐
5787 tion=0'
5788 (set to '0' by default, must be defined in range [0,1]).
5789
5790 Default values: 'interpolation=3', 'boundary_conditions=0' and
5791 'ax=ay=az=ac=0'.
5792
5793 r3dy:
5794 Shortcut for command 'resize3dy'.
5795
5796 resize3dy:
5797 height[%]>0,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac
5798
5799 Resize selected images along the y-axis, while preserving 3D ratio.
5800 (equivalent to shortcut command 'r3dy').
5801
5802 'interpolation' can be { -1=none (memory content) | 0=none |
5803 1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }.
5804 'boundary_conditions' has different meanings, according to the cho‐
5805 sen 'interpolation' mode :
5806 . When 'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions'
5807 is meaningless.
5808 . When 'interpolation==0', 'boundary_conditions' can be { 0=dirich‐
5809 let | 1=neumann | 2=periodic | 3=mirror }.
5810 . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be
5811 { 0=none | 1=neumann }.
5812 'ax,ay,az,ac' set the centering along each axis when 'interpola‐
5813 tion=0'
5814 (set to '0' by default, must be defined in range [0,1]).
5815
5816 Default values: 'interpolation=3', 'boundary_conditions=0' and
5817 'ax=ay=az=ac=0'.
5818
5819 r3dz:
5820 Shortcut for command 'resize3dz'.
5821
5822 resize3dz:
5823 depth[%]>0,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac
5824
5825 Resize selected images along the z-axis, while preserving 3D ratio.
5826 (equivalent to shortcut command 'r3dz').
5827
5828 'interpolation' can be { -1=none (memory content) | 0=none |
5829 1=nearest | 2=average | 3=linear | 4=grid | 5=bicubic | 6=lanczos }.
5830 'boundary_conditions' has different meanings, according to the cho‐
5831 sen 'interpolation' mode :
5832 . When 'interpolation=={ -1 | 1 | 2 | 4 }', 'boundary_conditions'
5833 is meaningless.
5834 . When 'interpolation==0', 'boundary_conditions' can be { 0=dirich‐
5835 let | 1=neumann | 2=periodic | 3=mirror }.
5836 . When 'interpolation=={ 3 | 5 | 6 }', 'boundary_conditions' can be
5837 { 0=none | 1=neumann }.
5838 'ax,ay,az,ac' set the centering along each axis when 'interpola‐
5839 tion=0'
5840 (set to '0' by default, must be defined in range [0,1]).
5841
5842 Default values: 'interpolation=3', 'boundary_conditions=0' and
5843 'ax=ay=az=ac=0'.
5844
5845 rotate (+):
5846 angle,_interpolation,_boundary_conditions,_center_x[%],_cen‐
5847 ter_y[%] |
5848 u,v,w,angle,interpolation,boundary_conditions,_center_x[%],_cen‐
5849 ter_y[%],_center_z[%]
5850
5851 Rotate selected images with specified angle (in deg.), and option‐
5852 ally 3D axis (u,v,w).
5853 'interpolation' can be { 0=none | 1=linear | 2=bicubic }.
5854 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
5855 | 3=mirror }.
5856 When a rotation center (cx,cy,_cz) is specified, the size of the
5857 image is preserved.
5858
5859 Default values: 'interpolation=1', 'boundary_conditions=0' and
5860 'center_x=center_y=(undefined)'.
5861
5862 Example:
5863 [#1] image.jpg +rotate -25,1,2,50%,50% rotate[0] 25
5864
5865 rotate_tileable:
5866 angle,_max_size_factor>=0
5867
5868 Rotate selected images by specified angle and make them tileable.
5869 If resulting size of an image is too big, the image is replaced by
5870 a 1x1 image.
5871
5872 Default values: 'max_size_factor=8'.
5873
5874 rows:
5875 y0[%],_y1[%]
5876
5877 Keep only specified rows of selected images.
5878 Dirichlet boundary conditions are used when specified rows are out
5879 of range.
5880
5881 Default value: 'y1=y0'.
5882
5883 Example:
5884 [#1] image.jpg rows -25%,50%
5885
5886 scale2x:
5887
5888 Resize selected images using the Scale2x algorithm.
5889
5890 Example:
5891 [#1] image.jpg threshold 50% resize 50%,50% +scale2x
5892
5893 scale3x:
5894
5895 Resize selected images using the Scale3x algorithm.
5896
5897 Example:
5898 [#1] image.jpg threshold 50% resize 33%,33% +scale3x
5899
5900 scale_dcci2x:
5901 _edge_threshold>=0,_exponent>0,_extend_1px={ 0=false | 1=true }
5902
5903 Double image size using directional cubic convolution interpola‐
5904 tion,
5905 as described in https://en.wikipedia.org/wiki/Directional_Cu‐
5906 bic_Convolution_Interpolation.
5907
5908 Default values: 'edge_threshold=1.15', 'exponent=5' and 'ex‐
5909 tend_1px=0'.
5910
5911 Example:
5912 [#1] image.jpg +scale_dcci2x ,
5913
5914 seamcarve:
5915 _width[%]>=0,_height[%]>=0,_is_priority_channel={ 0 | 1 },_is_an‐
5916 tialiasing={ 0 | 1 },_maximum_seams[%]>=0
5917
5918 Resize selected images with specified 2D geometry, using the seam-
5919 carving algorithm.
5920
5921 Default values: 'height=100%', 'is_priority_channel=0', 'is_an‐
5922 tialiasing=1' and 'maximum_seams=25%'.
5923
5924 Example:
5925 [#1] image.jpg seamcarve 60%
5926
5927 shift (+):
5928 vx[%],_vy[%],_vz[%],_vc[%],_boundary_conditions,_interpolation={
5929 0=nearest_neighbor | 1=linear }
5930
5931 Shift selected images by specified displacement vector.
5932 Displacement vector can be non-integer in which case linear inter‐
5933 polation should be chosen.
5934 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
5935 | 3=mirror }.
5936
5937 Default value: 'boundary_conditions=0' and 'interpolation=0'.
5938
5939 Example:
5940 [#1] image.jpg +shift[0] 50%,50%,0,0,0 +shift[0] 50%,50%,0,0,1
5941 +shift[0] 50%,50%,0,0,2
5942
5943 shrink_x:
5944 size_x>=0
5945
5946 Shrink selected images along the x-axis.
5947
5948 Example:
5949 [#1] image.jpg shrink_x 30
5950
5951 shrink_xy:
5952 size>=0
5953
5954 Shrink selected images along the xy-axes.
5955
5956 Example:
5957 [#1] image.jpg shrink_xy 30
5958
5959 shrink_xyz:
5960 size>=0
5961
5962 Shrink selected images along the xyz-axes.
5963
5964 shrink_y:
5965 size_y>=0
5966
5967 Shrink selected images along the y-axis.
5968
5969 Example:
5970 [#1] image.jpg shrink_y 30
5971
5972 shrink_z:
5973 size_z>=0
5974
5975 Shrink selected images along the z-axis.
5976
5977 slices:
5978 z0[%],_z1[%]
5979
5980 Keep only specified slices of selected images.
5981 Dirichlet boundary conditions are used when specified slices are
5982 out of range.
5983
5984 Default value: 'z1=z0'.
5985
5986 sort (+):
5987 _ordering={ + | - },_axis={ x | y | z | c }
5988
5989 Sort pixel values of selected images.
5990 If 'axis' is specified, the sorting is done according to the data
5991 of the first column/row/slice/channel
5992 of selected images.
5993
5994 Default values: 'ordering=+' and 'axis=(undefined)'.
5995
5996 Example:
5997 [#1] 64 rand 0,100 +sort display_graph 400,300,3
5998
5999 s (+):
6000 Shortcut for command 'split'.
6001
6002 split (+):
6003 { x | y | z | c }...{ x | y | z | c },_split_mode |
6004 keep_splitting_values={ + | - },_{ x | y | z | c }...{ x | y | z
6005 | c },value1,_value2,... |
6006 (no arg)
6007
6008 Split selected images along specified axes, or regarding to a se‐
6009 quence of scalar values
6010 (optionally along specified axes too).
6011 (equivalent to shortcut command 's').
6012
6013 'split_mode' can be { 0=split according to constant values |
6014 >0=split in N parts | <0=split in parts of size -N }.
6015
6016 Default value: 'split_mode=-1'.
6017
6018 Example:
6019 [#1] image.jpg split c
6020 [#2] image.jpg split y,3
6021 [#3] image.jpg split x,-128
6022 [#4] 1,20,1,1,"1,2,3,4" +split -,2,3 append[1--1] y
6023 [#5] (1,2,2,3,3,3,4,4,4,4) +split x,0 append[1--1] y
6024
6025 split_tiles:
6026 M!=0,_N!=0,_is_homogeneous={ 0 | 1 }
6027
6028 Split selected images as a MxN array of tiles.
6029 If M or N is negative, it stands for the tile size instead.
6030
6031 Default values: 'N=M' and 'is_homogeneous=0'.
6032
6033 Example:
6034 [#1] image.jpg +local split_tiles 5,4 blur 3,0 sharpen 700 ap‐
6035 pend_tiles 4,5 done
6036
6037 undistort:
6038 -1<=_amplitude<=1,_aspect_ratio,_zoom,_center_x[%],_cen‐
6039 ter_y[%],_boundary_conditions
6040
6041 Correct barrel/pincushion distortions occurring with wide-angle
6042 lens.
6043 References:
6044 [1] Zhang Z. (1999). Flexible camera calibration by viewing a plane
6045 from unknown orientation.
6046 [2] Andrew W. Fitzgibbon (2001). Simultaneous linear estimation of
6047 multiple view geometry and lens distortion.
6048 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
6049 | 3=mirror }.
6050
6051 Default values: 'amplitude=0.25', 'aspect_ratio=0', 'zoom=0', 'cen‐
6052 ter_x=center_y=50%' and 'boundary_conditions=0'.
6053
6054 y (+):
6055 Shortcut for command 'unroll'.
6056
6057 unroll (+):
6058 _axis={ x | y | z | c }
6059
6060 Unroll selected images along specified axis.
6061 (equivalent to shortcut command 'y').
6062
6063 Default value: 'axis=y'.
6064
6065 Example:
6066 [#1] (1,2,3;4,5,6;7,8,9) +unroll y
6067
6068 upscale_smart:
6069 width[%],_height[%],_depth,_smoothness>=0,_anisot‐
6070 ropy=[0,1],sharpening>=0
6071
6072 Upscale selected images with an edge-preserving algorithm.
6073
6074 Default values: 'height=100%', 'depth=100%', 'smoothness=2', 'an‐
6075 isotropy=0.4' and 'sharpening=10'.
6076
6077 Example:
6078 [#1] image.jpg resize2dy 100 +upscale_smart 500%,500% append x
6079
6080 warp (+):
6081 [warping_field],_mode,_interpolation,_boundary_condi‐
6082 tions,_nb_frames>0
6083
6084 Warp selected images with specified displacement field.
6085 'mode' can be { 0=backward-absolute | 1=backward-relative | 2=for‐
6086 ward-absolute | 3=forward-relative }.
6087 'interpolation' can be { 0=nearest-neighbor | 1=linear | 2=cubic }.
6088 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
6089 | 3=mirror }.
6090
6091 Default values: 'mode=0', 'interpolation=1', 'boundary_condi‐
6092 tions=0' and 'nb_frames=1'.
6093
6094 Example:
6095 [#1] image.jpg
6096 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))'
6097 warp[-2] [-1],1,1,0 quiver[-1] [-1],10,1,1,1,100
6098
6099 Tutorial: https://gmic.eu/oldtutorial/_warp
6100
6101 warp_patch:
6102 [warp‐
6103 ing_field],patch_width>=1,_patch_height>=1,_patch_depth>=1,_std_fac‐
6104 tor>0,_boundary_conditions.
6105
6106 Patch-warp selected images, with specified 2D or 3D displacement
6107 field (in backward-absolute mode).
6108 Argument 'std_factor' sets the std of the gaussian weights for the
6109 patch overlap,
6110 equal to 'std = std_factor*patch_size'.
6111 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
6112 | 3=mirror }.
6113
6114 Default values: 'std_factor=0.3' and 'boundary_conditions=3'.
6115
6116 warp_rbf:
6117 xs0[%],ys0[%],xt0[%],yt0[%],...,xsN[%],ysN[%],xtN[%],ytN[%]
6118
6119 Warp selected images using RBF-based interpolation.
6120 Each argument (xsk,ysk)-(xtk,ytk) corresponds to the coordinates of
6121 a keypoint
6122 respectively on the source and target images. The set of all key‐
6123 points define the overall image deformation.
6124
6125 Example:
6126 [#1] image.jpg +warp_rbf
6127 0,0,0,0,100%,0,100%,0,100%,100%,100%,100%,0,100%,0,100%,50%,50%,70%,50%,25%,25%,25%,75%
6128
6129 12.8. Filtering
6130 ---------
6131
6132 bandpass:
6133 _min_freq[%],_max_freq[%]
6134
6135 Apply bandpass filter to selected images.
6136
6137 Default values: 'min_freq=0' and 'max_freq=20%'.
6138
6139 Example:
6140 [#1] image.jpg bandpass 1%,3%
6141
6142 Tutorial: https://gmic.eu/oldtutorial/_bandpass
6143
6144 bilateral (+):
6145 [guide],std_deviation_s[%]>=0,std_deviation_r[%]>=0,_sam‐
6146 pling_s>=0,_sampling_r>=0 |
6147 std_deviation_s[%]>=0,std_deviation_r[%]>=0,_sampling_s>=0,_sam‐
6148 pling_r>=0
6149
6150 Blur selected images by anisotropic (eventually joint/cross) bilat‐
6151 eral filtering.
6152 If a guide image is provided, it is used for drive the smoothing
6153 filter.
6154 A guide image must be of the same xyz-size as the selected images.
6155 Set 'sampling' arguments to '0' for automatic adjustment.
6156
6157 Example:
6158 [#1] image.jpg repeat 5 { bilateral 10,10 }
6159
6160 b (+):
6161 Shortcut for command 'blur'.
6162
6163 blur (+):
6164 std_deviation>=0[%],_boundary_conditions,_kernel |
6165 axes,std_deviation>=0[%],_boundary_conditions,_kernel
6166
6167 Blur selected images by a deriche or gaussian filter (recursive im‐
6168 plementation).
6169 (equivalent to shortcut command 'b').
6170
6171 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
6172 | 3=mirror }.
6173 'kernel' can be { 0=deriche | 1=gaussian }.
6174 When specified, argument 'axes' is a sequence of { x | y | z | c }.
6175 Specifying one axis multiple times apply also the blur multiple
6176 times.
6177
6178 Default values: 'boundary_conditions=1' and 'kernel=1'.
6179
6180 Example:
6181 [#1] image.jpg +blur 5,0 +blur[0] 5,1
6182 [#2] image.jpg +blur y,10%
6183
6184 Tutorial: https://gmic.eu/oldtutorial/_blur
6185
6186 blur_angular:
6187 amplitude[%],_center_x[%],_center_y[%]
6188
6189 Apply angular blur on selected images.
6190
6191 Default values: 'center_x=center_y=50%'.
6192
6193 Example:
6194 [#1] image.jpg blur_angular 2%
6195
6196 Tutorial: https://gmic.eu/oldtutorial/_blur_angular
6197
6198 blur_bloom:
6199 _amplitude>=0,_ratio>=0,_nb_iter>=0,_blend_operator={ + | max |
6200 min },_kernel={ 0=deriche | 1=gaussian | 2=box | 3=triangle | 4=qua‐
6201 dratic },_normalize_scales={ 0 | 1 },_axes
6202
6203 Apply a bloom filter that blend multiple blur filters of different
6204 radii,
6205 resulting in a larger but sharper glare than a simple blur.
6206 When specified, argument 'axes' is a sequence of { x | y | z | c }.
6207 Specifying one axis multiple times apply also the blur multiple
6208 times.
6209 Reference: Masaki Kawase, "Practical Implementation of High Dynamic
6210 Range Rendering", GDC 2004.
6211
6212 Default values: 'amplitude=1', 'ratio=2', 'nb_iter=5', 'blend_oper‐
6213 ator=+', 'kernel=1', 'normalize_scales=0' and 'axes=(all)'
6214
6215 Example:
6216 [#1] image.jpg blur_bloom ,
6217
6218 blur_linear:
6219 amplitude1[%],_amplitude2[%],_angle,_boundary_conditions={
6220 0=dirichlet | 1=neumann }
6221
6222 Apply linear blur on selected images, with specified angle and am‐
6223 plitudes.
6224
6225 Default values: 'amplitude2=0', 'angle=0' and 'boundary_condi‐
6226 tions=1'.
6227
6228 Example:
6229 [#1] image.jpg blur_linear 10,0,45
6230
6231 Tutorial: https://gmic.eu/oldtutorial/_blur_linear
6232
6233 blur_radial:
6234 amplitude[%],_center_x[%],_center_y[%]
6235
6236 Apply radial blur on selected images.
6237
6238 Default values: 'center_x=center_y=50%'.
6239
6240 Example:
6241 [#1] image.jpg blur_radial 2%
6242
6243 Tutorial: https://gmic.eu/oldtutorial/_blur_radial
6244
6245 blur_selective:
6246 sigma>=0,_edges>0,_nb_scales>0
6247
6248 Blur selected images using selective gaussian scales.
6249
6250 Default values: 'sigma=5', 'edges=0.5' and 'nb_scales=5'.
6251
6252 Example:
6253 [#1] image.jpg noise 20 cut 0,255 +local[-1] repeat 4 { blur_se‐
6254 lective , } done
6255
6256 Tutorial: https://gmic.eu/oldtutorial/_blur_selective
6257
6258 blur_x:
6259 amplitude[%]>=0,_boundary_conditions={ 0=dirichlet | 1=neumann |
6260 2=periodic | 3=mirror }
6261
6262 Blur selected images along the x-axis.
6263
6264 Default value: 'boundary_conditions=1'.
6265
6266 Example:
6267 [#1] image.jpg +blur_x 6
6268
6269 Tutorial: https://gmic.eu/oldtutorial/_blur_x
6270
6271 blur_xy:
6272 amplitude_x[%],amplitude_y[%],_boundary_conditions={ 0=dirichlet
6273 | 1=neumann | 2=periodic | 3=mirror }
6274
6275 Blur selected images along the X and Y axes.
6276
6277 Default value: 'boundary_conditions=1'.
6278
6279 Example:
6280 [#1] image.jpg +blur_xy 6
6281
6282 Tutorial: https://gmic.eu/oldtutorial/_blur_y
6283
6284 blur_xyz:
6285 amplitude_x[%],amplitude_y[%],amplitude_z,_boundary_conditions={
6286 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }
6287
6288 Blur selected images along the X, Y and Z axes.
6289
6290 Default value: 'boundary_conditions=1'.
6291
6292 Tutorial: https://gmic.eu/oldtutorial/_blur_xyz
6293
6294 blur_y:
6295 amplitude[%]>=0,_boundary_conditions={ 0=dirichlet | 1=neumann |
6296 2=periodic | 3=mirror }
6297
6298 Blur selected images along the y-axis.
6299
6300 Default value: 'boundary_conditions=1'.
6301
6302 Example:
6303 [#1] image.jpg +blur_y 6
6304
6305 Tutorial: https://gmic.eu/oldtutorial/_blur_y
6306
6307 blur_z:
6308 amplitude[%]>=0,_boundary_conditions={ 0=dirichlet | 1=neumann |
6309 2=periodic | 3=mirror }
6310
6311 Blur selected images along the z-axis.
6312
6313 Default value: 'boundary_conditions=1'.
6314
6315 Tutorial: https://gmic.eu/oldtutorial/_blur_z
6316
6317 boxfilter (+):
6318 size>=0[%],_order,_boundary_conditions,_nb_iter>=0 |
6319 axes,size>=0[%],_order,_boundary_conditions,_nb_iter>=0
6320
6321 Blur selected images by a box filter of specified size (fast recur‐
6322 sive implementation).
6323 'order' can be { 0=smooth | 1=1st-derivative | 2=2nd-derivative }.
6324 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
6325 | 3=mirror }.
6326 When specified, argument 'axes' is a sequence of { x | y | z | c }.
6327 Specifying one axis multiple times apply also the blur multiple
6328 times.
6329
6330 Default values: 'order=0', 'boundary_conditions=1' and 'nb_iter=1'.
6331
6332 Example:
6333 [#1] image.jpg +boxfilter 5%
6334 [#2] image.jpg +boxfilter y,3,1
6335
6336 bump2normal:
6337
6338 Convert selected bumpmaps to normalmaps.
6339
6340 Example:
6341 [#1] 300,300 circle 50%,50%,128,1,1 blur 5% bump2normal
6342
6343 closing:
6344 size>=0 |
6345 size_x>=0,size_y>=0,_size_z>=0 |
6346 [kernel],_boundary_conditions,_is_real={ 0=binary-mode | 1=real-
6347 mode }
6348
6349 Apply morphological closing to selected images.
6350 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
6351 | 3=mirror }.
6352
6353 Default values: 'size_z=1', 'boundary_conditions=1' and
6354 'is_real=0'.
6355
6356 Example:
6357 [#1] image.jpg +closing 10
6358
6359 closing_circ:
6360 _size>=0,_is_real={ 0 | 1 }
6361
6362 Apply circular dilation of selected images by specified size.
6363
6364 Default values: 'boundary_conditions=1' and 'is_real=0'.
6365
6366 Example:
6367 [#1] image.jpg +closing_circ 7
6368
6369 compose_freq:
6370
6371 Compose selected low and high frequency parts into new images.
6372
6373 Example:
6374 [#1] image.jpg split_freq 2% mirror[-1] x compose_freq
6375
6376 convolve (+):
6377 [mask],_boundary_conditions,_is_normalized={ 0 | 1 },_chan‐
6378 nel_mode,_xcenter,_ycenter,_zcenter,_xstart,_ystart,_zs‐
6379 tart,_xend,_yend,_zend,_xstride,_ystride,_zstride,_xdilation,_ydila‐
6380 tion,_zdilation,
6381 interpolation_type
6382
6383 Convolve selected images by specified mask.
6384 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
6385 | 3=mirror }.
6386 'channel_mode' can be { 0=sum input channels | 1=one-for-one |
6387 2=expand }.
6388 'interpolation_type' can be { 0=nearest-neighbor | 1=linear }.
6389
6390 Default values: 'boundary_conditions=1', 'is_normalized=0', 'chan‐
6391 nel_mode=1', 'xcenter=ycenter=zcenter=(undefined)', 'xstart=ystart=zs‐
6392 tart=0',
6393 'xend=yend=zend=(max-coordinates)', 'xstride=ystride=zstride=1',
6394 'xdilation=ydilation=zdilation=1' and 'interpolation_type=0'.
6395
6396 Example:
6397 [#1] image.jpg (0,1,0;1,-4,1;0,1,0) convolve[-2] [-1] keep[-2]
6398 [#2] image.jpg (0,1,0) resize[-1] 130,1,1,1,3 +convolve[0] [1]
6399
6400 Tutorial: https://gmic.eu/oldtutorial/_convolve
6401
6402 convolve_fft:
6403 [mask],_boundary_conditions
6404
6405 Convolve selected images with specified mask, in the fourier do‐
6406 main.
6407 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
6408 | 3=mirror }.
6409
6410 Example:
6411 [#1] image.jpg 100%,100% gaussian[-1] 20,1,45 +convolve_fft[0]
6412 [1]
6413
6414 correlate (+):
6415 [mask],_boundary_conditions,_is_normalized={ 0 | 1 },_chan‐
6416 nel_mode,_xcenter,_ycenter,_zcenter,_xstart,_ystart,_zs‐
6417 tart,_xend,_yend,_zend,_xstride,_ystride,_zstride,_xdilation,_ydila‐
6418 tion,_zdilation,
6419 interpolation_type
6420
6421 Correlate selected images by specified mask.
6422 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
6423 | 3=mirror }.
6424 'channel_mode' can be { 0=sum input channels | 1=one-for-one |
6425 2=expand }.
6426 'interpolation_type' can be { 0=nearest-neighbor | 1=linear }.
6427
6428 Default values: 'boundary_conditions=1', 'is_normalized=0', 'chan‐
6429 nel_mode=1', 'xcenter=ycenter=zcenter=-1', 'xstart=ystart=zstart=0',
6430 'xend=yend=zend=(max-coordinates)', 'xstride=ystride=zstride=1',
6431 'xdilation=ydilation=zdilation=1' and 'interpolation_type=0'.
6432
6433 Example:
6434 [#1] image.jpg (0,1,0;1,-4,1;0,1,0) correlate[-2] [-1] keep[-2]
6435 [#2] image.jpg +crop 40%,40%,60%,60% +correlate[0] [-1],0,1
6436
6437 cross_correlation:
6438 [mask]
6439
6440 Compute cross-correlation of selected images with specified mask.
6441
6442 Example:
6443 [#1] image.jpg +shift -30,-20 +cross_correlation[0] [1]
6444
6445 curvature:
6446
6447 Compute isophote curvatures on selected images.
6448
6449 Example:
6450 [#1] image.jpg blur 10 curvature
6451
6452 dct:
6453 _{ x | y | z }...{ x | y | z } |
6454 (no arg)
6455
6456 Compute the discrete cosine transform of selected images, option‐
6457 ally along the specified axes only.
6458 Output images are always evenly sized, so this command may change
6459 the size of the selected images.
6460
6461 Default values: (no arg)
6462 See also: idct.
6463
6464 Example:
6465 [#1] image.jpg +dct +idct[-1] abs[-2] +[-2] 1 log[-2]
6466
6467 Tutorial: https://gmic.eu/oldtutorial/_dct-and-idct
6468
6469 deblur:
6470 amplitude[%]>=0,_nb_iter>=0,_dt>=0,_regul>=0,_regul_type={
6471 0=Tikhonov | 1=meancurv. | 2=TV }
6472
6473 Deblur image using a regularized Jansson-Van Cittert algorithm.
6474
6475 Default values: 'nb_iter=10', 'dt=20', 'regul=0.7' and
6476 'regul_type=1'.
6477
6478 Example:
6479 [#1] image.jpg blur 3 +deblur 3,40,20,0.01
6480
6481 deblur_goldmeinel:
6482 sigma>=0,_nb_iter>=0,_acceleration>=0,_kernel_type={ 0=deriche |
6483 1=gaussian }.
6484
6485 Deblur selected images using Gold-Meinel algorithm
6486
6487 Default values: 'nb_iter=8', 'acceleration=1' and 'kernel_type=1'.
6488
6489 Example:
6490 [#1] image.jpg +blur 1 +deblur_goldmeinel[-1] 1
6491
6492 deblur_richardsonlucy:
6493 sigma>=0, nb_iter>=0, _kernel_type={ 0=deriche | 1=gaussian }.
6494
6495 Deblur selected images using Richardson-Lucy algorithm.
6496
6497 Default values: 'nb_iter=50' and 'kernel_type=1'.
6498
6499 Example:
6500 [#1] image.jpg +blur 1 +deblur_richardsonlucy[-1] 1
6501
6502 deconvolve_fft:
6503 [kernel],_regularization>=0
6504
6505 Deconvolve selected images by specified mask in the fourier space.
6506
6507 Default value: 'regularization>=0'.
6508
6509 Example:
6510 [#1] image.jpg +gaussian 5 +convolve_fft[0] [1] +decon‐
6511 volve_fft[-1] [1]
6512
6513 deinterlace:
6514 _method={ 0 | 1 }
6515
6516 Deinterlace selected images ('method' can be { 0=standard or 1=mo‐
6517 tion-compensated }).
6518
6519 Default value: 'method=0'.
6520
6521 Example:
6522 [#1] image.jpg +rotate 3,1,1,50%,50% resize 100%,50% resize
6523 100%,200%,1,3,4 shift[-1] 0,1 add +deinterlace 1
6524
6525 denoise (+):
6526 [guide],std_deviation_s[%]>=0,_std_devia‐
6527 tion_r[%]>=0,_patch_size>0,_lookup_size>0,_smoothness,_fast_approx={ 0
6528 | 1 } |
6529 std_deviation_s[%]>=0,_std_devia‐
6530 tion_r[%]>=0,_patch_size>0,_lookup_size>0,_smoothness,_fast_approx={ 0
6531 | 1 }
6532
6533 Denoise selected images by non-local patch averaging.
6534
6535 Default values: 'std_deviation_p=10', 'patch_size=5',
6536 'lookup_size=6' and 'smoothness=1'.
6537
6538 Example:
6539 [#1] image.jpg +denoise 5,5,8
6540
6541 denoise_haar:
6542 _threshold>=0,_nb_scales>=0,_cycle_spinning>0
6543
6544 Denoise selected images using haar-wavelet thresholding with cycle
6545 spinning.
6546 Set 'nb_scales==0' to automatically determine the optimal number of
6547 scales.
6548
6549 Default values: 'threshold=1.4', 'nb_scale=0' and 'cycle_spin‐
6550 ning=10'.
6551
6552 Example:
6553 [#1] image.jpg noise 20 cut 0,255 +denoise_haar[-1] 0.8
6554
6555 denoise_cnn:
6556 _noise_type={ 0=soft | 1=heavy | 2=heavy (faster) | 3=pois‐
6557 son+gaussian | 4=poisson+gaussian2 },_patch_size>0
6558
6559 Denoise selected images using a convolutional neural network (CNN).
6560 Input value range should be [0,255]. Output value range is [0,255].
6561
6562 Default value: 'patch_size=64'.
6563
6564 Example:
6565 [#1] image.jpg noise 20 cut 0,255 +denoise_cnn
6566
6567 denoise_patchpca:
6568 _strength>=0,_patch_size>0,_lookup_size>0,_spatial_sampling>0
6569
6570 Denoise selected images using the patch-pca algorithm.
6571
6572 Default values: 'patch_size=7', 'lookup_size=11', 'details=1.8' and
6573 'spatial_sampling=5'.
6574
6575 Example:
6576 [#1] image.jpg +noise 20 cut[-1] 0,255 +denoise_patchpca[-1] ,
6577
6578 deriche (+):
6579 std_deviation>=0[%],order={ 0 | 1 | 2 },axis={ x | y | z | c
6580 },_boundary_conditions
6581
6582 Apply Deriche recursive filter on selected images, along specified
6583 axis and with
6584 specified standard deviation, order and boundary conditions.
6585 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
6586 | 3=mirror }.
6587
6588 Default value: 'boundary_conditions=1'.
6589
6590 Example:
6591 [#1] image.jpg deriche 3,1,x
6592 [#2] image.jpg +deriche 30,0,x deriche[-2] 30,0,y add
6593
6594 Tutorial: https://gmic.eu/oldtutorial/_deriche
6595
6596 dilate (+):
6597 size>=0 |
6598 size_x>=0,size_y>=0,size_z>=0 |
6599 [kernel],_boundary_conditions,_is_real={ 0=binary-mode | 1=real-
6600 mode }
6601
6602 Dilate selected images by a rectangular or the specified structur‐
6603 ing element.
6604 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
6605 | 3=mirror }.
6606
6607 Default values: 'size_z=1', 'boundary_conditions=1' and
6608 'is_real=0'.
6609
6610 Example:
6611 [#1] image.jpg +dilate 10
6612
6613 dilate_circ:
6614 _size>=0,_boundary_conditions,_is_real={ 0 | 1 }
6615
6616 Apply circular dilation of selected images by specified size.
6617 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
6618 | 3=mirror }.
6619
6620 Default values: 'boundary_conditions=1' and 'is_real=0'.
6621
6622 Example:
6623 [#1] image.jpg +dilate_circ 7
6624
6625 dilate_oct:
6626 _size>=0,_boundary_conditions,_is_real={ 0 | 1 }
6627
6628 Apply octagonal dilation of selected images by specified size.
6629
6630 Default values: 'boundary_conditions=1' and 'is_real=0'.
6631
6632 Example:
6633 [#1] image.jpg +dilate_oct 7
6634
6635 dilate_threshold:
6636 size_x>=1,size_y>=1,size_z>=1,_threshold>=0,_boundary_conditions
6637
6638 Dilate selected images in the (X,Y,Z,I) space.
6639 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
6640 | 3=mirror }.
6641
6642 Default values: 'size_y=size_x', 'size_z=1', 'threshold=255' and
6643 'boundary_conditions=1'.
6644
6645 divergence:
6646
6647 Compute divergence of selected vector fields.
6648
6649 Example:
6650 [#1] image.jpg luminance +gradient append[-2,-1] c divergence[-1]
6651
6652 dog:
6653 _sigma1>=0[%],_sigma2>=0[%]
6654
6655 Compute difference of gaussian on selected images.
6656
6657 Default values: 'sigma1=2%' and 'sigma2=3%'.
6658
6659 Example:
6660 [#1] image.jpg dog 2,3
6661
6662 diffusiontensors:
6663 _sharpness>=0,0<=_anisotropy<=1,_alpha[%],_sigma[%],is_sqrt={ 0 |
6664 1 }
6665
6666 Compute the diffusion tensors of selected images for edge-preserv‐
6667 ing smoothing algorithms.
6668
6669 Default values: 'sharpness=0.7', 'anisotropy=0.3', 'alpha=0.6',
6670 'sigma=1.1' and 'is_sqrt=0'.
6671
6672 Example:
6673 [#1] image.jpg diffusiontensors 0.8 abs pow 0.2
6674
6675 Tutorial: https://gmic.eu/oldtutorial/_diffusiontensors
6676
6677 edges:
6678 _threshold[%]>=0
6679
6680 Estimate contours of selected images.
6681
6682 Default value: 'edges=15%'
6683
6684 Example:
6685 [#1] image.jpg +edges 15%
6686
6687 erode (+):
6688 size>=0 |
6689 size_x>=0,size_y>=0,_size_z>=0 |
6690 [kernel],_boundary_conditions,_is_real={ 0=binary-mode | 1=real-
6691 mode }
6692
6693 Erode selected images by a rectangular or the specified structuring
6694 element.
6695 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
6696 | 3=mirror }.
6697
6698 Default values: 'size_z=1', 'boundary_conditions=1' and
6699 'is_real=0'.
6700
6701 Example:
6702 [#1] image.jpg +erode 10
6703
6704 erode_circ:
6705 _size>=0,_boundary_conditions,_is_real={ 0 | 1 }
6706
6707 Apply circular erosion of selected images by specified size.
6708 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
6709 | 3=mirror }.
6710
6711 Default values: 'boundary_conditions=1' and 'is_real=0'.
6712
6713 Example:
6714 [#1] image.jpg +erode_circ 7
6715
6716 erode_oct:
6717 _size>=0,_boundary_conditions,_is_real={ 0 | 1 }
6718
6719 Apply octagonal erosion of selected images by specified size.
6720
6721 Default values: 'boundary_conditions=1' and 'is_real=0'.
6722
6723 Example:
6724 [#1] image.jpg +erode_oct 7
6725
6726 erode_threshold:
6727 size_x>=1,size_y>=1,size_z>=1,_threshold>=0,_boundary_conditions
6728
6729 Erode selected images in the (X,Y,Z,I) space.
6730 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
6731 | 3=mirror }.
6732
6733 Default values: 'size_y=size_x', 'size_z=1', 'threshold=255' and
6734 'boundary_conditions=1'.
6735
6736 fft (+):
6737 _{ x | y | z }...{ x | y | z }
6738
6739 Compute the direct fourier transform (real and imaginary parts) of
6740 selected images,
6741 optionally along the specified axes only.
6742 See also: ifft.
6743
6744 Example:
6745 [#1] image.jpg luminance +fft append[-2,-1] c norm[-1] log[-1]
6746 shift[-1] 50%,50%,0,0,2
6747 [#2] image.jpg w2:=int(w/2) h2:=int(h/2) fft shift $w2,$h2,0,0,2
6748 ellipse $w2,$h2,30,30,0,1,0 shift -$w2,-$h2,0,0,2 ifft remove[-1]
6749
6750 Tutorial: https://gmic.eu/oldtutorial/_fft
6751
6752 g (+):
6753 Shortcut for command 'gradient'.
6754
6755 gradient:
6756 { x | y | z | c }...{ x | y | z | c },_scheme,_boundary_condi‐
6757 tions |
6758 (no arg)
6759
6760 Compute the gradient components (first derivatives) of selected im‐
6761 ages, along specified axes.
6762 (equivalent to shortcut command 'g').
6763
6764 'scheme' can be { -1=backward | 0=centered | 1=forward | 2=sobel |
6765 3=rotation-invariant (default) | 4=deriche | 5=vanvliet }.
6766 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
6767 | 3=mirror }.
6768 (no arg) compute all significant components.
6769
6770 Default values: 'scheme=0' and 'boundary_conditions=1'.
6771
6772 Example:
6773 [#1] image.jpg gradient
6774
6775 Tutorial: https://gmic.eu/oldtutorial/_gradient
6776
6777 gradient_norm:
6778
6779 Compute gradient norm of selected images.
6780
6781 Example:
6782 [#1] image.jpg gradient_norm equalize
6783
6784 Tutorial: https://gmic.eu/oldtutorial/_gradient_norm
6785
6786 gradient_orientation:
6787 _dimension={ 1 | 2 | 3 }
6788
6789 Compute N-d gradient orientation of selected images.
6790
6791 Default value: 'dimension=3'.
6792
6793 Example:
6794 [#1] image.jpg +gradient_orientation 2
6795
6796 guided (+):
6797 [guide],radius[%]>=0,regularization[%]>=0 |
6798 radius[%]>=0,regularization[%]>=0
6799
6800 Blur selected images by guided image filtering.
6801 If a guide image is provided, it is used to drive the smoothing
6802 process.
6803 A guide image must be of the same xyz-size as the selected images.
6804 This command implements the filtering algorithm described in:
6805 He, Kaiming; Sun, Jian; Tang, Xiaoou, "Guided Image Filtering",
6806 IEEE Transactions on Pattern Analysis and Machine Intelligence,
6807 vol.35, no.6, pp.1397,1409, June 2013
6808
6809 Example:
6810 [#1] image.jpg +guided 5,400
6811
6812 haar:
6813 scale>0
6814
6815 Compute the direct haar multiscale wavelet transform of selected
6816 images.
6817 See also: ihaar.
6818
6819 Tutorial: https://gmic.eu/oldtutorial/_haar
6820
6821 heat_flow:
6822 _nb_iter>=0,_dt,_keep_sequence={ 0 | 1 }
6823
6824 Apply iterations of the heat flow on selected images.
6825
6826 Default values: 'nb_iter=10', 'dt=30' and 'keep_sequence=0'.
6827
6828 Example:
6829 [#1] image.jpg +heat_flow 20
6830
6831 hessian:
6832 { xx | xy | xz | yy | yz | zz }...{ xx | xy | xz | yy | yz | zz
6833 },_boundary_conditions |
6834 (no arg) :
6835
6836 Compute the hessian components (second derivatives) of selected im‐
6837 ages along specified axes.
6838 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
6839 | 3=mirror }.
6840 (no arg) compute all significant components.
6841
6842 Default value: 'boundary_conditions=1'.
6843
6844 Example:
6845 [#1] image.jpg hessian
6846
6847 idct:
6848 _{ x | y | z }...{ x | y | z } |
6849 (no arg)
6850
6851 Compute the inverse discrete cosine transform of selected images,
6852 optionally along the specified axes only.
6853 Output images are always evenly sized, so this command may change
6854 the size of the selected images.
6855 (dct images obtained with the 'dct' command are evenly sized any‐
6856 way).
6857
6858 Default values: (no arg)
6859 See also: dct.
6860
6861 Tutorial: https://gmic.eu/oldtutorial/_dct-and-idct
6862
6863 iee:
6864
6865 Compute gradient-orthogonal-directed 2nd derivative of image(s).
6866
6867 Example:
6868 [#1] image.jpg iee
6869
6870 ifft (+):
6871 _{ x | y | z }...{ x | y | z }
6872
6873 Compute the inverse fourier transform (real and imaginary parts) of
6874 selected images.
6875 optionally along the specified axes only.
6876 See also: fft.
6877
6878 Tutorial: https://gmic.eu/oldtutorial/_fft
6879
6880 ihaar:
6881 scale>0
6882
6883 Compute the inverse haar multiscale wavelet transform of selected
6884 images.
6885 See also: haar.
6886
6887 Tutorial: https://gmic.eu/oldtutorial/_haar
6888
6889 ilaplacian:
6890 { nb_iterations>0 | 0 },_[initial_estimate]
6891
6892 Invert selected Laplacian images.
6893 If given 'nb_iterations' is '0', inversion is done in Fourier space
6894 (single iteration),
6895 otherwise, by applying 'nb_iterations' of a Laplacian-inversion PDE
6896 flow.
6897 Note that the resulting inversions are just estimation of possi‐
6898 ble/approximated solutions.
6899
6900 Default values: 'nb_iterations=0' and '[initial_estimated]=(unde‐
6901 fined)'.
6902
6903 Example:
6904 [#1] image.jpg +laplacian +ilaplacian[-1] 0
6905
6906 inn:
6907
6908 Compute gradient-directed 2nd derivative of image(s).
6909
6910 Example:
6911 [#1] image.jpg inn
6912
6913 inpaint (+):
6914 [mask] |
6915 [mask],0,_fast_method |
6916 [mask],_patch_size>=1,_lookup_size>=1,_lookup_fac‐
6917 tor>=0,_lookup_increment!=0,_blend_size>=0,0<=_blend_thresh‐
6918 old<=1,_blend_decay>=0,_blend_scales>=1,_is_blend_outer={ 0 | 1 }
6919
6920 Inpaint selected images by specified mask.
6921 If no patch size (or 0) is specified, inpainting is done using a
6922 fast average or median algorithm.
6923 Otherwise, it used a patch-based reconstruction method, that can be
6924 very time consuming.
6925 'fast_method' can be { 0=low-connectivity average | 1=high-connec‐
6926 tivity average | 2=low-connectivity median | 3=high-connectivity median
6927 }.
6928
6929 Default values: 'patch_size=0', 'fast_method=1', 'lookup_size=22',
6930 'lookup_factor=0.5', 'lookup_increment=1', 'blend_size=0',
6931 'blend_threshold=0',
6932 'blend_decay=0.05', 'blend_scales=10' and 'is_blend_outer=1'.
6933
6934 Example:
6935 [#1] image.jpg 100%,100% ellipse 50%,50%,30,30,0,1,255 ellipse
6936 20%,20%,30,10,0,1,255 +inpaint[-2] [-1] remove[-2]
6937 [#2] image.jpg 100%,100% circle 30%,30%,30,1,255,0,255 circle
6938 70%,70%,50,1,255,0,255 +inpaint[0] [1],5,15,0.5,1,9,0 remove[1]
6939
6940 inpaint_pde:
6941 [mask],_nb_scales[%]>=0,_diffusion_type={ 0=isotropic | 1=Delau‐
6942 nay-guided | 2=edge-guided | 3=mask-guided },_diffusion_iter>=0
6943
6944 Inpaint selected images by specified mask using a multiscale trans‐
6945 port-diffusion algorithm.
6946 If 'diffusion type==3', non-zero values of the mask (e.g. a dis‐
6947 tance function) are used
6948 to guide the diffusion process.
6949
6950 Default values: 'nb_scales=75%', 'diffusion_type=1' and 'diffu‐
6951 sion_iter=20'.
6952
6953 Example:
6954 [#1] image.jpg 100%,100% ellipse[-1] 30%,30%,40,30,0,1,255 +in‐
6955 paint_pde[0] [1]
6956
6957 inpaint_flow:
6958 [mask],_nb_global_iter>=0,_nb_local_iter>=0,_dt>0,_al‐
6959 pha>=0,_sigma>=0
6960
6961 Apply iteration of the inpainting flow on selected images.
6962
6963 Default values: 'nb_global_iter=10', 'nb_local_iter=100', 'dt=5',
6964 'alpha=1' and 'sigma=3'.
6965
6966 Example:
6967 [#1] image.jpg 100%,100% ellipse[-1] 30%,30%,40,30,0,1,255 in‐
6968 paint_flow[0] [1]
6969
6970 inpaint_holes:
6971 maximal_area[%]>=0,_tolerance>=0,_is_high_connectivity={ 0 | 1 }
6972
6973 Inpaint all connected regions having an area less than specified
6974 value.
6975
6976 Default values: 'maximal_area=4', 'tolerance=0' and 'is_high_con‐
6977 nectivity=0'.
6978
6979 Example:
6980 [#1] image.jpg noise 5%,2 +inpaint_holes 8,40
6981
6982 inpaint_morpho:
6983 [mask]
6984
6985 Inpaint selected images by specified mask using morphological oper‐
6986 ators.
6987
6988 Example:
6989 [#1] image.jpg 100%,100% ellipse[-1] 30%,30%,40,30,0,1,255 +in‐
6990 paint_morpho[0] [1]
6991
6992 inpaint_matchpatch:
6993 [mask],_nb_scales={ 0=auto | >0 },_patch_size>0,_nb_itera‐
6994 tions_per_scale>0,_blend_size>=0,_allow_outer_blending={ 0 | 1
6995 },_is_already_initialized={ 0 | 1 }
6996
6997 Inpaint selected images by specified binary mask, using a multi-
6998 scale matchpatch algorithm.
6999
7000 Default values: 'nb_scales=0', 'patch_size=9', 'nb_itera‐
7001 tions_per_scale=10', 'blend_size=5','allow_outer_blending=1' and
7002 'is_already_initialized=0'.
7003
7004 Example:
7005 [#1] image.jpg 100%,100% ellipse[-1] 30%,30%,40,30,0,1,255 +in‐
7006 paint_matchpatch[0] [1]
7007
7008 kuwahara:
7009 size>0
7010
7011 Apply Kuwahara filter of specified size on selected images.
7012
7013 Example:
7014 [#1] image.jpg kuwahara 9
7015
7016 laplacian:
7017
7018 Compute Laplacian of selected images.
7019
7020 Example:
7021 [#1] image.jpg laplacian
7022
7023 lic:
7024 _amplitude>0,_channels>0
7025
7026 Render LIC representation of selected vector fields.
7027
7028 Default values: 'amplitude=30' and 'channels=1'.
7029
7030 Example:
7031 [#1] 400,400,1,2,'if(c==0,x-w/2,y-h/2)' +lic 200,3 quiver[-2]
7032 [-2],10,1,1,1,255
7033
7034 map_tones:
7035 _threshold>=0,_gamma>=0,_smoothness>=0,nb_iter>=0
7036
7037 Apply tone mapping operator on selected images, based on Poisson
7038 equation.
7039
7040 Default values: 'threshold=0.1', 'gamma=0.8', 'smoothness=0.5' and
7041 'nb_iter=30'.
7042
7043 Example:
7044 [#1] image.jpg +map_tones ,
7045
7046 map_tones_fast:
7047 _radius[%]>=0,_power>=0
7048
7049 Apply fast tone mapping operator on selected images.
7050
7051 Default values: 'radius=3%' and 'power=0.3'.
7052
7053 Example:
7054 [#1] image.jpg +map_tones_fast ,
7055
7056 meancurvature_flow:
7057 _nb_iter>=0,_dt,_keep_sequence={ 0 | 1 }
7058
7059 Apply iterations of the mean curvature flow on selected images.
7060
7061 Default values: 'nb_iter=10', 'dt=30' and 'keep_sequence=0'.
7062
7063 Example:
7064 [#1] image.jpg +meancurvature_flow 20
7065
7066 median (+):
7067 size>=0,_threshold>0
7068
7069 Apply (opt. thresholded) median filter on selected images with
7070 structuring element size x size.
7071
7072 Example:
7073 [#1] image.jpg +median 5
7074
7075 nlmeans:
7076 [guide],_patch_radius>0,_spatial_bandwidth>0,_tonal_band‐
7077 width>0,_patch_measure_command |
7078 _patch_radius>0,_spatial_bandwidth>0,_tonal_band‐
7079 width>0,_patch_measure_command
7080
7081 Apply non local means denoising of Buades et al, 2005. on selected
7082 images.
7083 The patch is a gaussian function of 'std_patch_radius'.
7084 The spatial kernel is a rectangle of radius 'spatial_bandwidth'.
7085 The tonal kernel is exponential ('exp(-d^2/_tonal_bandwidth^2)')
7086 with 'd' the euclidean distance between image patches.
7087
7088 Default values: 'patch_radius=4', 'spatial_bandwidth=4',
7089 'tonal_bandwidth=10' and 'patch_measure_command=-norm'.
7090
7091 Example:
7092 [#1] image.jpg +noise 10 nlmeans[-1] 4,4,{0.6*${-std_noise}}
7093
7094 nlmeans_core:
7095 _reference_image,_scaling_map,_patch_radius>0,_spatial_band‐
7096 width>0
7097
7098 Apply non local means denoising using a image for weight and a map
7099 for scaling
7100
7101 normalize_local:
7102 _amplitude>=0,_radius>0,_n_smooth>=0[%],_a_smooth>=0[%],_is_cut={
7103 0 | 1 },_min=0,_max=255
7104
7105 Normalize selected images locally.
7106
7107 Default values: 'amplitude=3', 'radius=16', 'n_smooth=4%',
7108 'a_smooth=2%', 'is_cut=1', 'min=0' and 'max=255'.
7109
7110 Example:
7111 [#1] image.jpg normalize_local 8,10
7112
7113 normalized_cross_correlation:
7114 [mask]
7115
7116 Compute normalized cross-correlation of selected images with speci‐
7117 fied mask.
7118
7119 Example:
7120 [#1] image.jpg +shift -30,-20 +normalized_cross_correlation[0]
7121 [1]
7122
7123 opening:
7124 size>=0 |
7125 size_x>=0,size_y>=0,_size_z>=0 |
7126 [kernel],_boundary_conditions,_is_real={ 0=binary-mode | 1=real-
7127 mode }
7128
7129 Apply morphological opening to selected images.
7130 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
7131 | 3=mirror }.
7132
7133 Default values: 'size_z=1', 'boundary_conditions=1' and
7134 'is_real=0'.
7135
7136 Example:
7137 [#1] image.jpg +opening 10
7138
7139 opening_circ:
7140 _size>=0,_is_real={ 0 | 1 }
7141
7142 Apply circular opening of selected images by specified size.
7143
7144 Default values: 'boundary_conditions=1' and 'is_real=0'.
7145
7146 Example:
7147 [#1] image.jpg +opening_circ 7
7148
7149 percentile:
7150 [mask],0<=_min_percentile[%]<=100,0<=_max_percentile[%]<=100.
7151
7152 Apply percentile averaging filter to selected images.
7153
7154 Default values: 'min_percentile=0' and 'max_percentile=100'.
7155
7156 Example:
7157 [#1] image.jpg shape_circle 11,11 +percentile[0] [1],25,75
7158
7159 peronamalik_flow:
7160 K_factor>0,_nb_iter>=0,_dt,_keep_sequence={ 0 | 1 }
7161
7162 Apply iterations of the Perona-Malik flow on selected images.
7163
7164 Default values: 'K_factor=20', 'nb_iter=5', 'dt=5' and 'keep_se‐
7165 quence=0'.
7166
7167 Example:
7168 [#1] image.jpg +heat_flow 20
7169
7170 phase_correlation:
7171 [destination]
7172
7173 Estimate translation vector between selected source images and
7174 specified destination.
7175
7176 Example:
7177 [#1] image.jpg +shift -30,-20 +phase_correlation[0] [1] un‐
7178 roll[-1] y
7179
7180 pde_flow:
7181 _nb_iter>=0,_dt,_velocity_command,_keep_sequence={ 0 | 1 }
7182
7183 Apply iterations of a generic PDE flow on selected images.
7184
7185 Default values: 'nb_iter=10', 'dt=30', 'velocity_command=laplacian'
7186 and 'keep_sequence=0'.
7187
7188 Example:
7189 [#1] image.jpg +pde_flow 20
7190
7191 periodize_poisson:
7192
7193 Periodize selected images using a Poisson solver in Fourier space.
7194
7195 Example:
7196 [#1] image.jpg +periodize_poisson array 2,2,2
7197
7198 rbf:
7199 dx,_x0,_x1,_phi(r) |
7200 dx,dy,_x0,_y0,_x1,_y1,_phi(r) |
7201 dx,dy,dz,x0,y0,z0,x1,y1,z1,phi(r)
7202
7203 Reconstruct 1D/2D or 3D image from selected sets of keypoints, by
7204 RBF-interpolation.
7205 A set of keypoints is represented by a vector-valued image, where
7206 each pixel represents a single keypoint.
7207 Vector components of a keypoint have the following meaning:
7208 - For 1D reconstruction: [ x_k, f1(k),...fN(k) ].
7209 - For 2D reconstruction: [ x_k,y_k, f1(k),...,fN(k) ].
7210 - For 3D reconstruction: [ x_k,y_k,z_k, f1(k),...,fN(k) ].
7211 Values 'x_k','y_k' and 'z_k' are the spatial coordinates of key‐
7212 point 'k'.
7213 Values 'f1(k),..,fN(k)' are the 'N' components of the vector value
7214 of keypoint 'k'.
7215 The command reconstructs an image with specified size
7216 'dx'x'dy'x'dz', with 'N' channels.
7217
7218 Default values: 'x0=y0=z0=0', 'x1=dx-1', 'y1=dy-1', 'z1=dz-1',
7219 'phi(r)=r^2*log(1e-5+r)'.
7220
7221 Example:
7222 [#1] sp colorful r2dx 400 100%,100% noise_poissondisk. 10
7223 1,{is},1,5 eval[-2] "begin(p=0);i?(I[#-1,p++]=[x,y,I(#0)])" to_rgb[1]
7224 mul[0,1] dilate_circ[0] 5 +rbf[-1] {0,[w,h]} c[-1] 0,255
7225 [#2] 32,1,1,5,u([400,400,255,255,255]) rbf 400,400 c 0,255
7226
7227 red_eye:
7228 0<=_threshold<=100,_smoothness>=0,0<=attenuation<=1
7229
7230 Attenuate red-eye effect in selected images.
7231
7232 Default values: 'threshold=75', 'smoothness=3.5' and 'attenua‐
7233 tion=0.1'.
7234
7235 Example:
7236 [#1] image.jpg +red_eye ,
7237
7238 remove_hotpixels:
7239 _mask_size>0, _threshold[%]>0
7240
7241 Remove hot pixels in selected images.
7242
7243 Default values: 'mask_size=3' and 'threshold=10%'.
7244
7245 Example:
7246 [#1] image.jpg noise 10,2 +remove_hotpixels ,
7247
7248 remove_pixels:
7249 number_of_pixels[%]>=0
7250
7251 Remove specified number of pixels (i.e. set them to 0) from the set
7252 of non-zero pixels in selected images.
7253
7254 Example:
7255 [#1] image.jpg +remove_pixels 50%
7256
7257 rolling_guidance:
7258 std_deviation_s[%]>=0,std_deviation_r[%]>=0,_precision>=0
7259
7260 Apply the rolling guidance filter on selected image.
7261 Rolling guidance filter is a fast image abstraction filter, de‐
7262 scribed in:
7263 "Rolling Guidance Filter", Qi Zhang Xiaoyong, Shen Li, Xu Jiaya
7264 Jia, ECCV'2014.
7265
7266 Default values: 'std_deviation_s=4', 'std_deviation_r=10' and 'pre‐
7267 cision=0.5'.
7268
7269 Example:
7270 [#1] image.jpg +rolling_guidance , +-
7271
7272 sharpen:
7273 amplitude>=0 |
7274 amplitude>=0,edge>=0,_alpha[%],_sigma[%]
7275
7276 Sharpen selected images by inverse diffusion or shock filters meth‐
7277 ods.
7278 'edge' must be specified to enable shock-filter method.
7279
7280 Default values: 'edge=0', 'alpha=0' and 'sigma=0'.
7281
7282 Example:
7283 [#1] image.jpg sharpen 300
7284 [#2] image.jpg blur 5 sharpen 300,1
7285
7286 smooth (+):
7287 amplitude[%]>=0,_sharpness>=0,0<=_anisotropy<=1,_al‐
7288 pha[%],_sigma[%],_dl>0,_da>0,_precision>0,_interpolation,_fast_approx={
7289 0 | 1 } |
7290 nb_iterations>=0,_sharpness>=0,_anisotropy,_alpha,_sigma,_dt>0,0
7291 |
7292 [tensor_field],_amplitude>=0,_dl>0,_da>0,_precision>0,_interpola‐
7293 tion,_fast_approx={ 0 | 1 } |
7294 [tensor_field],_nb_iters>=0,_dt>0,0
7295
7296 Smooth selected images anisotropically using diffusion PDE's, with
7297 specified field of
7298 diffusion tensors.
7299 'interpolation' can be { 0=nearest | 1=linear | 2=runge-kutta }.
7300
7301 Default values: 'sharpness=0.7', 'anisotropy=0.3', 'alpha=0.6',
7302 'sigma=1.1', 'dl=0.8', 'da=30', 'precision=2', 'interpolation=0' and
7303 'fast_approx=1'.
7304
7305 Example:
7306 [#1] image.jpg repeat 3 smooth 40,0,1,1,2 done
7307 [#2] image.jpg 100%,100%,1,2 rand[-1] -100,100 repeat 2
7308 smooth[-1] 100,0.2,1,4,4 done warp[0] [-1],1,1,1
7309
7310 Tutorial: https://gmic.eu/oldtutorial/_smooth
7311
7312 split_freq:
7313 smoothness>0[%]
7314
7315 Split selected images into low and high frequency parts.
7316
7317 Example:
7318 [#1] image.jpg split_freq 2%
7319
7320 solve_poisson:
7321 "laplacian_command",_nb_iterations>=0,_time_step>0,_nb_scales>=0
7322
7323 Solve Poisson equation so that applying 'laplacian[n]' is close to
7324 the result of 'laplacian_command[n]'.
7325 Solving is performed using a multi-scale gradient descent algo‐
7326 rithm.
7327 If 'nb_scales=0', the number of scales is automatically determined.
7328
7329 Default values: 'nb_iterations=60', 'dt=5' and 'nb_scales=0'.
7330
7331 Example:
7332 [#1] image.jpg command "foo : gradient x" +solve_poisson foo
7333 +foo[0] +laplacian[1]
7334
7335 split_details:
7336 _nb_scales>0,_base_scale[%]>=0,_detail_scale[%]>=0
7337
7338 Split selected images into 'nb_scales' detail scales.
7339 If 'base_scale''detail_scale'0, the image decomposition is done
7340 with 'a trous' wavelets.
7341 Otherwise, it uses laplacian pyramids with linear standard devia‐
7342 tions.
7343
7344 Default values: 'nb_scales=4', 'base_scale=0' and 'detail_scale=0'.
7345
7346 Example:
7347 [#1] image.jpg split_details ,
7348
7349 structuretensors:
7350 _scheme={ 0=centered | 1=forward/backward }
7351
7352 Compute the structure tensor field of selected images.
7353
7354 Default value: 'scheme=0'.
7355
7356 Example:
7357 [#1] image.jpg structuretensors abs pow 0.2
7358
7359 Tutorial: https://gmic.eu/oldtutorial/_structuretensors
7360
7361 solidify:
7362 _smoothness[%]>=0,_diffusion_type={ 0=isotropic | 1=Delaunay-
7363 guided | 2=edge-oriented },_diffusion_iter>=0
7364
7365 Solidify selected transparent images.
7366
7367 Default values: 'smoothness=75%', 'diffusion_type=1' and 'diffu‐
7368 sion_iter=20'.
7369
7370 Example:
7371 [#1] image.jpg 100%,100% circle[-1] 50%,50%,25%,1,255 append c
7372 +solidify , display_rgba
7373
7374 syntexturize:
7375 _width[%]>0,_height[%]>0
7376
7377 Resynthetize 'width'x'height' versions of selected micro-textures
7378 by phase randomization.
7379 The texture synthesis algorithm is a straightforward implementation
7380 of the method described in :
7381 http://www.ipol.im/pub/art/2011/ggm_rpn/.
7382
7383 Default values: 'width=height=100%'.
7384
7385 Example:
7386 [#1] image.jpg crop 2,282,50,328 +syntexturize 320,320
7387
7388 syntexturize_matchpatch:
7389 _width[%]>0,_height[%]>0,_nb_scales>=0,_patch_size>0,_blend‐
7390 ing_size>=0,_precision>=0
7391
7392 Resynthetize 'width'x'height' versions of selected micro-textures
7393 using a patch-matching algorithm.
7394 If 'nbscales==0', the number of scales used is estimated from the
7395 image size.
7396
7397 Default values: 'width=height=100%', 'nb_scales=0', 'patch_size=7',
7398 'blending_size=5' and 'precision=1'.
7399
7400 Example:
7401 [#1] image.jpg crop 25%,25%,75%,75% syntexturize_matchpatch
7402 512,512
7403
7404 tv_flow:
7405 _nb_iter>=0,_dt,_keep_sequence={ 0 | 1 }
7406
7407 Apply iterations of the total variation flow on selected images.
7408
7409 Default values: 'nb_iter=10', 'dt=30' and 'keep_sequence=0'.
7410
7411 Example:
7412 [#1] image.jpg +tv_flow 40
7413
7414 unsharp:
7415 radius[%]>=0,_amount>=0,_threshold[%]>=0
7416
7417 Apply unsharp mask on selected images.
7418
7419 Default values: 'amount=2' and 'threshold=0'.
7420
7421 Example:
7422 [#1] image.jpg blur 3 +unsharp 1.5,15 cut 0,255
7423
7424 unsharp_octave:
7425 _nb_scales>0,_radius[%]>=0,_amount>=0,threshold[%]>=0
7426
7427 Apply octave sharpening on selected images.
7428
7429 Default values: 'nb_scales=4', 'radius=1', 'amount=2' and 'thresh‐
7430 old=0'.
7431
7432 Example:
7433 [#1] image.jpg blur 3 +unsharp_octave 4,5,15 cut 0,255
7434
7435 vanvliet (+):
7436 std_deviation>=0[%],order={ 0 | 1 | 2 | 3 },axis={ x | y | z | c
7437 },_boundary_conditions
7438
7439 Apply Vanvliet recursive filter on selected images, along specified
7440 axis and with
7441 specified standard deviation, order and boundary conditions.
7442 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
7443 | 3=mirror }.
7444
7445 Default value: 'boundary_conditions=1'.
7446
7447 Example:
7448 [#1] image.jpg +vanvliet 3,1,x
7449 [#2] image.jpg +vanvliet 30,0,x vanvliet[-2] 30,0,y add
7450
7451 voronoi:
7452
7453 Compute the discrete Voronoi diagram of non-zero pixels in selected
7454 images.
7455
7456 Example:
7457 [#1] 400,400 noise 0.2,2 eq 1 +label_fg 0 voronoi[-1] +gradi‐
7458 ent[-1] xy,1 append[-2,-1] c norm[-1] ==[-1] 0 map[-2] 2,2 mul[-2,-1]
7459 normalize[-2] 0,255 dilate_circ[-2] 4 reverse max
7460
7461 watermark_fourier:
7462 text,_size>0
7463
7464 Add a textual watermark in the frequency domain of selected images.
7465
7466 Default value: 'size=33'.
7467
7468 Example:
7469 [#1] image.jpg +watermark_fourier "Watermarked!" +display_fft re‐
7470 move[-3,-1] normalize 0,255 append[-4,-2] y append[-2,-1] y
7471
7472 watershed (+):
7473 [priority_image],_is_high_connectivity={ 0 | 1 }
7474
7475 Compute the watershed transform of selected images.
7476
7477 Default value: 'is_high_connectivity=1'.
7478
7479 Example:
7480 [#1] 400,400 noise 0.2,2 eq 1 +distance 1 mul[-1] -1 label[-2]
7481 watershed[-2] [-1] mod[-2] 256 map[-2] 0 reverse
7482
7483 12.9. Features Extraction
7484 -------------------
7485
7486 area:
7487 tolerance>=0,is_high_connectivity={ 0 | 1 }
7488
7489 Compute area of connected components in selected images.
7490
7491 Default values: 'is_high_connectivity=0'.
7492
7493 Example:
7494 [#1] image.jpg luminance stencil[-1] 1 +area 0
7495
7496 Tutorial: https://gmic.eu/oldtutorial/_area
7497
7498 area_fg:
7499 tolerance>=0,is_high_connectivity={ 0 | 1 }
7500
7501 Compute area of connected components for non-zero values in se‐
7502 lected images.
7503 Similar to 'area' except that 0-valued pixels are not considered.
7504
7505 Default values: 'is_high_connectivity=0'.
7506
7507 Example:
7508 [#1] image.jpg luminance stencil[-1] 1 +area_fg 0
7509
7510 at_line:
7511 x0[%],y0[%],z0[%],x1[%],y1[%],z1[%]
7512
7513 Retrieve pixels of the selected images belonging to the specified
7514 line (x0,y0,z0)-(x1,y1,z1).
7515
7516 Example:
7517 [#1] image.jpg +at_line 0,0,0,100%,100%,0 line[0]
7518 0,0,100%,100%,1,0xFF00FF00,255,0,0
7519
7520 at_quadrangle:
7521 x0[%],y0[%],x1[%],y1[%],x2[%],y2[%],x3[%],y3[%],_interpola‐
7522 tion,_boundary_conditions |
7523 x0[%],y0[%],z0[%],x1[%],y1[%],z1[%],x2[%],y2[%],z2[%],x3[%],y3[%],z3[%],_in‐
7524 terpolation,_boundary_conditions
7525
7526 Retrieve pixels of the selected images belonging to the specified
7527 2D or 3D quadrangle.
7528 'interpolation' can be { 0=nearest-neighbor | 1=linear | 2=cubic }.
7529 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
7530 | 3=mirror }.
7531
7532 Example:
7533 [#1] image.jpg params=5%,5%,95%,5%,60%,95%,40%,95% +at_quadrangle
7534 $params polygon.. 4,$params,0.5,255
7535
7536 barycenter:
7537
7538 Compute the barycenter vector of pixel values.
7539
7540 Example:
7541 [#1] 256,256 ellipse 50%,50%,20%,20%,0,1,1 deform 20 +barycenter
7542 +ellipse[-2] {@0,1},5,5,0,10
7543
7544 delaunay:
7545 _output_type={ 0=image | 1=coordinates/triangles }
7546
7547 Generate discrete 2D Delaunay triangulation of non-zero pixels in
7548 selected images.
7549 Input images must be scalar.
7550 Each pixel of the output image is a triplet (a,b,c) meaning the
7551 pixel belongs to
7552 the Delaunay triangle 'ABC' where 'a','b','c' are the labels of the
7553 pixels 'A','B','C'.
7554
7555 Example:
7556 [#1] 400,400 rand 32,255 100%,100% noise. 0.4,2 eq. 1 mul +delau‐
7557 nay
7558 [#2] image.jpg 100%,100% noise. 2,2 eq. 1 delaunay. +blend sha‐
7559 peaverage0
7560
7561 detect_skin:
7562 0<=tolerance<=1,_skin_x,_skin_y,_skin_radius>=0
7563
7564 Detect skin in selected color images and output an appartenance
7565 probability map.
7566 Detection is performed using CbCr chromaticity data of skin pixels.
7567 If arguments 'skin_x', 'skin_y' and 'skin_radius' are provided,
7568 skin pixels are learnt
7569 from the sample pixels inside the circle located at
7570 ('skin_x','skin_y') with radius 'skin_radius'.
7571
7572 Default value: 'tolerance=0.5' and 'skin_x=skiny=radius=-1'.
7573
7574 displacement (+):
7575 [source_image],_smoothness,_precision>=0,_nb_scales>=0,_itera‐
7576 tion_max>=0,is_backward={ 0 | 1 },_[guide]
7577
7578 Estimate displacement field between specified source and selected
7579 target images.
7580 If 'smoothness>=0', regularization type is set to isotropic, else
7581 to anisotropic.
7582 If 'nbscales==0', the number of scales used is estimated from the
7583 image size.
7584
7585 Default values: 'smoothness=0.1', 'precision=5', 'nb_scales=0',
7586 'iteration_max=10000', 'is_backward=1' and '[guide]=(unused)'.
7587
7588 Example:
7589 [#1] image.jpg +rotate 3,1,0,50%,50% +displacement[-1] [-2]
7590 quiver[-1] [-1],15,1,1,1,{1.5*iM}
7591
7592 distance (+):
7593 isovalue[%],_metric |
7594 isovalue[%],[metric],_method
7595
7596 Compute the unsigned distance function to specified isovalue, opt.
7597 according to a custom metric.
7598 'metric' can be { 0=chebyshev | 1=manhattan | 2=euclidean |
7599 3=squared-euclidean }.
7600 'method' can be { 0=fast-marching | 1=low-connectivity dijkstra |
7601 2=high-connectivity dijkstra | 3=1+return path | 4=2+return path }.
7602
7603 Default value: 'metric=2' and 'method=0'.
7604
7605 Example:
7606 [#1] image.jpg threshold 20% distance 0 pow 0.3
7607 [#2] 400,400 set 1,50%,50% +distance[0] 1,2 +distance[0] 1,1 dis‐
7608 tance[0] 1,0 mod 32 threshold 16 append c
7609
7610 Tutorial: https://gmic.eu/oldtutorial/_distance
7611
7612 fftpolar:
7613
7614 Compute fourier transform of selected images, as centered magni‐
7615 tude/phase images.
7616
7617 Example:
7618 [#1] image.jpg fftpolar ellipse 50%,50%,10,10,0,1,0 ifftpolar
7619
7620 histogram (+):
7621 nb_levels>0[%],_min_value[%],_max_value[%]
7622
7623 Compute the histogram of selected images.
7624 If value range is set, the histogram is estimated only for pixels
7625 in the specified
7626 value range. Argument 'max_value' must be specified if 'min_value'
7627 is set.
7628
7629 Default values: 'min_value=0%' and 'max_value=100%'.
7630
7631 Example:
7632 [#1] image.jpg +histogram 64 display_graph[-1] 400,300,3
7633
7634 histogram_nd:
7635 nb_levels>0[%],_value0[%],_value1[%]
7636
7637 Compute the 1D,2D or 3D histogram of selected multi-channels images
7638 (having 1,2 or 3 channels).
7639 If value range is set, the histogram is estimated only for pixels
7640 in the specified
7641 value range.
7642
7643 Default values: 'value0=0%' and 'value1=100%'.
7644
7645 Example:
7646 [#1] image.jpg channels 0,1 +histogram_nd 256
7647
7648 histogram_cumul:
7649 _nb_levels>0,_is_normalized={ 0 | 1 },_val0[%],_val1[%]
7650
7651 Compute cumulative histogram of selected images.
7652
7653 Default values: 'nb_levels=256', 'is_normalized=0', 'val0=0%' and
7654 'val1=100%'.
7655
7656 Example:
7657 [#1] image.jpg +histogram_cumul 256 histogram[0] 256 dis‐
7658 play_graph 400,300,3
7659
7660 histogram_pointwise:
7661 nb_levels>0[%],_value0[%],_value1[%]
7662
7663 Compute the histogram of each vector-valued point of selected im‐
7664 ages.
7665 If value range is set, the histogram is estimated only for values
7666 in the specified
7667 value range.
7668
7669 Default values: 'value0=0%' and 'value1=100%'.
7670
7671 hough:
7672 _width>0,_height>0,gradient_norm_voting={ 0 | 1 }
7673
7674 Compute hough transform (theta,rho) of selected images.
7675
7676 Default values: 'width=512', 'height=width' and 'gradient_norm_vot‐
7677 ing=1'.
7678
7679 Example:
7680 [#1] image.jpg +blur 1.5 hough[-1] 400,400 blur[-1] 0.5 add[-1] 1
7681 log[-1]
7682
7683 ifftpolar:
7684
7685 Compute inverse fourier transform of selected images, from centered
7686 magnitude/phase images.
7687
7688 img2patches:
7689 patch_size>0,_overlap[%]>0,_boundary_conditions
7690
7691 Decompose selected 2D images into (possibly overlapping) patches
7692 and stack them along the z-axis.
7693 'overlap' must be in range '[0,patch_size-1]'.
7694 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
7695 | 3=mirror }.
7696
7697 Default values: 'overlap=0' and 'boundary_conditions=0'.
7698 See also: patches2img.
7699 image.jpg img2patches 64
7700
7701 isophotes:
7702 _nb_levels>0
7703
7704 Render isophotes of selected images on a transparent background.
7705
7706 Default value: 'nb_levels=64'
7707
7708 Example:
7709 [#1] image.jpg blur 2 isophotes 6 dilate_circ 5 display_rgba
7710
7711 label (+):
7712 _tolerance>=0,is_high_connectivity={ 0 | 1 },_is_L2_norm={ 0 | 1
7713 }
7714
7715 Label connected components in selected images.
7716
7717 Default values: 'tolerance=0', 'is_high_connectivity=0' and
7718 'is_L2_norm=1'.
7719
7720 Example:
7721 [#1] image.jpg luminance threshold 60% label normalize 0,255 map
7722 0
7723 [#2] 400,400 set 1,50%,50% distance 1 mod 16 threshold 8 label
7724 mod 255 map 2
7725
7726 Tutorial: https://gmic.eu/oldtutorial/_label
7727
7728 label_fg:
7729 tolerance>=0,is_high_connectivity={ 0 | 1 }
7730
7731 Label connected components for non-zero values (foreground) in se‐
7732 lected images.
7733 Similar to 'label' except that 0-valued pixels are not labeled.
7734
7735 Default value: 'is_high_connectivity=0'.
7736
7737 laar:
7738
7739 Extract the largest axis-aligned rectangle in non-zero areas of se‐
7740 lected images.
7741 Rectangle coordinates are returned in status, as a sequence of num‐
7742 bers x0,y0,x1,y1.
7743
7744 Example:
7745 [#1] shape_cupid 256 coords=${-laar} normalize 0,255 to_rgb rec‐
7746 tangle $coords,0.5,0,128,0
7747
7748 max_patch:
7749 _patch_size>=1
7750
7751 Return locations of maximal values in local patch-based neighbor‐
7752 hood of given size for selected images.
7753
7754 Default value: 'patch_size=16'.
7755
7756 Example:
7757 [#1] image.jpg norm +max_patch 16
7758
7759 min_patch:
7760 _patch_size>=1
7761
7762 Return locations of minimal values in local patch-based neighbor‐
7763 hood of given size for selected images.
7764
7765 Default value: 'patch_size=16'.
7766
7767 Example:
7768 [#1] image.jpg norm +min_patch 16
7769
7770 minimal_path:
7771 x0[%]>=0,y0[%]>=0,z0[%]>=0,x1[%]>=0,y1[%]>=0,z1[%]>=0,_is_high_con‐
7772 nectivity={ 0 | 1 }
7773
7774 Compute minimal path between two points on selected potential maps.
7775
7776 Default value: 'is_high_connectivity=0'.
7777
7778 Example:
7779 [#1] image.jpg +gradient_norm fill[-1] 1/(1+i) minimal_path[-1]
7780 0,0,0,100%,100%,0 pointcloud[-1] 0 *[-1] 280 to_rgb[-1] ri[-1] [-2],0
7781 or
7782
7783 mse:
7784 [reference]
7785
7786 Compute MSE (Mean-Squared Error) between selected images and speci‐
7787 fied reference image.
7788 This command does not modify the images, it just returns a value or
7789 a list of values in the status.
7790
7791 mse_matrix:
7792
7793 Compute MSE (Mean-Squared Error) matrix between selected images.
7794
7795 Example:
7796 [#1] image.jpg +noise 30 +noise[0] 35 +noise[0] 38 cut. 0,255
7797 +mse_matrix
7798
7799 patches2img:
7800 width>0,height>0,_overlap[%]>0,_overlap_std[%]
7801
7802 Recompose 2D images from their selected patch representations.
7803 'overlap' must be in range '[0,patch_size-1]' where 'patch_size' is
7804 the width/height of the selected image.
7805 'overlap_std' is the standard deviation of the gaussian weights
7806 used for reconstructing overlapping patches.
7807 If 'overlap_std' is set to '-1', uniform weights are used rather
7808 than gaussian.
7809
7810 Default value: 'overlap=0' and 'overlap_std=-1'.
7811 See also: img2patches.
7812 image.jpg +img2patches 32,0,3 mirror[-1] xy patches2img[-1]
7813 {0,[w,h]}
7814
7815 patches:
7816 patch_width>0,patch_height>0,patch_depth>0,x0,y0,z0,_x1,_y1,_z1,...,_xN,_yN,_zN
7817
7818 Extract N+1 patches from selected images, centered at specified lo‐
7819 cations.
7820
7821 Example:
7822 [#1] image.jpg +patches
7823 64,64,1,153,124,0,184,240,0,217,126,0,275,38,0
7824
7825 matchpatch (+):
7826 [patch_im‐
7827 age],patch_width>=1,_patch_height>=1,_patch_depth>=1,_nb_itera‐
7828 tions>=0,_nb_randoms>=0,_patch_penalization,_output_score={ 0 | 1
7829 },_[guide]
7830
7831 Estimate correspondence map between selected images and specified
7832 patch image, using
7833 a patch-matching algorithm.
7834 Each pixel of the returned correspondence map gives the location
7835 (p,q) of the closest patch in
7836 the specified patch image. If 'output_score=1', the third channel
7837 also gives the corresponding
7838 matching score for each patch as well.
7839 If 'patch_penalization' is >=0, SSD is penalized with patch occur‐
7840 rences.
7841 If 'patch_penalization' is <0, SSD is inf-penalized when distance
7842 between patches are less than '-patch_penalization'.
7843
7844 Default values: 'patch_height=patch_width', 'patch_depth=1',
7845 'nb_iterations=5', 'nb_randoms=5', 'patch_penalization=0', 'out‐
7846 put_score=0' and
7847 'guide=(undefined)'.
7848
7849 Example:
7850 [#1] image.jpg sample colorful +matchpatch[0] [1],3 +warp[-2]
7851 [-1],0
7852
7853 plot2value:
7854
7855 Retrieve values from selected 2D graph plots.
7856
7857 Example:
7858 [#1] 400,300,1,1,'if(y>300*abs(cos(x/10+2*u)),1,0)' +plot2value
7859 +display_graph[-1] 400,300
7860
7861 pointcloud:
7862 _type = { -X=-X-opacity | 0=binary | 1=cumulative | 2=label |
7863 3=retrieve coordinates },_width,_height>0,_depth>0
7864
7865 Render a set of point coordinates, as a point cloud in a 1D/2D or
7866 3D binary image
7867 (or do the reverse, i.e. retrieve coordinates of non-zero points
7868 from a rendered point cloud).
7869 Input point coordinates can be a NxMx1x1, Nx1x1xM or 1xNx1xM image,
7870 where 'N' is the number of points,
7871 and M the point coordinates.
7872 If 'M'>3, the 3-to-M components sets the (M-3)-dimensional color at
7873 each point.
7874 Parameters 'width','height' and 'depth' are related to the size of
7875 the final image :
7876 - If set to 0, the size is automatically set along the speci‐
7877 fied axis.
7878 - If set to N>0, the size along the specified axis is N.
7879 - If set to N<0, the size along the specified axis is at most
7880 N.
7881 Points with coordinates that are negative or higher than specified
7882 ('width','height','depth')
7883 are not plotted.
7884
7885 Default values: 'type=0' and 'max_width=max_height=max_depth=0'.
7886
7887 Example:
7888 [#1] 3000,2 rand 0,400 +pointcloud 0 dilate[-1] 3
7889 [#2] 3000,2 rand 0,400 {w} {w},3 rand[-1] 0,255 append y +point‐
7890 cloud 0 dilate[-1] 3
7891
7892 psnr:
7893 [reference],_max_value>0
7894
7895 Compute PSNR (Peak Signal-to-Noise Ratio) between selected images
7896 and specified reference image.
7897 This command does not modify the images, it just returns a value or
7898 a list of values in the status.
7899
7900 Default value: 'max_value=255'.
7901
7902 psnr_matrix:
7903 _max_value>0
7904
7905 Compute PSNR (Peak Signal-to-Noise Ratio) matrix between selected
7906 images.
7907
7908 Default value: 'max_value=255'.
7909
7910 Example:
7911 [#1] image.jpg +noise 30 +noise[0] 35 +noise[0] 38 cut. 0,255
7912 +psnr_matrix
7913
7914 segment_watershed:
7915 _threshold>=0
7916
7917 Apply watershed segmentation on selected images.
7918
7919 Default values: 'threshold=2'.
7920
7921 Example:
7922 [#1] image.jpg segment_watershed 2
7923
7924 shape2bump:
7925 _resolution>=0,0<=_weight_std_max_avg<=1,_dilation,_smoothness>=0
7926
7927 Estimate bumpmap from binary shape in selected images.
7928
7929 Default value: 'resolution=256', 'weight_std_max=0.75', 'dila‐
7930 tion=0' and 'smoothness=100'.
7931
7932 skeleton:
7933 _boundary_conditions={ 0=dirichlet | 1=neumann }
7934
7935 Compute skeleton of binary shapes using distance transform and con‐
7936 strained thinning.
7937
7938 Default value: 'boundary_conditions=1'.
7939
7940 Example:
7941 [#1] shape_cupid 320 +skeleton 0
7942
7943 slic:
7944 size>0,_regularity>=0,_nb_iterations>0
7945
7946 Segment selected 2D images with superpixels, using the SLIC algo‐
7947 rithm (Simple Linear Iterative Clustering).
7948 Scalar images of increasingly labeled pixels are returned.
7949 Reference paper: Achanta, R., Shaji, A., Smith, K., Lucchi, A.,
7950 Fua, P., & Susstrunk, S. (2010). SLIC Superpixels (No. EPFL-RE‐
7951 PORT-149300).
7952
7953 Default values: 'size=16', 'regularity=10' and 'nb_iterations=10'.
7954
7955 Example:
7956 [#1] image.jpg +srgb2lab slic[-1] 16 +blend shapeaverage f[-2]
7957 "j(1,0)==i && j(0,1)==i" *[-1] [-2]
7958
7959 ssd_patch:
7960 [patch],_use_fourier={ 0 | 1 },_boundary_conditions
7961
7962 Compute fields of SSD between selected images and specified patch.
7963 Argument 'boundary_conditions' is valid only when 'use_fourier=0'.
7964 'boundary_conditions' can be { 0=dirichlet | 1=neumann | 2=periodic
7965 | 3=mirror }.
7966
7967 Default value: 'use_fourier=0' and 'boundary_conditions=0'.
7968
7969 Example:
7970 [#1] image.jpg +crop 20%,20%,35%,35% +ssd_patch[0] [1],0,0
7971
7972 ssim:
7973 [reference],_patch_size>0,_max_value>0
7974
7975 Compute the Structural Similarity Index Measure (SSIM) between se‐
7976 lected images and specified reference image.
7977 This command does not modify the images, it just returns a value or
7978 a list of values in the status.
7979 When 'downsampling_factor' is specified with a ending '%', its
7980 value is equal to '1+(patch_size-1)*spatial_factor%'.
7981
7982 SSIM is a measure introduced int the following paper:
7983 Wang, Zhou, et al., "Image quality assessment: from error visibil‐
7984 ity to structural similarity.",
7985 in IEEE transactions on image processing 13.4 (2004): 600-612.
7986
7987 The implementation of this command is a direct translation of the
7988 reference code (in Matlab), found at :
7989 https://ece.uwaterloo.ca/~z70wang/research/ssim/
7990
7991 Default values: 'patch_size=11', and 'max_value=255'.
7992
7993 ssim_matrix:
7994 _patch_size>0,_max_value>0
7995
7996 Compute SSIM (Structural Similarity Index Measure) matrix between
7997 selected images.
7998
7999 Default values: 'patch_size=11', and 'max_value=255'.
8000
8001 Example:
8002 [#1] image.jpg +noise 30 +noise[0] 35 +noise[0] 38 cut. 0,255
8003 +ssim_matrix
8004
8005 thinning:
8006 _boundary_conditions={ 0=dirichlet | 1=neumann }
8007
8008 Compute skeleton of binary shapes using morphological thinning
8009 (beware, this is a quite slow iterative process)
8010
8011 Default value: 'boundary_conditions=1'.
8012
8013 Example:
8014 [#1] shape_cupid 320 +thinning
8015
8016 tones:
8017 N>0
8018
8019 Get N tones masks from selected images.
8020
8021 Example:
8022 [#1] image.jpg +tones 3
8023
8024 topographic_map:
8025 _nb_levels>0,_smoothness
8026
8027 Render selected images as topographic maps.
8028
8029 Default values: 'nb_levels=16' and 'smoothness=2'.
8030
8031 Example:
8032 [#1] image.jpg topographic_map 10
8033
8034 tsp:
8035 _precision>=0
8036
8037 Try to solve the 'travelling salesman' problem, using a combination
8038 of greedy search and 2-opt algorithms.
8039 Selected images must have dimensions Nx1x1xC to represent N cities
8040 each with C-dimensional coordinates.
8041 This command re-order the selected data along the x-axis so that
8042 the point sequence becomes a shortest path.
8043
8044 Default values: 'precision=256'.
8045
8046 Example:
8047 [#1] 256,1,1,2 rand 0,512 tsp , 512,512,1,3 repeat w#0 circle[-1]
8048 {0,I[$>]},2,1,255,255,255 line[-1] {0,bound‐
8049 ary=2;[I[$>],I[$>+1]]},1,255,128,0 done keep[-1]
8050
8051 variance_patch:
8052 _patch_size>=1
8053
8054 Compute variance of each images patch centered at (x,y), in se‐
8055 lected images.
8056
8057 Default value: 'patch_size=16'
8058
8059 Example:
8060 [#1] image.jpg +variance_patch
8061
8062 12.10. Image Drawing
8063 -------------
8064
8065 arrow:
8066 x0[%],y0[%],x1[%],y1[%],_thick‐
8067 ness[%]>=0,_head_length[%]>=0,_head_thickness[%]>=0,_opacity,_pat‐
8068 tern,_color1,...
8069
8070 Draw specified arrow on selected images.
8071 'pattern' is an hexadecimal number starting with '0x' which can be
8072 omitted
8073 even if a color is specified. If a pattern is specified, the arrow
8074 is
8075 drawn outlined instead of filled.
8076
8077 Default values: 'thickness=1%', 'head_length=10%', 'head_thick‐
8078 ness=3%', 'opacity=1', 'pattern=(undefined)' and 'color1=0'.
8079
8080 Example:
8081 [#1] 400,400,1,3 repeat 100 arrow
8082 50%,50%,{u(100)}%,{u(100)}%,3,20,10,0.3,${-rgb} done
8083
8084 axes:
8085 x0,x1,y0,y1,_font_height>=0,_opacity,_pattern,_color1,...
8086
8087 Draw xy-axes on selected images.
8088 'pattern' is an hexadecimal number starting with '0x' which can be
8089 omitted
8090 even if a color is specified.
8091 To draw only one x-axis at row Y, set both 'y0' and 'y1' to Y.
8092 To draw only one y-axis at column X, set both 'x0' and 'x1' to X.
8093
8094 Default values: 'font_height=14', 'opacity=1', 'pattern=(unde‐
8095 fined)' and 'color1=0'.
8096
8097 Example:
8098 [#1] 400,400,1,3,255 axes -1,1,1,-1
8099
8100 ball:
8101 _size>0, _R,_G,_B,0<=_specular_light<=8,0<=_specu‐
8102 lar_size<=8,_shadow>=0
8103
8104 Input a 2D RGBA colored ball sprite.
8105
8106 Default values: 'size=64', 'R=255', 'G=R', 'B=R', 'specu‐
8107 lar_light=0.8', 'specular_size=1' and 'shading=1.5'.
8108
8109 Example:
8110 [#1] repeat 9 { ball {1.5^($>+2)},${-rgb} } append x
8111
8112 chessboard:
8113 size1>0,_size2>0,_offset1,_offset2,_angle,_opac‐
8114 ity,_color1,...,_color2,...
8115
8116 Draw chessboard on selected images.
8117
8118 Default values: 'size2=size1', 'offset1=offset2=0', 'angle=0',
8119 'opacity=1', 'color1=0' and 'color2=255'.
8120
8121 Example:
8122 [#1] image.jpg chessboard 32,32,0,0,25,0.3,255,128,0,0,128,255
8123
8124 cie1931:
8125
8126 Draw CIE-1931 chromaticity diagram on selected images.
8127
8128 Example:
8129 [#1] 500,400,1,3 cie1931
8130
8131 circle:
8132 x[%],y[%],R[%],_opacity,_pattern,_color1,...
8133
8134 Draw specified colored circle on selected images.
8135 A radius of '100%' stands for 'sqrt(width^2+height^2)'.
8136 'pattern' is an hexadecimal number starting with '0x' which can be
8137 omitted
8138 even if a color is specified. If a pattern is specified, the circle
8139 is
8140 drawn outlined instead of filled.
8141
8142 Default values: 'opacity=1', 'pattern=(undefined)' and 'color1=0'.
8143
8144 Example:
8145 [#1] image.jpg repeat 300 circle
8146 {u(100)}%,{u(100)}%,{u(30)},0.3,${-rgb} done circle 50%,50%,100,0.7,255
8147
8148 close_binary:
8149 0<=_endpoint_rate<=100,_endpoint_connectivity>=0,_spline_dist‐
8150 max>=0,_segment_distmax>=0,0<=_spline_anglemax<=180,_spline_round‐
8151 ness>=0,_area_min>=0,_allow_self_intersection={ 0 | 1 }
8152
8153 Automatically close open shapes in binary images (defining white
8154 strokes on black background).
8155
8156 Default values: 'endpoint_rate=75', 'endpoint_connectivity=2',
8157 'spline_distmax=80', 'segment_distmax=20', 'spline_anglemax=90',
8158 'spline_roundness=1',
8159 'area_min=100', 'allow_self_intersection=1'.
8160
8161 ellipse (+):
8162 x[%],y[%],R[%],r[%],_angle,_opacity,_pattern,_color1,...
8163
8164 Draw specified colored ellipse on selected images.
8165 A radius of '100%' stands for 'sqrt(width^2+height^2)'.
8166 'pattern' is an hexadecimal number starting with '0x' which can be
8167 omitted
8168 even if a color is specified. If a pattern is specified, the el‐
8169 lipse is
8170 drawn outlined instead of filled.
8171
8172 Default values: 'opacity=1', 'pattern=(undefined)' and 'color1=0'.
8173
8174 Example:
8175 [#1] image.jpg repeat 300 ellipse
8176 {u(100)}%,{u(100)}%,{u(30)},{u(30)},{u(180)},0.3,${-rgb} done ellipse
8177 50%,50%,100,100,0,0.7,255
8178
8179 flood (+):
8180 x[%],_y[%],_z[%],_tolerance>=0,_is_high_connectivity={ 0 | 1
8181 },_opacity,_color1,...
8182
8183 Flood-fill selected images using specified value and tolerance.
8184
8185 Default values: 'y=z=0', 'tolerance=0', 'is_high_connectivity=0',
8186 'opacity=1' and 'color1=0'.
8187
8188 Example:
8189 [#1] image.jpg repeat 1000 flood
8190 {u(100)}%,{u(100)}%,0,20,0,1,${-rgb} done
8191
8192 gaussian:
8193 _sigma1[%],_sigma2[%],_angle
8194
8195 Draw a centered gaussian on selected images, with specified stan‐
8196 dard deviations and orientation.
8197
8198 Default values: 'sigma1=3', 'sigma2=sigma1' and 'angle=0'.
8199
8200 Example:
8201 [#1] 400,400 gaussian 100,30,45
8202
8203 Tutorial: https://gmic.eu/oldtutorial/_gaussian
8204
8205 graph (+):
8206 [function_image],_plot_type,_vertex_type,_ymin,_ymax,_opac‐
8207 ity,_pattern,_color1,... |
8208 'formula',_resolution>=0,_plot_type,_ver‐
8209 tex_type,_xmin,xmax,_ymin,_ymax,_opacity,_pattern,_color1,...
8210
8211 Draw specified function graph on selected images.
8212 'plot_type' can be { 0=none | 1=lines | 2=splines | 3=bar }.
8213 'vertex_type' can be { 0=none | 1=points | 2,3=crosses | 4,5=cir‐
8214 cles | 6,7=squares }.
8215 'pattern' is an hexadecimal number starting with '0x' which can be
8216 omitted
8217 even if a color is specified.
8218
8219 Default values: 'plot_type=1', 'vertex_type=1', 'ymin=ymax=0
8220 (auto)', 'opacity=1', 'pattern=(undefined)'
8221 and 'color1=0'.
8222
8223 Example:
8224 [#1] image.jpg +rows 50% blur[-1] 3 split[-1] c div[0] 1.5
8225 graph[0] [1],2,0,0,0,1,255,0,0 graph[0] [2],2,0,0,0,1,0,255,0 graph[0]
8226 [3],2,0,0,0,1,0,0,255 keep[0]
8227
8228 grid:
8229 size_x[%]>=0,size_y[%]>=0,_offset_x[%],_offset_y[%],_opac‐
8230 ity,_pattern,_color1,...
8231
8232 Draw xy-grid on selected images.
8233 'pattern' is an hexadecimal number starting with '0x' which can be
8234 omitted
8235 even if a color is specified.
8236
8237 Default values: 'offset_x=offset_y=0', 'opacity=1', 'pattern=(unde‐
8238 fined)' and 'color1=0'.
8239
8240 Example:
8241 [#1] image.jpg grid 10%,10%,0,0,0.5,255
8242 [#2] 400,400,1,3,255 grid 10%,10%,0,0,0.3,0xCCCCCCCC,128,32,16
8243
8244 j (+):
8245 Shortcut for command 'image'.
8246
8247 image (+):
8248 [sprite],_x[%|~],_y[%|~],_z[%|~],_c[%|~],_opacity,_[opac‐
8249 ity_mask],_max_opacity_mask
8250
8251 Draw specified sprite image on selected images.
8252 (equivalent to shortcut command 'j').
8253
8254 If one of the x,y,z or c argument ends with a '~', its value is ex‐
8255 pected to be
8256 a centering ratio (in [0,1]) rather than a position.
8257 Usual centering ratio are { 0=left-justified | 0.5=centered |
8258 1=right-justified }.
8259
8260 Default values: 'x=y=z=c=0', 'opacity=1', 'opacity_mask=(unde‐
8261 fined)' and 'max_opacity_mask=1'.
8262
8263 Example:
8264 [#1] image.jpg +crop 40%,40%,60%,60% resize[-1] 200%,200%,1,3,5
8265 frame[-1] 2,2,0 image[0] [-1],30%,30% keep[0]
8266
8267 line (+):
8268 x0[%],y0[%],x1[%],y1[%],_opacity,_pattern,_color1,...
8269
8270 Draw specified colored line on selected images.
8271 'pattern' is an hexadecimal number starting with '0x' which can be
8272 omitted
8273 even if a color is specified.
8274
8275 Default values: 'opacity=1', 'pattern=(undefined)' and 'color1=0'.
8276
8277 Example:
8278 [#1] image.jpg repeat 500 line 50%,50%,{u(w)},{u(h)},0.5,${-rgb}
8279 done line 0,0,100%,100%,1,0xCCCCCCCC,255 line 100%,0,0,100%,1,0xCCCCC‐
8280 CCC,255
8281
8282 thickline:
8283 x0[%],y0[%],x1[%],y1[%],_thickness,_opacity,_color1
8284
8285 Draw specified colored thick line on selected images.
8286
8287 Default values: 'thickness=2', 'opacity=1' and 'color1=0'.
8288
8289 Example:
8290 [#1] 400,400,1,3 repeat 100 thickline
8291 {u([w,h,w,h,5])},0.5,${-rgb} done
8292
8293 mandelbrot (+):
8294 z0r,z0i,z1r,z1i,_iteration_max>=0,_is_julia={ 0 | 1
8295 },_c0r,_c0i,_opacity
8296
8297 Draw mandelbrot/julia fractal on selected images.
8298
8299 Default values: 'iteration_max=100', 'is_julia=0', 'c0r=c0i=0' and
8300 'opacity=1'.
8301
8302 Example:
8303 [#1] 400,400 mandelbrot -2.5,-2,2,2,1024 map 0 +blur 2 eleva‐
8304 tion3d[-1] -0.2
8305
8306 marble:
8307 _image_weight,_pattern_weight,_angle,_amplitude,_sharp‐
8308 ness>=0,_anisotropy>=0,_alpha,_sigma,_cut_low>=0,_cut_high>=0
8309
8310 Render marble like pattern on selected images.
8311
8312 Default values: 'image_weight=0.2', 'pattern_weight=0.1', 'an‐
8313 gle=45', 'amplitude=0', 'sharpness=0.4' and 'anisotropy=0.8',
8314 'alpha=0.6', 'sigma=1.1' and 'cut_low=cut_high=0'.
8315
8316 Example:
8317 [#1] image.jpg +marble ,
8318
8319 maze:
8320 _width>0,_height>0,_cell_size>0
8321
8322 Input maze with specified size.
8323
8324 Example:
8325 [#1] maze 30,20 negate normalize 0,255
8326
8327 maze_mask:
8328 _cellsize>0
8329
8330 Input maze according to size and shape of selected mask images.
8331 Mask may contain disconnected shapes.
8332
8333 Example:
8334 [#1] 0 text "G'MIC",0,0,53,1,1 dilate 3 autocrop 0 frame 1,1,0
8335 maze_mask 8 dilate 3 negate mul 255
8336
8337 newton_fractal:
8338 z0r,z0i,z1r,z1i,_angle,0<=_descent_method<=2,_itera‐
8339 tion_max>=0,_convergence_preci‐
8340 sion>0,_expr_p(z),_expr_dp(z),_expr_d2p(z)
8341
8342 Draw newton fractal on selected images, for complex numbers in
8343 range (z0r,z0i) - (z1r,z1i).
8344 Resulting images have 3 channels whose meaning is [ last_zr,
8345 last_zi, nb_iter_used_for_convergence ].
8346 'descent_method' can be { 0=secant | 1=newton | 2=householder }.
8347
8348 Default values: 'angle=0', 'descent_method=1', 'iteration_max=200',
8349 'convergence_precision=0.01', 'expr_p(z)=z^^3-1', 'expr_dp(z)=3*z^^2'
8350 and
8351 'expr_d2z(z)=6*z'.
8352
8353 Example:
8354 [#1] 400,400 newton_fractal -1.5,-1.5,1.5,1.5,0,2,200,0.01,"z^^6
8355 + z^^3 - 1","6*z^^5 + 3*z^^2","30*z^^4 + 6*z" f "[
8356 atan2(i1,i0)*90+20,1,cut(i2/30,0.2,0.7) ]" hsl2rgb
8357
8358 j3d (+):
8359 Shortcut for command 'object3d'.
8360
8361 object3d (+):
8362 [object3d],_x[%],_y[%],_z,_opacity,_rendering_mode,_is_dou‐
8363 ble_sided={ 0 | 1 },_is_zbuffer={ 0 | 1 },_fo‐
8364 cale,_light_x,_light_y,_light_z,_specular_lightness,_specular_shininess
8365
8366 Draw specified 3D object on selected images.
8367 (equivalent to shortcut command 'j3d').
8368
8369 'rendering_mode' can be { 0=dots | 1=wireframe | 2=flat | 3=flat-
8370 shaded | 4=gouraud-shaded | 5=phong-shaded }.
8371
8372 Default values: 'x=y=z=0', 'opacity=1' and 'is_zbuffer=1'. All
8373 other arguments take their default values
8374 from the 3D environment variables.
8375
8376 Example:
8377 [#1] image.jpg torus3d 100,10 cone3d 30,-120 add3d[-2,-1] ro‐
8378 tate3d. 1,1,0,60 object3d[0] [-1],50%,50% keep[0]
8379
8380 pack_sprites:
8381 _nb_scales>=0,0<=_min_scale<=100,_allow_rotation={ 0=0 deg. |
8382 1=180 deg. | 2=90 deg. | 3=any },_spacing,_precision>=0,max_itera‐
8383 tions>=0
8384
8385 Try to randomly pack as many sprites as possible onto the 'empty'
8386 areas of an image.
8387 Sprites can be eventually rotated and scaled during the packing
8388 process.
8389 First selected image is the canvas that will be filled with the
8390 sprites.
8391 Its last channel must be a binary mask whose zero values represent
8392 potential locations for drawing the sprites.
8393 All other selected images represent the sprites considered for
8394 packing.
8395 Their last channel must be a binary mask that represents the sprite
8396 shape (i.e. a 8-connected component).
8397 The order of sprite packing follows the order of specified sprites
8398 in the image list.
8399 Sprite packing is done on random locations and iteratively with de‐
8400 creasing scales.
8401 'nb_scales' sets the number of decreasing scales considered for all
8402 specified sprites to be packed.
8403 'min_scale' (in %) sets the minimal size considered for packing
8404 (specified as a percentage of the
8405 original sprite size).
8406 'spacing' can be positive or negative.
8407 'precision' tells about the desired number of failed trials before
8408 ending the filling process.
8409
8410 Default values: 'nb_scales=5', 'min_scale=25', 'allow_rotation=3',
8411 'spacing=1', 'precision=7' and 'max_iterations=256'.
8412
8413 Example:
8414 [#1] 512,512,1,3,"min(255,y*c/2)" 100%,100% circle
8415 50%,50%,100,1,255 append c image.jpg resize2dy[-1] 24 to_rgba
8416 pack_sprites 3,25
8417
8418 piechart:
8419 label_height>=0,label_R,label_G,label_B,"la‐
8420 bel1",value1,R1,G1,B1,...,"labelN",valueN,RN,GN,BN
8421
8422 Draw pie chart on selected (RGB) images.
8423
8424 Example:
8425 [#1] image.jpg piechart
8426 25,0,0,0,"Red",55,255,0,0,"Green",40,0,255,0,"Blue",30,128,128,255,"Other",5,128,128,128
8427
8428 plasma (+):
8429 _alpha,_beta,_scale>=0
8430
8431 Draw a random colored plasma fractal on selected images.
8432 This command implements the so-called 'Diamond-Square' algorithm.
8433
8434 Default values: 'alpha=1', 'beta=1' and 'scale=8'.
8435
8436 Example:
8437 [#1] 400,400,1,3 plasma
8438
8439 Tutorial: https://gmic.eu/oldtutorial/_plasma
8440
8441 point (+):
8442 x[%],_y[%],_z[%],_opacity,_color1,...
8443
8444 Set specified colored pixel on selected images.
8445
8446 Default values: 'z=0', 'opacity=1' and 'color1=0'.
8447
8448 Example:
8449 [#1] image.jpg repeat 10000 point {u(100)}%,{u(100)}%,0,1,${-rgb}
8450 done
8451
8452 polka_dots:
8453 diameter>=0,_density,_offset1,_offset2,_angle,_aliasing,_shad‐
8454 ing,_opacity,_color,...
8455
8456 Draw dots pattern on selected images.
8457
8458 Default values: 'density=20', 'offset1=offset2=50', 'angle=0',
8459 'aliasing=10', 'shading=1', 'opacity=1' and 'color=255'.
8460
8461 Example:
8462 [#1] image.jpg polka_dots 10,15,0,0,20,10,1,0.5,0,128,255
8463
8464 polygon (+):
8465 N>=1,x1[%],y1[%],...,xN[%],yN[%],_opacity,_pattern,_color1,...
8466
8467 Draw specified colored N-vertices polygon on selected images.
8468 'pattern' is an hexadecimal number starting with '0x' which can be
8469 omitted
8470 even if a color is specified. If a pattern is specified, the poly‐
8471 gon is
8472 drawn outlined instead of filled.
8473
8474 Default values: 'opacity=1', 'pattern=(undefined)' and 'color1=0'.
8475
8476 Example:
8477 [#1] image.jpg polygon
8478 4,20%,20%,80%,30%,80%,70%,20%,80%,0.3,0,255,0 polygon
8479 4,20%,20%,80%,30%,80%,70%,20%,80%,1,0xCCCCCCCC,255
8480 [#2] image.jpg 2,16,1,1,'u(if(x,{h},{w}))' polygon[-2]
8481 {h},{^},0.6,255,0,255 remove[-1]
8482
8483 quiver:
8484 [function_image],_sampling[%]>0,_factor>=0,_is_arrow={ 0 | 1
8485 },_opacity,_color1,...
8486
8487 Draw specified 2D vector/orientation field on selected images.
8488
8489 Default values: 'sampling=5%', 'factor=1', 'is_arrow=1', 'opac‐
8490 ity=1', 'pattern=(undefined)'
8491 and 'color1=0'.
8492
8493 Example:
8494 [#1] 100,100,1,2,'if(c==0,x-w/2,y-h/2)' 500,500,1,3,255
8495 quiver[-1] [-2],10
8496 [#2] image.jpg +resize2dy 600 luminance[0] gradient[0] mul[1] -1
8497 reverse[0,1] append[0,1] c blur[0] 8 orientation[0] quiver[1]
8498 [0],20,1,1,0.8,255
8499
8500 rectangle:
8501 x0[%],y0[%],x1[%],y1[%],_opacity,_pattern,_color1,...
8502
8503 Draw specified colored rectangle on selected images.
8504 'pattern' is an hexadecimal number starting with '0x' which can be
8505 omitted
8506 even if a color is specified. If a pattern is specified, the rec‐
8507 tangle is
8508 drawn outlined instead of filled.
8509
8510 Default values: 'opacity=1', 'pattern=(undefined)' and 'color1=0'.
8511
8512 Example:
8513 [#1] image.jpg repeat 30 { rectangle
8514 {u(100)}%,{u(100)}%,{u(100)}%,{u(100)}%,0.3,${-rgb} }
8515
8516 rorschach:
8517 'smoothness[%]>=0','mirroring={ 0=none | 1=x | 2=y | 3=xy }
8518
8519 Render rorschach-like inkblots on selected images.
8520
8521 Default values: 'smoothness=5%' and 'mirroring=1'.
8522
8523 Example:
8524 [#1] 400,400 rorschach 3%
8525
8526 sierpinski:
8527 recursion_level>=0
8528
8529 Draw Sierpinski triangle on selected images.
8530
8531 Default value: 'recursion_level=7'.
8532
8533 Example:
8534 [#1] image.jpg sierpinski 7
8535
8536 spiralbw:
8537 width>0,_height>0,_is_2dcoords={ 0 | 1 }
8538
8539 Input a 2D rectangular spiral image with specified size.
8540
8541 Default values: 'height=width' and 'is_2dcoords=0'.
8542
8543 Example:
8544 [#1] spiralbw 16
8545 [#2] image.jpg spiralbw {[w,h]},1 +warp[0] [1],0,1,1 +warp[2]
8546 [1],2,1,1
8547
8548 spline:
8549 x0[%],y0[%],u0[%],v0[%],x1[%],y1[%],u1[%],v1[%],_opac‐
8550 ity,_color1,...
8551
8552 Draw specified colored spline curve on selected images (cubic her‐
8553 mite spline).
8554
8555 Default values: 'opacity=1' and 'color1=0'.
8556
8557 Example:
8558 [#1] image.jpg repeat 30 { spline
8559 {u(100)}%,{u(100)}%,{u(-600,600)},{u(-600,600)},{u(100)}%,{u(100)}%,{u(-600,600)},{u(-600,600)},0.6,255
8560 }
8561
8562 tetraedron_shade:
8563 x0,y0,z0,x1,y1,z1,x2,y2,z2,x3,y3,z3,R0,G0,B0,...,R1,G1,B1,...,R2,G2,B2,...,R3,G3,B3,...
8564
8565 Draw tetraedron with interpolated colors on selected (volumetric)
8566 images.
8567
8568 t (+):
8569 Shortcut for command 'text'.
8570
8571 text (+):
8572 text,_x[%|~],_y[%|~],_font_height[%]>=0,_opacity,_color1,...
8573
8574 Draw specified colored text string on selected images.
8575 (equivalent to shortcut command 't').
8576
8577 If one of the x or y argument ends with a '~', its value is ex‐
8578 pected to be
8579 a centering ratio (in [0,1]) rather than a position.
8580 Usual centering ratio are { 0=left-justified | 0.5=centered |
8581 1=right-justified }.
8582 Sizes '13' and '128' are special and correspond to binary fonts
8583 (no-antialiasing).
8584 Any other font size is rendered with anti-aliasing.
8585 Specifying an empty target image resizes it to new dimensions such
8586 that the image contains
8587 the entire text string.
8588
8589 Default values: 'x=y=0.01~', 'font_height=16', 'opacity=1' and
8590 'color1=0'.
8591
8592 Example:
8593 [#1] image.jpg resize2dy 600 y=0 repeat 30 { text {2*$>}" : This
8594 is a nice text, isn't it ?",10,$y,{2*$>},0.9,255 y+={2*$>} }
8595 [#2] 0 text "G'MIC",0,0,23,1,255
8596
8597 to:
8598 Shortcut for command 'text_outline'.
8599
8600 text_outline:
8601 text,_x[%|~],_y[%|~],_font_height[%]>0,_outline>=0,_opac‐
8602 ity,_color1,...
8603
8604 Draw specified colored and outlined text string on selected images.
8605 If one of the x or y argument ends with a '~', its value is ex‐
8606 pected to be
8607 a centering ratio (in [0,1]) rather than a position.
8608 Usual centering ratio are { 0=left-justified | 0.5=centered |
8609 1=right-justified }.
8610
8611 Default values: 'x=y=0.01~', 'font_height=7.5%', 'outline=2',
8612 'opacity=1', 'color1=color2=color3=255' and 'color4=255'.
8613
8614 Example:
8615 [#1] image.jpg text_outline "Hi there!",10,10,63,3
8616
8617 triangle_shade:
8618 x0,y0,x1,y1,x2,y2,R0,G0,B0,...,R1,G1,B1,...,R2,G2,B2,...
8619
8620 Draw triangle with interpolated colors on selected images.
8621
8622 Example:
8623 [#1] image.jpg triangle_shade
8624 20,20,400,100,120,200,255,0,0,0,255,0,0,0,255
8625
8626 truchet:
8627 _scale>0,_radius>=0,_pattern_type={ 0=straight | 1=curved }
8628
8629 Fill selected images with random truchet patterns.
8630
8631 Default values: 'scale=32', 'radius=5' and 'pattern_type=1'.
8632
8633 Example:
8634 [#1] 400,300 truchet ,
8635
8636 turbulence:
8637 _radius>0,_octaves={1,2,3...,12},_alpha>0,_differ‐
8638 ence={-10,10},_mode={0,1,2,3}
8639
8640 Render fractal noise or turbulence on selected images.
8641
8642 Default values: 'radius=32', 'octaves=6', 'alpha=3', 'difference=0'
8643 and 'mode=0'.
8644
8645 Example:
8646 [#1] 400,400,1,3 turbulence 16
8647
8648 Tutorial: https://gmic.eu/oldtutorial/_turbulence
8649
8650 yinyang:
8651
8652 Draw a yin-yang symbol on selected images.
8653
8654 Example:
8655 [#1] 400,400 yinyang
8656
8657 12.11. Matrix Computation
8658 ------------------
8659
8660 dijkstra (+):
8661 starting_node>=0,ending_node>=0
8662
8663 Compute minimal distances and paths from specified adjacency matri‐
8664 ces by the Dijkstra algorithm.
8665
8666 eigen (+):
8667
8668 Compute the eigenvalues and eigenvectors of selected symmetric ma‐
8669 trices or matrix fields.
8670 If one selected image has 3 or 6 channels, it is regarded as a
8671 field of 2x2 or 3x3 symmetric matrices,
8672 whose eigen elements are computed at each point of the field.
8673
8674 Example:
8675 [#1] (1,0,0;0,2,0;0,0,3) +eigen
8676 [#2] image.jpg structuretensors blur 2 eigen split[0] c
8677
8678 Tutorial: https://gmic.eu/oldtutorial/_eigen
8679
8680 eye:
8681 _size>0
8682
8683 Insert an identity matrix of given size at the end of the image
8684 list.
8685
8686 Example:
8687 [#1] eye 3 eye 7 eye 10
8688
8689 invert (+):
8690 solver={ 0=SVD | 1=LU }
8691
8692 Compute the inverse of the selected matrices.
8693 SVD solver is slower but less numerically instable than LU.
8694
8695 Default value: 'solver=1'.
8696
8697 Example:
8698 [#1] (0,1,0;0,0,1;1,0,0) +invert
8699
8700 orthogonalize:
8701 _mode = { 0=orthogonalize | 1=orthonormalize }
8702
8703 Orthogonalize or orthonormalize selected matrices, using Modified
8704 Gram-Schmidt process.
8705
8706 Default value: 'mode=0'.
8707
8708 meigen:
8709 m>=1
8710
8711 Compute an approximation of the 'm' largest eigenvalues and eigen‐
8712 vectors of selected symmetric matrices,
8713 using the Arnoldi iteration method
8714 (https://en.wikipedia.org/wiki/Arnoldi_iteration).
8715 A larger 'm' goes with better numerical precision.
8716
8717 Example:
8718 [#1] (1,0,0;0,2,0;0,0,3) +meigen 3
8719
8720 mproj (+):
8721 [dictionary],_method,_max_iter={ 0=auto | >0 },_max_residual>=0
8722
8723 Find best matching projection of selected matrices onto the span of
8724 an over-complete
8725 dictionary D, using the orthogonal projection or Matching Pursuit
8726 algorithm.
8727 Selected images are 2D-matrices in which each column represent a
8728 signal to project.
8729 '[dictionary]' is a matrix in which each column is an element of
8730 the dictionary D.
8731 'method' tells what projection algorithm must be applied. It can
8732 be:
8733 - 0 = orthogonal projection (least-squares solution using LU-
8734 based solver).
8735 - 1 = matching pursuit.
8736 - 2 = matching pursuit, with a single orthogonal projection step
8737 at the end.
8738 - >=3 = orthogonal matching pursuit where an orthogonal projec‐
8739 tion step is performed
8740 every 'method-2' iterations.
8741 'max_iter' sets the max number of iterations processed for each
8742 signal.
8743 If set to '0' (default), 'max_iter' is equal to the number of col‐
8744 umns in D.
8745 (only meaningful for matching pursuit and its variants).
8746 'max_residual' gives a stopping criterion on signal reconstruction
8747 accuracy.
8748 (only meaningful for matching pursuit and its variants).
8749 For each selected image, the result is returned as a matrix W
8750 whose columns correspond to the weights associated to each column
8751 of D,
8752 such that the matrix product D*W is an approximation of the input
8753 matrix.
8754
8755 Default values: 'method=0', 'max_iter=0' and 'max_residual=1e-6'.
8756
8757 solve (+):
8758 [image]
8759
8760 Solve linear system AX = B for selected B-matrices and specified A-
8761 matrix.
8762 If the system is under- or over-determined, the least squares solu‐
8763 tion is returned
8764 (using SVD-based solver).
8765
8766 Example:
8767 [#1] (0,1,0;1,0,0;0,0,1) (1;2;3) +solve[-1] [-2]
8768
8769 svd (+):
8770
8771 Compute SVD decomposition of selected matrices.
8772
8773 Example:
8774 [#1] 10,10,1,1,'if(x==y,x+u(-0.2,0.2),0)' +svd
8775
8776 transpose:
8777
8778 Transpose selected matrices.
8779
8780 Example:
8781 [#1] image.jpg +transpose
8782
8783 trisolve (+):
8784 [image]
8785
8786 Solve tridiagonal system AX = B for selected B-vectors and speci‐
8787 fied tridiagonal A-matrix.
8788 Tridiagonal matrix must be stored as a 3 column vector, where 2nd
8789 column contains the
8790 diagonal coefficients, while 1st and 3rd columns contain the left
8791 and right coefficients.
8792
8793 Example:
8794 [#1] (0,0,1;1,0,0;0,1,0) (1;2;3) +trisolve[-1] [-2]
8795
8796 12.12. 3D Meshes
8797 ---------
8798
8799 +3d (+):
8800 Shortcut for command 'add3d'.
8801
8802 add3d (+):
8803 tx,_ty,_tz |
8804 [object3d] |
8805 (no arg)
8806
8807 Shift selected 3D objects with specified displacement vector, or
8808 merge them with specified
8809 3D object, or merge all selected 3D objects together.
8810 (equivalent to shortcut command '+3d').
8811
8812 Default values: 'ty=tz=0'.
8813
8814 Example:
8815 [#1] sphere3d 10 repeat 5 { +add3d[-1] 10,{u(-10,10)},0
8816 color3d[-1] ${-rgb} } add3d
8817 [#2] repeat 20 { torus3d 15,2 color3d[-1] ${-rgb} mul3d[-1] 0.5,1
8818 if $>%2 rotate3d[-1] 0,1,0,90 fi add3d[-1] 70 add3d rotate3d[-1]
8819 0,0,1,18 } double3d 0
8820
8821 animate3d:
8822 nb_frames>0,_step_angle_x,_step_angle_y,_step_angle_z,_zoom_fac‐
8823 tor,0<=_fake_shadow_level<=100,_[background]
8824
8825 Generate 3D animation frames of rotating 3D objects.
8826 Frames are stacked along the z-axis (volumetric image).
8827 Frame size is the same as the size of the '[background]' image (or
8828 800x800 if no background specified).
8829
8830 Default values: 'filename=(undefined)'.
8831
8832 apply_camera3d:
8833 pos_x,pos_y,pos_z,target_x,target_y,target_z,up_x,up_y,up_z
8834
8835 Apply 3D camera matrix to selected 3D objects.
8836
8837 Default values: 'target_x=0', 'target_y=0', 'target_z=0', 'up_x=0',
8838 'up_y=-1' and 'up_z=0'.
8839
8840 apply_matrix3d:
8841 a11,a12,a13,...,a31,a32,a33
8842
8843 Apply specified 3D rotation matrix to selected 3D objects.
8844
8845 Example:
8846 [#1] torus3d 10,1 +apply_matrix3d
8847 {mul(rot(1,0,1,-15°),[1,0,0,0,2,0,0,0,8],3)} double3d 0
8848
8849 array3d:
8850 size_x>=1,_size_y>=1,_size_z>=1,_offset_x[%],_offset_y[%],_off‐
8851 set_y[%]
8852
8853 Duplicate a 3D object along the X,Y and Z axes.
8854
8855 Default values: 'size_y=1', 'size_z=1' and 'offset_x=offset_y=off‐
8856 set_z=100%'.
8857
8858 Example:
8859 [#1] torus3d 10,1 +array3d 5,5,5,110%,110%,300%
8860
8861 arrow3d:
8862 x0,y0,z0,x1,y1,z1,_radius[%]>=0,_head_length[%]>=0,_head_ra‐
8863 dius[%]>=0
8864
8865 Input 3D arrow with specified starting and ending 3D points.
8866
8867 Default values: 'radius=5%', 'head_length=25%' and 'head_ra‐
8868 dius=15%'.
8869
8870 Example:
8871 [#1] repeat 10 { a={$>*2*pi/10} arrow3d
8872 0,0,0,{cos($a)},{sin($a)},-0.5 } +3d
8873
8874 axes3d:
8875 _size_x,_size_y,_size_z,_font_size>0,_label_x,_label_y,_la‐
8876 bel_z,_is_origin={ 0=no | 1=yes }
8877
8878 Input 3D axes with specified sizes along the x,y and z orienta‐
8879 tions.
8880
8881 Default values: 'size_x=size_y=size_z=1', 'font_size=23', 'la‐
8882 bel_x=X', 'label_y=Y', 'label_z=Z' and 'is_origin=1'
8883
8884 Example:
8885 [#1] axes3d ,
8886
8887 boundingbox3d:
8888
8889 Replace selected 3D objects by their 3D bounding boxes.
8890
8891 Example:
8892 [#1] torus3d 100,30 +boundingbox3d +3d[-1] [-2]
8893
8894 box3d:
8895 _size_x,_size_y,_size_z
8896
8897 Input 3D box at (0,0,0), with specified geometry.
8898
8899 Default values: 'size_x=1' and 'size_z=size_y=size_x'.
8900
8901 Example:
8902 [#1] box3d 100,40,30 +primitives3d 1 color3d[-2] ${-rgb}
8903
8904 c3d:
8905 Shortcut for command 'center3d'.
8906
8907 center3d:
8908
8909 Center selected 3D objects at (0,0,0).
8910 (equivalent to shortcut command 'c3d').
8911
8912 Example:
8913 [#1] repeat 100 { circle3d {u(100)},{u(100)},{u(100)},2 } add3d
8914 color3d[-1] 255,0,0 +center3d color3d[-1] 0,255,0 add3d
8915
8916 circle3d:
8917 _x0,_y0,_z0,_radius>=0
8918
8919 Input 3D circle at specified coordinates.
8920
8921 Default values: 'x0=y0=z0=0' and 'radius=1'.
8922
8923 Example:
8924 [#1] repeat 500 { a={$>*pi/250} circle3d
8925 {cos(3*$a)},{sin(2*$a)},0,{$a/50} color3d[-1] ${-rgb},0.4 } add3d
8926
8927 circles3d:
8928 _radius>=0,_is_wireframe={ 0 | 1 }
8929
8930 Convert specified 3D objects to sets of 3D circles with specified
8931 radius.
8932
8933 Default values: 'radius=1' and 'is_wireframe=1'.
8934
8935 Example:
8936 [#1] image.jpg luminance resize2dy 40 threshold 50% * 255 point‐
8937 cloud3d color3d[-1] 255,255,255 circles3d 0.7
8938
8939 col3d (+):
8940 Shortcut for command 'color3d'.
8941
8942 color3d (+):
8943 R,_G,_B,_opacity |
8944 (no arg)
8945
8946 Set color and opacity of selected 3D objects.
8947 (equivalent to shortcut command 'col3d').
8948
8949 Default value: 'B=G=R' and 'opacity=(undefined)'.
8950
8951 Example:
8952 [#1] torus3d 100,10 double3d 0 repeat 7 { +rotate3d[-1] 1,0,0,20
8953 color3d[-1] ${-rgb} } add3d
8954
8955 colorcube3d:
8956
8957 Input 3D color cube.
8958
8959 Example:
8960 [#1] colorcube3d mode3d 2 +primitives3d 1
8961
8962 cone3d:
8963 _radius,_height,_nb_subdivisions>0
8964
8965 Input 3D cone at (0,0,0), with specified geometry.
8966
8967 Default value: 'radius=1','height=1' and 'nb_subdivisions=24'.
8968
8969 Example:
8970 [#1] cone3d 10,40 +primitives3d 1 color3d[-2] ${-rgb}
8971
8972 cubes3d:
8973 _size>=0
8974
8975 Convert specified 3D objects to sets of 3D cubes with specified
8976 size.
8977
8978 Default value: 'size=1'.
8979
8980 Example:
8981 [#1] image.jpg luminance resize2dy 40 threshold 50% * 255 point‐
8982 cloud3d color3d[-1] 255,255,255 cubes3d 1
8983
8984 cup3d:
8985 _resolution>0
8986
8987 Input 3D cup object.
8988
8989 Default value: 'resolution=128'.
8990
8991 Example:
8992 [#1] cup3d ,
8993
8994 cylinder3d:
8995 _radius,_height,_nb_subdivisions>0
8996
8997 Input 3D cylinder at (0,0,0), with specified geometry.
8998
8999 Default value: 'radius=1','height=1' and 'nb_subdivisions=24'.
9000
9001 Example:
9002 [#1] cylinder3d 10,40 +primitives3d 1 color3d[-2] ${-rgb}
9003
9004 delaunay3d:
9005
9006 Generate 3D Delaunay triangulations from selected images.
9007 One assumes that the selected input images are binary images con‐
9008 taining the set of points to mesh.
9009 The output 3D object is a mesh composed of non-oriented triangles.
9010
9011 Example:
9012 [#1] 500,500 noise 0.05,2 eq 1 * 255 +delaunay3d color3d[1]
9013 255,128,0 dilate_circ[0] 5 to_rgb[0] +object3d[0] [1],0,0,0,1,1 max[-1]
9014 [0]
9015
9016 distribution3d:
9017
9018 Get 3D color distribution of selected images.
9019
9020 Example:
9021 [#1] image.jpg distribution3d colorcube3d primitives3d[-1] 1
9022 add3d
9023
9024 /3d (+):
9025 Shortcut for command 'div3d'.
9026
9027 div3d (+):
9028 factor |
9029 factor_x,factor_y,_factor_z
9030
9031 Scale selected 3D objects isotropically or anisotropically, with
9032 the inverse of specified
9033 factors.
9034 (equivalent to shortcut command '/3d').
9035
9036 Default value: 'factor_z=1'.
9037
9038 Example:
9039 [#1] torus3d 5,2 repeat 5 { +add3d[-1] 12,0,0 div3d[-1] 1.2
9040 color3d[-1] ${-rgb} } add3d
9041
9042 db3d (+):
9043 Shortcut for command 'double3d'.
9044
9045 double3d (+):
9046 _is_double_sided={ 0 | 1 }
9047
9048 Enable/disable double-sided mode for 3D rendering.
9049 (equivalent to shortcut command 'db3d').
9050
9051 Default value: 'is_double_sided=1'.
9052
9053 Example:
9054 [#1] mode3d 1 repeat 2 { torus3d 100,30 rotate3d[-1] 1,1,0,60
9055 double3d $> snapshot3d[-1] 400 }
9056
9057 elevation3d:
9058 { z-factor | [elevation_map] | 'formula' },base_height={ -1 | >=0
9059 } |
9060 (no arg)
9061
9062 Generate 3D elevation of selected images, opt. with a specified el‐
9063 evation map.
9064 When invoked with (no arg) or 'z-factor', the elevation map is com‐
9065 puted as the pointwise L2 norm of the
9066 pixel values. Otherwise, the elevation map is taken from the speci‐
9067 fied image or formula.
9068
9069 Example:
9070 [#1] image.jpg +blur 5 elevation3d. 0.75
9071 [#2] 128,128,1,3,u(255) plasma 10,3 blur 4 sharpen 10000 n 0,255
9072 elevation3d[-1]
9073 'X=(x-64)/6;Y=(y-64)/6;-100*exp(-(X^2+Y^2)/30)*abs(cos(X)*sin(Y))'
9074
9075 empty3d:
9076
9077 Input empty 3D object.
9078
9079 Example:
9080 [#1] empty3d
9081
9082 extrude3d:
9083 _depth>0,_resolution>0,_smoothness[%]>=0
9084
9085 Generate extruded 3D object from selected binary XY-profiles.
9086
9087 Default values: 'depth=16', 'resolution=1024' and 'smooth‐
9088 ness=0.5%'.
9089
9090 Example:
9091 [#1] image.jpg threshold 50% extrude3d 16
9092
9093 f3d (+):
9094 Shortcut for command 'focale3d'.
9095
9096 focale3d (+):
9097 focale
9098
9099 Set 3D focale.
9100 (equivalent to shortcut command 'f3d').
9101
9102 Set 'focale' to 0 to enable parallel projection (instead of per‐
9103 spective).
9104 Set negative 'focale' will disable 3D sprite zooming.
9105
9106 Default value: 'focale=700'.
9107
9108 Example:
9109 [#1] repeat 5 { torus3d 100,30 rotate3d[-1] 1,1,0,60 focale3d
9110 {$<*90} snapshot3d[-1] 400 } remove[0]
9111
9112 gaussians3d:
9113 _size>0,_opacity
9114
9115 Convert selected 3D objects into set of 3D gaussian-shaped sprites.
9116
9117 Example:
9118 [#1] image.jpg r2dy 32 distribution3d gaussians3d 20 colorcube3d
9119 primitives3d[-1] 1 +3d
9120
9121 gmic3d:
9122
9123 Input a 3D G'MIC logo.
9124
9125 Example:
9126 [#1] gmic3d +primitives3d 1
9127
9128 gyroid3d:
9129 _resolution>0,_zoom
9130
9131 Input 3D gyroid at (0,0,0), with specified resolution.
9132
9133 Default values: 'resolution=32' and 'zoom=5'.
9134
9135 Example:
9136 [#1] gyroid3d 48 +primitives3d 1
9137
9138 histogram3d:
9139
9140 Get 3D color histogram of selected images.
9141
9142 Example:
9143 [#1] image.jpg resize2dx 64 histogram3d circles3d 3 opacity3d.
9144 0.75 colorcube3d primitives3d[-1] 1 add3d
9145
9146 image6cube3d:
9147
9148 Generate 3D mapped cubes from 6-sets of selected images.
9149
9150 Example:
9151 [#1] image.jpg animate flower,"30,0","30,5",6 image6cube3d
9152
9153 imageblocks3d:
9154 _maximum_elevation,_smoothness[%]>=0
9155
9156 Generate 3D blocks from selected images.
9157 Transparency of selected images is taken into account.
9158
9159 Default values: 'maximum_elevation=10' and 'smoothness=0'.
9160
9161 Example:
9162 [#1] image.jpg resize2dy 32 imageblocks3d -20 mode3d 3
9163
9164 imagecube3d:
9165
9166 Generate 3D mapped cubes from selected images.
9167
9168 Example:
9169 [#1] image.jpg imagecube3d
9170
9171 imageplane3d:
9172
9173 Generate 3D mapped planes from selected images.
9174
9175 Example:
9176 [#1] image.jpg imageplane3d
9177
9178 imagepyramid3d:
9179
9180 Generate 3D mapped pyramids from selected images.
9181
9182 Example:
9183 [#1] image.jpg imagepyramid3d
9184
9185 imagerubik3d:
9186 _xy_tiles>=1,0<=xy_shift<=100,0<=z_shift<=100
9187
9188 Generate 3D mapped rubik's cubes from selected images.
9189
9190 Default values: 'xy_tiles=3', 'xy_shift=5' and 'z_shift=5'.
9191
9192 Example:
9193 [#1] image.jpg imagerubik3d ,
9194
9195 imagesphere3d:
9196 _resolution1>=3,_resolution2>=3
9197
9198 Generate 3D mapped sphere from selected images.
9199
9200 Default values: 'resolution1=32' and 'resolutions2=16'.
9201
9202 Example:
9203 [#1] image.jpg imagesphere3d 32,16
9204
9205 isoline3d (+):
9206 isovalue[%] |
9207 'formula',value,_x0,_y0,_x1,_y1,_size_x>0[%],_size_y>0[%]
9208
9209 Extract 3D isolines with specified value from selected images or
9210 from specified formula.
9211
9212 Default values: 'x0=y0=-3', 'x1=y1=3' and 'size_x=size_y=256'.
9213
9214 Example:
9215 [#1] image.jpg blur 1 isoline3d 50%
9216 [#2] isoline3d 'X=x-w/2;Y=y-h/2;(X^2+Y^2)%20',10,-10,-10,10,10
9217
9218 isosurface3d (+):
9219 isovalue[%] |
9220 'for‐
9221 mula',value,_x0,_y0,_z0,_x1,_y1,_z1,_size_x>0[%],_size_y>0[%],_size_z>0[%]
9222
9223 Extract 3D isosurfaces with specified value from selected images or
9224 from specified formula.
9225
9226 Default values: 'x0=y0=z0=-3', 'x1=y1=z1=3' and
9227 'size_x=size_y=size_z=32'.
9228
9229 Example:
9230 [#1] image.jpg resize2dy 128 luminance threshold 50% expand_z 2,0
9231 blur 1 isosurface3d 50% mul3d 1,1,30
9232 [#2] isosurface3d 'x^2+y^2+abs(z)^abs(4*cos(x*y*z*3))',3
9233
9234 label3d:
9235 "text",font_height>=0,_opacity,_color1,...
9236
9237 Generate 3D text label.
9238
9239 Default values: 'font_height=13', 'opacity=1' and
9240 'color=255,255,255'.
9241
9242 label_points3d:
9243 _label_size>0,_opacity
9244
9245 Add a numbered label to all vertices of selected 3D objects.
9246
9247 Default values: 'label_size=13' and 'opacity=0.8'.
9248
9249 Example:
9250 [#1] torus3d 100,40,6,6 label_points3d 23,1 mode3d 1
9251
9252 lathe3d:
9253 _resolution>0,_smoothness[%]>=0,_max_angle>=0
9254
9255 Generate 3D object from selected binary XY-profiles.
9256
9257 Default values: 'resolution=128', 'smoothness=0.5%' and 'max_an‐
9258 gle=361'.
9259
9260 Example:
9261 [#1] 300,300 rand -1,1 blur 40 sign normalize 0,255 lathe3d ,
9262
9263 l3d (+):
9264 Shortcut for command 'light3d'.
9265
9266 light3d (+):
9267 position_x,position_y,position_z |
9268 [texture] |
9269 (no arg)
9270
9271 Set the light coordinates or the light texture for 3D rendering.
9272 (equivalent to shortcut command 'l3d').
9273
9274 (no arg) resets the 3D light to default.
9275
9276 Example:
9277 [#1] torus3d 100,30 double3d 0 specs3d 1.2 repeat 5 { light3d
9278 {$>*100},0,-300 +snapshot3d[0] 400 } remove[0]
9279
9280 line3d:
9281 x0,y0,z0,x1,y1,z1
9282
9283 Input 3D line at specified coordinates.
9284
9285 Example:
9286 [#1] repeat 100 { a={$>*pi/50} line3d
9287 0,0,0,{cos(3*$a)},{sin(2*$a)},0 color3d. ${-rgb} } add3d
9288
9289 lissajous3d:
9290 resolution>1,a,A,b,B,c,C
9291
9292 Input 3D lissajous curves (x(t)=sin(at+A*2pi), y(t)=sin(bt+B*2pi),
9293 z(t)=sin(ct+C*2pi)).
9294
9295 Default values: 'resolution=1024', 'a=2', 'A=0', 'b=1', 'B=0',
9296 'c=0' and 'C=0'.
9297
9298 Example:
9299 [#1] lissajous3d ,
9300
9301 m3d (+):
9302 Shortcut for command 'mode3d'.
9303
9304 mode3d (+):
9305 _mode
9306
9307 Set static 3D rendering mode.
9308 (equivalent to shortcut command 'm3d').
9309
9310 'mode' can be { -1=bounding-box | 0=dots | 1=wireframe | 2=flat |
9311 3=flat-shaded | 4=gouraud-shaded | 5=phong-shaded }.");
9312 Bounding-box mode ('mode==-1') is active only for the interactive
9313 3D viewer.
9314
9315 Default value: 'mode=4'.
9316
9317 Example:
9318 [#1] (0,1,2,3,4,5) double3d 0 repeat w { torus3d 100,30 ro‐
9319 tate3d[-1] 1,1,0,60 mode3d {0,@$>} snapshot3d[-1] 300 } remove[0]
9320
9321 md3d (+):
9322 Shortcut for command 'moded3d'.
9323
9324 moded3d (+):
9325 _mode
9326
9327 Set dynamic 3D rendering mode for interactive 3D viewer.
9328 (equivalent to shortcut command 'md3d').
9329
9330 'mode' can be { -1=bounding-box | 0=dots | 1=wireframe | 2=flat |
9331 3=flat-shaded | 4=gouraud-shaded | 5=phong-shaded }.
9332
9333 Default value: 'mode=-1'.
9334
9335 *3d (+):
9336 Shortcut for command 'mul3d'.
9337
9338 mul3d (+):
9339 factor |
9340 factor_x,factor_y,_factor_z
9341
9342 Scale selected 3D objects isotropically or anisotropically, with
9343 specified factors.
9344 (equivalent to shortcut command '*3d').
9345
9346 Default value: 'factor_z=1'.
9347
9348 Example:
9349 [#1] torus3d 5,2 repeat 5 { +add3d[-1] 10,0,0 mul3d[-1] 1.2
9350 color3d[-1] ${-rgb} } add3d
9351
9352 n3d:
9353 Shortcut for command 'normalize3d'.
9354
9355 normalize3d:
9356
9357 Normalize selected 3D objects to unit size.
9358 (equivalent to shortcut command 'n3d').
9359
9360 Example:
9361 [#1] repeat 100 { circle3d {u(3)},{u(3)},{u(3)},0.1 } add3d
9362 color3d[-1] 255,0,0 +normalize3d[-1] color3d[-1] 0,255,0 add3d
9363
9364 o3d (+):
9365 Shortcut for command 'opacity3d'.
9366
9367 opacity3d (+):
9368 _opacity
9369
9370 Set opacity of selected 3D objects.
9371 (equivalent to shortcut command 'o3d').
9372
9373 Default value: 'opacity=1'.
9374
9375 Example:
9376 [#1] torus3d 100,10 double3d 0 repeat 7 { +rotate3d[-1] 1,0,0,20
9377 opacity3d[-1] {u} } add3d
9378
9379 parametric3d:
9380 _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‐
9381 ness>=0,_isovalue>=0
9382
9383 Input 3D object from specified parametric surface '(a,b) ⟶
9384 (x(a,b),y(a,b),z(a,b))'.
9385
9386 Default values: 'x=(2+cos(b))*sin(a)', 'y=(2+cos(b))*cos(a)',
9387 'c=sin(b)', 'amin=-pi', 'amax=pi', 'bmin=-pi', 'bmax=pi', 'res_a=512',
9388 'res_b=res_a',
9389 'res_x=64', 'res_y=res_x', 'res_z=res_y', 'smoothness=2%' and
9390 'isovalue=10%'.
9391
9392 Example:
9393 [#1] parametric3d ,
9394
9395 pca_patch3d:
9396 _patch_size>0,_M>0,_N>0,_normalize_input={ 0 | 1 },_normal‐
9397 ize_output={ 0 | 1 },_lambda_xy
9398
9399 Get 3D patch-pca representation of selected images.
9400 The 3D patch-pca is estimated from M patches on the input image,
9401 and displayed as a cloud of N 3D points.
9402
9403 Default values: 'patch_size=7', 'M=1000', 'N=3000', 'normalize_in‐
9404 put=1', 'normalize_output=0', and 'lambda_xy=0'.
9405
9406 Example:
9407 [#1] image.jpg pca_patch3d 7
9408
9409 plane3d:
9410 _size_x,_size_y,_nb_subdivisions_x>0,_nb_subdisivions_y>0
9411
9412 Input 3D plane at (0,0,0), with specified geometry.
9413
9414 Default values: 'size_x=1', 'size_y=size_x' and 'nb_subdivi‐
9415 sions_x=nb_subdivisions_y=24'.
9416
9417 Example:
9418 [#1] plane3d 50,30 +primitives3d 1 color3d[-2] ${-rgb}
9419
9420 point3d:
9421 x0,y0,z0
9422
9423 Input 3D point at specified coordinates.
9424
9425 Example:
9426 [#1] repeat 1000 { a={$>*pi/500} point3d
9427 {cos(3*$a)},{sin(2*$a)},0 color3d[-1] ${-rgb} } add3d
9428
9429 pointcloud3d:
9430
9431 Convert selected planar or volumetric images to 3D point clouds.
9432
9433 Example:
9434 [#1] image.jpg luminance resize2dy 100 threshold 50% mul 255
9435 pointcloud3d color3d[-1] 255,255,255
9436
9437 pose3d:
9438 p1,...,p12
9439
9440 Apply 3D pose matrix to selected 3D objects.
9441
9442 Example:
9443 [#1] torus3d 100,20 pose3d
9444 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
9445 snapshot3d 400
9446
9447 p3d:
9448 Shortcut for command 'primitives3d'.
9449
9450 primitives3d:
9451 mode
9452
9453 Convert primitives of selected 3D objects.
9454 (equivalent to shortcut command 'p3d').
9455
9456 'mode' can be { 0=points | 1=outlines | 2=non-textured }.
9457
9458 Example:
9459 [#1] sphere3d 30 primitives3d 1 torus3d 50,10 color3d[-1] ${-rgb}
9460 add3d
9461
9462 projections3d:
9463 _x[%],_y[%],_z[%],_is_bounding_box={ 0 | 1 }
9464
9465 Generate 3D xy,xz,yz projection planes from specified volumetric
9466 images.
9467
9468 pyramid3d:
9469 width,height
9470
9471 Input 3D pyramid at (0,0,0), with specified geometry.
9472
9473 Example:
9474 [#1] pyramid3d 100,-100 +primitives3d 1 color3d[-2] ${-rgb}
9475
9476 quadrangle3d:
9477 x0,y0,z0,x1,y1,z1,x2,y2,z2,x3,y3,z3
9478
9479 Input 3D quadrangle at specified coordinates.
9480
9481 Example:
9482 [#1] quadrangle3d -10,-10,10,10,-10,10,10,10,10,-10,10,10 repeat
9483 10 { +rotate3d[-1] 0,1,0,30 color3d[-1] ${-rgb},0.6 } add3d mode3d 2
9484
9485 random3d:
9486 nb_points>=0
9487
9488 Input random 3D point cloud in [0,1]^3.
9489
9490 Example:
9491 [#1] random3d 100 circles3d 0.1 opacity3d 0.5
9492
9493 rv3d (+):
9494 Shortcut for command 'reverse3d'.
9495
9496 reverse3d (+):
9497
9498 Reverse primitive orientations of selected 3D objects.
9499 (equivalent to shortcut command 'rv3d').
9500
9501 Example:
9502 [#1] torus3d 100,40 double3d 0 +reverse3d
9503
9504 r3d (+):
9505 Shortcut for command 'rotate3d'.
9506
9507 rotate3d (+):
9508 u,v,w,angle
9509
9510 Rotate selected 3D objects around specified axis with specified an‐
9511 gle (in deg.).
9512 (equivalent to shortcut command 'r3d').
9513
9514 Example:
9515 [#1] torus3d 100,10 double3d 0 repeat 7 { +rotate3d[-1] 1,0,0,20
9516 } add3d
9517
9518 rotation3d:
9519 u,v,w,angle
9520
9521 Input 3x3 rotation matrix with specified axis and angle (in deg).
9522
9523 Example:
9524 [#1] rotation3d 1,0,0,0 rotation3d 1,0,0,90 rotation3d 1,0,0,180
9525
9526 sierpinski3d:
9527 _recursion_level>=0,_width,_height
9528
9529 Input 3d Sierpinski pyramid.
9530
9531 Example:
9532 [#1] sierpinski3d 3,100,-100 +primitives3d 1 color3d[-2] ${-rgb}
9533
9534 size3d:
9535
9536 Return bounding box size of the last selected 3D object.
9537
9538 skeleton3d:
9539 _metric,_frame_type={ 0=squares | 1=diamonds | 2=circles | 3=auto
9540 },_skeleton_opacity,_frame_opacity,_is_frame_wireframe={ 0 | 1 }
9541
9542 Build 3D skeletal structure object from 2d binary shapes located in
9543 selected images.
9544 'metric' can be { 0=chebyshev | 1=manhattan | 2=euclidean }.
9545
9546 Default values: 'metric=2', 'bones_type=3', 'skeleton_opacity=1'
9547 and 'frame_opacity=0.1'.
9548
9549 Example:
9550 [#1] shape_cupid 480 +skeleton3d ,
9551
9552 snapshot3d:
9553 _size>0,_zoom>=0,_backgroundR,_backgroundG,_backgroundB,_back‐
9554 groundA |
9555 [background_image],zoom>=0
9556
9557 Take 2d snapshots of selected 3D objects.
9558 Set 'zoom' to 0 to disable object auto-scaling.
9559
9560 Default values: 'size=512', 'zoom=1' and '[background_image]=(de‐
9561 fault)'.
9562
9563 Example:
9564 [#1] torus3d 100,20 rotate3d 1,1,0,60 snapshot3d
9565 400,1.2,128,64,32
9566 [#2] torus3d 100,20 rotate3d 1,1,0,60 sample ? +snapshot3d[0]
9567 [1],1.2
9568
9569 sl3d (+):
9570 Shortcut for command 'specl3d'.
9571
9572 specl3d (+):
9573 value>=0
9574
9575 Set lightness of 3D specular light.
9576 (equivalent to shortcut command 'sl3d').
9577
9578 Default value: 'value=0.15'.
9579
9580 Example:
9581 [#1] (0,0.3,0.6,0.9,1.2) repeat w { torus3d 100,30 rotate3d[-1]
9582 1,1,0,60 color3d[-1] 255,0,0 specl3d {0,@$>} snapshot3d[-1] 400 } re‐
9583 move[0]
9584
9585 ss3d (+):
9586 Shortcut for command 'specs3d'.
9587
9588 specs3d (+):
9589 value>=0
9590
9591 Set shininess of 3D specular light.
9592 (equivalent to shortcut command 'ss3d').
9593
9594 Default value: 'value=0.8'.
9595
9596 Example:
9597 [#1] (0,0.3,0.6,0.9,1.2) repeat w { torus3d 100,30 rotate3d[-1]
9598 1,1,0,60 color3d[-1] 255,0,0 specs3d {0,@$>} snapshot3d[-1] 400 } re‐
9599 move[0]
9600
9601 sphere3d (+):
9602 radius,_nb_recursions>=0
9603
9604 Input 3D sphere at (0,0,0), with specified geometry.
9605
9606 Default value: 'nb_recursions=3'.
9607
9608 Example:
9609 [#1] sphere3d 100 +primitives3d 1 color3d[-2] ${-rgb}
9610
9611 spherical3d:
9612 _nb_azimuth>=3,_nb_zenith>=3,_radius_function(phi,theta)
9613
9614 Input 3D spherical object at (0,0,0), with specified geometry.
9615
9616 Default values: 'nb_zenith=nb_azimut=64' and 'radius_func‐
9617 tion="abs(1+0.5*cos(3*phi)*sin(4*theta))"'.
9618
9619 Example:
9620 [#1] spherical3d 64 +primitives3d 1
9621
9622 spline3d:
9623 x0[%],y0[%],z0[%],u0[%],v0[%],w0[%],x1[%],y1[%],z1[%],u1[%],v1[%],w1[%],_nb_ver‐
9624 tices>=2
9625
9626 Input 3D spline with specified geometry.
9627
9628 Default values: 'nb_vertices=128'.
9629
9630 Example:
9631 [#1] repeat 100 { spline3d
9632 {u},{u},{u},{u},{u},{u},{u},{u},{u},{u},{u},{u},128 color3d[-1] ${-rgb}
9633 } box3d 1 primitives3d[-1] 1 add3d
9634
9635 s3d (+):
9636 Shortcut for command 'split3d'.
9637
9638 split3d (+):
9639 _full_split={ 0 | 1 }
9640
9641 Split selected 3D objects into feature vectors :
9642 * If 'full_split==0', { header, sizes, vertices, primitives, col‐
9643 ors, opacities }.
9644 * If 'full_split==1', { header, sizes, vertices, p0,...,pP,
9645 c0,...,cP, o0,...,oP }.
9646 (equivalent to shortcut command 's3d').
9647
9648 To recreate the 3D object, append all produced images along the y-
9649 axis.
9650
9651 Default value: 'full_split=0'.
9652
9653 Example:
9654 [#1] box3d 100 +split3d
9655
9656 sprite3d:
9657
9658 Convert selected images as 3D sprites.
9659 Selected images with alpha channels are managed.
9660
9661 Example:
9662 [#1] image.jpg sprite3d
9663
9664 sprites3d:
9665 [sprite],_sprite_has_alpha_channel={ 0 | 1 }
9666
9667 Convert selected 3D objects as a sprite cloud.
9668 Set 'sprite_has_alpha_channel' to 1 to make the last channel of the
9669 selected sprite be a transparency mask.
9670
9671 Default value: 'mask_has_alpha_channel=0'.
9672
9673 Example:
9674 [#1] torus3d 100,20 image.jpg resize2dy[-1] 64 100%,100% gauss‐
9675 ian[-1] 30%,30% *[-1] 255 append[-2,-1] c +sprites3d[0] [1],1 dis‐
9676 play_rgba[-2]
9677
9678 star3d:
9679 _nb_branches>0,0<=_thickness<=1
9680
9681 Input 3D star at position '(0,0,0)', with specified geometry.
9682
9683 Default values: 'nb_branches=5' and 'thickness=0.38'.
9684
9685 Example:
9686 [#1] star3d , +primitives3d 1 color3d[-2] ${-rgb}
9687
9688 streamline3d (+):
9689 x[%],y[%],z[%],_L>=0,_dl>0,_interpolation,_is_backward={ 0 | 1
9690 },_is_oriented={ 0 | 1 } |
9691 'formula',x,y,z,_L>=0,_dl>0,_interpolation,_is_backward={ 0 | 1
9692 },_is_oriented={ 0 | 1 }
9693
9694 Extract 3D streamlines from selected vector fields or from speci‐
9695 fied formula.
9696 'interpolation' can be { 0=nearest integer | 1=1st-order | 2=2nd-
9697 order | 3=4th-order }.
9698
9699 Default values: 'dl=0.1', 'interpolation=2', 'is_backward=0' and
9700 'is_oriented=0'.
9701
9702 Example:
9703 [#1] 100,100,100,3 rand -10,10 blur 3 repeat 300 { +stream‐
9704 line3d[0] {u(100)},{u(100)},{u(100)},1000,1,1 color3d[-1] ${-rgb} } re‐
9705 move[0] box3d 100 primitives3d[-1] 1 add3d
9706
9707 -3d (+):
9708 Shortcut for command 'sub3d'.
9709
9710 sub3d (+):
9711 tx,_ty,_tz
9712
9713 Shift selected 3D objects with the opposite of specified displace‐
9714 ment vector.
9715 (equivalent to shortcut command '3d').
9716
9717 Default values: 'ty=tz=0'.
9718
9719 Example:
9720 [#1] sphere3d 10 repeat 5 { +sub3d[-1] 10,{u(-10,10)},0
9721 color3d[-1] ${-rgb} } add3d
9722
9723 superformula3d:
9724 resolution>1,m>=1,n1,n2,n3
9725
9726 Input 2D superformula curve as a 3D object.
9727
9728 Default values: 'resolution=1024', 'm=8', 'n1=1', 'n2=5' and
9729 'n3=8'.
9730
9731 Example:
9732 [#1] superformula3d ,
9733
9734 surfels3d:
9735 0<=_left_right_attenuation<=1,0<=_top_bottom_attenua‐
9736 tion<=1,0<=_closer_further_attenuation<=1
9737
9738 Convert selected images to 3d objects composed of 3D surfels (or 2D
9739 edgels for 2D images).
9740 Selected images must contain binary shapes, where each value 0 is
9741 an exterior voxel, and each value !=0 is an interior voxel.
9742 The resulting 3D object is colored according to the color of non
9743 zero voxels.
9744
9745 Default values: 'left_right_attenuation=1', 'top_bottom_attenua‐
9746 tion=1' and 'closer_further_attenuation=1'.
9747
9748 Example:
9749 [#1] 100,100,100 = 1,40%,40%,40% = 1,60%,60%,60% distance 1 lt
9750 30% blur 3 gt 50% surfels3d 0.5,0.75,1
9751
9752 tensors3d:
9753 _radius_factor>=0,_shape={ 0=box | >=N=ellipsoid },_radius_min>=0
9754
9755 Generate 3D tensor fields from selected images.
9756 when 'shape'>0, it gives the ellipsoid shape precision.
9757
9758 Default values: 'radius_factor=1', 'shape=2' and 'radius_min=0.05'.
9759
9760 Example:
9761 [#1] 6,6,6,9,"U = [x,y,z] - [w,h,d]/2; U/=norm(U); mul(U,U,3) +
9762 0.3*eye(3)" tensors3d 0.8
9763
9764 text_pointcloud3d:
9765 _"text1",_"text2",_smoothness
9766
9767 Input 3D text pointcloud from the two specified strings.
9768
9769 Default values: 'text1="text1"', 'text2="text2"' and 'smooth‐
9770 ness=1'.
9771
9772 Example:
9773 [#1] text_pointcloud3d "G'MIC","Rocks!"
9774
9775 text3d:
9776 text,_font_height>0,_depth>0,_smoothness
9777
9778 Input a 3D text object from specified text.
9779
9780 Default values: 'font_height=53', 'depth=10' and 'smoothness=1.5'.
9781
9782 Example:
9783 [#1] text3d "G'MIC as a0D logo!"
9784
9785 t3d:
9786 Shortcut for command 'texturize3d'.
9787
9788 texturize3d:
9789 [ind_texture],_[ind_coords]
9790
9791 Texturize selected 3D objects with specified texture and coordi‐
9792 nates.
9793 (equivalent to shortcut command 't3d').
9794
9795 When '[ind_coords]' is omitted, default XY texture projection is
9796 performed.
9797
9798 Default value: 'ind_coords=(undefined)'.
9799
9800 Example:
9801 [#1] image.jpg torus3d 100,30 texturize3d[-1] [-2] keep[-1]
9802
9803 torus3d:
9804 _radius1,_radius2,_nb_subdivisions1>2,_nb_subdivisions2>2
9805
9806 Input 3D torus at (0,0,0), with specified geometry.
9807
9808 Default values: 'radius1=1', 'radius2=0.3', 'nb_subdivisions1=24'
9809 and 'nb_subdivisions2=12'.
9810
9811 Example:
9812 [#1] torus3d 10,3 +primitives3d 1 color3d[-2] ${-rgb}
9813
9814 triangle3d:
9815 x0,y0,z0,x1,y1,z1,x2,y2,z2
9816
9817 Input 3D triangle at specified coordinates.
9818
9819 Example:
9820 [#1] repeat 100 { a={$>*pi/50} triangle3d
9821 0,0,0,0,0,3,{cos(3*$a)},{sin(2*$a)},0 color3d[-1] ${-rgb} } add3d
9822
9823 volume3d:
9824
9825 Transform selected 3D volumetric images as 3D parallelepipedic ob‐
9826 jects.
9827
9828 Example:
9829 [#1] image.jpg animate blur,0,5,30 append z volume3d
9830
9831 weird3d:
9832 _resolution>0
9833
9834 Input 3D weird object at (0,0,0), with specified resolution.
9835
9836 Default value: 'resolution=32'.
9837
9838 Example:
9839 [#1] weird3d 48 +primitives3d 1 color3d[-2] ${-rgb}
9840
9841 12.13. Flow Control
9842 ------------
9843
9844 ap:
9845 Shortcut for command 'apply_parallel'.
9846
9847 apply_parallel:
9848 "command"
9849
9850 Apply specified command on each of the selected images, by paral‐
9851 lelizing it for all image of the list.
9852 (equivalent to shortcut command 'ap').
9853
9854 Example:
9855 [#1] image.jpg +mirror x +mirror y apply_parallel "blur 3"
9856
9857 apc:
9858 Shortcut for command 'apply_parallel_channels'.
9859
9860 apply_parallel_channels:
9861 "command"
9862
9863 Apply specified command on each of the selected images, by paral‐
9864 lelizing it for all channel
9865 of the images independently.
9866 (equivalent to shortcut command 'apc').
9867
9868 Example:
9869 [#1] image.jpg apply_parallel_channels "blur 3"
9870
9871 apo:
9872 Shortcut for command 'apply_parallel_overlap'.
9873
9874 apply_parallel_overlap:
9875 "command",overlap[%],nb_threads={ 0=auto | 1 | 2 | 4 | 8 | 16 }
9876
9877 Apply specified command on each of the selected images, by paral‐
9878 lelizing it on 'nb_threads'
9879 overlapped sub-images.
9880 (equivalent to shortcut command 'apo').
9881
9882 'nb_threads' must be a power of 2.
9883
9884 Default values: 'overlap=0','nb_threads=0'.
9885
9886 Example:
9887 [#1] image.jpg +apply_parallel_overlap "smooth 500,0,1",1
9888
9889 at:
9890 Shortcut for command 'apply_tiles'.
9891
9892 apply_tiles:
9893 "com‐
9894 mand",_tile_width[%]>0,_tile_height[%]>0,_tile_depth[%]>0,_over‐
9895 lap_width[%]>=0,_overlap_height[%]>=0,_overlap_depth[%]>=0,_bound‐
9896 ary_conditions={ 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }
9897
9898 Apply specified command on each tile (neighborhood) of the selected
9899 images, eventually with overlapping tiles.
9900 (equivalent to shortcut command 'at').
9901
9902 Default values: 'tile_width=tile_height=tile_depth=10%','over‐
9903 lap_width=overlap_height=overlap_depth=0' and 'boundary_conditions=1'.
9904
9905 Example:
9906 [#1] image.jpg +equalize[0] 256 +apply_tiles[0] "equalize
9907 256",16,16,1,50%,50%
9908
9909 apply_timeout:
9910 "command",_timeout={ 0=no timeout | >0=with specified timeout (in
9911 seconds) }
9912
9913 Apply a command with a timeout.
9914 Set variable '$_is_timeout' to '1' if timeout occurred, '0' other‐
9915 wise.
9916
9917 Default value: 'timeout=20'.
9918
9919 check (+):
9920 condition
9921
9922 Evaluate specified condition and display an error message if evalu‐
9923 ated to false.
9924
9925 check3d (+):
9926 _is_full_check={ 0 | 1 }
9927
9928 Check validity of selected 3D vector objects, and display an error
9929 message
9930 if one of the selected images is not a valid 3D vector object.
9931 Full 3D object check is slower but more precise.
9932
9933 Default value: 'is_full_check=1'.
9934
9935 continue (+):
9936
9937 Go to end of current 'do...while', 'for...done', 'foreach...done',
9938 'local...done' or 'repeat...done' block.
9939
9940 Example:
9941 [#1] image.jpg repeat 10 blur 1 if 1==1 continue fi deform 10
9942 done
9943
9944 break (+):
9945
9946 Break current 'do...while', 'for...done', 'foreach...done', 'lo‐
9947 cal...done' or 'repeat...done' block.
9948
9949 Example:
9950 [#1] image.jpg repeat 10 blur 1 if 1==1 break fi deform 10 done
9951
9952 do (+):
9953
9954 Start a 'do...while' block.
9955
9956 Example:
9957 [#1] image.jpg luminance i={ia+2} do set 255,{u(100)}%,{u(100)}%
9958 while ia<$i
9959
9960 } (+):
9961 Shortcut for command 'done'.
9962
9963 done (+):
9964
9965 End a 'for/foreach/local/repeat...done' block, and go to associated
9966 'for/foreach/repeat' if iterations remain.
9967 (equivalent to shortcut command '}').
9968
9969 elif (+):
9970 condition
9971
9972 Start a 'elif...[else]...fi' block if previous 'if' was not veri‐
9973 fied
9974 and test if specified condition holds
9975 'condition' is a mathematical expression, whose evaluation is in‐
9976 terpreted as { 0=false | other=true }..
9977
9978 Tutorial: https://gmic.eu/tutorial/iffi
9979
9980 else (+):
9981
9982 Execute following commands if previous 'if' or 'elif' conditions
9983 failed.
9984
9985 Tutorial: https://gmic.eu/tutorial/iffi
9986
9987 fi (+):
9988
9989 End a 'if...[elif]...[else]...fi' block.
9990 (equivalent to shortcut command 'fi').
9991
9992 Tutorial: https://gmic.eu/tutorial/iffi
9993
9994 error (+):
9995 message
9996
9997 Print specified error message on the standard error (stderr) and
9998 exit interpreter, except
9999 if error is caught by a 'onfail' command.
10000 Command selection (if any) stands for displayed call stack subset
10001 instead of image indices.
10002
10003 eval (+):
10004 expression
10005
10006 Evaluate specified math expression.
10007 * If no command selection is specified, the expression is evalu‐
10008 ated once and its result is set to status.
10009 * If command selection is specified, the evaluation is looped over
10010 selected images. Status is not modified.
10011 (in this latter case, 'eval' is similar to 'fill' without assign‐
10012 ing the image values).
10013
10014 x (+):
10015 Shortcut for command 'exec'.
10016
10017 exec (+):
10018 _is_verbose={ 0 | 1 },"command"
10019
10020 Execute external command using a system call.
10021 The status value is then set to the error code returned by the sys‐
10022 tem call.
10023 If 'is_verbose=1', the executed command is allowed to output on
10024 stdout/stderr.
10025 (equivalent to shortcut command 'x').
10026
10027 Default value: 'is_verbose=1'.
10028
10029 xo:
10030 Shortcut for command 'exec_out'.
10031
10032 exec_out:
10033 _mode,"command"
10034
10035 Execute external command using a system call, and return resulting
10036 'stdout' and/or 'stderr'.
10037 'mode' can be { 0=stdout | 1=stderr | 2=stdout+stderr }.
10038
10039 for (+):
10040 condition
10041
10042 Start a 'for...done' block.
10043
10044 Example:
10045 [#1] image.jpg resize2dy 32 400,400,1,3 x=0 for $x<400 image[1]
10046 [0],$x,$x x+=40 done
10047
10048 foreach (+):
10049
10050 Start a 'foreach...[onfail]...done' block, that iterates over all
10051 images in the selection, with a separate local environment for each
10052 one.
10053
10054 Example:
10055 [#1] sample colorful,earth,duck,dog foreach[^2] +blur 10 sub nor‐
10056 malize 0,255 done
10057
10058 if (+):
10059 condition
10060
10061 Start a 'if...[elif]...[else]...fi' block and test if specified
10062 condition holds.
10063 'condition' is a mathematical expression, whose evaluation is in‐
10064 terpreted as { 0=false | other=true }.
10065
10066 Example:
10067 [#1] image.jpg if ia<64 add 50% elif ia<128 add 25% elif ia<192
10068 sub 25% else sub 50% fi cut 0,255
10069
10070 Tutorial: https://gmic.eu/tutorial/iffi
10071
10072 l (+):
10073 Shortcut for command 'local'.
10074
10075 local (+):
10076
10077 Start a 'local...[onfail]...done' block, with selected images.
10078 (equivalent to shortcut command 'l').
10079
10080 Example:
10081 [#1] image.jpg local[] 300,300,1,3 rand[0] 0,255 blur 4 sharpen
10082 1000 done
10083 [#2] image.jpg +local repeat 3 { deform 20 } done
10084
10085 Tutorial: https://gmic.eu/oldtutorial/_local
10086
10087 mutex (+):
10088 index,_action={ 0=unlock | 1=lock }
10089
10090 Lock or unlock specified mutex for multi-threaded programming.
10091 A locked mutex can be unlocked only by the same thread. All mutexes
10092 are unlocked by default.
10093 'index' designates the mutex index, in [0,255].
10094
10095 Default value: 'action=1'.
10096
10097 noarg (+):
10098
10099 Used in a custom command, 'noarg' tells the command that its argu‐
10100 ment list have not been used
10101 finally, and so they must be evaluated next in the G'MIC pipeline,
10102 just as if the custom
10103 command takes no arguments at all.
10104 Use this command to write a custom command which can decide if it
10105 takes arguments or not.
10106
10107 onfail (+):
10108
10109 Execute following commands when an error is encountered in the body
10110 of the 'local...done' block.
10111 The status value is set with the corresponding error message.
10112
10113 Example:
10114 [#1] image.jpg +local blur -3 onfail mirror x done
10115
10116 parallel (+):
10117 _wait_threads,"command1","command2",...
10118
10119 Execute specified commands in parallel, each in a different thread.
10120 Parallel threads share the list of images.
10121 'wait_threads' can be { 0=when current environment ends | 1=immedi‐
10122 ately }.
10123
10124 Default value: 'wait_threads=1'.
10125
10126 Example:
10127 [#1] image.jpg [0] parallel "blur[0] 3","mirror[1] c"
10128
10129 progress (+):
10130 0<=value<=100 |
10131 -1
10132
10133 Set the progress index of the current processing pipeline.
10134 This command is useful only when G'MIC is used by an embedding ap‐
10135 plication.
10136
10137 q (+):
10138 Shortcut for command 'quit'.
10139
10140 quit (+):
10141
10142 Quit G'MIC interpreter.
10143 (equivalent to shortcut command 'q').
10144
10145 repeat (+):
10146 nb_iterations
10147
10148 Start 'nb_iterations' iterations of a 'repeat...done' block.
10149 'nb_iterations' is a mathematical expression that will be evalu‐
10150 ated.
10151
10152 Example:
10153 [#1] image.jpg split y repeat $! n=$> shift[$n] $<,0,0,0,2 done
10154 append y
10155 [#2] image.jpg mode3d 2 repeat 4 imagecube3d rotate3d 1,1,0,40
10156 snapshot3d 400,1.4 done
10157
10158 Tutorial: https://gmic.eu/oldtutorial/_repeat
10159
10160 return (+):
10161
10162 Return from current custom command.
10163
10164 rprogress:
10165 0<=value<=100 | -1 | "com‐
10166 mand",0<=value_min<=100,0<=value_max<=100
10167
10168 Set the progress index of the current processing pipeline (rela‐
10169 tively to
10170 previously defined progress bounds), or call the specified command
10171 with
10172 specified progress bounds.
10173
10174 run:
10175 "G'MIC pipeline"
10176
10177 Run specified G'MIC pipeline.
10178 This is only useful when used from a shell, e.g. to avoid shell
10179 substitutions to happen in argument.
10180
10181 skip (+):
10182 item
10183
10184 Do nothing but skip specified item.
10185
10186 u (+):
10187 Shortcut for command 'status'.
10188
10189 status (+):
10190 status_string
10191
10192 Set the current status. Used to define a returning value from a
10193 function.
10194 (equivalent to shortcut command 'u').
10195
10196 Example:
10197 [#1] image.jpg command "foo : u0=Dark u1=Bright status
10198 ${u{ia>=128}}" text_outline ${-foo},2,2,23,2,1,255
10199
10200 while (+):
10201 condition
10202
10203 End a 'do...while' block and go back to associated 'do' if speci‐
10204 fied condition holds.
10205 'condition' is a mathematical expression, whose evaluation is in‐
10206 terpreted as { 0=false | other=true }.
10207
10208 12.14. Neural Networks
10209 ---------------
10210
10211 nn_lib ::
10212
10213 Return the list of library functions that has to be included in a
10214 math expression,in order to use the neural network library.
10215
10216 nn_init:
10217
10218 Initialize a new network.
10219
10220 nn_check_layer:
10221 name
10222
10223 Check that the layer with specified name exists in the network.
10224
10225 nn_layer_input:
10226 name,width,_height,_depth,_spectrum
10227
10228 Add an 'input' layer to the network.
10229
10230 Default values: 'height=1', 'depth=1' and 'spectrum=1'.
10231
10232 nn_layer_add:
10233 name,in0,in1
10234
10235 Add an 'add' layer to the network.
10236
10237 nn_layer_append:
10238 name,in0,in1
10239
10240 Add an 'append' layer to the network.
10241
10242 nn_layer_avgpool2d:
10243 name,in
10244
10245 Add a 'avgpool2d' layer (2d average pooling) to the network.
10246
10247 nn_layer_batchnorm:
10248 name,in,_learning_mode.
10249
10250 Add a 'batchnorm' layer to the network.
10251 'learning_mode' can be { 0=learn no parameters | 1=learn gamma |
10252 2=learn beta | 3=learn gamma and beta}.
10253
10254 Default value: 'learning_mode=3'.
10255
10256 nn_layer_clone:
10257 name0,name1,in
10258
10259 Add a 'clone' layer to the network.
10260
10261 nn_layer_conv2d:
10262 name,in,nb_channels>0,_kernel_size>0,_stride>0,_dila‐
10263 tion,_is_learned={ 0 | 1 }
10264
10265 Add a 'conv2d' layer (2D convolutional layer) to the network.
10266
10267 Default values: 'kernel_size=3', 'stride=1', 'dilation=1' and
10268 'is_learned=1'.
10269
10270 nn_layer_conv2dbnnl:
10271 name,in,nb_channels>0,_kernel_size>0,_stride>0,_dilation>0,_acti‐
10272 vation,_is_learned={ 0 | 1 }
10273
10274 Add a 'con2dbnnl' (2D convolutional layer followed by a batchnorm,
10275 then a non-linearity), to the network.
10276
10277 Default values: 'kernel_size=3', 'stride=1', 'dilation=1', 'activa‐
10278 tion=leakyrelu' and 'is_learned=1'.
10279
10280 nn_layer_conv2dnl:
10281 name,in,nb_channels>0,_kernel_size>0,_stride>0,_dilation>0,_acti‐
10282 vation,_is_learned={ 0 | 1 }
10283
10284 Add a 'con2dnl' (2D convolutional layer followed by a non-linear‐
10285 ity), to the network.
10286
10287 Default values: 'kernel_size=3', 'stride=1', 'dilation=1', 'activa‐
10288 tion=leakyrelu' and 'is_learned=1'.
10289
10290 nn_layer_resconv2d:
10291 name,in,_kernel_size>0,_stride>0,_dilation>0,_is_learned={ 0 | 1
10292 }
10293
10294 Add a 'rescon2d' (residual 2D convolutional layer), to the network.
10295
10296 Default values: 'kernel_size=3', 'stride=1', 'dilation=1' and
10297 'is_learned=1'.
10298
10299 nn_layer_resconv2dnl:
10300 name,in,_kernel_size>0,_stride>0,_dilation>0,_activa‐
10301 tion,_is_learned={ 0 | 1 }
10302
10303 Add a 'rescon2dnl' (residual 2D convolutional layer followed by a
10304 non-linearity), to the network.
10305
10306 Default values: 'kernel_size=3', 'stride=1', 'dilation=1', activa‐
10307 tion='leakyrelu' and 'is_learned=1'.
10308
10309 nn_layer_crop:
10310 name,in,x0,y0,z0,x1,y1,z1
10311
10312 Add a 'crop' layer to the network.
10313
10314 nn_layer_fc:
10315 name,in,nb_channels>0,_is_learned={ 0 | 1 }
10316
10317 Add a 'fc' layer (fully connected layer) to the network.
10318
10319 Default value: 'is_learned=1'.
10320
10321 nn_layer_fcbnnl:
10322 name,in,nb_neurons>0,_activation,_is_learned={ 0 | 1 }
10323
10324 Add a 'fcbnnl' layer (fully connected layer followed by batchnorm,
10325 then a non-linearity), to the network.
10326
10327 Default value: 'activation=leakyrelu' and 'is_learned=1'.
10328
10329 nn_layer_fcnl:
10330 name,in,nb_neurons>0,_activation,_is_learned={ 0 | 1 }
10331
10332 Add a 'fcnl' layer (fully connected layer followed by a non-linear‐
10333 ity), to the network.
10334
10335 Default value: 'activation=leakyrelu' and 'is_learned=1'.
10336
10337 nn_layer_maxpool2d:
10338 name,in
10339
10340 Add a 'maxpool2d' layer (2d max pooling) to the network.
10341
10342 nn_layer_nl:
10343 name,in,_activation
10344
10345 Add a 'nl' (nonlinearity) layer to the network.
10346 'activation' can be { elu | gelu | leakyrelu | linear | relu | sig‐
10347 moid | softmax | sqr | sqrt | swish | tanh }.
10348
10349 Default value: 'activation=leakyrelu'.
10350
10351 nn_layer_rename:
10352 name,in
10353
10354 Add a 'rename' layer to the network.
10355
10356 nn_layer_reshape:
10357 name,in,width>0,height>0,depth>0,spectrum>0
10358
10359 Add a 'reshape' layer to the network.
10360
10361 nn_layer_resize:
10362 name,in,width[%]>0,_height[%]>0,_depth[%]>0,_spectrum[%]>0,_in‐
10363 terpolation
10364
10365 Add a 'resize' layer to the network.
10366
10367 Default values: 'height=depth=spectrum=100%'.
10368
10369 nn_layer_run:
10370 name,in,"command",_width[%]>0,_height[%]>0,_depth[%]>0,_spec‐
10371 trum[%]>0
10372
10373 Add a 'run' layer to the network.
10374
10375 Default values: 'width=height=depth=spectrum=100%'.
10376
10377 nn_layer_split:
10378 name0,name1,in,nb_channels0
10379
10380 Add a 'split' layer to the network.
10381
10382 nn_loss_bce:
10383 name,in,ground_truth
10384
10385 Add a 'bce' loss to the network (binary cross entropy).
10386
10387 nn_loss_mse:
10388 name,in,ground_truth
10389
10390 Add a 'mse' loss to the network (mean-squared error).
10391
10392 nn_trainer:
10393 name,loss,_learning_rate>0,_optimizer,_scheduler
10394
10395 Add a network trainer to the network.
10396 'optimizer' can be { sgd | rmsprop | adam | adamax }.
10397 'scheduler' can be { constant | linear | exponential | adaptive }.
10398
10399 Default value: 'learning_rate=1e-6', 'optimizer=adam' and 'sched‐
10400 uler=constant'.
10401
10402 nn_load:
10403 'filename.gmz'
10404
10405 Load and initialize network saved as a .gmz file.
10406 Neural network files can be only loaded in .gmz format.
10407
10408 nn_save:
10409 'filename.gmz'
10410
10411 Save current network as a .gmz file.
10412 Neural network files can be only saved in .gmz format.
10413
10414 12.15. Arrays, Tiles and Frames
10415 ------------------------
10416
10417 array:
10418 M>0,_N>0,_expand_type={ 0=min | 1=max | 2=all }
10419
10420 Create MxN array from selected images.
10421
10422 Default values: 'N=M' and 'expand_type=0'.
10423
10424 Example:
10425 [#1] image.jpg array 3,2,2
10426
10427 array_fade:
10428 M>0,_N>0,0<=_fade_start<=100,0<=_fade_end<=100,_ex‐
10429 pand_type={0=min | 1=max | 2=all}
10430
10431 Create MxN array from selected images.
10432
10433 Default values: 'N=M', 'fade_start=60', 'fade_end=90' and 'ex‐
10434 pand_type=1'.
10435
10436 Example:
10437 [#1] image.jpg array_fade 3,2
10438
10439 array_mirror:
10440 N>=0,_dir={ 0=x | 1=y | 2=xy | 3=tri-xy },_expand_type={ 0 | 1 }
10441
10442 Create 2^Nx2^N array from selected images.
10443
10444 Default values: 'dir=2' and 'expand_type=0'.
10445
10446 Example:
10447 [#1] image.jpg array_mirror 2
10448
10449 array_random:
10450 Ms>0,_Ns>0,_Md>0,_Nd>0
10451
10452 Create MdxNd array of tiles from selected MsxNs source arrays.
10453
10454 Default values: 'Ns=Ms', 'Md=Ms' and 'Nd=Ns'.
10455
10456 Example:
10457 [#1] image.jpg +array_random 8,8,15,10
10458
10459 frame:
10460 Shortcut for command 'frame_xy'.
10461
10462 frame_blur:
10463 _sharpness>0,_size>=0,_smoothness,_shading,_blur
10464
10465 Draw RGBA-colored round frame in selected images.
10466
10467 Default values: 'sharpness=10', 'size=30', 'smoothness=0', 'shad‐
10468 ing=1' and 'blur=3%'.
10469
10470 Example:
10471 [#1] image.jpg frame_blur 3,30,8,10%
10472
10473 frame_cube:
10474 _depth>=0,_centering_x,_centering_y,_left_side={0=normal | 1=mir‐
10475 ror-x | 2=mirror-y | 3=mirror-xy},_right_side,_lower_side,_upper_side
10476
10477 Insert 3D frames in selected images.
10478
10479 Default values: 'depth=1', 'centering_x=centering_y=0' and
10480 'left_side=right_side,lower_side=upper_side=0'.
10481
10482 Example:
10483 [#1] image.jpg frame_cube ,
10484
10485 frame_fuzzy:
10486 size_x[%]>=0,_size_y[%]>=0,_fuzzyness>=0,_smooth‐
10487 ness[%]>=0,_R,_G,_B,_A
10488
10489 Draw RGBA-colored fuzzy frame in selected images.
10490
10491 Default values: 'size_y=size_x', 'fuzzyness=5', 'smoothness=1' and
10492 'R=G=B=A=255'.
10493
10494 Example:
10495 [#1] image.jpg frame_fuzzy 20
10496
10497 frame_painting:
10498 _size[%]>=0,0<=_contrast<=1,_profile_smooth‐
10499 ness[%]>=0,_R,_G,_B,_vignette_size[%]>=0,_vignette_contrast>=0,_de‐
10500 fects_contrast>=0,0<=_defects_density<=100,_defects_size>=0,_de‐
10501 fects_smoothness[%]>=0,
10502 _serial_number
10503
10504 Add a painting frame to selected images.
10505
10506 Default values: 'size=10%', 'contrast=0.4', 'profile_smooth‐
10507 ness=6%', 'R=225', 'G=200', 'B=120', 'vignette_size=2%', 'vignette_con‐
10508 trast=400',
10509 'defects_contrast=50', 'defects_density=10', 'defects_size=1',
10510 'defects_smoothness=0.5%' and 'serial_number=123456789'.
10511
10512 Example:
10513 [#1] image.jpg frame_painting ,
10514
10515 frame_pattern:
10516 M>=3,_constrain_size={ 0 | 1 } |
10517 M>=3,_[frame_image],_constrain_size={ 0 | 1 }
10518
10519 Insert selected pattern frame in selected images.
10520
10521 Default values: 'pattern=0' and 'constrain_size=0'.
10522
10523 Example:
10524 [#1] image.jpg frame_pattern 8
10525
10526 frame_round:
10527 frame_size[%]>=0,radius[%]>=0,_smoothness[%]>=0,_col1,...,_colN
10528
10529 Insert an inner round frame in selected images.
10530
10531 Default values: 'size=1, 'radius=30%', 'smoothness=0' and
10532 'col=0,0,0,255'.
10533
10534 frame_seamless:
10535 frame_size>=0,_patch_size>0,_blend_size>=0,_frame_direction={
10536 0=inner (preserve image size) | 1=outer }
10537
10538 Insert frame in selected images, so that tiling the resulting image
10539 makes less visible seams.
10540
10541 Default values: 'patch_size=7', 'blend_size=5' and 'frame_direc‐
10542 tion=1'.
10543
10544 Example:
10545 [#1] image.jpg +frame_seamless 30 array 2,2
10546
10547 frame_x:
10548 size_x[%],_col1,...,_colN
10549
10550 Insert outer frame along the x-axis in selected images.
10551
10552 Default values: 'col1=col2=col3=255' and 'col4=255'.
10553
10554 Example:
10555 [#1] image.jpg frame_x 20,255,0,255
10556
10557 frame_xy:
10558 size_x[%],_size_y[%],_col1,...,_colN
10559
10560 Insert outer frame along the x-axis in selected images.
10561
10562 Default values: 'size_y=size_x', 'col1=col2=col3=255' and
10563 'col4=255'.
10564 (equivalent to shortcut command 'frame').
10565
10566 Example:
10567 [#1] image.jpg frame_xy 1,1,0 frame_xy 20,10,255,0,255
10568
10569 frame_xyz:
10570 size_x[%],_size_y[%],_size_z[%]_col1,...,_colN
10571
10572 Insert outer frame along the x-axis in selected images.
10573
10574 Default values: 'size_y=size_x=size_z', 'col1=col2=col3=255' and
10575 'col4=255'.
10576
10577 frame_y:
10578 size_y[%],_col1,...,_colN
10579
10580 Insert outer frame along the y-axis in selected images.
10581
10582 Default values: 'col1=col2=col3=255' and 'col4=255'.
10583
10584 Example:
10585 [#1] image.jpg frame_y 20,255,0,255
10586
10587 img2ascii:
10588 _charset,_analysis_scale>0,_analysis_smoothness[%]>=0,_synthe‐
10589 sis_scale>0,_output_ascii_filename
10590
10591 Render selected images as binary ascii art.
10592 This command returns the corresponding the list of widths and
10593 heights (expressed as a number of characters)
10594 for each selected image.
10595
10596 Default values: 'charset=[ascii charset]', 'analysis_scale=16',
10597 'analysis_smoothness=20%', 'synthesis_scale=16' and '_out‐
10598 put_ascii_filename=[undefined]'.
10599
10600 Example:
10601 [#1] image.jpg img2ascii ,
10602
10603 imagegrid:
10604 M>0,_N>0
10605
10606 Create MxN image grid from selected images.
10607
10608 Default value: 'N=M'.
10609
10610 Example:
10611 [#1] image.jpg imagegrid 16
10612
10613 imagegrid_hexagonal:
10614 _resolution>0,0<=_outline<=1
10615
10616 Create hexagonal grids from selected images.
10617
10618 Default values: 'resolution=32', 'outline=0.1' and 'is_an‐
10619 tialiased=1'.
10620
10621 Example:
10622 [#1] image.jpg imagegrid_hexagonal 24
10623
10624 imagegrid_triangular:
10625 pattern_width>=1,_pattern_height>=1,_pattern_type,0<=_out‐
10626 line_opacity<=1,_outline_color1,...
10627
10628 Create triangular grids from selected images.
10629 'pattern type' can be { 0=horizontal | 1=vertical | 2=crossed |
10630 3=cube | 4=decreasing | 5=increasing }.
10631
10632 Default values: 'pattern_width=24', 'pattern_height=pattern_width',
10633 'pattern_type=0', 'outline_opacity=0.1' and 'outline_color1=0'.
10634
10635 Example:
10636 [#1] image.jpg imagegrid_triangular 6,10,3,0.5
10637
10638 linearize_tiles:
10639 M>0,_N>0
10640
10641 Linearize MxN tiles on selected images.
10642
10643 Default value: 'N=M'.
10644
10645 Example:
10646 [#1] image.jpg +linearize_tiles 16
10647
10648 map_sprites:
10649 _nb_sprites>=1,_allow_rotation={ 0=none | 1=90 deg. | 2=180 deg.
10650 }
10651
10652 Map set of sprites (defined as the 'nb_sprites' latest images of
10653 the selection) to other selected images,
10654 according to the luminosity of their pixel values.
10655
10656 Example:
10657 [#1] image.jpg resize2dy 48 repeat 16 ball {8+2*$>},${-rgb}
10658 mul[-1] {(1+$>)/16} done map_sprites 16
10659
10660 pack:
10661 is_ratio_constraint={ 0 | 1 },_sort_criterion
10662
10663 Pack selected images into a single image.
10664 The returned status contains the list of new (x,y) offsets for each
10665 input image.
10666 Parameter 'is_ratio_constraint' tells if the resulting image must
10667 tend to a square image.
10668
10669 Default values: 'is_ratio_constraint=0' and 'sort_crite‐
10670 rion=max(w,h)'.
10671
10672 Example:
10673 [#1] image.jpg repeat 10 +resize2dx[-1] 75% balance_gamma[-1]
10674 ${-rgb} done pack 0
10675
10676 puzzle:
10677 _width>0,_height>0,_M>=1,_N>=1,_curvature,_centering,_connec‐
10678 tors_variability,_resolution>=1
10679
10680 Input puzzle binary mask with specified size and geometry.
10681
10682 Default values: 'width=height=512', 'M=N=5', 'curvature=0.5', 'cen‐
10683 tering=0.5', 'connectors_variability=0.5' and 'resolution=64'.
10684
10685 Example:
10686 [#1] puzzle ,
10687
10688 quadratize_tiles:
10689 M>0,_N>0
10690
10691 Quadratize MxN tiles on selected images.
10692
10693 Default value: 'N=M'.
10694
10695 Example:
10696 [#1] image.jpg +quadratize_tiles 16
10697
10698 rotate_tiles:
10699 angle,_M>0,N>0
10700
10701 Apply MxN tiled-rotation effect on selected images.
10702
10703 Default values: 'M=8' and 'N=M'.
10704
10705 Example:
10706 [#1] image.jpg to_rgba rotate_tiles 10,8 drop_shadow 10,10 dis‐
10707 play_rgba
10708
10709 shift_tiles:
10710 M>0,_N>0,_amplitude
10711
10712 Apply MxN tiled-shift effect on selected images.
10713
10714 Default values: 'N=M' and 'amplitude=20'.
10715
10716 Example:
10717 [#1] image.jpg +shift_tiles 8,8,10
10718
10719 taquin:
10720 M>0,_N>0,_remove_tile={ 0=none | 1=first | 2=last | 3=random
10721 },_relief,_border_thickness[%],_border_outline[%],_outline_color
10722
10723 Create MxN taquin puzzle from selected images.
10724
10725 Default value: 'N=M', 'relief=50', 'border_thickness=5', 'bor‐
10726 der_outline=0' and 'remove_tile=0'.
10727
10728 Example:
10729 [#1] image.jpg +taquin 8
10730
10731 tunnel:
10732 _level>=0,_factor>0,_centering_x,_centering_y,_opacity,_angle
10733
10734 Apply tunnel effect on selected images.
10735
10736 Default values: 'level=9', 'factor=80%', 'centering_x=center‐
10737 ing_y=0.5', 'opacity=1' and 'angle=0'
10738
10739 Example:
10740 [#1] image.jpg tunnel 20
10741
10742 12.16. Artistic
10743 --------
10744
10745 boxfitting:
10746 _min_box_size>=1,_max_box_size>=0,_initial_density>=0,_min_spac‐
10747 ing>0
10748
10749 Apply box fitting effect on selected images, as displayed the web
10750 page:
10751 http://www.complexification.net/gallery/machines/boxFittingImg/.
10752
10753 Default values: 'min_box_size=1', 'max_box_size=0', 'initial_den‐
10754 sity=0.25' and 'min_spacing=1'.
10755
10756 Example:
10757 [#1] image.jpg boxfitting ,
10758
10759 brushify:
10760 [brush],_brush_nb_sizes>=1,0<=_brush_min_size_fac‐
10761 tor<=1,_brush_nb_orienta‐
10762 tions>=1,_brush_light_type,0<=_brush_light_strength<=1,_brush_opac‐
10763 ity,_painting_density[%]>=0,0<=_painting_contours_coherence<=1,
10764 0<=_painting_orientation_coherence<=1,_painting_coherence_al‐
10765 pha[%]>=0,_painting_coherence_sigma[%]>=0,_painting_primary_an‐
10766 gle,0<=_painting_angle_dispersion<=1
10767
10768 Apply specified brush to create painterly versions of specified im‐
10769 ages.
10770 'brush_light_type' can be { 0=none | 1=flat | 2=darken | 3=lighten
10771 | 4=full }.
10772
10773 Default values: 'brush_nb_sizes=3', 'brush_min_size_factor=0.66',
10774 'brush_nb_orientations=12', 'brush_light_type=0',
10775 'brush_light_strength=0.25', 'brush_opacity=0.8',
10776 'painting_density=20%', 'painting_contours_coherence=0.9',
10777 'painting_orientation_coherence=0.9', 'painting_coherence_alpha=1',
10778 'painting_coherence_sigma=1',
10779 'painting_primary_angle=0', 'painting_angle_dispersion=0.2'
10780
10781 Example:
10782 [#1] image.jpg 40,40 gaussian[-1] 10,4 spread[-1] 10,0
10783 brushify[0] [1],1
10784
10785 cartoon:
10786 _smoothness,_sharpening,_threshold>=0,_thick‐
10787 ness>=0,_color>=0,quantization>0
10788
10789 Apply cartoon effect on selected images.
10790
10791 Default values: 'smoothness=3', 'sharpening=150', 'threshold=20',
10792 'thickness=0.25', 'color=1.5' and 'quantization=8'.
10793
10794 Example:
10795 [#1] image.jpg cartoon 3,50,10,0.25,3,16
10796
10797 color_ellipses:
10798 _count>0,_radius>=0,_opacity>=0
10799
10800 Add random color ellipses to selected images.
10801
10802 Default values: 'count=400', 'radius=5' and 'opacity=0.1'.
10803
10804 Example:
10805 [#1] image.jpg +color_ellipses ,,0.15
10806
10807 cubism:
10808 _density>=0,0<=_thickness<=50,_max_angle,_opacity,_smoothness>=0
10809
10810 Apply cubism effect on selected images.
10811
10812 Default values: 'density=50', 'thickness=10', 'max_angle=75',
10813 'opacity=0.7' and 'smoothness=0'.
10814
10815 Example:
10816 [#1] image.jpg cubism ,
10817
10818 draw_whirl:
10819 _amplitude>=0
10820
10821 Apply whirl drawing effect on selected images.
10822
10823 Default value: 'amplitude=100'.
10824
10825 Example:
10826 [#1] image.jpg draw_whirl ,
10827
10828 drawing:
10829 _amplitude>=0
10830
10831 Apply drawing effect on selected images.
10832
10833 Default value: 'amplitude=200'.
10834
10835 Example:
10836 [#1] image.jpg +drawing ,
10837
10838 drop_shadow:
10839 _offset_x[%],_offset_y[%],_smoothness[%]>=0,0<=_curvature<=1,_ex‐
10840 pand_size={ 0 | 1 }
10841
10842 Drop shadow behind selected images.
10843
10844 Default values: 'offset_x=20', 'offset_y=offset_x', 'smoothness=5',
10845 'curvature=0' and 'expand_size=1'.
10846
10847 Example:
10848 [#1] image.jpg drop_shadow 10,20,5,0.5 expand_xy 20,0 dis‐
10849 play_rgba
10850
10851 ellipsionism:
10852 _R>0[%],_r>0[%],_smoothness>=0[%],_opacity,_outline>0,_density>0
10853
10854 Apply ellipsionism filter to selected images.
10855
10856 Default values: 'R=10', 'r=3', 'smoothness=1%', 'opacity=0.7',
10857 'outline=8' and 'density=0.6'.
10858
10859 Example:
10860 [#1] image.jpg ellipsionism ,
10861
10862 fire_edges:
10863 _edges>=0,0<=_attenuation<=1,_smoothness>=0,_thresh‐
10864 old>=0,_nb_frames>0,_starting_frame>=0,frame_skip>=0
10865
10866 Generate fire effect from edges of selected images.
10867
10868 Default values: 'edges=0.7', 'attenuation=0.25', 'smoothness=0.5',
10869 'threshold=25', 'nb_frames=1', 'starting_frame=20' and 'frame_skip=0'.
10870
10871 Example:
10872 [#1] image.jpg fire_edges ,
10873
10874 fractalize:
10875 0<=detail_level<=1
10876
10877 Randomly fractalize selected images.
10878
10879 Default value: 'detail_level=0.8'
10880
10881 Example:
10882 [#1] image.jpg fractalize ,
10883
10884 glow:
10885 _amplitude>=0
10886
10887 Add soft glow on selected images.
10888
10889 Default value: 'amplitude=1%'.
10890
10891 Example:
10892 [#1] image.jpg glow ,
10893
10894 halftone:
10895 nb_levels>=2,_size_dark>=2,_size_bright>=2,_shape={ 0=square |
10896 1=diamond | 2=circle | 3=inv-square | 4=inv-diamond | 5=inv-circle
10897 },_smoothness[%]>=0
10898
10899 Apply halftone dithering to selected images.
10900
10901 Default values: 'nb_levels=5', 'size_dark=8', 'size_bright=8',
10902 'shape=5' and 'smoothnesss=0'.
10903
10904 Example:
10905 [#1] image.jpg halftone ,
10906
10907 hardsketchbw:
10908 _amplitude>=0,_density>=0,_opacity,0<=_edge_thresh‐
10909 old<=100,_is_fast={ 0 | 1 }
10910
10911 Apply hard B&W sketch effect on selected images.
10912
10913 Default values: 'amplitude=1000', 'sampling=3', 'opacity=0.1',
10914 'edge_threshold=20' and 'is_fast=0'.
10915
10916 Example:
10917 [#1] image.jpg +hardsketchbw 200,70,0.1,10 median[-1] 2 +local
10918 reverse blur[-1] 3 blend[-2,-1] overlay done
10919
10920 hearts:
10921 _density>=0
10922
10923 Apply heart effect on selected images.
10924
10925 Default value: 'density=10'.
10926
10927 Example:
10928 [#1] image.jpg hearts ,
10929
10930 houghsketchbw:
10931 _density>=0,_radius>0,0<=_threshold<=100,0<=_opacity<=1,_vote‐
10932 size[%]>0
10933
10934 Apply hough B&W sketch effect on selected images.
10935
10936 Default values: 'density=100', 'radius=3', 'threshold=100', 'opac‐
10937 ity=0.1' and 'votesize=100%'.
10938
10939 Example:
10940 [#1] image.jpg +houghsketchbw ,
10941
10942 lightrays:
10943 100<=_density<=0,_center_x[%],_cen‐
10944 ter_y[%],_ray_length>=0,_ray_attenuation>=0
10945
10946 Generate ray lights from the edges of selected images.
10947
10948 Default values: 'density=50%', 'center_x=50%', 'center_y=50%',
10949 'ray_length=0.9' and 'ray_attenuation=0.5'.
10950
10951 Example:
10952 [#1] image.jpg +lightrays , + cut 0,255
10953
10954 light_relief:
10955 _ambient_light,_specular_lightness,_specular_size,_dark‐
10956 ness,_light_smoothness,_xl,_yl,_zl,_zscale,_opacity_is_heightmap={ 0 |
10957 1 }
10958
10959 Apply relief light to selected images.
10960 Default values(s) : 'ambient_light=0.3', 'specular_lightness=0.5',
10961 'specular_size=0.2', 'darkness=0', 'xl=0.2', 'yl=zl=0.5',
10962 'zscale=1', 'opacity=1' and 'opacity_is_heightmap=0'.
10963
10964 Example:
10965 [#1] image.jpg blur 2 light_relief 0.3,4,0.1,0
10966
10967 linify:
10968 0<=_density<=100,_spreading>=0,_resolution[%]>0,_line_opac‐
10969 ity>=0,_line_precision>0,_mode={ 0=subtractive | 1=additive }
10970
10971 Apply linify effect on selected images.
10972 The algorithm is inspired from the one described on the webpage
10973 http://linify.me/about.
10974
10975 Default values: 'density=50', 'spreading=2', 'resolution=40%',
10976 'line_opacity=10', 'line_precision=24' and 'mode=0'.
10977
10978 Example:
10979 [#1] image.jpg linify 60
10980
10981 mosaic:
10982 0<=_density<=100
10983
10984 Create random mosaic from selected images.
10985
10986 Default values: 'density=30'.
10987
10988 Example:
10989 [#1] image.jpg mosaic , +fill "I!=J(1) || I!=J(0,1)?[0,0,0]:I"
10990
10991 old_photo:
10992
10993 Apply old photo effect on selected images.
10994
10995 Example:
10996 [#1] image.jpg old_photo
10997
10998 pencilbw:
10999 _size>=0,_amplitude>=0
11000
11001 Apply B&W pencil effect on selected images.
11002
11003 Default values: 'size=0.3' and 'amplitude=60'.
11004
11005 Example:
11006 [#1] image.jpg pencilbw ,
11007
11008 pixelsort:
11009 _ordering={ + | - },_axis={ x | y | z | xy | yx },_[sorting_cri‐
11010 terion],_[mask]
11011
11012 Apply a 'pixel sorting' algorithm on selected images, as described
11013 in the page :
11014 http://satyarth.me/articles/pixel-sorting/.
11015
11016 Default values: 'ordering=+', 'axis=x' and 'sorting_crite‐
11017 rion=mask=(undefined)'.
11018
11019 Example:
11020 [#1] image.jpg +norm +ge[-1] 30% +pixelsort[0] +,y,[1],[2]
11021
11022 polaroid:
11023 _size1>=0,_size2>=0
11024
11025 Create polaroid effect in selected images.
11026
11027 Default values: 'size1=10' and 'size2=20'.
11028
11029 Example:
11030 [#1] image.jpg to_rgba polaroid 5,30 rotate 20 drop_shadow ,
11031 drgba
11032
11033 polygonize:
11034 _warp_amplitude>=0,_smoothness[%]>=0,_min_area[%]>=0,_resolu‐
11035 tion_x[%]>0,_resolution_y[%]>0
11036
11037 Apply polygon effect on selected images.
11038
11039 Default values: 'warp_amplitude=300', 'smoothness=2%',
11040 'min_area=0.1%', 'resolution_x=resolution_y=10%'.
11041
11042 Example:
11043 [#1] image.jpg image.jpg polygonize 100,10 +fill "I!=J(1) ||
11044 I!=J(0,1)?[0,0,0]:I"
11045
11046 poster_edges:
11047 0<=_edge_threshold<=100,0<=_edge_shade<=100,_edge_thick‐
11048 ness>=0,_edge_antialiasing>=0,0<=_posterization_level<=15,_posteriza‐
11049 tion_antialiasing>=0
11050
11051 Apply poster edges effect on selected images.
11052
11053 Default values: 'edge_threshold=40', 'edge_shade=5', 'edge_thick‐
11054 ness=0.5', 'edge_antialiasing=10', 'posterization_level=12' and 'pos‐
11055 terization_antialiasing=0'.
11056
11057 Example:
11058 [#1] image.jpg poster_edges ,
11059
11060 poster_hope:
11061 _smoothness>=0
11062
11063 Apply Hope stencil poster effect on selected images.
11064
11065 Default value: 'smoothness=3'.
11066
11067 Example:
11068 [#1] image.jpg poster_hope ,
11069
11070 rodilius:
11071 0<=_amplitude<=100,_0<=thickness<=100,_sharpness>=0,_nb_orienta‐
11072 tions>0,_offset,_color_mode={ 0=darker | 1=brighter }
11073
11074 Apply rodilius (fractalius-like) filter on selected images.
11075
11076 Default values: 'amplitude=10', 'thickness=10', 'sharpness=400',
11077 'nb_orientations=7', 'offset=0' and 'color_mode=1'.
11078
11079 Example:
11080 [#1] image.jpg rodilius 12,10,300,10 normalize_local 10,6
11081 [#2] image.jpg normalize_local 10,16 rodilius 10,4,400,16 smooth
11082 60,0,1,1,4 normalize_local 10,16
11083
11084 sketchbw:
11085 _nb_angles>0,_start_angle,_angle_range>=0,_length>=0,_thresh‐
11086 old>=0,_opacity,_bgfactor>=0,_density>0,_sharpness>=0,_anisot‐
11087 ropy>=0,_smoothness>=0,_coherence>=0,_is_boost={ 0 | 1 },_is_curved={ 0
11088 | 1 }
11089
11090 Apply sketch effect to selected images.
11091
11092 Default values: 'nb_angles=2', 'start_angle=45', 'angle_range=180',
11093 'length=30', 'threshold=3', 'opacity=0.03', 'bgfactor=0', 'den‐
11094 sity=0.6',
11095 'sharpness=0.1', 'anisotropy=0.6', 'smoothness=0.25', 'coher‐
11096 ence=1', 'is_boost=0' and 'is_curved=1'.
11097
11098 Example:
11099 [#1] image.jpg +sketchbw 1 reverse blur[-1] 3 blend[-2,-1] over‐
11100 lay
11101
11102 sponge:
11103 _size>0
11104
11105 Apply sponge effect on selected images.
11106
11107 Default value: 'size=13'.
11108
11109 Example:
11110 [#1] image.jpg sponge ,
11111
11112 stained_glass:
11113 _edges[%]>=0, shading>=0, is_thin_separators={ 0 | 1 }
11114
11115 Generate stained glass from selected images.
11116
11117 Default values: 'edges=40%', 'shading=0.2' and 'is_precise=0'.
11118
11119 Example:
11120 [#1] image.jpg stained_glass 20%,1 cut 0,20
11121
11122 stars:
11123 _density[%]>=0,_depth>=0,_size>0,_nb_branches>=1,0<=_thick‐
11124 ness<=1,_smoothness[%]>=0,_R,_G,_B,_opacity
11125
11126 Add random stars to selected images.
11127
11128 Default values: 'density=10%', 'depth=1', 'size=32',
11129 'nb_branches=5', 'thickness=0.38', 'smoothness=0.5', 'R=G=B=200' and
11130 'opacity=1'.
11131
11132 Example:
11133 [#1] image.jpg stars ,
11134
11135 stencil:
11136 _radius[%]>=0,_smoothness>=0,_iterations>=0
11137
11138 Apply stencil filter on selected images.
11139
11140 Default values: 'radius=3', 'smoothness=1' and 'iterations=8'.
11141
11142 Example:
11143 [#1] image.jpg +norm stencil. 2,1,4 +mul rm[0]
11144
11145 stencilbw:
11146 _edges>=0,_smoothness>=0
11147
11148 Apply B&W stencil effect on selected images.
11149
11150 Default values: 'edges=15' and 'smoothness=10'.
11151
11152 Example:
11153 [#1] image.jpg +stencilbw 40,4
11154
11155 stylize:
11156 [style_image],_fidelity_finest,_fidelity_coarsest,_fi‐
11157 delity_smoothness_finest>=0,_fidelity_smoothnes_coarsest>=0,0<=_fi‐
11158 delity_chroma<=1,_init_type,_init_resolution>=0,init_max_gradient>=0,
11159 _patchsize_analysis>0,_patchsize_synthesis>0,_patchsize_synthe‐
11160 sis_final>0,_nb_matches_finest>=0,_nb_matches_coarsest>=0,_penal‐
11161 ize_repetitions>=0,_matching_precision>=0,_scale_factor>1,
11162 _skip_finest_scales>=0,_"image_matching_command"
11163
11164 Transfer colors and textures from specified style image to selected
11165 images, using a multi-scale patch-mathing algorithm.
11166 If instant display window[0] is opened, the steps of the image syn‐
11167 thesis are displayed on it.
11168 'init_type' can be { 0=best-match | 1=identity | 2=randomized }.
11169
11170 Default values: 'fidelity_finest=0.5', 'fidelity_coarsest=2', 'fi‐
11171 delity_smoothness_finest=3', 'fidelity_smoothness_coarsest=0.5', 'fi‐
11172 delity_chroma=0.1',
11173 'init_type=0', 'init_resolution=16', 'init_max_gradient=0',
11174 'patchsize_analysis=5', 'patchsize_synthesis=5', 'patchsize_synthe‐
11175 sis_final=5',
11176 'nb_matches_finest=2', 'nb_matchesc_coarsest=30', 'penalize_repe‐
11177 titions=2', 'matching_precision=2', 'scale_factor=1.85',
11178 'skip_finest_scales=0' and
11179 'image_matching_command'="s c,-3 transfer_pca[0] [2] b[0,2] xy,0.7
11180 n[0,2] 0,255 n[1,2] 0,200 a[0,1] c a[1,2] c"'.
11181
11182 tetris:
11183 _scale>0
11184
11185 Apply tetris effect on selected images.
11186
11187 Default value: 'scale=10'.
11188
11189 Example:
11190 [#1] image.jpg +tetris 10
11191
11192 warhol:
11193 _M>0,_N>0,_smoothness>=0,_color>=0
11194
11195 Create MxN Andy Warhol-like artwork from selected images.
11196
11197 Default values: 'M=3', 'N=M', 'smoothness=2' and 'color=20'.
11198
11199 Example:
11200 [#1] image.jpg warhol 3,3,3,40
11201
11202 weave:
11203 _density>=0,0<=_thickness<=100,0<=_shadow<=100,_shad‐
11204 ing>=0,_fibers_amplitude>=0,_fibers_smoothness>=0,_angle,-1<=_x_curva‐
11205 ture<=1,-1<=_y_curvature<=1
11206
11207 Apply weave effect to the selected images.
11208 'angle' can be { 0=0 deg. | 1=22.5 deg. | 2=45 deg. | 3=67.5 deg.
11209 }.
11210
11211 Default values: 'density=6', 'thickness=65', 'shadow=40', 'shad‐
11212 ing=0.5', 'fibers_amplitude=0', _'fibers_smoothness=0', 'angle=0' and
11213 'curvature_x=curvature_y=0'
11214
11215 Example:
11216 [#1] image.jpg weave ,
11217
11218 whirls:
11219 _texture>=0,_smoothness>=0,_darkness>=0,_lightness>=0
11220
11221 Add random whirl texture to selected images.
11222
11223 Default values: 'texture=3', 'smoothness=6', 'darkness=0.5' and
11224 'lightness=1.8'.
11225
11226 Example:
11227 [#1] image.jpg whirls ,
11228
11229 12.17. Warpings
11230 --------
11231
11232 deform:
11233 _amplitude>=0,_interpolation
11234
11235 Apply random smooth deformation on selected images.
11236 'interpolation' can be { 0=none | 1=linear | 2=bicubic }.
11237
11238 Default value: 'amplitude=10'.
11239
11240 Example:
11241 [#1] image.jpg +deform[0] 10 +deform[0] 20
11242
11243 euclidean2polar:
11244 _center_x[%],_center_y[%],_stretch_factor>0,_boundary_condi‐
11245 tions={ 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }
11246
11247 Apply euclidean to polar transform on selected images.
11248
11249 Default values: 'center_x=center_y=50%', 'stretch_factor=1' and
11250 'boundary_conditions=3'.
11251
11252 Example:
11253 [#1] image.jpg +euclidean2polar ,
11254
11255 equirectangular2nadirzenith:
11256
11257 Transform selected equirectangular images to nadir/zenith rectilin‐
11258 ear projections.
11259
11260 fisheye:
11261 _center_x,_center_y,0<=_radius<=100,_amplitude>=0
11262
11263 Apply fish-eye deformation on selected images.
11264
11265 Default values: 'x=y=50', 'radius=50' and 'amplitude=1.2'.
11266
11267 Example:
11268 [#1] image.jpg +fisheye ,
11269
11270 flower:
11271 _amplitude,_frequency,_offset_r[%],_angle,_center_x[%],_cen‐
11272 ter_y[%],_boundary_conditions={ 0=dirichlet | 1=neumann | 2=periodic |
11273 3=mirror}
11274
11275 Apply flower deformation on selected images.
11276
11277 Default values: 'amplitude=30', 'frequency=6', 'offset_r=0', 'an‐
11278 gle=0', 'center_x=center_y=50%' and 'boundary_conditions=3'.
11279
11280 Example:
11281 [#1] image.jpg +flower ,
11282
11283 kaleidoscope:
11284 _center_x[%],_center_y[%],_radius,_angle,_boundary_conditions={
11285 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }
11286
11287 Create kaleidoscope effect from selected images.
11288
11289 Default values: 'center_x=center_y=50%', 'radius=100', 'angle=30'
11290 and 'boundary_conditions=3'.
11291
11292 Example:
11293 [#1] image.jpg kaleidoscope ,
11294
11295 map_sphere:
11296 _width>0,_height>0,_radius,_dilation>0,_fading>=0,_fad‐
11297 ing_power>=0
11298
11299 Map selected images on a sphere.
11300
11301 Default values: 'width=height=512', 'radius=100', 'dilation=0.5',
11302 'fading=0' and 'fading_power=0.5'.
11303
11304 Example:
11305 [#1] image.jpg map_sphere ,
11306
11307 nadirzenith2equirectangular:
11308
11309 Transform selected nadir/zenith rectilinear projections to
11310 equirectangular images.
11311
11312 polar2euclidean:
11313 _center_x[%],_center_y[%],_stretch_factor>0,_boundary_condi‐
11314 tions={ 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }
11315
11316 Apply euclidean to polar transform on selected images.
11317
11318 Default values: 'center_x=center_y=50%', 'stretch_factor=1' and
11319 'boundary_conditions=3'.
11320
11321 Example:
11322 [#1] image.jpg +euclidean2polar ,
11323
11324 raindrops:
11325 _amplitude,_density>=0,_wavelength>=0,_merging_steps>=0
11326
11327 Apply raindrops deformation on selected images.
11328
11329 Default values: 'amplitude=80','density=0.1', 'wavelength=1' and
11330 'merging_steps=0'.
11331
11332 Example:
11333 [#1] image.jpg +raindrops ,
11334
11335 ripple:
11336 _amplitude,_bandwidth,_shape={ 0=block | 1=triangle | 2=sine |
11337 3=sine+ | 4=random },_angle,_offset
11338
11339 Apply ripple deformation on selected images.
11340
11341 Default values: 'amplitude=10', 'bandwidth=10', 'shape=2', 'an‐
11342 gle=0' and 'offset=0'.
11343
11344 Example:
11345 [#1] image.jpg +ripple ,
11346
11347 rotoidoscope:
11348 _center_x[%],_center_y[%],_tiles>0,_smoothness[%]>=0,_bound‐
11349 ary_conditions={ 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }
11350
11351 Create rotational kaleidoscope effect from selected images.
11352
11353 Default values: 'center_x=center_y=50%', 'tiles=10', 'smoothness=1'
11354 and 'boundary_conditions=3'.
11355
11356 Example:
11357 [#1] image.jpg +rotoidoscope ,
11358
11359 spherize:
11360 _radius[%]>=0,_strength,_smoothness[%]>=0,_center_x[%],_cen‐
11361 ter_y[%],_ratio_x/y>0,_angle,_interpolation
11362
11363 Apply spherize effect on selected images.
11364
11365 Default values: 'radius=50%', 'strength=1', 'smoothness=0', 'cen‐
11366 ter_x=center_y=50%', 'ratio_x/y=1', 'angle=0' and 'interpolation=1'.
11367
11368 Example:
11369 [#1] image.jpg grid 5%,5%,0,0,0.6,255 spherize ,
11370
11371 symmetrize:
11372 _x[%],_y[%],_angle,_boundary_conditions={ 0=dirichlet | 1=neumann
11373 | 2=periodic | 3=mirror },_is_antisymmetry={ 0 | 1 },_swap_sides={ 0 |
11374 1 }
11375
11376 Symmetrize selected images regarding specified axis.
11377
11378 Default values: 'x=y=50%', 'angle=90', 'boundary_conditions=3',
11379 'is_antisymmetry=0' and 'swap_sides=0'.
11380
11381 Example:
11382 [#1] image.jpg +symmetrize 50%,50%,45 +symmetrize[-1] 50%,50%,-45
11383
11384 transform_polar:
11385 "expr_radius",_"expr_angle",_center_x[%],_center_y[%],_bound‐
11386 ary_conditions={ 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }
11387
11388 Apply user-defined transform on polar representation of selected
11389 images.
11390
11391 Default values: 'expr_radius=R-r', 'expr_rangle=a', 'center_x=cen‐
11392 ter_y=50%' and 'boundary_conditions=3'.
11393
11394 Example:
11395 [#1] image.jpg +transform_polar[0] R*(r/R)^2,a +transform_po‐
11396 lar[0] r,2*a
11397
11398 twirl:
11399 _amplitude,_center_x[%],_center_y[%],_boundary_conditions={
11400 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }
11401
11402 Apply twirl deformation on selected images.
11403
11404 Default values: 'amplitude=1', 'center_x=center_y=50%' and 'bound‐
11405 ary_conditions=3'.
11406
11407 Example:
11408 [#1] image.jpg twirl 0.6
11409
11410 warp_perspective:
11411 _x-angle,_y-angle,_zoom>0,_x-center,_y-center,_boundary_condi‐
11412 tions={ 0=dirichlet | 1=neumann | 2=periodic | 3=mirror }
11413
11414 Warp selected images with perspective deformation.
11415
11416 Default values: 'x-angle=1.5', 'y-angle=0', 'zoom=1', 'x-center=y-
11417 center=50' and 'boundary_conditions=2'.
11418
11419 Example:
11420 [#1] image.jpg warp_perspective ,
11421
11422 water:
11423 _amplitude,_smoothness>=0,_angle
11424
11425 Apply water deformation on selected images.
11426
11427 Default values: 'amplitude=30', 'smoothness=1.5' and 'angle=45'.
11428
11429 Example:
11430 [#1] image.jpg water ,
11431
11432 wave:
11433 _amplitude>=0,_frequency>=0,_center_x,_center_y
11434
11435 Apply wave deformation on selected images.
11436
11437 Default values: 'amplitude=4', 'frequency=0.4' and 'center_x=cen‐
11438 ter_y=50'.
11439
11440 Example:
11441 [#1] image.jpg wave ,
11442
11443 wind:
11444 _amplitude>=0,_angle,0<=_attenuation<=1,_threshold
11445
11446 Apply wind effect on selected images.
11447
11448 Default values: 'amplitude=20', 'angle=0', 'attenuation=0.7' and
11449 'threshold=20'.
11450
11451 Example:
11452 [#1] image.jpg +wind ,
11453
11454 zoom:
11455 _factor,_cx,_cy,_cz,_boundary_conditions={ 0=dirichlet | 1=neu‐
11456 mann | 2=periodic | 3=mirror }
11457
11458 Apply zoom factor to selected images.
11459
11460 Default values: 'factor=1', 'cx=cy=cz=0.5' and 'boundary_condi‐
11461 tions=0'.
11462
11463 Example:
11464 [#1] image.jpg +zoom[0] 0.6 +zoom[0] 1.5
11465
11466 12.18. Degradations
11467 ------------
11468
11469 cracks:
11470 0<=_density<=100,_is_relief={ 0 | 1 },_opacity,_color1,...
11471
11472 Draw random cracks on selected images with specified color.
11473
11474 Default values: 'density=25', 'is_relief=0', 'opacity=1' and
11475 'color1=0'.
11476
11477 Example:
11478 [#1] image.jpg +cracks ,
11479
11480 light_patch:
11481 _density>0,_darkness>=0,_lightness>=0
11482
11483 Add light patches to selected images.
11484
11485 Default values: 'density=10', 'darkness=0.9' and 'lightness=1.7'.
11486
11487 Example:
11488 [#1] image.jpg +light_patch 20,0.9,4
11489
11490 noise_hurl:
11491 _amplitude>=0
11492
11493 Add hurl noise to selected images.
11494
11495 Default value: 'amplitude=10'.
11496
11497 Example:
11498 [#1] image.jpg +noise_hurl ,
11499
11500 pixelize:
11501 _scale_x>0,_scale_y>0,_scale_z>0
11502
11503 Pixelize selected images with specified scales.
11504
11505 Default values: 'scale_x=20' and 'scale_y=scale_z=scale_x'.
11506
11507 Example:
11508 [#1] image.jpg +pixelize ,
11509
11510 scanlines:
11511 _amplitude,_bandwidth,_shape={ 0=block | 1=triangle | 2=sine |
11512 3=sine+ | 4=random },_angle,_offset
11513
11514 Apply ripple deformation on selected images.
11515
11516 Default values: 'amplitude=60', 'bandwidth=2', 'shape=0', 'angle=0'
11517 and 'offset=0'.
11518
11519 Example:
11520 [#1] image.jpg +scanlines ,
11521
11522 shade_stripes:
11523 _frequency>=0,_direction={ 0=horizontal | 1=vertical },_dark‐
11524 ness>=0,_lightness>=0
11525
11526 Add shade stripes to selected images.
11527
11528 Default values: 'frequency=5', 'direction=1', 'darkness=0.8' and
11529 'lightness=2'.
11530
11531 Example:
11532 [#1] image.jpg +shade_stripes 30
11533
11534 shadow_patch:
11535 _opacity>=0
11536
11537 Add shadow patches to selected images.
11538
11539 Default value: 'opacity=0.7'.
11540
11541 Example:
11542 [#1] image.jpg +shadow_patch 0.4
11543
11544 spread:
11545 _dx>=0,_dy>=0,_dz>=0
11546
11547 Spread pixel values of selected images randomly along x,y and z.
11548
11549 Default values: 'dx=3', 'dy=dx' and 'dz=0'.
11550
11551 Example:
11552 [#1] image.jpg +spread 3
11553
11554 stripes_y:
11555 _frequency>=0
11556
11557 Add vertical stripes to selected images.
11558
11559 Default value: 'frequency=10'.
11560
11561 Example:
11562 [#1] image.jpg +stripes_y ,
11563
11564 texturize_canvas:
11565 _amplitude>=0,_fibrousness>=0,_emboss_level>=0
11566
11567 Add paint canvas texture to selected images.
11568
11569 Default values: 'amplitude=20', 'fibrousness=3' and 'em‐
11570 boss_level=0.6'.
11571
11572 Example:
11573 [#1] image.jpg +texturize_canvas ,
11574
11575 texturize_paper:
11576
11577 Add paper texture to selected images.
11578
11579 Example:
11580 [#1] image.jpg +texturize_paper
11581
11582 vignette:
11583 _strength>=0,0<=_radius_min<=100,0<=_radius_max<=100
11584
11585 Add vignette effect to selected images.
11586
11587 Default values: 'strength=100', 'radius_min=70' and 'ra‐
11588 dius_max=90'.
11589
11590 Example:
11591 [#1] image.jpg vignette ,
11592
11593 watermark_visible:
11594 _text,0<_opacity<1,_size>0,_angle,_mode={ 0=remove | 1=add
11595 },_smoothness>=0
11596
11597 Add or remove a visible watermark on selected images (value range
11598 must be [0,255]).
11599
11600 Default values: 'text=(c) G'MIC', 'opacity=0.3', 'size=53', 'an‐
11601 gle=25', 'mode=1' and 'smoothness=0'.
11602
11603 Example:
11604 [#1] image.jpg watermark_visible ,0.7
11605
11606 12.19. Blending and Fading
11607 -------------------
11608
11609 blend:
11610 [layer],blending_mode,_opacity[%],_selection_is={ 0=base-layers |
11611 1=top-layers } |
11612 blending_mode,_opacity[%]
11613
11614 Blend selected G,GA,RGB or RGBA images by specified layer or blend
11615 all selected images together,
11616 using specified blending mode.
11617 'blending_mode' can be { add | alpha | and | average | blue | burn
11618 | darken | difference |
11619 divide | dodge | edges | exclusion | freeze | grainextract | grain‐
11620 merge | green | hardlight |
11621 hardmix | hue | interpolation | lchlightness | lighten | lightness
11622 | linearburn | linearlight | luminance |
11623 multiply | negation | or | overlay | pinlight | red | reflect |
11624 saturation |
11625 screen | seamless | seamless_mixed | shapeareamax | shapeareamax0 |
11626 shapeareamin | shapeareamin0 |
11627 shapeaverage | shapeaverage0 | shapemedian | shapemedian0 |
11628 shapemin | shapemin0 | shapemax | shapemax0 |
11629 softburn | softdodge | softlight | stamp | subtract | value |
11630 vividlight | xor }.
11631 'opacity' must be in range '[0,1]' (or '[0%,100%]').
11632
11633 Default values: 'blending_mode=alpha', 'opacity=1' and 'selec‐
11634 tion_is=0'.
11635
11636 Example:
11637 [#1] image.jpg +drop_shadow , resize2dy[-1] 200 rotate[-1] 20
11638 +blend alpha display_rgba[-2]
11639 [#2] image.jpg testimage2d {w},{h} blend overlay
11640 [#3] command "ex : $""=arg repeat $""# +blend[0,1] ${arg{$>+1}}
11641 text_outline[-1] Mode:
11642 [#4] command "ex : $""=arg repeat $""# +blend[0,1] ${arg{$>+1}}
11643 text_outline[-1] Mode:
11644 grainextract,grainmerge
11645 [#5] command "ex : $""=arg repeat $""# +blend[0,1] ${arg{$>+1}}
11646 text_outline[-1] Mode:
11647 lighten,lightness
11648 [#6] command "ex : $""=arg repeat $""# +blend[0,1] ${arg{$>+1}}
11649 text_outline[-1] Mode:
11650 negation,or,overlay
11651 [#7] command "ex : $""=arg repeat $""# +blend[0,1] ${arg{$>+1}}
11652 text_outline[-1] Mode:
11653 shapeaverage,softburn
11654 [#8] command "ex : $""=arg repeat $""# +blend[0,1] ${arg{$>+1}}
11655 text_outline[-1] Mode:
11656 vividlight,xor
11657
11658 blend:
11659 [layer],blending_mode,_opacity[%],_selection_is={ 0=base-layers |
11660 1=top-layers } |
11661 blending_mode,_opacity[%]
11662
11663 blend_edges:
11664 smoothness[%]>=0
11665
11666 Blend selected images togethers using 'edges' mode.
11667
11668 Example:
11669 [#1] image.jpg testimage2d {w},{h} +blend_edges 0.8
11670
11671 blend_fade:
11672 [fading_shape]
11673
11674 Blend selected images together using specified fading shape.
11675
11676 Example:
11677 [#1] image.jpg testimage2d {w},{h} 100%,100%,1,1,'cos(y/10)' nor‐
11678 malize[-1] 0,1 +blend_fade[0,1] [2]
11679
11680 blend_median:
11681
11682 Blend selected images together using 'median' mode.
11683
11684 Example:
11685 [#1] image.jpg testimage2d {w},{h} +mirror[0] y +blend_median
11686
11687 blend_seamless:
11688 _is_mixed_mode={ 0 | 1 },_inner_fading[%]>=0,_outer_fading[%]>=0
11689
11690 Blend selected images using a seamless blending mode (Poisson-
11691 based).
11692
11693 Default values: 'is_mixed=0', 'inner_fading=0' and 'outer_fad‐
11694 ing=100%'.
11695
11696 fade_diamond:
11697 0<=_start<=100,0<=_end<=100
11698
11699 Create diamond fading from selected images.
11700
11701 Default values: 'start=80' and 'end=90'.
11702
11703 Example:
11704 [#1] image.jpg testimage2d {w},{h} +fade_diamond 80,85
11705
11706 fade_linear:
11707 _angle,0<=_start<=100,0<=_end<=100
11708
11709 Create linear fading from selected images.
11710
11711 Default values: 'angle=45', 'start=30' and 'end=70'.
11712
11713 Example:
11714 [#1] image.jpg testimage2d {w},{h} +fade_linear 45,48,52
11715
11716 fade_radial:
11717 0<=_start<=100,0<=_end<=100
11718
11719 Create radial fading from selected images.
11720
11721 Default values: 'start=30' and 'end=70'.
11722
11723 Example:
11724 [#1] image.jpg testimage2d {w},{h} +fade_radial 30,70
11725
11726 fade_x:
11727 0<=_start<=100,0<=_end<=100
11728
11729 Create horizontal fading from selected images.
11730
11731 Default values: 'start=30' and 'end=70'.
11732
11733 Example:
11734 [#1] image.jpg testimage2d {w},{h} +fade_x 30,70
11735
11736 fade_y:
11737 0<=_start<=100,0<=_end<=100
11738
11739 Create vertical fading from selected images.
11740
11741 Default values: 'start=30' and 'end=70'.
11742
11743 Example:
11744 [#1] image.jpg testimage2d {w},{h} +fade_y 30,70
11745
11746 fade_z:
11747 0<=_start<=100,0<=_end<=100
11748
11749 Create transversal fading from selected images.
11750
11751 Default values: 'start=30' and 'end=70'.
11752
11753 sub_alpha:
11754 [base_image],_opacity_gain>=1
11755
11756 Compute the minimal alpha-channel difference (opposite of alpha
11757 blending) between the selected images
11758 and the specified base image.
11759 The alpha difference A-B is defined as the image having minimal
11760 opacity, such that alpha_blend(B,A-B) = A.
11761
11762 Default value: 'opacity_gain=1'.
11763
11764 Example:
11765 [#1] image.jpg testimage2d {w},{h} +sub_alpha[0] [1] display_rgba
11766
11767 12.20. Image Sequences and Videos
11768 --------------------------
11769
11770 animate:
11771 fil‐
11772 ter_name,"param1_start,...,paramN_start","param1_end,...,paramN_end",nb_frames>=0,_out‐
11773 put_frames={ 0 | 1 },_output_filename |
11774 delay>0,_back and forth={ 0 | 1 }
11775
11776 Animate filter from starting parameters to ending parameters or an‐
11777 imate selected images
11778 in a display window.
11779
11780 Default value: 'delay=30'.
11781
11782 Example:
11783 [#1] image.jpg animate flower,"0,3","20,8",9
11784
11785 apply_camera:
11786 _"command",_camera_index>=0,_skip_frames>=0,_output_filename
11787
11788 Apply specified command on live camera stream, and display it on
11789 display window [0].
11790 This command requires features from the OpenCV library (not enabled
11791 in G'MIC by default).
11792
11793 Default values: 'command=""', 'camera_index=0' (default camera),
11794 'skip_frames=0' and 'output_filename=""'.
11795
11796 apply_files:
11797 "filename_pattern",_"command",_first_frame>=0,_last_frame={ >=0 |
11798 -1=last },_frame_step>=1,_output_filename
11799
11800 Apply a G'MIC command on specified input image files, in a streamed
11801 way.
11802 If a display window is opened, rendered frames are displayed in it
11803 during processing.
11804 The output filename may have extension '.avi' or '.mp4' (saved as a
11805 video), or any other usual image file
11806 extension (saved as a sequence of images).
11807
11808 Default values: 'command=(undefined)', 'first_frame=0',
11809 'last_frame=-1', 'frame_step=1' and 'output_filename=(undefined)'.
11810
11811 apply_video:
11812 video_filename,_"command",_first_frame>=0,_last_frame={ >=0 |
11813 -1=last },_frame_step>=1,_output_filename
11814
11815 Apply a G'MIC command on all frames of the specified input video
11816 file, in a streamed way.
11817 If a display window is opened, rendered frames are displayed in it
11818 during processing.
11819 The output filename may have extension '.avi' or '.mp4' (saved as a
11820 video), or any other usual image
11821 file extension (saved as a sequence of images).
11822 This command requires features from the OpenCV library (not enabled
11823 in G'MIC by default).
11824
11825 Default values: 'first_frame=0', 'last_frame=-1', 'frame_step=1'
11826 and 'output_filename=(undefined)'.
11827
11828 average_files:
11829 "filename_pattern",_first_frame>=0,_last_frame={ >=0 | -1=last
11830 },_frame_step>=1,_output_filename
11831
11832 Average specified input image files, in a streamed way.
11833 If a display window is opened, rendered frames are displayed in it
11834 during processing.
11835 The output filename may have extension '.avi' or '.mp4' (saved as a
11836 video), or any other usual image
11837 file extension (saved as a sequence of images).
11838
11839 Default values: 'first_frame=0', 'last_frame=-1', 'frame_step=1'
11840 and 'output_filename=(undefined)'.
11841
11842 average_video:
11843 video_filename,_first_frame>=0,_last_frame={ >=0 | -1=last
11844 },_frame_step>=1,_output_filename
11845
11846 Average frames of specified input video file, in a streamed way.
11847 If a display window is opened, rendered frames are displayed in it
11848 during processing.
11849 The output filename may have extension '.avi' or '.mp4' (saved as a
11850 video), or any other usual image
11851 file extension (saved as a sequence of images).
11852 This command requires features from the OpenCV library (not enabled
11853 in G'MIC by default).
11854
11855 Default values: 'first_frame=0', 'last_frame=-1', 'frame_step=1'
11856 and 'output_filename=(undefined)'.
11857
11858 fade_files:
11859 "filename_pattern",_nb_in‐
11860 ner_frames>0,_first_frame>=0,_last_frame={ >=0 | -1=last
11861 },_frame_step>=1,_output_filename
11862
11863 Generate a temporal fading from specified input image files, in a
11864 streamed way.
11865 If a display window is opened, rendered frames are displayed in it
11866 during processing.
11867 The output filename may have extension 'avi' or 'mp4' (saved as a
11868 video), or any other usual image
11869 file extension (saved as a sequence of images).
11870
11871 Default values: 'nb_inner_frames=10', 'first_frame=0',
11872 'last_frame=-1', 'frame_step=1' and 'output_filename=(undefined)'.
11873
11874 fade_video:
11875 video_filename,_nb_inner_frames>0,_first_frame>=0,_last_frame={
11876 >=0 | -1=last },_frame_step>=1,_output_filename
11877
11878 Create a temporal fading sequence from specified input video file,
11879 in a streamed way.
11880 If a display window is opened, rendered frames are displayed in it
11881 during processing.
11882 This command requires features from the OpenCV library (not enabled
11883 in G'MIC by default).
11884
11885 Default values: 'nb_inner_frames=10', 'first_frame=0',
11886 'last_frame=-1', 'frame_step=1' and 'output_filename=(undefined)'.
11887
11888 files2video:
11889 "filename_pattern",_output_filename,_fps>0,_codec
11890
11891 Convert several files into a single video file.
11892
11893 Default values: 'output_filename=output.mp4', 'fps=25' and
11894 'codec=mp4v'.
11895
11896 median_files:
11897 "filename_pattern",_first_frame>=0,_last_frame={ >=0 | -1=last
11898 },_frame_step>=1,_frame_rows[%]>=1,_is_fast_approximation={ 0 | 1 }
11899
11900 Compute the median frame of specified input image files, in a
11901 streamed way.
11902 If a display window is opened, rendered frame is displayed in it
11903 during processing.
11904
11905 Default values: 'first_frame=0', 'last_frame=-1', 'frame_step=1',
11906 'frame_rows=20%' and 'is_fast_approximation=0'.
11907
11908 median_video:
11909 video_filename,_first_frame>=0,_last_frame={ >=0 | -1=last
11910 },_frame_step>=1,_frame_rows[%]>=1,_is_fast_approximation={ 0 | 1 }
11911
11912 Compute the median of all frames of an input video file, in a
11913 streamed way.
11914 If a display window is opened, rendered frame is displayed in it
11915 during processing.
11916 This command requires features from the OpenCV library (not enabled
11917 in G'MIC by default).
11918
11919 Default values: 'first_frame=0', 'last_frame=-1', 'frame_step=1',
11920 'frame_rows=100%' and 'is_fast_approximation=1'.
11921
11922 morph:
11923 nb_inner_frames>=1,_smoothness>=0,_precision>=0
11924
11925 Create morphing sequence between selected images.
11926
11927 Default values: 'smoothness=0.1' and 'precision=4'.
11928
11929 Example:
11930 [#1] image.jpg +rotate 20,1,1,50%,50% morph 9
11931
11932 morph_files:
11933 "filename_pattern",_nb_inner_frames>0,_smoothness>=0,_preci‐
11934 sion>=0,_first_frame>=0,_last_frame={ >=0 | -1=last
11935 },_frame_step>=1,_output_filename
11936
11937 Generate a temporal morphing from specified input image files, in a
11938 streamed way.
11939 If a display window is opened, rendered frames are displayed in it
11940 during processing.
11941 The output filename may have extension '.avi' or '.mp4' (saved as a
11942 video), or any other usual image
11943 file extension (saved as a sequence of images).
11944
11945 Default values: 'nb_inner_frames=10', 'smoothness=0.1', 'preci‐
11946 sion=4', 'first_frame=0', 'last_frame=-1', 'frame_step=1' and 'out‐
11947 put_filename=(undefined)'.
11948
11949 morph_rbf:
11950 nb_in‐
11951 ner_frames>=1,xs0[%],ys0[%],xt0[%],yt0[%],...,xsN[%],ysN[%],xtN[%],ytN[%]
11952
11953 Create morphing sequence between selected images, using RBF-based
11954 interpolation.
11955 Each argument (xsk,ysk)-(xtk,ytk) corresponds to the coordinates of
11956 a keypoint
11957 respectively on the source and target images. The set of all key‐
11958 points define the overall image deformation.
11959
11960 morph_video:
11961 video_filename,_nb_inner_frames>0,_smoothness>=0,_preci‐
11962 sion>=0,_first_frame>=0,_last_frame={ >=0 | -1=last
11963 },_frame_step>=1,_output_filename
11964
11965 Generate a temporal morphing from specified input video file, in a
11966 streamed way.
11967 If a display window is opened, rendered frames are displayed in it
11968 during processing.
11969 The output filename may have extension '.avi' or '.mp4' (saved as a
11970 video), or any other usual image
11971 file extension (saved as a sequence of images).
11972 This command requires features from the OpenCV library (not enabled
11973 in G'MIC by default).
11974
11975 Default values: 'nb_inner_frames=10', 'smoothness=0.1', 'preci‐
11976 sion=4', 'first_frame=0', 'last_frame=-1', 'frame_step=1' and 'out‐
11977 put_filename=(undefined)'.
11978
11979 register_nonrigid:
11980 [destination],_smoothness>=0,_precision>0,_nb_scale>=0
11981
11982 Register selected source images with specified destination image,
11983 using non-rigid warp.
11984
11985 Default values: 'smoothness=0.2', 'precision=6' and
11986 'nb_scale=0(auto)'.
11987
11988 Example:
11989 [#1] image.jpg +rotate 20,1,1,50%,50% +register_nonrigid[0] [1]
11990
11991 register_rigid:
11992 [destination],_smoothness>=0,_boundary_conditions={ 0=dirichlet |
11993 1=neumann | 2=periodic | 3=mirror }
11994
11995 Register selected source images with specified destination image,
11996 using rigid warp (shift).
11997
11998 Default values: 'smoothness=0.1%' and 'boundary_conditions=0'.
11999
12000 Example:
12001 [#1] image.jpg +shift 30,20 +register_rigid[0] [1]
12002
12003 transition:
12004 [transition_shape],nb_added_frames>=0,100>=shading>=0,_sin‐
12005 gle_frame_only={ -1=disabled | >=0 }
12006
12007 Generate a transition sequence between selected images.
12008
12009 Default values: 'shading=0' and 'single_frame_only=-1'.
12010
12011 Example:
12012 [#1] image.jpg +mirror c 100%,100% plasma[-1] 1,1,6 transi‐
12013 tion[0,1] [2],5
12014
12015 transition3d:
12016 _nb_frames>=2,_nb_xtiles>0,_nb_ytiles>0,_axis_x,_axis_y,_axis_z,_is_an‐
12017 tialias={ 0 | 1 }
12018
12019 Create 3D transition sequence between selected consecutive images.
12020 'axis_x', 'axis_y' and 'axis_z' can be set as mathematical expres‐
12021 sions, depending on 'x' and 'y'.
12022
12023 Default values: 'nb_frames=10', 'nb_xtiles=nb_ytiles=3',
12024 'axis_x=1', 'axis_y=1', 'axis_z=0' and 'is_antialias=1'.
12025
12026 Example:
12027 [#1] image.jpg +blur 5 transition3d 9 display_rgba
12028
12029 video2files:
12030 input_filename,_output_filename,_first_frame>=0,_last_frame={ >=0
12031 | -1=last },_frame_step>=1
12032
12033 Split specified input video file into image files, one for each
12034 frame.
12035 First and last frames as well as step between frames can be speci‐
12036 fied.
12037
12038 Default values: 'output_filename=frame.png', 'first_frame=0',
12039 'last_frame=-1' and 'frame_step=1'.
12040
12041 12.21. Convenience Functions
12042 ---------------------
12043
12044 alert:
12045 _title,_message,_label_button1,_label_button2,...
12046
12047 Display an alert box and wait for user's choice.
12048 If a single image is in the selection, it is used as an icon for
12049 the alert box.
12050
12051 Default values: 'title=[G'MIC Alert]' and 'message=This is an alert
12052 box.'.
12053
12054 arg:
12055 n>=1,_arg1,...,_argN
12056
12057 Return the n-th argument of the specified argument list.
12058
12059 arg0:
12060 n>=0,_arg0,...,_argN
12061
12062 Return the n-th argument of the specified argument list (where 'n'
12063 starts from '0').
12064
12065 arg2img:
12066 argument_1,...,argument_N
12067
12068 Split specified list of arguments and return each as a new image
12069 (as a null-terminated string).
12070
12071 arg2var:
12072 variable_name,argument_1,...,argument_N
12073
12074 For each i in [1...N], set 'variable_name$i=argument_i'.
12075 The variable name should be global to make this command useful
12076 (i.e. starts by an underscore).
12077
12078 autocrop_coords:
12079 value1,value2,... | auto
12080
12081 Return coordinates (x0,y0,z0,x1,y1,z1) of the autocrop that could
12082 be performed on the latest
12083 of the selected images.
12084
12085 Default value: 'auto'
12086
12087 average_vectors:
12088
12089 Return the vector-valued average of the latest of the selected im‐
12090 ages.
12091
12092 base642img:
12093 "base64_string"
12094
12095 Decode given base64-encoded string as a newly inserted image at the
12096 end of the list.
12097 The argument string must have been generated using command
12098 'img2base64'.
12099
12100 base642uint8:
12101 "base64_string"
12102
12103 Decode given base64-encoded string as a newly inserted 1-column im‐
12104 age at the end of the list.
12105 The argument string must have been generated using command
12106 'uint82base64'.
12107
12108 basename:
12109 file_path,_variable_name_for_folder
12110
12111 Return the basename of a file path, and opt. its folder location.
12112 When specified 'variable_name_for_folder' must starts by an under‐
12113 score
12114 (global variable accessible from calling function).
12115
12116 bin:
12117 binary_int1,...
12118
12119 Print specified binary integers into their octal, decimal, hexadec‐
12120 imal and string representations.
12121
12122 bin2dec:
12123 binary_int1,...
12124
12125 Convert specified binary integers into their decimal representa‐
12126 tions.
12127
12128 covariance_vectors:
12129 _avg_outvarname
12130
12131 Return the covariance matrix of the vector-valued colors in the
12132 latest of the selected images
12133 (for arbitrary number of channels).
12134 Parameter 'avg_outvarname' is used as a variable name that takes
12135 the value of the average vector-value.
12136
12137 dec:
12138 decimal_int1,...
12139
12140 Print specified decimal integers into their binary, octal, hexadec‐
12141 imal and string representations.
12142
12143 dec2str:
12144 decimal_int1,...
12145
12146 Convert specifial decimal integers into its string representation.
12147
12148 dec2bin:
12149 decimal_int1,...
12150
12151 Convert specified decimal integers into their binary representa‐
12152 tions.
12153
12154 dec2hex:
12155 decimal_int1,...
12156
12157 Convert specified decimal integers into their hexadecimal represen‐
12158 tations.
12159
12160 dec2oct:
12161 decimal_int1,...
12162
12163 Convert specified decimal integers into their octal representa‐
12164 tions.
12165
12166 fact:
12167 value
12168
12169 Return the factorial of the specified value.
12170
12171 fibonacci:
12172 N>=0
12173
12174 Return the Nth number of the Fibonacci sequence.
12175
12176 Example:
12177 [#1] echo ${"fibonacci 10"}
12178
12179
12180 [gmic]-0./ Start G'MIC interpreter.
12181 [gmic]-0./ 55
12182 [gmic]-0./ End G'MIC interpreter.
12183
12184 file_mv:
12185 filename_src,filename_dest
12186
12187 Rename or move a file from a location $1 to another location $2.
12188
12189 file_rand:
12190
12191 Return a random filename for storing temporary data.
12192
12193 filename:
12194 filename,_number1,_number2,...,_numberN
12195
12196 Return a filename numbered with specified indices.
12197
12198 files (+):
12199 _mode,path
12200
12201 Return the list of files and/or subfolders from specified path.
12202 'path' can be eventually a matching pattern.
12203 'mode' can be { 0=files only | 1=folders only | 2=files + folders
12204 }.
12205 Add '3' to 'mode' to return full paths instead of filenames only.
12206
12207 Default value: 'mode=5'.
12208
12209 files2img:
12210 _mode,path
12211
12212 Insert a new image where each vector-valued pixel is a string en‐
12213 coding the filenames returned by command files.
12214 Useful to manage list of filenames containing characters that have
12215 a special meaning in the G'MIC language,such as spaces or commas.
12216
12217 fitratio_wh:
12218 min_width,min_height,ratio_wh
12219
12220 Return a 2D size 'width,height' which is bigger than
12221 'min_width,min_height' and has the specified w/h ratio.
12222
12223 fitscreen:
12224 width,height,_depth,_minimal_size[%],_maximal_size[%] |
12225 [image],_minimal_size[%],_maximal_size[%]
12226
12227 Return the 'ideal' size WxH for a window intended to display an im‐
12228 age of specified size on screen.
12229
12230 Default values: 'depth=1', 'minimal_size=128' and 'maxi‐
12231 mal_size=85%'.
12232
12233 fontchart:
12234
12235 Insert G'MIC font chart at the end of the image list.
12236
12237 Example:
12238 [#1] fontchart
12239
12240 fps:
12241
12242 Return the number of time this function is called per second, or -1
12243 if this info is not yet available.
12244 Useful to display the framerate when displaying animations.
12245
12246 gcd:
12247 a,b
12248
12249 Return the GCD (greatest common divisor) between a and b.
12250
12251 hex:
12252 hexadecimal_int1,...
12253
12254 Print specified hexadecimal integers into their binary, octal, dec‐
12255 imal and string representations.
12256
12257 hex2dec:
12258 hexadecimal_int1,...
12259
12260 Convert specified hexadecimal integers into their decimal represen‐
12261 tations.
12262
12263 hex2img:
12264 "hexadecimal_string"
12265
12266 Insert new image 1xN at the end of the list with values specified
12267 by the given hexadecimal-encoded string.
12268
12269 hex2str:
12270 hexadecimal_string
12271
12272 Convert specified hexadecimal string into a string.
12273 See also: str2hex.
12274
12275 img2base64:
12276 _encoding={ 0=base64 | 1=base64url },_store_names={ 0 | 1 }
12277
12278 Encode selected images as a base64-encoded string.
12279 The images can be then decoded using command 'base642img'.
12280
12281 Default values: 'encoding=0' and 'store_names=1'.
12282
12283 img2hex:
12284
12285 Return representation of last image as an hexadecimal-encoded
12286 string.
12287 Input image must have values that are integers in [0,255].
12288
12289 img2str:
12290
12291 Return the content of the latest of the selected images as a spe‐
12292 cial G'MIC input string.
12293
12294 img2text:
12295 _line_separator
12296
12297 Return text contained in a multi-line image.
12298
12299 Default value: 'line_separator= '.
12300
12301 img82hex:
12302
12303 Convert selected 8bits-valued vectors into their hexadecimal repre‐
12304 sentations (ascii-encoded).
12305
12306 hex2img8:
12307
12308 Convert selected hexadecimal representations (ascii-encoded) into
12309 8bits-valued vectors.
12310
12311 is_3d:
12312
12313 Return 1 if all of the selected images are 3D objects, 0 otherwise.
12314
12315 is_change:
12316 _value={ 0=false | 1=true }
12317
12318 Set or unset the 'is_change' flag associated to the image list.
12319 This flag tells the interpreter whether or not the image list
12320 should be displayed when the pipeline ends.
12321
12322 Default value: 'value=1'.
12323
12324 is_half:
12325
12326 Return 1 if the type of image pixels is limited to half-float.
12327
12328 is_ext:
12329 filename,_extension
12330
12331 Return 1 if specified filename has a given extensioin.
12332
12333 is_image_arg:
12334 string
12335
12336 Return 1 if specified string looks like '[ind]'.
12337
12338 is_pattern:
12339 string
12340
12341 Return 1 if specified string looks like a drawing pattern
12342 '0x......'.
12343
12344 is_percent:
12345 string
12346
12347 Return 1 if specified string ends with a '%', 0 otherwise.
12348
12349 is_videofilename:
12350
12351 Return 1 if extension of specified filename is typical from video
12352 files.
12353
12354 is_macos:
12355
12356 Return 1 if current computer OS is Darwin (MacOS), 0 otherwise.
12357
12358 is_windows:
12359
12360 Return 1 if current computer OS is Windows, 0 otherwise.
12361
12362 math_lib:
12363
12364 Return string that defines a set of several useful macros for the
12365 embedded math evaluator.
12366
12367 mad:
12368
12369 Return the MAD (Maximum Absolute Deviation) of the last selected
12370 image.
12371 The MAD is defined as MAD = med_i|x_i-med_j(x_j)|
12372
12373 max_w:
12374
12375 Return the maximal width between selected images.
12376
12377 max_h:
12378
12379 Return the maximal height between selected images.
12380
12381 max_d:
12382
12383 Return the maximal depth between selected images.
12384
12385 max_s:
12386
12387 Return the maximal spectrum between selected images.
12388
12389 max_wh:
12390
12391 Return the maximal wxh size of selected images.
12392
12393 max_whd:
12394
12395 Return the maximal wxhxd size of selected images.
12396
12397 max_whds:
12398
12399 Return the maximal wxhxdxs size of selected images.
12400
12401 median_vectors:
12402
12403 Return the median vector value of the last selected image (median
12404 computed channel by channel)
12405
12406 min_w:
12407
12408 Return the minimal width between selected images.
12409
12410 min_h:
12411
12412 Return the minimal height between selected images.
12413
12414 min_d:
12415
12416 Return the minimal depth between selected images.
12417
12418 min_s:
12419
12420 Return the minimal s size of selected images.
12421
12422 min_wh:
12423
12424 Return the minimal wxh size of selected images.
12425
12426 min_whd:
12427
12428 Return the minimal wxhxd size of selected images.
12429
12430 min_whds:
12431
12432 Return the minimal wxhxdxs size of selected images.
12433
12434 nmd (+):
12435 Shortcut for command 'named'.
12436
12437 named (+):
12438 _mode,"name1","name2",...
12439
12440 Return the set of indices corresponding to images of the selection
12441 with specified names.
12442 After this command returns, the status contains a list of indices
12443 (unsigned integers),
12444 separated by commas (or an empty string if no images with those
12445 names have been found).
12446 (equivalent to shortcut command 'nmd').
12447
12448 'mode' can be { 0=all indices (default) | 1=lowest index | 2=high‐
12449 est index | 3 = all indices (case insensitive) | 4 = lowest index (case
12450 insensitive) | 5 = highest index (case insensitive)}
12451
12452 normalize_filename:
12453 filename
12454
12455 Return a "normalized" version of the specified filename, without
12456 spaces and capital letters.
12457
12458 oct:
12459 octal_int1,...
12460
12461 Print specified octal integers into their binary, decimal, hexadec‐
12462 imal and string representations.
12463
12464 oct2dec:
12465 octal_int1,...
12466
12467 Convert specified octal integers into their decimal representa‐
12468 tions.
12469
12470 padint:
12471 number,_size>0
12472
12473 Return a integer with 'size' digits (eventually left-padded with
12474 '0').
12475
12476 path_cache:
12477
12478 Return a path to store G'MIC data files for one user (whose value
12479 is OS-dependent).
12480
12481 path_current:
12482
12483 Return current folder from where G'MIC has been run.
12484
12485 path_gimp:
12486
12487 Return a path to store GIMP configuration files for one user (whose
12488 value is OS-dependent).
12489
12490 path_tmp:
12491
12492 Return a path to store temporary files (whose value is OS-depen‐
12493 dent).
12494
12495 remove_copymark:
12496 "image_name"
12497
12498 Remove copy mark from names of selected images.
12499
12500 reset:
12501
12502 Reset global parameters of the interpreter environment.
12503
12504 rgb:
12505
12506 Return a random int-valued RGB color.
12507
12508 rgba:
12509
12510 Return a random int-valued RGBA color.
12511
12512 shell_cols:
12513
12514 Return the estimated number of columns of the current shell.
12515
12516 size_value:
12517
12518 Return the size (in bytes) of image values.
12519
12520 std_noise:
12521
12522 Return the estimated noise standard deviation of the last selected
12523 image.
12524
12525 str:
12526 string
12527
12528 Print specified string into its binary, octal, decimal and hexadec‐
12529 imal representations.
12530
12531 str2hex:
12532 "string"
12533
12534 Convert specified string argument into a sequence of hexadecimal
12535 values (returned as a string).
12536 See also: hex2str.
12537
12538 Example:
12539 [#1] hex=${"str2hex
12540
12541
12542 [gmic]-0./ Start G'MIC interpreter.
12543 [gmic]-0./ 48656c6c6f206d7920667269656e6473
12544 [gmic]-0./ End G'MIC interpreter.
12545
12546 strcapitalize:
12547 string
12548
12549 Capitalize specified string.
12550
12551 strcontains:
12552 string1,string2
12553
12554 Return 1 if the first string contains the second one.
12555
12556 strlen:
12557 string1
12558
12559 Return the length of specified string argument.
12560
12561 strreplace:
12562 string,search,replace
12563
12564 Search and replace substrings in an input string.
12565
12566 strlowercase:
12567 string
12568
12569 Return a lower-case version of the specified string.
12570
12571 struppercase:
12572 string
12573
12574 Return an upper-case version of the specified string.
12575
12576 strvar:
12577 "string"
12578
12579 Return a simplified version of the specified string, that can be
12580 used as a variable name.
12581 (version that creates a lowercase result, no longer than 128
12582 chars).
12583
12584 strcasevar:
12585 "string"
12586
12587 Return a simplified version of the specified string, that can be
12588 used as a variable name.
12589 (version that keeps original case of specified string, no longer
12590 than 128 chars).
12591
12592 strver:
12593 _version,_prerelease
12594
12595 Return the specified version number of the G'MIC interpreter, as a
12596 string.
12597
12598 Default value: 'version=$_version' and 'prerelease='.
12599
12600 tic:
12601
12602 Initialize tic-toc timer.
12603 Use it in conjunction with 'toc'.
12604
12605 toc:
12606
12607 Display elapsed time of the tic-toc timer since the last call to
12608 'tic'.
12609 This command returns the elapsed time in the status value.
12610 Use it in conjunction with 'tic'.
12611
12612 to_clutname:
12613 "string"
12614
12615 Return simplified name that can be used as a CLUT name, from speci‐
12616 fied input string.
12617
12618 uint82base64:
12619 _encoding={ 0=base64 | 1=base64url }
12620
12621 Encode the values of the latest of the selected images as a
12622 base64-encoded string.
12623 The string can be decoded using command 'base642uint8'.
12624 Selected images must have values that are integers in [0,255].
12625
12626 Default values: 'encoding=0'.
12627
12628 12.22. Other Interactive Commands
12629 --------------------------
12630
12631 demos:
12632 _run_in_parallel={ 0=no | 1=yes | 2=auto }
12633
12634 Show a menu to select and view all G'MIC interactive demos.
12635
12636 tixy:
12637 "expression"
12638
12639 Animate specified mathematical expression with a 16x16 grid of cir‐
12640 cles, using the rules described at https://tixy.land.
12641
12642 x_2048:
12643
12644 Launch the 2048 game.
12645
12646 x_blobs:
12647
12648 Launch the blobs editor.
12649 ../img/x_blobs.jpg [image: 'x_blobs']
12650
12651 x_bouncing:
12652
12653 Launch the bouncing balls demo.
12654
12655 x_color_curves:
12656 _colorspace={ rgb | cmy | cmyk | hsi | hsl | hsv | lab | lch |
12657 ycbcr | last }
12658
12659 Apply color curves on selected RGB[A] images, using an interactive
12660 window.
12661 Set 'colorspace' to 'last' to apply last defined color curves with‐
12662 out opening interactive windows.
12663
12664 Default value: 'colorspace=rgb'.
12665
12666 x_colorize:
12667 _is_lineart={ 0 | 1 },_max_resolution={ 0 | >=128 },_multichan‐
12668 nels_output={ 0 | 1 },_[palette1],_[palette2],_[grabber1]
12669
12670 Colorized selected B&W images, using an interactive window.
12671 When >0, argument 'max_resolution' defines the maximal image reso‐
12672 lution used in the interactive window.
12673
12674 Default values: 'is_lineart=1', 'max_resolution=1024' and 'multi‐
12675 channels_output=0'.
12676
12677 x_connect4:
12678
12679 Launch the Connect Four game.
12680
12681 xz:
12682 Shortcut for command 'x_crop'.
12683
12684 x_crop:
12685
12686 Crop selected images interactively.
12687 (equivalent to shortcut command 'xz').
12688
12689 x_cut:
12690
12691 Cut selected images interactively.
12692
12693 x_fire:
12694
12695 Launch the fire effect demo.
12696
12697 x_fireworks:
12698
12699 Launch the fireworks demo.
12700
12701 x_fisheye:
12702
12703 Launch the fish-eye effect demo.
12704
12705 x_fourier:
12706
12707 Launch the fourier filtering demo.
12708
12709 x_grab_color:
12710 _variable_name
12711
12712 Open a color grabber widget from the first selected image.
12713 Argument 'variable_name' specifies the variable that contains the
12714 selected color values at any time.
12715 Assigning '-1' to it forces the interactive window to close.
12716
12717 Default values: 'variable_name=xgc_variable'.
12718
12719 x_hanoi:
12720
12721 Launch the Tower of Hanoi game.
12722
12723 x_histogram:
12724
12725 Launch the histogram demo.
12726
12727 x_hough:
12728
12729 Launch the hough transform demo.
12730
12731 x_jawbreaker:
12732 0<_width<20,0<_height<20,0<_balls<=8
12733
12734 Launch the Jawbreaker game.
12735
12736 x_landscape:
12737
12738 Launch the virtual landscape demo.
12739
12740 x_life:
12741
12742 Launch the game of life.
12743
12744 x_light:
12745
12746 Launch the light effect demo.
12747
12748 x_mandelbrot:
12749 _julia={ 0 | 1 },_c0r,_c0i
12750
12751 Launch Mandelbrot/Julia explorer.
12752
12753 x_mask_color:
12754 _colorspace={ all | rgb | lrgb | ycbcr | lab | lch | hsv | hsi |
12755 hsl | cmy | cmyk | yiq },_spatial_tolerance>=0,_color_tolerance>=0
12756
12757 Interactively select a color, and add an alpha channel containing
12758 the corresponding color mask.
12759 Argument 'colorspace' refers to the color metric used to compute
12760 color similarities, and can be basically
12761 one of { rgb | lrgb | ycbcr | lab | lch | hsv | hsi | hsl | cmy |
12762 cmyk | yiq }.
12763 You can also select one one particular channel of this colorspace,
12764 by setting 'colorspace' as
12765 'colorspace_channel' (e.g. 'hsv_h' for the hue).
12766
12767 Default values: 'colorspace=all', 'spatial_tolerance=5' and
12768 'color_tolerance=5'.
12769
12770 x_metaballs3d:
12771
12772 Launch the 3D metaballs demo.
12773
12774 x_minesweeper:
12775 8<=_width=<20,8<=_height<=20
12776
12777 Launch the Minesweeper game.
12778
12779 x_minimal_path:
12780
12781 Launch the minimal path demo.
12782
12783 x_morph:
12784 _nb_frames>=2,_preview_fidelity={ 0=coarsest | 1=coarse | 2=nor‐
12785 mal | 3=fine | 4=finest }
12786
12787 Launch the interactive image morpher.
12788
12789 Default values: 'nb_frames=16' and 'preview_fidelity=3'.
12790
12791 x_pacman:
12792
12793 Launch pacman game.
12794
12795 x_paint:
12796
12797 Launch the interactive painter.
12798
12799 x_plasma:
12800
12801 Launch the plasma effect demo.
12802
12803 x_quantize_rgb:
12804 _nbcolors>=2
12805
12806 Launch the RGB color quantization demo.
12807
12808 x_reflection3d:
12809
12810 Launch the 3D reflection demo.
12811
12812 x_rubber3d:
12813
12814 Launch the 3D rubber object demo.
12815
12816 x_segment:
12817 _max_resolution={ 0 | >=128 }
12818
12819 Segment foreground from background in selected opaque RGB images,
12820 interactively.
12821 Return RGBA images with binary alpha-channels.
12822
12823 Default value: 'max_resolution=1024'.
12824
12825 x_select_color:
12826 _variable_name
12827
12828 Display a RGB or RGBA color selector.
12829 Argument 'variable_name' specifies the variable that contains the
12830 selected color values (as R,G,B,[A])
12831 at any time.
12832 Its value specifies the initial selected color. Assigning '-1' to
12833 it forces the interactive window to close.
12834
12835 Default value: 'variable_name=xsc_variable'.
12836
12837 x_select_function1d:
12838 _variable_name,_background_curve_R,_background_curve_G,_back‐
12839 ground_curve_B
12840
12841 Open an interactive window, where the user can defined its own 1D
12842 function.
12843 If an image is selected, it is used to display additional informa‐
12844 tion :
12845 - The first row defines the values of a background curve dis‐
12846 played on the window (e.g. an histogram).
12847 - The 2nd, 3rd and 4th rows define the R,G,B color components
12848 displayed beside the X and Y axes.
12849 Argument 'variable_name' specifies the variable that contains the
12850 selected function keypoints at any time.
12851 Assigning '-1' to it forces the interactive window to close.
12852
12853 Default values: 'variable_name=xsf_variable', 'back‐
12854 ground_curve_R=220', 'background_curve_G=background_curve_B=back‐
12855 ground_curve_T'.
12856
12857 x_select_palette:
12858 _variable_name,_number_of_columns={ 0=auto | >0 }
12859
12860 Open a RGB or RGBA color selector widget from a palette.
12861 The palette is given as a selected image.
12862 Argument 'variable_name' specifies the variable that contains the
12863 selected color values (as R,G,B,[A])
12864 at any time.
12865 Assigning '-1' to it forces the interactive window to close.
12866
12867 Default values: 'variable_name=xsp_variable' and 'number_of_col‐
12868 umns=2'.
12869
12870 x_shadebobs:
12871
12872 Launch the shade bobs demo.
12873
12874 x_spline:
12875
12876 Launch spline curve editor.
12877
12878 x_starfield3d:
12879
12880 Launch the 3D starfield demo.
12881
12882 x_tetris:
12883
12884 Launch tetris game.
12885
12886 x_threshold:
12887
12888 Threshold selected images interactively.
12889
12890 x_tictactoe:
12891
12892 Launch tic-tac-toe game.
12893
12894 x_warp:
12895 _nb_keypoints_xgrid>=2,_nb_keypoints_ygrid>=2,_nb_keypoints_con‐
12896 tours>=0,_preview_fidelity={ 0=coarsest | 1=coarse | 2=normal | 3=fine
12897 | 4=finest },_[background_image],0<=_background_opacity<=1
12898
12899 Launch the interactive image warper.
12900
12901 Default values: 'nb_keypoints_xgrid=nb_keypoints_ygrid=2', 'nb_key‐
12902 points_contours=0' and 'preview_fidelity=1'.
12903
12904 x_waves:
12905
12906 Launch the image waves demo.
12907
12908 x_whirl:
12909 _opacity>=0
12910
12911 Launch the fractal whirls demo.
12912
12913 Default values: 'opacity=0.2'.
12914
12915 13. Examples of Use
12916 ---------------
12917
12918 'gmic' is a generic image processing tool which can be used in a wide
12919 variety of situations. The few examples below illustrate possible uses
12920 of this tool:
12921
12922 ### View a list of images:
12923
12924 $ gmic file1.bmp file2.jpeg
12925
12926 ### Convert an image file:
12927
12928 $ gmic input.bmp output output.jpg
12929
12930 ### Create a volumetric image from a movie sequence:
12931
12932 $ gmic input.mpg append z output output.hdr
12933
12934 ### Compute image gradient norm:
12935
12936 $ gmic input.bmp gradient_norm
12937
12938 ### Denoise a color image:
12939
12940 $ gmic image.jpg denoise 30,10 output denoised.jpg
12941
12942 ### Compose two images using overlay layer blending:
12943
12944 $ gmic image1.jpg image2.jpg blend overlay output blended.jpg
12945
12946 ### Evaluate a mathematical expression:
12947
12948 $ gmic echo "cos(pi/4)^2+sin(pi/4)^2={cos(pi/4)^2+sin(pi/4)^2}"
12949
12950 ### Plot a 2D function:
12951
12952 $ gmic 1000,1,1,2 fill
12953 "X=3*(x-500)/500;X^2*sin(3*X^2)+if(c==0,u(0,-1),cos(X*10))" plot
12954
12955 ../img/exam‐
12956 ple_plot.png [image: '']
12957
12958 ### Plot a 3D elevated function in random colors:
12959
12960 $ gmic 128,128,1,3,"u(0,255)" plasma 10,3 blur 4 sharpen 10000 n
12961 0,255 elevation3d[-1]
12962 "'X=(x-64)/6;Y=(y-64)/6;100*exp(-(X^2+Y^2)/30)*abs(cos(X)*sin(Y))'"
12963
12964 ../img/exam‐
12965 ple_elevation3d.png [image: '']
12966
12967 ### Plot the isosurface of a 3D volume:
12968
12969 $ gmic mode3d 5 moded3d 5 double3d 0 isosurface3d
12970 "'x^2+y^2+abs(z)^abs(4*cos(x*y*z*3))'",3
12971
12972 ../img/exam‐
12973 ple_isosurface3d.png [image: '']
12974
12975 ### Render a G'MIC 3D logo:
12976
12977 $ gmic 0 text G´MIC,0,0,53,1,1,1,1 expand_xy 10,0 blur 1 normalize
12978 0,100 +plasma 0.4 add blur 1 elevation3d -0.1 moded3d 4
12979
12980 ../img/exam‐
12981 ple_logo.png [image: '']
12982
12983 ### Generate a 3D ring of torii:
12984
12985 $ gmic repeat 20 torus3d 15,2 color3d[-1]
12986 "{u(60,255)},{u(60,255)},{u(60,255)}" *3d[-1] 0.5,1 if "{$>%2}" ro‐
12987 tate3d[-1] 0,1,0,90 fi add3d[-1] 70 add3d rotate3d 0,0,1,18 done
12988 moded3d 3 mode3d 5 double3d 0
12989
12990 ../img/exam‐
12991 ple_torii.png [image: '']
12992
12993 ### Create a vase from a 3D isosurface:
12994
12995 $ gmic moded3d 4 isosurface3d "'x^2+2*abs(y/2)*sin(2*y)^2+z^2-3',0"
12996 sphere3d 1.5 sub3d[-1] 0,5 plane3d 15,15 rotate3d[-1] 1,0,0,90 cen‐
12997 ter3d[-1] add3d[-1] 0,3.2 color3d[-1] 180,150,255 color3d[-2] 128,255,
12998 0 color3d[-3] 255,128,0 add3d
12999
13000 ../img/exam‐
13001 ple_vase.png [image: '']
13002
13003 ### Launch a set of interactive demos:
13004
13005 $ gmic demos
13006
13007
13008
13009 ** G'MIC comes with ABSOLUTELY NO WARRANTY; for details visit:
13010 https://gmic.eu **
13011
13012
13013
13014 G'MIC(1)