.TH G'MIC 1 .SH NAME gmic \- Perform image processing operations using the G'MIC framework. .SH HELP \fBgmic: GREYC's Magic for Image Computing:\fR Command-Line Interface \fB\fBVersion 4.0.5\fR \fB\fI(https://gmic.eu)\fR Copyright (c) 2008-2026, David Tschumperlé / GREYC / CNRS. \fB\fI(https://www.greyc.fr)\fR \fB\fB1. Usage\fR \fB -----\fR \fBgmic [command_1 [arg_1_1,arg_1_2,..]] .. [command_N [arg_N_1,arg_N_2, ..]]\fR '\fBgmic\fR' is the open-source interpreter of the G'MIC\fR language, a scripting language dedicated to designing potentially complex image-processing pipelines and operators. It can be used to convert, manipulate, filter and visualize image datasets consisting of one or more 1D, 2D or 3D multi-spectral images. This reference documentation describes all the technical aspects of the G'MIC\fR framework, in its current version \fB4.0.5\fR. For a gentler introduction, see the tutorial: \fIhttps://gmic.eu/tutorial/\fR \fB\fB2. Overall Context\fR \fB ---------------\fR * At any given time, G'MIC\fR manages a single list of numbered (and optionally named) pixel-based images, entirely stored in computer memory (uncompressed). * The first image in the list has index '\fB0\fR' and is denoted by '\fB[0]\fR'. The second image in the list is denoted by '\fB[1]\fR', the third by '\fB[2]\fR' and so on. * Negative indices are handled periodically: '\fB[-1]\fR' refers to the last image in the list, '\fB[-2]\fR' to the penultimate one, etc. Thus, if the list has 4 images, '\fB[1]\fR' and '\fB[-3]\fR' both designate the second image in the list. * A named image can also be designated by '\fB[name]\fR', if '\fBname\fR' uses the character set '\fB[a-zA-Z0-9_]\fR' and does not start with a number. Image names can be set or reassigned at any time during the processing pipeline (see command \fIname\fR for this purpose). * G'MIC\fR defines a set of commands and substitution mechanisms to allow the design of complex pipelines and operators managing this list of images, in a very flexible way: You can insert or remove images in the list, rearrange image order, process images (individually or grouped), merge image data together, display and output image files, etc. * Such a pipeline can define a new custom G'MIC\fR command (stored in a user command file), which can then be reused as a regular command within a larger pipeline. \fB\fB3. Image Definition and Terminology\fR \fB --------------------------------\fR * In G'MIC\fR, each image is modeled as a 1D, 2D, 3D or 4D array of scalar values, uniformly discretized on a rectangular or parallelepiped domain. * The four dimensions are: - '\fBwidth\fR', the number of image columns (size along the '\fBx-axis\fR'). - '\fBheight\fR', the number of image rows (size along the '\fBy-axis\fR'). - '\fBdepth\fR', the number of image slices (size along the '\fBz-axis\fR'). The depth is equal to '\fB1\fR' for typical color or grayscale 2D images. - '\fBspectrum\fR', the number of image channels (size along the '\fBc-axis\fR'). The spectrum is equal to '\fB3\fR' and '\fB4\fR' for standard '\fBRGB\fR' and '\fBRGBA\fR' color images, respectively. * There is no hard limit on the size of the image along each dimension. For instance, the number of image slices or channels can be of arbitrary size within the limits of the available memory. * The '\fBwidth\fR', '\fBheight\fR' and '\fBdepth\fR' of an image are considered as spatial\fR dimensions, while the '\fBspectrum\fR' represents the spectral dimension. Thus, a 4D image in G'MIC\fR should be most often regarded as a 3D dataset of multi-spectral voxels. Most G'MIC\fR commands adhere to this convention (e.g. by default, command \fIblur\fR blurs 4D images only along the three spatial '\fBxyz\fR'-axes). * G'MIC\fR stores all the image data as buffers of '\fBfloat\fR' values (32 bits, value range '\fB[-3.4E38,+3.4E38]\fR'). It performs all its image processing operations with floating-point numbers. Each image pixel then requires 32 bits per channel (except if double-precision buffers have been enabled during the compilation of the software, in which case 64 bits per channel can be the default). * Using floating-point pixels ensures that numerical precision is maintained when executing image processing pipelines. For image input/output operations, you may want to specify a non-float datatype (such as '\fBbool\fR', '\fBchar\fR', '\fBint\fR', etc.). This is possible by specifying it as a file option when using I/O commands (see section \fIInput/Output Properties\fR to learn more about file options). \fB\fB4. Items of a Processing Pipeline\fR \fB ------------------------------\fR * In G'MIC\fR, an image processing pipeline is described as a sequence of items separated by the \fBspace\fR character. Such items are parsed and executed from left to right. For instance, the expression: \fBfilename.jpg blur 3,0 sharpen 10 resize 200%,200% output file_out.jpg\fR is a valid pipeline composed of nine G'MIC\fR items. * Each G'MIC\fR item is either a \fBcommand\fR, a list of \fBcommand arguments\fR, a \fBfilename\fR or a special \fBinput string\fR. * Escape characters '' and double quotes '\fB"\fR' can be used to define items containing spaces or other special characters. For instance, the two strings '\fBsingle\ item\fR' and '\fB"single item"\fR' both define the same single item, with a space in it. \fB\fB5. Input Data\fR \fB ----------\fR * If a G'MIC\fR item appears to be an existing filename, the corresponding image data are loaded and inserted at the end of the image list (which is equivalent to the use of '\fBinput filename\fR'). * Special filenames '\fB-\fR' and '\fB-.ext\fR' stand for the standard input/output (stdin/stdout) streams, optionally forced to be in a specific '\fBext\fR' file format (e.g. '\fB-.jpg\fR' or '\fB-.png\fR'). * The following special input strings may be used as G'MIC\fR items to create and insert new images with prescribed values, at the end of the image list: - '\fB[selection]\fR' or '\fB[selection]xN\fR': Insert 1 or N copies of already existing images. '\fBselection\fR' may represent one or several images (see section \fICommand Items and Selections\fR to learn more about selections). - '\fBwidth[%],_height[%],_depth[%],_spectrum[%],_values[xN]\fR': Insert one or '\fBN\fR' new images with specified size and values (adding '\fB%\fR' to a dimension means \fB"percentage of the size along the same axis"\fR, taken from the last image '\fB[-1]\fR'). Any specified dimension can be also written as '\fB[image]\fR', and is then set to the size (along the same axis) of the existing image '\fB[image]\fR'. '\fBvalues\fR' can be either a sequence of numbers separated by commas '\fB,\fR', or a mathematical expression, as e.g. in input item '\fB256,256,1,3,[x,y,128]\fR' which creates a '\fB256x256\fR' RGB color image with a spatial shading on the red and green channels. (see section \fIMathematical Expressions\fR to learn more about mathematical expressions). - '\fB(v1,v2,..[:delimiter | axis_order])[xN]\fR': Insert one or '\fBN\fR' new images from explicit values. Value separator inside parentheses can be '\fB, \fR' (column separator), '\fB;\fR' (row separator), '\fB/\fR' (slice separator) or '\fB^\fR' (channel separator). For instance, expression '\fB(1,2,3;4,5,6;7,8, 9)\fR' creates a 3x3 matrix (scalar image), with values running from 1 to 9. - '\fB('string'[:delimiter])[xN]\fR': Insert one or '\fBN\fR' new images from the given string, by filling the images with the character codes composing the string. When specified, '\fBdelimiter\fR' defines the main orientation of the image. Delimiter can be '\fBx\fR' (equivalent to '\fB,\fR' which is the default), '\fBy\fR' (eq. to '\fB;\fR'), '\fBz\fR' (eq. to '\fB/\fR') or '\fBc\fR' (eq. to '\fB^\fR'). When specified delimiter is '\fB,\fR', '\fB;\fR', '\fB/\fR' or '\fB^\fR', the expression is actually equivalent to '\fB({'string'[:delimiter]})[xN]\fR' (see section \fISubstitution Rules\fR for more information on the syntax). - '\fB0[xN]\fR': Insert one or '\fBN\fR' new '\fBempty\fR' images, containing no pixel data. Empty images are used only in rare occasions. * Input item '\fBname=value\fR' declares a new variable '\fBname\fR', or assigns a new string value to an existing variable. Variable names must use the character set '\fB[a-zA-Z0-9_]\fR' and cannot start with a number. * A variable definition is always local to the current command except: - When it starts with an underscore '\fB_\fR'. In that case, it also becomes accessible by any command invoked outside the current command scope (global variable). - When it is defined in a shared variable\fR command, a variable also becomes accessible in the calling (parent) command. A shared variable\fR command is a command whose name starts with '\fB__\fR' (e.g. '\fB__foo\fR'). * If a variable name starts with two underscores '\fB__\fR', the global variable is also shared among different threads and can be read/set by commands running in parallel (see command \fIparallel\fR for this purpose). Otherwise, it remains local to the thread that defined it. * Numerical variables can be updated using these special operators: '\fB+=\fR' (addition), '\fB-=\fR' (subtraction), '\fB*=\fR' (multiplication), '\fB/=\fR' (division), '\fB%=\fR' (modulo), '\fB&=\fR' (bitwise and), '\fB|=\fR' (bitwise or), '\fB^=\fR' (power), '\fB<<=\fR' and '\fB>>=\fR' (bitwise left and right shifts). For instance, '\fBfoo=1\fR' '\fBfoo+=3\fR'. * Input item '\fBname.=string\fR' appends '\fBstring\fR' at the end of variable '\fBname\fR'. * Input item '\fBname..=string\fR' prepends '\fBstring\fR' at the beginning of variable '\fBname\fR'. * Multiple variable assignments and updates are allowed, with expressions: '\fBname1,name2,...,nameN=value\fR' or '\fBname1,name2,...,nameN=value1,value2, ...,valueN\fR' where assignment operator '\fB=\fR' can be replaced by one of the allowed operators (e.g. '\fB+=\fR'). * Variables usually store numbers or strings. Use command \fIstore\fR to assign variables from image data (and syntax '\fBinput $variable\fR' to bring them back on the image list afterwards). \fB\fB6. Command Items and Selections\fR \fB ----------------------------\fR * A G'MIC\fR item that is not a filename nor a special input string usually designates a '\fBcommand\fR'. Generally, commands perform image processing operations on one or several available images in the list. * Frequently used commands have two equivalent names ('\fBregular\fR' and '\fBshort\fR'). For instance, command names '\fBresize\fR' and '\fBr\fR' refer to the same image resizing action. * A G'MIC\fR command may have mandatory or optional \fBarguments\fR. Command arguments must be specified in the next item on the command line. Commas '\fB, \fR' are used to separate multiple arguments of a single command, when required. * The execution of a G'MIC\fR command may be restricted only to a \fBsubset\fR of the image list, by appending '\fB[selection]\fR' to the command name. Examples of valid syntaxes for '\fBselection\fR' are: - '\fBcommand[-2]\fR': Apply command only to the penultimate image '\fB[-2]\fR' in the list. - '\fBcommand[0,1,3]\fR': Apply command only to images '\fB[0]\fR', '\fB[1]\fR' and '\fB[3]\fR'. - '\fBcommand[3-6]\fR': Apply command only to images '\fB[3]\fR' to '\fB[6]\fR' (i.e, '\fB[3]\fR', '\fB[4]\fR', '\fB[5]\fR' and '\fB[6]\fR'). - '\fBcommand[50%-100%]\fR': Apply command only to the second half of the image list. - '\fBcommand[0,-4--1]\fR': Apply command only to the first image and the last four images. - '\fBcommand[0-9:3]\fR': Apply command only to images '\fB[0]\fR' to '\fB[9]\fR', with a step of 3 (i.e. on images '\fB[0]\fR', '\fB[3]\fR', '\fB[6]\fR' and '\fB[9]\fR'). - '\fBcommand[0--1:2]\fR': Apply command only to images in the list with even indices. - '\fBcommand[0,2-4,50%--1]\fR': Apply command to images '\fB[0]\fR', '\fB[2]\fR', '\fB[3]\fR', '\fB[4]\fR' and on the second half of the image list. - '\fBcommand[^0,1]\fR': Apply command to all images except the first two. - '\fBcommand[name1,name2]\fR': Apply command to named images '\fBname1\fR' and '\fBname2\fR'. * Indices in selections are always sorted in increasing order, and duplicate indices are discarded. For instance, selections '\fB[3-1,1-3]\fR' and '\fB[1,1, 1,3,2]\fR' are both equivalent to '\fB[1-3]\fR'. If you want to repeat a single command multiple times on an image, use a '\fBrepeat..done\fR' loop instead. Inverting the order of images for a command is achieved by explicitly inverting the order of the images in the list, with command '\fBreverse[selection]\fR'. * Command selections '\fB[-1]\fR', '\fB[-2]\fR' and '\fB[-3]\fR' are so often used they have their own shortcuts, respectively '\fB.\fR', '\fB..\fR' and '\fB...\fR'. For instance, command '\fBblur..\fR' is equivalent to '\fBblur[-2]\fR'. These shortcuts work also when specifying command arguments. * G'MIC\fR commands invoked without '\fB[selection]\fR' are applied to all images in the list, i.e. the default selection is '\fB[0--1]\fR' (except for command \fIinput\fR whose default selection is '\fB[-1]\fR'). * Prepending a single hyphen '\fB-\fR' to a G'MIC\fR command is allowed. This may be useful to recognize command items more easily in a one-liner pipeline (typically invoked from a shell). * A G'MIC\fR command prepended with a plus sign '\fB+\fR' does not act \fBin-place\fR but inserts its result as one or several new images at the end of the image list. * There are two different types of commands that can be run by the G'MIC\fR interpreter: - \fBBuilt-in commands\fR are the hard-coded functionalities in the interpreter core. They are thus compiled as binary code and run fast, most of the time. Omitting an argument when invoking a built-in command is not permitted, unless all subsequent arguments are also omitted. For instance, invoking '\fBblur 1,,1\fR' is invalid but '\fBblur 1\fR' is correct. - \fBCustom commands\fR are defined as G'MIC\fR pipelines of built-in or other custom commands. They are parsed by the G'MIC\fR interpreter, and thus run a bit slower than built-in commands. Omitting arguments when invoking a custom command is permitted. For instance, the expressions '\fBflower ,,,100,, 2\fR' or '\fBflower ,\fR' are correct. * Most of the existing commands in G'MIC\fR are actually defined as \fBcustom commands\fR. * Users can easily add their own custom commands to the G'MIC\fR interpreter (see section \fIAdding Custom Commands\fR for more details). New built-in commands cannot be added (unless you modify the G'MIC\fR interpreter source code and recompile it). \fB\fB7. Input/Output Properties\fR \fB -----------------------\fR * G'MIC\fR is able to read/write most of the classical image file formats, including: - 2D grayscale/color files: '\fB.png\fR', '\fB.jpeg\fR', '\fB.gif\fR', '\fB.pnm\fR', '\fB.tif\fR', '\fB.bmp\fR', ... - 3D volumetric files: '\fB.dcm\fR', '\fB.hdr\fR', '\fB.nii\fR', '\fB.cube\fR', '\fB.pan\fR', '\fB.inr\fR', '\fB.pnk\fR', ... - Video files: '\fB.mpeg\fR', '\fB.avi\fR', '\fB.mp4\fR', '\fB.mov\fR', '\fB.ogg\fR', '\fB.flv\fR', ... - Generic text or binary data files: '\fB.gmz\fR', '\fB.cimg\fR', '\fB.cimgz\fR', '\fBflo\fR', '\fBggr\fR', '\fBgpl\fR', '\fB.dlm\fR', '\fB.asc\fR', '\fB.pfm\fR', '\fB.raw\fR', '\fB.txt\fR', '\fB.h\fR'. - 3D mesh files: '\fB.off\fR', '\fB.obj\fR'. * When dealing with color images, G'MIC\fR generally reads, writes and displays data using the usual sRGB color space. * When loading a '\fB.png\fR' or '\fB.tiff\fR' file, the bit-depth of the input image(s) is stored in the status. * G'MIC\fR is able to manage \fB3D mesh objects\fR that may be read from files or generated by G'MIC\fR commands. A 3D object is stored as a one-column scalar image containing the object data, in the following order: \fB{ magic_number; sizes; vertices; primitives; colors; opacities }\fR. These 3D representations can then be processed as regular images (see command \fIsplit3d\fR for accessing each of these 3D object data separately). * Be aware that standard file formats may sometimes not be suitable for storing all the available image data, since G'MIC\fR uses floating-point image buffers. For instance, saving an image that was initially loaded with 16 bits per channel as a '\fB.jpg\fR' file will result in a loss of information. Use the G'MIC\fR-specific file extension '\fB.gmz\fR' to ensure that all data precision is preserved when saving images. * Sometimes, file options may or must be set for specific file formats: - \fBVideo files:\fR Only sub-frames of an image sequence may be loaded, using the input expression '\fBfilename.ext,[first_frame[,last_frame[, step]]]\fR'. Set '\fBlast_frame==-1\fR' to tell it must be the last frame of the video. Set '\fBstep\fR' to '\fB0\fR' to force an opened video file to be opened/closed. Output framerate and codec can also be set by using the output expression '\fBfilename.avi,_fps,_codec,_keep_open\fR' where '\fBkeep_open\fR' can be \fB{ 0:No (default) | 1:Yes }\fR. '\fBcodec\fR' is a 4-char string (see \fIhttp://www.fourcc.org/codecs.php\fR ) or '\fB0\fR' for the default codec. '\fBkeep_open\fR' indicates whether the output video file must be kept open for appending new frames afterwards. - '\fB.cimg[z]\fR' \fBfiles:\fR Only crops and sub-images of .cimg files can be loaded, using the input expressions '\fBfilename.cimg,N0,N1\fR', '\fBfilename.cimg,N0,N1,x0,x1\fR', '\fBfilename.cimg,N0,N1,x0,y0,x1,y1\fR', '\fBfilename.cimg,N0,N1,x0,y0,z0,x1,y1,z1\fR' or '\fBfilename.cimg,N0,N1,x0,y0, z0,c0,x1,y1,z1,c1\fR'. Specifying '\fB-1\fR' for one coordinates stands for the maximum possible value. Output expression '\fBfilename.cimg[z][,datatype]\fR' can be used to force the output pixel type. '\fBdatatype\fR' can be \fB{ auto | bool | uint8 | int8 | uint16 | int16 | uint32 | int32 | uint64 | int64 | float32 | float64 }\fR. - '\fB.raw\fR' \fBbinary files:\fR Image dimensions and input pixel type may be specified when loading '\fB.raw\fR' files with input expression '\fBfilename.raw[,datatype][,width][,height[,depth[,dim[,offset]]]]]\fR'. If no dimensions are specified, the resulting image is a one-column vector with maximum possible height. Pixel type can also be specified with the output expression '\fBfilename.raw[,datatype]\fR'. '\fBdatatype\fR' can be the same as for '\fB.cimg[z]\fR' files. - '\fB.yuv\fR' \fBfiles:\fR Image dimensions must be specified when loading, and only sub-frames of an image sequence may be loaded, using the input expression '\fBfilename.yuv,width,height[,chroma_subsampling[,first_frame[, last_frame[,step]]]\fR'. '\fBchroma_subsampling\fR' can be \fB{ 420 | 422 | 444 }\fR. When saving, chroma subsampling mode can be specified with output expression '\fBfilename.yuv[,chroma_subsampling]\fR'. - '\fB.tiff\fR' \fBfiles:\fR Only sub-images of multi-pages tiff files can be loaded, using the input expression '\fBfilename.tif,_first_frame,_last_frame, _step\fR'. Output expression '\fBfilename.tiff,_datatype,_compression, _force_multipage,_use_bigtiff\fR' can be used to specify the output pixel type, as well as the compression method. '\fBdatatype\fR' can be the same as for '\fB.cimg[z]\fR' files. '\fBcompression\fR' can be \fB{ none | adobe_deflate | ccitt_t4 | ccitt_t6 | ccittfax3 | ccittfax4 | ccittrle | ccittrlew | dcs | deflate | it8bl | it8ctpad | it8lw | it8mp | jbig | jp2000 | jpeg | jpg | jxl | lerc | lzma | lzw | next | ojpeg | packbits | pixarfilm | pixarlog | sgilog | sgilog24 | t43 | t85 | thunderscan | webp | zip | zstd }\fR. '\fBforce_multipage\fR' can be \fB{ 0:No (default) | 1:Yes }\fR. '\fBuse_bigtiff\fR' can be \fB{ 0:No | 1:Yes (default) }\fR. - '\fB.pdf\fR' \fBfiles:\fR When loading a file, the rendering resolution can be specified using the input expression '\fBfilename.pdf,resolution\fR', where '\fBresolution\fR' is an unsigned integer value. - '\fB.gif\fR' \fBfiles:\fR Animated gif files can be saved, using the input expression '\fBfilename.gif,fps>0,nb_loops\fR'. Specify '\fBnb_loops=0\fR' to get an infinite number of animation loops (this is the default behavior). - '\fB.jpeg\fR' and '\fB.webp\fR' \fBfiles:\fR The output quality may be specified (in %), using the output expression '\fBfilename.jpg,30\fR' (here, to get a 30% quality output). '\fB100\fR' is the default. - '\fB.png\fR' \fBfiles:\fR The bit depth can be specified (8 or 16), using the output expression '\fBfilename.png,16\fR' (here, to get a 16 bit depth output file). By default, G'MIC\fR guesses the best bit depth automatically. - '\fB.mnc\fR' \fBfiles:\fR The output header can be set from another file, using the output expression '\fBfilename.mnc,header_template.mnc\fR'. - '\fB.pan\fR', '\fB.cpp\fR', '\fB.hpp\fR', '\fB.c\fR' and '\fB.h\fR' \fBfiles:\fR The output datatype can be selected with output expression '\fBfilename[,datatype]\fR'. '\fBdatatype\fR' can be the same as for '\fB.cimg[z]\fR' files. - '\fB.gmic\fR' \fBfiles:\fR These filenames are assumed to be G'MIC\fR custom commands files. Loading such a file will add the commands it defines to the interpreter. Debug information can be enabled/disabled by the input expression '\fBfilename.gmic[,add_debug_info]\fR' where '\fBdebug_info\fR' can be \fB{ 0:False | 1:True }\fR. - Prepending '\fBext:\fR' to a filename (e.g. '\fBjpg:filename\fR') forces G'MIC\fR to read/write the file as if it had the given extension '\fB.ext\fR'. * Some input/output formats and options may not be supported, depending on the configuration flags that have been set during the build of the G'MIC\fR software. \fB\fB8. Substitution Rules\fR \fB ------------------\fR * G'MIC\fR items containing '\fB$\fR' or '\fB{}\fR' are substituted before being interpreted. Use these substituting expressions to access various data from the interpreter environment. * '\fB$name\fR' and '\fB${name}\fR' are both substituted by the value of the named variable (set previously by the item '\fBname=value\fR'). If this variable has not already been set, the expression is substituted by the highest positive index of the named image '\fB[name]\fR'. If no image has this name, the expression is substituted by the value of the OS environment variable with the same name (it may be an empty string if it is not defined). * The following reserved variables are predefined by the G'MIC\fR interpreter: - '\fB$!\fR': The current number of images in the list. - '\fB$>\fR' and '\fB$<\fR': The increasing/decreasing index of the latest (currently running) loop.'\fB$>\fR' goes from '\fB0\fR' (first loop iteration) to '\fBnb_iterations - 1\fR' (last iteration). '\fB$<\fR' does the opposite (except for '\fBfor\fR' and '\fBwhile\fR' loops, where '\fB$<\fR' is '\fBnan\fR' as the number of iterations is unknown). - '\fB$%\fR': A value that linearly goes from '\fB0\fR' (first iteration) to '\fB1\fR' (last iteration) in a running loop (equivalent to '\fB$>/($>+$<)\fR'). - '\fB$/\fR': The current call stack. Stack items are separated by slashes '\fB/\fR'. - '\fB$|\fR': The current value (expressed in seconds) of a millisecond precision timer. - '\fB$^\fR': The current verbosity level. - '\fB$_cpus\fR': The number of CPU cores available on your machine. - '\fB$_flags\fR': The list of enabled flags when G'MIC\fR interpreter has been compiled. - '\fB$_host\fR': A string telling about the host running the G'MIC\fR interpreter (e.g. '\fBcli\fR' or '\fBgimp\fR'). - '\fB$_os\fR': A string describing the running operating system. - '\fB$_path_rc\fR': The path to the G'MIC\fR folder used to store configuration files (its value is OS-dependent). - '\fB$_path_user\fR': The path to the G'MIC\fR user file '\fB.gmic\fR' or '\fBuser.gmic\fR' (its value is OS-dependent). - '\fB$_path_commands\fR': A list of all imported command files (stored as an image list). - '\fB$_pid\fR': The current process identifier, as an integer. - '\fB$_pixeltype\fR': The type of image pixels (default: '\fBfloat32\fR'). - '\fB$_prerelease\fR': For pre-releases, the date of the pre-release as '\fByymmdd\fR'. For stable releases, this variable is set to '\fB0\fR'. - '\fB$_user_agent\fR': A string telling the user-agent G'MIC\fR uses when accessing network files (default: '\fBgmic\fR'). - '\fB$_version\fR': A 3-digit number indicating the current version of the G'MIC\fR interpreter (e.g. '\fB405\fR'). - '\fB$_vt100\fR': Set to '\fB1\fR' if colored text output is allowed on the console. Otherwise, set to '\fB0\fR'. * '\fB$$name\fR' and '\fB$${name}\fR' are both substituted by the G'MIC\fR script code of the named '\fBcustom command\fR', or by an empty string if no custom command with specified name exists. * '\fB${"-pipeline"}\fR' is substituted by the \fBstatus value\fR after the execution of the G'MIC\fR pipeline (see command \fIstatus\fR). Expression '\fB${}\fR' thus stands for the current status value. * '\fB{:string}\fR' is substituted by a double-quoted version of the string. * '\fB{/string}\fR' is substituted by the escaped version of the string. * '\fB{'string'[:delimiter]}\fR' (between single quotes) is substituted by the sequence of character codes that composes the string, separated by specified delimiter. Possible delimiters are '\fB,\fR' (default), '\fB;\fR', '\fB/\fR', '\fB^\fR' or '\fB \fR'. For instance, item '\fB{'foo'}\fR' is substituted by '\fB102,111,111\fR' and '\fB{'foo\fR':;}' by '\fB102;111;111\fR'. * '\fB{image,feature[:delimiter]}\fR' is substituted by a specific feature of the image '\fB[image]\fR'. '\fBimage\fR' can be either an image number or an image name. It can also be omitted, in which case the last image '\fB[-1]\fR' in the list is considered for the requested feature. Specified '\fBfeature\fR' can be one of: - '\fBb\fR': The image basename (i.e. filename without the folder path nor extension). - '\fBf\fR': The image folder name. - '\fBn\fR': The image name or filename (if the image has been read from a file). - '\fBt\fR': The text string from the image values regarded as character codes. - '\fBx\fR': The image extension (i.e the characters after the last '\fB.\fR' in the image name). - '\fB^\fR': The sequence of all image values, separated by commas '\fB, \fR'. - '\fB@subset\fR': The sequence of image values corresponding to the specified subset, and separated by commas '\fB,\fR'. - Any other '\fBfeature\fR' is considered as a \fBmathematical expression\fR associated to the image '\fB[image]\fR' and is substituted by its evaluated result (floating-point value). For instance, expression '\fB{0, w+h}\fR' is substituted by the sum of the width and height of the first image (see section \fIMathematical Expressions\fR for more details). If a mathematical expression starts with an underscore '\fB_\fR', the resulting value is truncated to a readable format. For instance, item '\fB{_pi}\fR' is substituted by '\fB3.14159\fR' (while '\fB{pi}\fR' is substituted by '\fB3.141592653589793\fR'). - A '\fBfeature\fR' delimited by backquotes is replaced by a string whose character codes correspond to the list of values resulting from the evaluation of the specified mathematical expression. For instance, item '\fB{`[102,111, 111]`}\fR' is substituted by '\fBfoo\fR' and item '\fB{`vector8(65)`}\fR' by '\fBAAAAAAAA\fR'. * '\fB{*}\fR' is substituted by the visibility state of the instant display window '\fB#0\fR' (can be \fB{ 0:Closed | 1:Visible }\fR). * '\fB{*[index],feature1,...,featureN[:delimiter]}\fR' is substituted by a specific set of features of the instant display window '\fB#0\fR' (or '\fB#index\fR', if specified). Requested '\fBfeatures\fR' can be: - '\fBu\fR': screen width (actually independent on the window size). - '\fBv\fR': screen height (actually independent on the window size). - '\fBuv\fR': screen width*screen height. - '\fBd\fR': window width (i.e. width of the window widget). - '\fBe\fR': window height (i.e. height of the window widget). - '\fBde\fR': window width*window height. - '\fBw\fR': display width (i.e. width of the display area managed by the window). - '\fBh\fR': display height (i.e. height of the display area managed by the window). - '\fBwh\fR': display width*display height. - '\fBi\fR': X-coordinate of the display window. - '\fBj\fR': Y-coordinate of the display window. - '\fBf\fR': current fullscreen state of the instant display. - '\fBn\fR': current normalization type of the instant display. - '\fBt\fR': window title of the instant display. - '\fBx\fR': X-coordinate of the mouse position (or -1, if outside the display area). - '\fBy\fR': Y-coordinate of the mouse position (or -1, if outside the display area). - '\fBb\fR': state of the mouse buttons \fB{ 1:left-but. | 2:right-but. | 4:middle-but. }\fR. - '\fBo\fR': state of the mouse wheel. - '\fBk\fR': decimal code of the pressed key if any, 0 otherwise. - '\fBc\fR': boolean (0 or 1) telling if the instant display has been closed recently. - '\fBr\fR': boolean telling if the instant display has been resized recently. - '\fBm\fR': boolean telling if the instant display has been moved recently. - Any other '\fBfeature\fR' stands for a keycode name (in capital letters), and is substituted by a boolean describing the current key state \fB{ 0:Pressed | 1:Released }\fR. - You can also prepend a hyphen '\fB-\fR' to a '\fBfeature\fR' (that supports it) to flush the corresponding event immediately after reading its state (works for keys, mouse and window events). * Item substitution is \fBnever\fR performed in items between double quotes. One must break the quotes to enable substitution if needed, as in '"3+8 kg = "{3+8}" kg"'. Using double quotes is then a convenient way to disable the substitutions mechanism in items, when necessary. * One can also disable the substitution mechanism on items outside double quotes, by escaping the '\fB{\fR', '\fB}\fR' or '\fB$\fR' characters, as in '\fB\{3+4\}\ doesn't\ evaluate\fR'. \fB\fB9. Mathematical Expressions\fR \fB ------------------------\fR * G'MIC\fR has an embedded \fBmathematical parser\fR, used to evaluate (possibly complex) mathematical expressions specified inside braces '\fB{}\fR', or formulas in commands that may take one as an argument (e.g. \fIfill\fR or \fIeval\fR). * When the context allows it, a formula is evaluated \fBfor each pixel\fR of the selected images (e.g. \fIfill\fR or \fIeval\fR). * A mathematical expression may return, or take as arguments, either a \fBscalar\fR or a \fBfixed-size vector\fR. The mathematical parser supports the following operators, functions and variables: \fB\fB## Common mathematical operators:\fR '\fB||\fR' (logical or), '\fB&&\fR' (logical and), '\fB|\fR' (bitwise or), '\fB&\fR' (bitwise and), '\fB!=\fR', '\fB==\fR', '\fB<=\fR', '\fB>=\fR', '\fB<\fR', '\fB>\fR', '\fB<<\fR' (left bitwise shift), '\fB>>\fR' (right bitwise shift), '\fB-\fR', '\fB+\fR', '\fB*\fR', '\fB/\fR', '\fB%\fR' (modulo), '\fB^\fR' (power), '\fB!\fR' (logical not), '\fB~\fR' (bitwise not), '\fB++\fR', '\fB--\fR', '\fB+=\fR', '\fB-=\fR', '\fB*=\fR', '\fB/=\fR', '\fB%=\fR', '\fB&=\fR', '\fB|=\fR', '\fB^=\fR', '\fB>>\fR', '\fB<<=\fR' (in-place operators). \fB\fB## Common mathematical functions:\fR '\fBabs()\fR', '\fBacos()\fR', '\fBacosh()\fR', '\fBarg0()\fR', '\fBarg1()\fR', '\fBargkth()\fR', '\fBargmax()\fR', '\fBargmaxabs()\fR', '\fBargmin()\fR', '\fBargminabs()\fR', '\fBasin()\fR', '\fBasinh()\fR', '\fBatan()\fR', '\fBatan2()\fR', '\fBatanh()\fR', '\fBavg()\fR', '\fBbool()\fR', '\fBcbrt()\fR', '\fBceil()\fR', '\fBcos()\fR', '\fBcosh()\fR', '\fBcut()\fR', '\fBdeg2rad()\fR', '\fBerf()\fR', '\fBerfinv()\fR', '\fBexp()\fR', '\fBfact()\fR', '\fBfibo()\fR', '\fBfloor()\fR', '\fBfrac()\fR', '\fBgamma()\fR', '\fBgauss()\fR', '\fBgcd()\fR', '\fBhypot()\fR', '\fBint()\fR', '\fBisconst()\fR', '\fBisfinite()\fR', '\fBisnan()\fR', '\fBisnum()\fR', '\fBisinf()\fR', '\fBisint()\fR', '\fBisbool()\fR', '\fBisexpr()\fR', '\fBisfile()\fR', '\fBisdir()\fR', '\fBisin()\fR', '\fBkth()\fR', '\fBlcm()\fR', '\fBlog()\fR', '\fBlog2()\fR', '\fBlog10()\fR', '\fBlogit()\fR', '\fBmax()\fR', '\fBmaxabs()\fR', '\fBmed()\fR', '\fBmin()\fR', '\fBminabs()\fR', '\fBnarg()\fR', '\fBprod()\fR', '\fBrad2deg()\fR', '\fBrol()\fR' (left bit rotation), '\fBror()\fR' (right bit rotation), '\fBround()\fR', '\fBsign()\fR', '\fBsigmoid()\fR', '\fBsin()\fR', '\fBsinc()\fR', '\fBsinh()\fR', '\fBsqrt()\fR', '\fBstd()\fR', '\fBsrand(_seed)\fR', '\fBsum()\fR', '\fBtan()\fR', '\fBtanh()\fR', '\fBvar()\fR', '\fBxor()\fR'. * '\fBcov(A,B,_avgA,_avgB)\fR' estimates the covariance between vectors '\fBA\fR' and '\fBB\fR' (estimated averages of these vectors may be specified as arguments). * '\fBmse(A,B)\fR' returns the mean-squared error between vectors '\fBA\fR' and '\fBB\fR'. * '\fBatan2(y,x)\fR' is the version of '\fBatan()\fR' with two arguments '\fBy\fR' and '\fBx\fR' (as in C/C++). * '\fBperm(k,n,_with_order)\fR' computes the number of permutations of '\fBk\fR' objects from a set of '\fBn\fR' objects. * '\fBgauss(x,_sigma,_is_normalized)\fR' returns '\fBexp(-x^2/(2*s^2))/(is_normalized?sqrt(2*pi*sigma^2):1)\fR'. * '\fBcut(x,min,_max)\fR' returns '\fBx\fR' if it is in range '\fB[min, max]\fR', or '\fBmin\fR' or '\fBmax\fR' otherwise. * '\fBabscut(x,min,_max,_offset)\fR' returns '\fBcut(abs(x) + offset,min, max)*sign(x)\fR'. * '\fBnarg(a_1,...,a_N)\fR' returns the number of given arguments (here, '\fBN\fR'). * '\fBarg0(i,a_0,..,a_N)\fR' returns the '\fBi\fR'-th argument '\fBa_i\fR' (where index '\fBi\fR' goes from '\fB0\fR' to '\fBN\fR'). * '\fBarg1(i,a_1,..,a_N)\fR' does the same, but for index '\fBi\fR' going from '\fB1\fR' to '\fBN\fR'. * '\fBindexof(ref,a_0,..,a_N)\fR' returns the index '\fBi\fR' of the element '\fBref\fR' in the list of elements '\fBa_k\fR' (or '\fB-1\fR' if '\fBref\fR' is not present in the list). Index '\fBi\fR' starts from '\fB0\fR'. * '\fBisnum()\fR', '\fBisnan()\fR', '\fBisinf()\fR', '\fBisint()\fR', '\fBisbool()\fR' test the type of the given number or expression, and return '\fB0\fR' (false) or '\fB1\fR' (true). * '\fBisfile('path')\fR' (resp. '\fBisdir('path\fR')'\fB) returns '0\fR' (false) or '\fB1\fR' (true) depending on whether its string argument is a path to an existing file (resp. to a directory). * '\fBispercentage(arg)\fR' returns '\fB1\fR' (true) if '\fBarg\fR' ends with a '\fB%\fR', and '\fB0\fR' (false) otherwise. * '\fBisvarname('str')\fR' returns '\fB0\fR' (false) or '\fB1\fR' (true) depending on whether its string argument is a valid variable name. * '\fBisvar(varname)\fR' returns '\fB0\fR' (false) or '\fB1\fR' (true) depending on whether '\fBvarname\fR' is an already-defined variable. * '\fBisin(v,a_1,...,a_n)\fR' returns '\fB0\fR' (false) or '\fB1\fR' (true) depending on whether the first argument '\fBv\fR' appears in the set of other argument '\fBa_i\fR'. * '\fBisint(x,_xmin,_xmax)\fR' returns '\fB1\fR' (true), if '\fBx\fR' is an integer in range '\fB[xmin,xmax]\fR', otherwise '\fB0\fR' (false). * '\fBinrange(value,m,M,include_m,include_M)\fR' returns '\fB0\fR' (false) or '\fB1\fR' (true) depending on whether the given value lies in range '\fB[m, M]\fR' ('\fBinclude_m\fR' and '\fBincludeM\fR' tells how boundaries '\fBm\fR' and '\fBM\fR' are considered). * '\fBargkth()\fR', '\fBargmin()\fR', '\fBargmax()\fR', '\fBargminabs()\fR', '\fBargmaxabs()\fR', '\fBavg()\fR', '\fBkth()\fR', '\fBmin()\fR', '\fBmax()\fR', '\fBminabs()\fR', '\fBmaxabs()\fR', '\fBmed()\fR', '\fBprod()\fR', '\fBstd()\fR', '\fBsum()\fR' and '\fBvar()\fR' can be called with an arbitrary number of scalar/vector arguments. * '\fBvargkth()\fR', '\fBvargmin()\fR', '\fBvargmax()\fR', '\fBvargminabs()\fR', '\fBvargmaxabs()\fR', '\fBvavg()\fR', '\fBvkth()\fR', '\fBvmin()\fR', '\fBvmax()\fR', '\fBvminabs()\fR', '\fBvmaxabs()\fR', '\fBvmed()\fR', '\fBvprod()\fR', '\fBvstd()\fR', '\fBvsum()\fR' and '\fBvvar()\fR' are the versions of the previous function with vector arguments. * '\fBwave(x,type)\fR' defines a periodic function, period 1, with values in [-1,1]. '\fBtype\fR' sets the waveform. It can be \fB{ 0:Square | 1:Triangle | 2:Ascending sawtooth | 3:Descending sawtooth | 4:Sine }\fR. * '\fBround(value,rounding_value,direction)\fR' returns a rounded value. '\fBdirection\fR' can be \fB{ -1:To-lowest | 0:To-nearest | 1:To-highest }\fR. * '\fBsoftmax(V,_temperature)\fR' and '\fBsoftmin(V,_temperature)\fR' respectively returns the softmax and softmin of vector '\fBV\fR'. Default value for '\fBtemperature\fR' is 1. * '\fBsoftargmax(V,_temperature)\fR' and '\fBsoftargmin(V,_temperature)\fR' respectively returns the softargmax and softargmin of vector '\fBV\fR'. Default value for '\fBtemperature\fR' is 1. * '\fBlerp(a,b,t)\fR' returns '\fBa*(1-t)+b*t\fR'. * '\fBswap(a,b)\fR' swaps the values of the given arguments. '\fBswap(#ind, offset0,offset1,_is_vector)\fR' swaps pixels of image '\fB[ind]\fR', located at offsets '\fBoffset0\fR' and '\fBoffset1\fR'. \fB\fB## Predefined variable names:\fR Variable names below are predefined. They can be overridden though. * '\fBl\fR': length of the current list of images. * '\fBk\fR': index of the current image, in '\fB[0,l-1]\fR'. * '\fBw\fR': width of the current image, if any ('\fB0\fR' otherwise). * '\fBh\fR': height of the current image, if any ('\fB0\fR' otherwise). * '\fBd\fR': depth of the current image, if any ('\fB0\fR' otherwise). * '\fBs\fR': spectrum of the current image, if any ('\fB0\fR' otherwise). * '\fBr\fR': shared state of the current image, if any ('\fB0\fR' otherwise). * '\fBwh\fR': shortcut for '\fBwidth*height\fR'. * '\fBwhd\fR': shortcut for '\fBwidth*height*depth\fR'. * '\fBwhds\fR': shortcut for '\fBwidth*height*depth*spectrum\fR' (i.e. number of image values). * '\fBia\fR', '\fBic\fR', '\fBid\fR', '\fBim\fR', '\fBiM\fR', '\fBin\fR', '\fBip\fR', '\fBis\fR', '\fBiv\fR': Respectively the average, median, standard deviation, minimum, maximum, L2-norm, product, sum and variance of the current image, if any ('\fB0\fR' otherwise). * '\fBxm\fR', '\fBym\fR', '\fBzm\fR', '\fBcm\fR': The pixel coordinates of the minimum value in the current image, if any ('\fB0\fR' otherwise). * '\fBxM\fR', '\fByM\fR', '\fBzM\fR', '\fBcM\fR': The pixel coordinates of the maximum value in the current image, if any ('\fB0\fR' otherwise). * All these variables are treated as \fBconstant values\fR by the math parser (for optimization purposes) which is indeed the case most of the time. However, this might not hold if function '\fBresize(#ind,..)\fR' is used in the math expression. If so, it is safer to invoke functions '\fBl()\fR', '\fBw(_#ind)\fR', '\fBh(_#ind)\fR', ... '\fBs(_#ind)\fR' and '\fBin(_#ind)\fR' instead of the corresponding named variables. * '\fBi\fR': currently processed pixel value (i.e. value located at '\fB(x,y,z, c)\fR') in the current image, if any ('\fB0\fR' otherwise). * '\fBiN\fR': N-th channel value of currently processed pixel (i.e. value located at '\fB(x,y,z,N)\fR' in the current image, if any ('\fB0\fR' otherwise). '\fBN\fR' must be an integer in range '\fB[0,9]\fR'. * '\fBR\fR', '\fBG\fR', '\fBB\fR' and '\fBA\fR' are equivalent to '\fBi0\fR', '\fBi1\fR', '\fBi2\fR' and '\fBi3\fR' respectively. * '\fBI\fR': currently processed vector pixel in the current image, if any ('\fB0\fR' otherwise). The number of vector components is equal to the number of image channels (e.g. '\fBI\fR' = '\fB[ R,G,B ]\fR' for a '\fBRGB\fR' image). * '\fB_0\fR' and '\fB_1\fR': Vectors whose dimension is equal to the number of channels of the current image, and whose values are all '\fB0\fR' or '\fB1\fR'. * You may add '\fB#ind\fR' to any of the variable name above to retrieve the information for any numbered image '\fB[ind]\fR' in the list (when this makes sense). For instance '\fBia#0\fR' denotes the average value of the first image in the list). * '\fBx\fR': currently processed column of the image, if any ('\fB0\fR' otherwise). * '\fBy\fR': currently processed row of the image, if any ('\fB0\fR' otherwise). * '\fBz\fR': currently processed slice of the image, if any ('\fB0\fR' otherwise). * '\fBc\fR': currently processed channel of the image, if any ('\fB0\fR' otherwise). * '\fBt\fR': thread id when an expression is evaluated with multiple threads ('\fB0\fR' means \fBmaster thread\fR). * '\fBn\fR': maximum number of threads when expression is evaluated in parallel (so that '\fBt\fR' goes from '\fB0\fR' to '\fBn-1\fR'). * '\fBe\fR': value of e, i.e. '\fB2.71828...\fR'. * '\fBpi\fR': value of pi, i.e. '\fB3.1415926...\fR'. * '\fBeps\fR': value of machine epsilon, that is the difference between 1.0 and the next value representable by a double. * '\fBu\fR': a random value between '\fB[0,1]\fR', following a uniform distribution. * '\fBv\fR': a random integer that is either '\fB0\fR' or '\fB1\fR', following a uniform distribution. * '\fBg\fR': a random value, following a gaussian distribution of variance 1 (roughly in '\fB[-6,6]\fR'). * '\fBinterpolation\fR': value of the default interpolation mode used when reading pixel values with the pixel access operators (i.e. when the interpolation argument is not explicitly specified, see below for more details on pixel access operators). Its initial default value is '\fB0\fR'. * '\fBboundary\fR': value of the default boundary conditions used when reading pixel values with the pixel access operators (i.e. when the boundary condition argument is not explicitly specified, see below for more details on pixel access operators). Its initial default value is '\fB0\fR'. * The last image in the list is always associated to the evaluations of '\fBexpressions\fR', e.g. G'MIC\fR sequence \fB256,128 fill {w}\fR will create a 256x128 image filled with value 256. \fB\fB## Vector functions and operators:\fR The math evaluator is able to work with vector elements. A math function applied to a vector argument usually returns a vector with same dimension, where each element of the input vector has been passed to the specified function (e.g. '\fBabs([-1,2,-3])\fR' returns '\fB[1,2,3]\fR'). There are specific functions and operators to define or compute vector elements though : * '\fB[a0,a1,...,aN-1]\fR' defines a '\fBN\fR'-dimensional vector with scalar coefficients '\fBak\fR'. * '\fBvectorN(a0,a1,,...,aN-1)\fR' does the same, with the '\fBak\fR' being repeated periodically if only a few are specified. * '\fBvector(#N,a0,a1,,...,aN-1)\fR' does the same, and can be used for any constant expression '\fBN\fR'. * In previous expressions, the '\fBak\fR' can be vectors themselves, to be concatenated into a single vector. * The scalar element '\fBak\fR' of a vector '\fBX\fR' is retrieved by '\fBX[k]\fR'. * The sub-vector '\fB[X[p],X[p+s]...X[p+s*(q-1)]]\fR' (of size '\fBq\fR') of a vector '\fBX\fR' is retrieved by '\fBX[p,q,s]\fR'. * Equality/inequality comparisons between two vectors is done with operators '\fB==\fR' and '\fB!=\fR'. * Some vector-specific functions can be used on vector values: '\fBcross(X, Y)\fR' (cross product), '\fBdot(X,Y)\fR' (dot product), '\fBsize(X)\fR' (vector dimension), '\fBsort(X,_is_increasing,_starting_index,_nb_elts,_size_elt, _sort_index)\fR' (sorted values), '\fBreverse(A)\fR' (reverse order of components), '\fBmap(X,P,_nb_channelsX,_nb_channelsP,_boundary_conditions)\fR', '\fBshift(A,_length,_boundary_conditions)\fR' and '\fBsame(A,B,_nb_vals, _is_case_sensitive)\fR' (vector equality test). * Function '\fBnormP(u1,...,un)\fR' computes the LP-norm of the specified vector ('\fBP\fR' being a constant or '\fBinf\fR', as in e.g. '\fBnorm1()\fR'). * Function '\fBnormp(V,_p)\fR' computes the Lp-norm of the vector '\fBV\fR'. Here, '\fBp\fR' can be variable. Default value for '\fBp\fR' is 2. * Function '\fBunitnorm(V,_p)\fR' returns a normalized version '\fBV/normp(V)\fR' of vector '\fBV\fR'. Default value for '\fBp\fR' is 2. * Function '\fBresize(A,size,_interpolation,_boundary_conditions)\fR' returns a resized version of a vector '\fBA\fR' with given interpolation mode. '\fBinterpolation\fR' can be \fB{ -1:None (memory content) | 0:None | 1:Nearest | 2:Average | 3:Linear | 4:Grid | 5:Bicubic | 6:Lanczos }\fR, and '\fBboundary_conditions\fR' can be \fB{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR. * Function '\fBfind(A,B,_starting_index,_search_step,_max_iterations)\fR' returns the index where sub-vector '\fBB\fR' appears in vector '\fBA\fR' (or '\fB-1\fR' if '\fBB\fR' is not contained in '\fBA\fR'). Argument '\fBA\fR' can be also replaced by an image index '\fB#ind\fR'. * Specifying a vector-valued math expression as an argument of a command that operates on image values (e.g. '\fBfill\fR') modifies the whole spectrum range of the processed image(s), for each spatial coordinates '\fB(x,y,z)\fR'. The command does not loop over the '\fBc\fR'-axis in this case. \fB\fB## Complex-valued functions:\fR A '\fB2\fR'-dimensional vector may be interpreted as a complex number and used in those particular functions/operators: '\fB**\fR' (complex multiplication), '\fB//\fR' (complex division), '\fB^^\fR' (complex exponentiation), '\fB**=\fR' (complex self-multiplication), '\fB//=\fR' (complex self-division), '\fB^^=\fR' (complex self-exponentiation), '\fBcabs()\fR' (complex modulus), '\fBcarg()\fR' (complex argument), '\fBcconj()\fR' (complex conjugate), '\fBcexp()\fR' (complex exponential), '\fBclog()\fR' (complex logarithm), '\fBccos()\fR' (complex cosine), '\fBcsin()\fR' (complex sine), '\fBcsqr()\fR' (complex square), '\fBcsqrt()\fR' (complex square root), '\fBctan()\fR' (complex tangent), '\fBccosh()\fR' (complex hyperpolic cosine), '\fBcsinh()\fR' (complex hyperbolic sine) and '\fBctanh()\fR' (complex hyperbolic tangent). \fB\fB## Matrix-valued functions:\fR A '\fBMN\fR'-dimensional vector may be interpreted as a '\fBM\fR' x '\fBN\fR' matrix and used in those particular functions/operators: '\fB*\fR' (matrix-vector multiplication), '\fBdet(A)\fR' (determinant), '\fBdiag(V)\fR' (diagonal matrix from a vector), '\fBeig(A)\fR' (eigenvalues/eigenvectors), '\fBeye(n)\fR' (n x n identity matrix), '\fBinvert(A,_nb_colsA)\fR' (matrix inverse), '\fBmul(A,B,_nb_colsB)\fR' (matrix-matrix multiplication), '\fBqr(A, _nb_colsA,_is_reduced_form)\fR', '\fBrot(u,v,w,angle)\fR' (3D rotation matrix), '\fBrot(angle)\fR' (2D rotation matrix), '\fBsolve(A,B,_nb_colsB)\fR' (solver of linear system A.X = B), '\fBsvd(A,_nb_colsA)\fR' (singular value decomposition), '\fBtrace(A)\fR' (matrix trace) and '\fBtranspose(A, nb_colsA)\fR' (matrix transpose). Argument '\fBnb_colsB\fR' may be omitted if it is equal to '\fB1\fR'. \fB\fB## Image-valued functions:\fR Some functions take vector-valued arguments that represent image data : * Function '\fBexpr(formula,_w,_h,_d,_s,_A)\fR' outputs a vector of size '\fBw*h*d*s\fR' with values generated from the given formula, as if one were filling an image with dimensions '\fB(w,h,d,s)\fR'. If '\fBA\fR' is specified, it must be a vector of size '\fBw*h*d*N\fR' ('\fBN\fR' can be different from '\fBs\fR'). It is then passed as a reference image (of size '\fBw\fR' x '\fBh\fR' x '\fBd\fR' x '\fBN\fR') for the given expression. * Function '\fBresize(A,wA,hA,dA,sA,nwA,_nhA,_ndA,_nsA,_interpolation, _boundary_conditions,_ax,_ay,_az,_ac)\fR' is an extended version of the '\fBresize()\fR' function. It lets you resize the vector '\fBA\fR', treated as an image of size '\fB(ow,oh,od,os)\fR' as a new image of size '\fB(nw,nh,nd, ns)\fR', with specified resizing options. * Function '\fBwarp(A,wA,hA,dA,sA,B,wB,hB,dB,sB,_mode,_interpolation, _boundary_conditions)\fR' returns the warped version of the image '\fBA\fR' (of size '\fB(wA,hA,dA,sA)\fR', treated as a vector of size '\fB(wA*hA*dA*sA)\fR' by the warping field '\fBB\fR' (of size '\fB(wB,hB,dB,sB)\fR'). The resulting image has size '\fB(wB,hB,dB,sA)\fR'. This is the math evaluator equivalent of command \fIwarp\fR. * Function '\fBindex(A,P,nb_channelsP,_dithering,_map_colors)\fR' returns the indexed version of the image '\fBA\fR' by the colormap '\fBP\fR'. This is the math evaluator equivalent of command \fIindex\fR. * Function '\fBpermute(A,wA,hA,dA,sA,permutation)\fR' returns a permuted version of the image '\fBA\fR' (of size '\fB(wA,hA,dA,sA)\fR', treated as a vector of size '\fBwA*hA*dA*sA\fR'). This is the math evaluator equivalent of command \fIpermute\fR. * Function '\fBmirror(A,wA,hA,dA,sA,axes_string)\fR' returns a mirrored version of the image '\fBA\fR' (of size '\fB(wA,hA,dA,sA)\fR', treated as a vector of size '\fBwA*hA*dA*sA\fR'). This is the math evaluator equivalent of command \fImirror\fR. * Function '\fBcumulate(A,wA,hA,dA,sA,_axes_string)\fR' returns a cumulated version of the image '\fBA\fR' (of size '\fB(wA,hA,dA,sA)\fR', treated as a vector of size '\fBwA*hA*dA*sA\fR'). This is the math evaluator equivalent of command \fIcumulate\fR. * Function '\fBhistogram(A,nb_levels,_min_value,_max_value)\fR' returns the histogram of the vector '\fBA\fR'. This is the math evaluator equivalent of command \fIhistogram\fR. * Function '\fBequalize(A,nb_levels,_min_value,_max_value)\fR' returns the equalized version of the vector '\fBA\fR'. This is the math evaluator equivalent of command \fIequalize\fR. * Function '\fBnormalize(A,_min_value,_max_value)\fR' returns the normalized version of the vector '\fBA\fR'. This is the math evaluator equivalent of command \fInormalize\fR. * Function '\fBmproj(S,nb_colsS,D,nb_colsD,method,max_iter,max_residual)\fR' projects a matrix '\fBS\fR' onto a dictionary (matrix) '\fBD\fR'. This is the math evaluator equivalent of command \fImproj\fR. * Functions '\fBfft(R,I,w,h,d,s,_'axis\fR')' computes the Fast Fourier Transform of the complex pair '\fB[R,I]\fR', treated as images of size '\fB(w,h, d,s)\fR'. Inverse fft is computed with similar function '\fBifft()\fR'. These functions replace the content of '\fBR\fR' and '\fBI\fR' in-place. This is the math evaluator equivalent of commands \fIfft\fR and \fIifft\fR. * Function '\fBshift(A,wA,hA,dA,sA,_dx,_dy,_dz,_dc,_boundary_conditions)\fR' returns a shifted version of the vector '\fBA\fR', treated as an image of size '\fB(wA,hA,dA,sA)\fR'. This is the math evaluator equivalent of command \fIshift\fR. * Function '\fBnoise(A,amplitude,_noise_type)\fR' returns the noisy version of the vector '\fBA\fR'. This is the math evaluator equivalent of command \fInoise\fR. * Function '\fBrand(#size,_min_value,_max_value,_pdf,_precision)\fR' returns a vector of '\fBsize\fR' random values. This is the math evaluator equivalent of command \fIrand\fR. \fB\fB## String manipulation:\fR Character strings are defined as vector objects and can therefore be managed as such. Dedicated functions and initializers to manage strings exist: * '\fB['string']\fR' and '\fB'string'\fR' define a vector whose values are the character codes of the given '\fBcharacter string\fR' (e.g. '\fB'foo'\fR' is equal to '\fB[ 102,111,111 ]\fR'). * '\fB_'character'\fR' returns the ASCII code of the given character (e.g. '\fB_'A'\fR' is equal to '\fB65\fR'). * A special case happens for \fBempty\fR strings: Values of both expressions '\fB['']\fR' and '\fB''\fR' are '\fB0\fR'. * Functions '\fBlowercase()\fR' and '\fBuppercase()\fR' return string with all string characters lowercased or uppercased. * Function '\fBs2v(str,_starting_index,_is_strict)\fR' parses string '\fBstr\fR' and returns the value contained in it. * Function '\fBv2s(expr,_nb_digits,_siz)\fR' returns a vector of size '\fBsiz\fR' which contains the character representation of values described by expression '\fBexpr\fR'. '\fBnb_digits\fR' can be \fB{ <-1:0-Padding of integers | -1:Auto-reduced | 0:All | >0:Max number of digits }\fR. * Function '\fBecho(str1,str2,...,strN)\fR' prints the concatenation of given string arguments on the console. * Function '\fBstring(_#siz,str1,str2,...,strN)\fR' generates a vector corresponding to the concatenation of given string/number arguments. \fB\fB## Dynamic arrays:\fR A dynamic array is defined as a one-column (or empty) image '\fB[ind]\fR' in the image list. It allows elements to be added or removed, each element having the same dimension (which is actually the number of channels of image '\fB[ind]\fR'). Dynamic arrays adapt their size to the number of elements they contain. A dynamic array can be manipulated in a math expression, with the following functions: * '\fBda_size(_#ind)\fR': Returns the number of elements in dynamic array '\fB[ind]\fR'. * '\fBda_back(_#ind)\fR': Returns the last element of the dynamic array '\fB[ind]\fR'. * '\fBda_insert(_#ind,pos,elt_1,_elt_2,...,_elt_N)\fR': Insert '\fBN\fR' new elements '\fBelt_k\fR' starting from index '\fBpos\fR' in dynamic array '\fB[ind]\fR'. * '\fBda_push(_#ind,elt1,_elt2,...,_eltN)\fR': Insert '\fBN\fR' new elements '\fBelt_k\fR' at the end of dynamic array '\fB[ind]\fR'. * '\fBda_pop(_#ind)\fR': Same as '\fBda_back()\fR' but also remove last element from the dynamic array '\fB[ind]\fR'. * '\fBda_push_heap(_#ind,elt1,_elt2,...,_eltN)\fR' and '\fBda_pop_heap(_#ind)\fR' do the same but for a dynamic array seen as a min-heap structure. * '\fBda_insert_n(_#ind,n,pos,elt_1,_elt_2,...,_elt_N)\fR', '\fBda_push_n(_#ind,n,elt1,_elt2,...,_eltN)\fR' and '\fBda_push_heap_n(_#ind,n, elt1,_elt2,...,_eltN)\fR' are variants that insert the given elements consecutively, '\fBn\fR' times. If no elements are given, they insert '\fBn\fR' empty elements. * '\fBda_remove(_#ind,_start,_end)\fR': Remove elements located between indices '\fBstart\fR' and '\fBend\fR' (included) in dynamic array '\fB[ind]\fR'. * '\fBda_freeze(_#ind)\fR': Convert a dynamic array into a 1-column image with height '\fBda_size(#ind)\fR'. * The value of the k-th element of dynamic array '\fB[ind]\fR' is retrieved with '\fBi[_#ind,k]\fR' (if the element is a scalar value), or '\fBI[_#ind, k]\fR' (if the element is a vector). In the functions above, argument '\fB#ind\fR' may be omitted in which case it is assumed to be '\fB#-1\fR'. \fB\fB## Special operators:\fR * '\fB;\fR': expression separator. The returned value is always the last encountered expression. For instance expression '\fB1;2;pi\fR' is evaluated as '\fBpi\fR'. * '\fB=\fR': variable assignment. Variables in mathematical parser can only refer to numerical values (vectors or scalars). Variable names are case-sensitive. Use this operator in conjunction with '\fB;\fR' to define more complex evaluable expressions, such as \fBt = cos(x); 3*t^2 + 2*t + 1\fR These variables remain \fBlocal\fR to the mathematical parser and cannot be accessed outside the evaluated expression. * Variables defined in math parser may have a \fBconstant\fR property, by specifying keyword '\fBconst\fR' before the variable name (e.g. 'const foo = pi/4;'). The value assigned to such a variable must be a \fBconstant scalar\fR. Constant variables allow certain types of optimizations in the math JIT compiler. \fB\fB## Specific functions:\fR * '\fBaddr(expr)\fR': returns the pointer address to the given expression '\fBexpr\fR'. * '\fBo2c(_#ind,offset,_boundary_conditions)\fR' and '\fBc2o(_#ind,x,_y,_z,_c, _boundary_conditions)\fR': Convert image offset to image coordinates and vice-versa. Argument '\fBboundary_conditions\fR' can be \fB{ 0:None | 1:Return -1 if out-of-range }\fR. * '\fBfill(target,expr)\fR' or '\fBfill(target,index_name,expr)\fR' fills the vector variable '\fBtarget\fR', using the given expression, e.g. '\fBV = vector16(); fill(V,k,k^2 + k + 1);\fR'. This is basically equivalent to: '\fBfor (index_name = 0, index_name=0\fR' (e.g., '\fB46368\fR' for '\fBN=24\fR'). '\fBdo(expression,condition)\fR' always evaluates the expression at least once, then checks for the loop condition. When done, it returns the last value of '\fBexpression\fR'. * '\fBfor(init,condition,_procedure,body)\fR' first evaluates the expression '\fBinit\fR', then iteratively evaluates '\fBbody\fR' (followed by '\fBprocedure\fR' if specified) while '\fBcondition\fR' holds (i.e. not zero). It may happen that no iterations are done, in which case the function returns '\fBnan\fR'. Otherwise, it returns the last value of '\fBbody\fR'. For instance, the expression: \fBif(N<2,N,for(n=N;F0=0;F1=1,n=n-1,F2=F0+F1;F0=F1;F1=F2))\fR returns the '\fBN\fR'-th value of the Fibonacci sequence, for '\fBN>=0\fR' (e.g., '\fB46368\fR' for '\fBN=24\fR'). * '\fBwhile(condition,expression)\fR' is exactly the same as '\fBfor(init, condition,expression)\fR' without the specification of an initializing expression. * '\fBrepeat(nb_iters,expr)\fR' or '\fBfill(nb_iters,iter_name,expr)\fR' run '\fBnb_iters\fR' iterations of the given expression '\fBexpr\fR', e.g. '\fBV = vector16(); repeat(16,k,V[k] = k^2 + k + 1);\fR'. It is basically equivalent to: '\fBfor (iter_name = 0, iter_namebegin(foo = 0); ++foo"'). * '\fBcopy(dest,src,_nb_elts,_inc_d,_inc_s,_opacity)\fR' copies an entire memory block of '\fBnb_elts\fR' elements starting from a source value '\fBsrc\fR' to a specified destination '\fBdest\fR', with increments defined by '\fBinc_d\fR' and '\fBinc_s\fR' respectively for the destination and source pointers. * '\fBstats(_#ind)\fR' returns the statistics vector of the running image '\fB[ind]\fR', i.e the vector '\fB[ im,iM,ia,iv,xm,ym,zm,cm,xM,yM,zM,cM,is,ip, in ]\fR' (15 values). * '\fBstats(X,w,h,d,s)\fR' returns the statistics vector of the vector '\fBX\fR', treated as an image of size '\fB(w,h,d,s)\fR'. * '\fBref(expr,a)\fR' references given expression '\fBexpr\fR' as variable name '\fBa\fR'. * '\fBunref(a,b,...)\fR' destroys references to the named variable given as arguments. * '\fBbreakpoint()\fR' inserts a possible computation breakpoint (useless with the cli interface). * '\fB_(comment) expr\fR' just returns expression '\fBexpr\fR' (useful for inserting inline comments in math expressions). * '\fBrun('pipeline\fR')' executes the G'MIC\fR pipeline as if it was called outside the currently evaluated expression. * '\fBset('variable_name',A)\fR' sets the G'MIC\fR variable '\fB$variable_name\fR' with the value of expression '\fBA\fR'. If '\fBA\fR' is a vector variable, it is assumed to encode a string. * '\fBstore('variable_name',A,_w,_h,_d,_s,_is_compressed)\fR' transfers the data of vector '\fBA\fR' as a '\fB(w,h,d,s)\fR' image to the G'MIC\fR variable '\fB$variable_name\fR'. Thus, the data becomes available outside the math expression (that is equivalent to using the regular command \fIstore\fR, but directly in the math expression). * '\fBget('variable_name',_size,_return_as_string)\fR' returns the value of the variable, as a vector of '\fBsize\fR' values, or as a scalar (if '\fBsize\fR' is zero or not specified). * '\fBname(_#ind,size)\fR' returns a vector of size '\fBsize\fR', whose values are the characters codes of the name of image '\fB[ind]\fR' (or default image selected if '\fBind\fR' is not specified). * '\fBcorrelate(I,wI,hI,dI,sI,K,wK,hK,dK,sK,_boundary_conditions, _is_normalized,_channel_mode,_xcenter,_ycenter,_zcenter,_xstride,_ystride, _zstride,_xdilation,_ydilation,_zdilation,_xoffset,_yoffset,_zoffset,_xsize, _ysize,_zsize)\fR' returns the correlation, unrolled as a vector, of the '\fB(wI,hI,dI,sI)\fR'-sized image '\fBI\fR' with the '\fB(wK,hK,dK, sK)\fR'-sized kernel '\fBK\fR' (the meaning of the other arguments are the same as in command '\fBcorrelate\fR'). Similar function '\fBconvolve(...)\fR' is also defined for computing the convolution between '\fBI\fR' and '\fBK\fR'. \fB\fB## User-defined macros:\fR * Custom macro functions can be defined in a math expression, using the assignment operator '\fB=\fR', e.g. \fBfoo(x,y) = cos(x + y); result = foo(1,2) + foo(2,3)\fR * Trying to override a built-in function (e.g. '\fBabs()\fR') has no effect. * Overloading macros with different number of arguments is possible. Re-defining a previously defined macro with the same number of arguments discards its previous definition. * Macro functions are processed as \fBmacros\fR by the mathematical evaluator. You should avoid invoking them with arguments that are themselves results of assignments or self-operations. For instance, \fBfoo(x) = x + x; z = 0; foo(++z)\fR returns '\fB4\fR' rather than expected value '\fB2\fR'. * When substituted, macro arguments are placed inside parentheses, except if a number sign '\fB#\fR' is located just before or after the argument name. For instance, expression \fBfoo(x,y) = x*y; foo(1+2,3)\fR returns '\fB9\fR' (being substituted as '\fB(1+2)*(3)\fR'), while expression \fBfoo(x,y) = x#*y#; foo(1+2,3)\fR returns '\fB7\fR' (being substituted as '\fB1+2*3\fR'). * Number signs '\fB#\fR' appearing between macro arguments actually act as \fBempty\fR separators. They may be used to force the substitution of macro arguments in unusual places, e.g. as in \fBstr(N) = ['I like N#'];\fR * Macros with variadic arguments can be defined, by specifying a single argument name followed by '\fB...\fR'. For instance, \fBfoo(args...) = sum([ args ]^2);\fR defines a macro that returns the sum of its squared arguments, so '\fBfoo(1,2, 3)\fR' returns '\fB14\fR' and '\fBfoo(4,5)\fR' returns '\fB41\fR'. \fB\fB## Multi-threaded and in-place evaluation:\fR * If your images are large enough and you have several CPU cores available, it is possible that the math expression passed to a '\fBfill\fR', '\fBeval\fR' or '\fBinput\fR' commands can be evaluated in parallel\fR, using multiple computation threads. * G'MIC\fR tries to auto-detect if an expression can be parallelized\fR, and if it can be evaluated in-place\fR (otherwise, a temporary copy of the image is allocated). However, this auto-detection can be overridden, by starting the mathematical expression for the '\fBfill\fR' or '\fBeval\fR' commands, with a single character, that can be: - '\fB*\fR': Evaluate expression in parallel\fR, possibly using a temporary image copy. - '\fB:\fR': Evaluate expression in parallel\fR, but in-place\fR. - '\fB+\fR': Evaluate expression in a single thread\fR, possibly using a temporary image copy (in scanline\fR order). - '\fB>\fR': Evaluate expression in a single thread\fR, but in-place\fR (in scanline\fR order). - '\fB<\fR': Evaluate expression in a single thread\fR, but in-place\fR (in reverse scanline\fR order). * Beware, depending on the amount of data to process, parallel evaluations may be slower than using single-thread evaluations (e.g. for small images). * For parallel evaluations, function '\fBcritical(expr)\fR' serializes execution of the given sub-expression '\fBexpr\fR' in a single thread at a time. * '\fBbegin_t(expr)\fR' and '\fBend_t(expr)\fR' evaluate the given expression once for each running thread (so possibly several times) at the beginning and the end of the evaluation procedure. * '\fBmerge(variable,operator)\fR' specifies that the local thread values requests merging, with the given operator, when all threads have finished computing. * Expressions '\fBi(_#ind,x,_y,_z,_c)=value\fR', '\fBj(_#ind,x,_y,_z, _c)=value\fR', '\fBi[_#ind,offset]=value\fR' and '\fBj[_#ind,offset]=value\fR' set a pixel value at a location other than the current one in the image '\fB[ind]\fR' (or in the current image if argument '\fB#ind\fR' is omitted), either with global coordinates/offsets (with '\fBi(...)\fR' and '\fBi[...]\fR'), or relatively to the current position '\fB(x,y,z,c)\fR' (with '\fBj(...)\fR' and '\fBj[...]\fR'). These expressions always return '\fBvalue\fR'. \fB\fB10. Adding Custom Commands\fR \fB ----------------------\fR * New custom commands can be added by the user, through the use of G'MIC\fR \fBcustom commands files\fR. * A command file is a simple text file, where each line starts either with \fBcommand_name: command_definition\fR or \fBcommand_definition (continuation)\fR * At startup, G'MIC\fR automatically includes the user's command file '\fB$HOME/.gmic\fR' (on \fBUnix\fR) or '\fB%USERPROFILE%\user.gmic\fR' (on \fBWindows\fR). The CLI tool '\fBgmic\fR' automatically runs the command '\fBcli_start\fR' if defined. * Custom command names must use character set '\fB[a-zA-Z0-9_]\fR' and cannot start with a number. * Any '\fB# comment\fR' expression found in a custom commands file is discarded by the G'MIC\fR parser, regardless of its position on the line. * In a custom command, the following '\fB$-expressions\fR' are recognized and substituted: - '\fB$*\fR' is substituted by a verbatim copy of the given string of arguments (do not include arguments set to default values). - '\fB$"*"\fR' is substituted by the sequence of given arguments, separated by commas '\fB,\fR', each being double-quoted (include arguments set to default values). - '\fB$#\fR' is substituted by the maximum index of known arguments (either specified by the user or set to a default value in the custom command). - '\fB$[]\fR' is substituted by the list of selected image indices that have been specified in the command invocation. - '\fB$?\fR' is substituted by a printable version of '\fB$[]\fR' to be used in command descriptions. - '\fB$i\fR' and '\fB${i}\fR' are both substituted by the '\fBi\fR'-th argument. Negative indices such as '\fB${-j}\fR' are allowed and refer to the '\fBj\fR'-th latest argument. '\fB$0\fR' is substituted by the custom command name. - '\fB${i=default}\fR' is substituted by the value of '\fB$i\fR' (if defined) or by its new value set to '\fBdefault\fR' otherwise ('\fBdefault\fR' may be a '\fB$-expression\fR' as well). - '\fB${subset}\fR' is substituted by the argument values (separated by commas '\fB,\fR') of an argument subset. For instance, the expression '\fB${2--2}\fR' is substituted by all command arguments except the first and the last one. Expression '\fB${^0}\fR' is then substituted by all arguments of the invoked command (eq. to '\fB$*\fR' if all arguments have been indeed specified). - '\fB$=var\fR' is substituted by the set of instructions that will assign each argument '\fB$i\fR' to the named variable '\fBvar$i\fR' (for i in '\fB[0...$#]\fR'. This is particularly useful when a custom command wants to manage variable numbers of arguments. Variables names must use character set '\fB[a-zA-Z0-9_]\fR' and cannot start with a number. * These particular '\fB$-expressions\fR' for custom commands are \fBalways substituted\fR, even in double-quoted items or when the dollar sign '\fB$\fR' is escaped with a backslash '\fB$\fR'. To avoid substitution, place an empty double quoted string just after the '\fB$\fR' (as in '\fB$""1\fR'). * Specifying arguments may be skipped when invoking a custom command, by replacing them by commas '\fB,\fR' as in expression \fBflower ,,3\fR Omitted arguments are set to their default values, which must therefore be explicitly defined in the code of the corresponding custom command (using default argument expressions as '\fB${1=default}\fR'). * If a required numbered argument of a custom command is missing a value, an error is thrown by the G'MIC\fR interpreter. * It is possible to specialize the invocation of a '\fB+command\fR' by defining it as \fB+command_name: command_definition\fR * A +-specialization takes priority over the regular command definition when the command is invoked with a prepended '\fB+\fR'. * When only a +-specialization of a command is defined, invoking '\fBcommand\fR' is actually equivalent to '\fB+command\fR'. \fB\fB11. List of Commands\fR \fB ----------------\fR All available G'MIC\fR commands are listed below by category. An argument enclosed in square brackets '\fB[]\fR' or starting with '\fB_\fR' is optional except when standing for an existing image '\fB[image]\fR', where '\fBimage\fR' can be either an index number or an image name. In this case, the '\fB[]\fR' characters are mandatory when writing the item. Note that all images that serve as illustrations in this reference documentation are normalized in range '\fB[0, 255]\fR' before being displayed. You may need to do this explicitly (command '\fBnormalize 0,255\fR') if you want to save and view images with the same appearance as those illustrated in the example codes. The examples accompanying this '\fBList of Commands\fR' illustrate the use of the G'MIC\fR language and are written as they would appear in a custom command. While some examples may work if entered directly at a shell prompt, there is no guarantee. No attempt has been made to escape special characters in these examples, which many shells reserve. \fB\fB11.1. Global Options\fR \fB --------------\fR \fBdebug (+):\fR Enable debug mode. When enabled, the G'MIC\fR interpreter becomes much more verbose and prints additional messages about its internal state to the standard output (stdout). This option is mainly intended for developers and for reporting potential interpreter bugs. \fBh:\fR Shortcut for command '\fBhelp\fR'. \fBhelp:\fR command |\fR (no arg)\fR Display help for all commands, or for a specified command, then exit. (equivalent to shortcut command '\fBh\fR'). \fBversion:\fR Display current version number on stdout. \fB\fB11.2. Input / Output\fR \fB --------------\fR \fBcamera (+):\fR _camera_index>=0,_nb_frames>0,_skip_frames>=0,_capture_width>=0,_capture_height>=0\fR Insert one or several frames from specified camera. When '\fBnb_frames==0\fR', the camera stream is released instead of capturing new images. This command requires features from the OpenCV library (not enabled in G'MIC\fR by default). \fBDefault values\fR: '\fBcamera_index=0\fR' (default camera), '\fBnb_frames=1\fR', '\fBskip_frames=0\fR' and '\fBcapture_width=capture_height=0\fR' (default size). \fBm (+):\fR Shortcut for command '\fBcommand\fR'. \fBcommand (+):\fR _add_debug_info={ 0:No | 1:Yes },{ filename | http[s]://URL | "string" }\fR Import G'MIC\fR custom commands from specified file, URL or string. (equivalent to shortcut command '\fBm\fR'). Imported commands are available directly after the '\fBcommand\fR' invocation. Specified filename is not allowed to contain colons '\fB:\fR'. \fBDefault value\fR: '\fBadd_debug_info=1\fR' (except for a "string" argument, in which case '\fBadd_debug_info=0\fR'). \fBExample:\fR [#1] image.jpg command "foo : mirror y deform $""1" +foo[0] 5 +foo[0] 15\fR \fBcompress_to_keypoints:\fR _method,_max_keypoints>=0,_err_avg[%]>=0,_err_max[%]>=0,_"err_command"\fR Compress each of the selected images into a set of keypoints that can be further decompressed using command \fIdecompress_from_keypoints\fR. \fBBeware:\fR This type of compression is effective only for images with very smooth content. '\fBmethod\fR' can be \fB{ 0:PDE | 1:RBF }\fR. Add '\fB2\fR' to '\fBmethod\fR' to skip the point removal step. * '\fBmax_keypoints\fR' is the maximal number of keypoints generated by the compression method. If '\fBmax_keypoints<0\fR', the removal step is not done when number of maximal keypoints has been reached. '\fBmax_keypoints=0\fR' means '\fBno limits\fR'. * '\fBerr_avg\fR' is the desired average compression error. * '\fBerr_max\fR' is the desired pointwise max compression error. * '\fBerr_command\fR' is the code of a command that inputs the two images '\fB[reference]\fR' and '\fB[compressed]\fR' and compute a single error map as a last image. \fBDefault values\fR: '\fBmethod=3\fR', '\fBmax_keypoints=0\fR', '\fBerr_avg=1%\fR', '\fBerr_max=5%\fR' and '\fBerr_command=-. [0] norm.\fR' \fBcreatedir (+):\fR force_overwrite={ 0:No | 1:Yes },directory_path_1,_directory_path_2,...\fR Create one or several new directories '\fBdirectory_path_k\fR' on the filesystem. If a specified directory path contains itself several subdirectories, they are all created if necessary. \fBDefault value\fR: '\fBforce_overwrite=1\fR'. \fBcursor (+):\fR _mode = { 0:hide | 1:show }\fR Show or hide mouse cursor for selected instant display windows. Command selection (if any) stands for instant display window indices instead of image indices. \fBDefault value\fR: '\fBmode=1\fR'. \fBdelete (+):\fR filename1[,filename2,...]\fR Delete specified files or directories on disk. Multiple filenames must be separated by commas. \fBd:\fR Shortcut for command '\fBdisplay\fR'. \fBdisplay:\fR Display selected images in an interactive window. (equivalent to shortcut command '\fBd\fR'). When invoked with a '\fB+\fR' prefix (i.e. '\fB+display\fR'), the command outputs its log messages on '\fBstdout\fR' rather than on '\fBstderr\fR'. Display window #0 is used as the default window for the display, if already opened. Available controls are shown below (where '\fBLMB\fR' = Left mouse button, '\fBRMB\fR' = Right mouse button, '\fBMMB\fR' = Middle mouse button and '\fBMW\fR' = Mouse wheel). * \fBThumbnail navigation bar:\fR '\fBTAB\fR': Show/hide thumbnails - '\fBLMB\fR': Select thumbnail or shift thumbnail bar - '\fB0\fR'-'\fB9\fR','\fBARROWS\fR' (optionally '\fB+SHIFT\fR'),'\fBB\fR','\fBBACKSPACE\fR','\fBC\fR','\fBE\fR','\fBEND\fR','\fBH\fR','\fBHOME\fR','\fBSPACE\fR': Navigate and select thumbnails (add '\fBCTRL\fR' if mouse pointer is outside thumbnail bar). * \fBImage view:\fR '\fBLMB\fR' or '\fBMMB\fR': Image pan - '\fBRMB\fR' or '\fBMW\fR': Image zoom - '\fBARROWS\fR' (optionally '\fB+SHIFT\fR'),'\fBHOME\fR','\fBEND\fR': Shift view - '\fBA\fR': Switch alpha rendering - '\fBC\fR': Center view - '\fBE\fR': Go to lower-right corner - '\fBRETURN\fR': Reset view - '\fBG\fR': Toggle grid - '\fBH\fR': Go to upper-left corner - '\fBK\fR': Switch background - '\fBM\fR': Toggle 3D view - '\fBN\fR': Switch normalization - '\fBP\fR': Print info about current image pixel on '\fBstdout\fR' - '\fBPAGEUP\fR' or '\fBPAGEDOWN\fR': Raise/lower base channel - '\fBR\fR': Rotate image - '\fBT\fR': Plot as a 1D curve - '\fBV\fR': Crop image - '\fBZ\fR': Switch zoom factor - '\fB0\fR'-'\fB9\fR': Set zoom factor. * \fB3D mesh view:\fR '\fBLMB\fR': Mesh rotation - '\fBCTRL+LMB\fR' or '\fBMMB\fR': Mesh pan - '\fBRMB\fR': Mesh zoom - '\fBA\fR': Toggle axes - '\fBD\fR': Switch face side mode - '\fBF\fR': Change focal length - '\fBJ\fR': Start/stop animation - '\fBK\fR': Switch background - '\fBO\fR': Switch outline mode - '\fBP\fR': Print 3D pose matrix on '\fBstdout\fR' - '\fBR\fR': Switch rendering mode - '\fBT\fR': Switch motion rendering mode - '\fBX\fR': Show/hide bounding-box - '\fBU\fR': Switch animation mode - '\fBZ\fR': Toggle z-buffer. * \fB2D images specific:\fR '\fBCTRL+LMB\fR': Rectangular selection. * \fB3D volumetric images specific:\fR '\fBCTRL+MW\fR': Pan along orthogonal axis - '\fBX\fR': Reset area layout. * \fBWindow size, decoration and data I/O:\fR '\fBCTRL+C\fR': Decrease window size - '\fBCTRL+D\fR': Increase window size - '\fBCTRL+F\fR': Toggle fullscreen - '\fBCTRL+I\fR': Toggle info label - '\fBCTRL+O\fR': Save copy of image as a '.gmz\fR' file - '\fBCTRL+L\fR': Save copy of image list as '.gmz\fR' file - '\fBCTRL+S\fR': Save screenshot as a '.png\fR' file - '\fBCTRL+W\fR': Start/stop window recording - '\fBCTRL+X\fR': Toggle cursor. * \fBConfiguration variables:\fR The viewer configuration can be tuned by assigning the following variables: - '\fB_display_selected\fR' is an integer or an image name that tells which image is selected by default. - '\fB_display_alpha\fR' can be \fB{ 0:Off | 1:On | 2:Over black | 3:Over gray | 4:Over white }\fR (default value: '\fB0\fR'). - '\fB_display_background\fR', an integer in range [ 0,9 ] (default value: '\fB3\fR'). - '\fB_display_cursor\fR' can be \fB{ 0:Off | 1:On (2D only) | 2:On (+3D volumetric images) }\fR (default value: '\fB1\fR'). - '\fB_display_is_grid\fR' can be \fB{ 0:Off | 1:On }\fR (default value: '\fB1\fR'). - '\fB_display_is_info\fR' can be \fB{ 0:Off | 1:On }\fR (default value: '\fB1\fR'). - '\fB_display_normalization\fR' can be \fB{ -1:Auto | 0:Off | 1:Cut | 2:Stretch channelwise | 3:Stretch global | 4: stretch (global-once) }\fR (default value: '\fB-1\fR'). - '\fB_display_print_images\fR' can be \fB{ 0:Off | N>0 }\fR (default value: '\fB5\fR'). It sets the max number '\fBN\fR' of images whose information is initially printed on 'stderr\fR' or 'stdout\fR'. - '\fB_display_3d_is_rendered\fR' can be \fB{ 0:Off | 1:On }\fR (default value: '\fB1\fR'). - '\fB_display_3d_rendering_mode\fR' can be \fB{ 0:Dots | 1:Wireframe | 2:Flat | 3:Flat-shaded | 4:Gouraud-shaded | 5=Phong-shaded }\fR (default value: '\fB4\fR'). - '\fB_display_3d_outline_mode\fR' can be \fB{ 0:No-outline | 1:Black-outline | 2:Gray-outline | 3:Red-outline | 4:Green-outline | 5:Blue-outline | 6:White-outline }\fR (default value: '\fB0\fR'). - '\fB_display_3d_motion_rendering_mode\fR' can be \fB{ -1:Bounding-box | 0:Dots | 1:Wireframe | 2:Flat | 3:Flat-shaded | 4:Gouraud-shaded | 5=Phong-shaded }\fR (default value: '\fB3\fR'). - '\fB_display_3d_motion_time_limit\fR' is specified in ms. Above this time, motion rendering toggle to '\fBbounding-box\fR' mode (default value: '\fB300\fR'). - '\fB_display_3d_side_mode\fR' can be \fB{ 0:Single-sided | 1:Double-sided | 2:Single-sided (flipped) }\fR (default value: '\fB0\fR'). - '\fB_display_3d_is_zbuffer\fR' can be \fB{ 0:Off | 1:On }\fR (default value: '\fB1\fR'). - '\fB_display_3d_focal\fR' can be \fB{ <0:Perspective projection w/o sprite zooming, 0:Parallel projection | >0:Perspective projection }\fR (default value: 1.5). - '\fB_display_3d_is_axes\fR' can be \fB{ 0:Off | 1:On }\fR (default value: '\fB1\fR'). - '\fB_display_3d_is_bounding_box\fR' can be \fB{ 0:Off | 1:On }\fR (default value: '\fB0\fR'). - '\fB_display_3d_background\fR' is an unsigned integer in range [0,11] (default value: '\fB11\fR'). - '\fB_display_3d_pose\fR' is a sequence of 12 values that defines the current 3D pose matrix (read/write). - '\fB_display_3d_animation\fR' can be \fB{ 0:Off | 1:Forward | 2:Backward }\fR (default value: '\fB0\fR'). - '\fB_display_3d_animation_mode\fR' can be \fB{ 0-3:X-axis | 4-7:Y-axis | 8-11:Z-axis | 12-15:XYZ-axes }\fR (default value: '\fB4\fR'). \fBd0:\fR Shortcut for command '\fBdisplay0\fR'. \fBdisplay0:\fR Display selected images in an interactive window, without normalization and alpha mode enabled. \fBda:\fR Shortcut for command '\fBdisplay_array\fR'. \fBdisplay_array:\fR _width>0,_height>0\fR Display images in interactive windows where pixel neighborhoods can be explored. \fBDefault values\fR: '\fBwidth=13\fR' and '\fBheight=width\fR'. \fBdc:\fR Shortcut for command '\fBdisplay_camera\fR'. \fBdisplay_camera:\fR Open camera viewer. This command requires features from the OpenCV library (not enabled in G'MIC\fR by default). \fBdclut:\fR Shortcut for command '\fBdisplay_clut\fR'. \fBdisplay_clut:\fR _image_resolution>0,_clut_resolution>0\fR Display selected 3D color LUTs. \fBDefault values\fR: '\fBimage_resolution=320\fR' and '\fBclut_resolution=33\fR'. \fBExample:\fR [#1] clut tealorange clut summer clut 60s display_clut 400\fR \fBdfft:\fR Shortcut for command '\fBdisplay_fft\fR'. \fBdisplay_fft:\fR Display fourier transform of selected images, with centered log-module and argument. (equivalent to shortcut command '\fBdfft\fR'). \fBExample:\fR [#1] image.jpg +display_fft\fR \fBdg:\fR Shortcut for command '\fBdisplay_graph\fR'. \fBdisplay_graph:\fR _width>=0,_height>=0,_plot_type,_vertex_type,_xmin,_xmax,_ymin,_ymax,_xlabel,_ylabel,_frame_size>=0\fR Render graph plot from selected image data. '\fBplot_type\fR' can be \fB{ 0:None | 1:Lines | 2:Splines | 3:Bar }\fR. '\fBvertex_type\fR' can be \fB{ 0:None | 1:Points | 2,3:Crosses | 4,5:Circles | 6,7:Squares }\fR. '\fBxmin\fR','\fBxmax\fR','\fBymin\fR','\fBymax\fR' set the coordinates of the displayed xy-axes. If specified '\fBwidth\fR' or '\fBheight\fR' is '\fB0\fR', then image size is set to half the screen size. \fBDefault values\fR: '\fBwidth=0\fR', '\fBheight=0\fR', '\fBplot_type=1\fR', '\fBvertex_type=1\fR', '\fBxmin=xmax=ymin=ymax=0 (auto)\fR', '\fBxlabel="x-axis"\fR', '\fBylabel="y-axis"\fR' and '\fBframe_size=32\fR'. \fBExample:\fR [#1] 128,1,1,1,'cos(x/10+u)' +display_graph 400,300,3\fR \fBdh:\fR Shortcut for command '\fBdisplay_histogram\fR'. \fBdisplay_histogram:\fR _width>=0,_height>=0,_clusters>0,_min_value[%],_max_value[%],_show_axes={ 0:No | 1:Yes },_expression.\fR Render a channel-by-channel histogram. If selected images have several slices, the rendering is performed for all input slices. '\fBexpression\fR' is a mathematical expression used to transform the histogram data for visualization purpose. (equivalent to shortcut command '\fBdh\fR'). If specified '\fBwidth\fR' or '\fBheight\fR' is '\fB0\fR', then image size is set to half the screen size. \fBDefault values\fR: '\fBwidth=0\fR', '\fBheight=0\fR', '\fBclusters=256\fR', '\fBmin_value=0%\fR', '\fBmax_value=100%\fR', '\fBshow_axes=1\fR' and '\fBexpression=i\fR'. \fBExample:\fR [#1] image.jpg +display_histogram 512,300\fR \fBdisplay_parametric:\fR _width>0,_height>0,_outline_opacity,_vertex_radius>=0,_is_antialiased={ 0:No | 1:Yes },_is_decorated={ 0:No | 1:Yes },_xlabel,_ylabel\fR Render 2D or 3D parametric curve or point clouds from selected image data. Curve points are defined as pixels of a 2 or 3-channel image. If the point image contains more than 3 channels, additional channels define the (R,G,B) color for each vertex. If '\fBoutline_opacity>1\fR', the outline is colored according to the specified vertex colors and '\fBoutline_opacity-1\fR' is used as the actual drawing opacity. \fBDefault values\fR: '\fBwidth=512\fR', '\fBheight=width\fR', '\fBoutline_opacity=3\fR', '\fBvertex_radius=0\fR', '\fBis_antialiased=1\fR', '\fBis_decorated=1\fR', '\fBxlabel="x-axis"\fR' and '\fBylabel="y-axis"\fR'. \fBExample:\fR [#1] 1024,1,1,2,'t=x/40;(!c?sin(t):cos(t))*(exp(cos(t))-2*cos(4*t)-sin(t/12)^5)' display_parametric 512,512\fR [#2] 1000,1,1,2,u(-100,100) quantize 4,1 noise 12 channels 0,2 +normalize 0,255 append c display_parametric 512,512,0.1,8\fR \fBdisplay_polar:\fR _width>32,_height>32,_outline_type,_fill_R,_fill_G,_fill_B,_theta_start,_theta_end,_xlabel,_ylabel\fR Render polar curve from selected image data. '\fBoutline_type\fR' can be \fB{ r<0:Dots with radius -r | 0:No outline | r>0:Lines+dots with radius r }\fR. '\fBfill_color\fR' can be \fB{ -1:No fill | R,G,B:Fill with specified color }\fR. \fBDefault values\fR: '\fBwidth=500\fR', '\fBheight=width\fR', '\fBoutline_type=1\fR', '\fBfill_R=fill_G=fill_B=200\fR', '\fBtheta_start=0\fR', '\fBtheta_end=360\fR', '\fBxlabel="x-axis"\fR' and '\fBylabel="y-axis"\fR'. \fBExample:\fR [#1] 300,1,1,1,'0.3+abs(cos(10*pi*x/w))+u(0.4)' display_polar 512,512,4,200,255,200\fR [#2] 3000,1,1,1,'x^3/1e10' display_polar 400,400,1,-1,,,0,{15*360}\fR \fBdq:\fR Shortcut for command '\fBdisplay_quiver\fR'. \fBdisplay_quiver:\fR _size_factor>0,_arrow_size>=0,_color_mode={ 0:Monochrome | 1:Grayscale | 2:Color }\fR Render selected images of 2D vectors as a field of 2D arrows. (equivalent to shortcut command '\fBdq\fR'). \fBDefault values\fR: '\fBsize_factor=16\fR', '\fBarrow_size=1.5\fR' and '\fBcolor_mode=1\fR'. \fBExample:\fR [#1] image.jpg +luminance gradient[-1] xy rv[-2,-1] *[-2] -1 a[-2,-1] c crop 60,10,90,30 +display_quiver[1] ,\fR \fBdrgba:\fR Shortcut for command '\fBdisplay_rgba\fR'. \fBdisplay_rgba:\fR _background_RGB_color\fR Render selected RGBA images over a checkerboard or colored background. (equivalent to shortcut command '\fBdrgba\fR'). \fBDefault values\fR: '\fBbackground_RGB_color=undefined\fR' (checkerboard). \fBExample:\fR [#1] image.jpg +norm threshold[-1] 40% blur[-1] 3 normalize[-1] 0,255 append c display_rgba\fR \fBdt:\fR Shortcut for command '\fBdisplay_tensors\fR'. \fBdisplay_tensors:\fR _size_factor>0,_ellipse_size>=0,_color_mode={ 0:Monochrome | 1:Grayscale | 2:Color },_outline>=0\fR Render selected images of tensors as a field of 2D ellipses. (equivalent to shortcut command '\fBdt\fR'). \fBDefault values\fR: '\fBsize_factor=16\fR', '\fBellipse_size=1.5\fR', '\fBcolor_mode=2\fR' and '\fBoutline=2\fR'. \fBExample:\fR [#1] image.jpg +diffusiontensors 0.1,0.9 rescale2d. 64 +display_tensors. 16,2\fR \fBTutorial: \fR\fIhttps://gmic.eu/oldtutorial/_display_tensors\fR \fBdv3d:\fR Shortcut for command '\fBdisplay_voxels3d\fR'. \fBdisplay_voxels3d:\fR Display selected images as set of 3D voxels. (equivalent to shortcut command '\fBdv3d\fR'). \fBdw:\fR Shortcut for command '\fBdisplay_warp\fR'. \fBdisplay_warp:\fR _cell_size>0\fR Render selected 2D warping fields. (equivalent to shortcut command '\fBdw\fR'). \fBDefault value\fR: '\fBcell_size=15\fR'. \fBExample:\fR [#1] 400,400,1,2,'x=x-w/2;y=y-h/2;r=sqrt(x*x+y*y);a=atan2(y,x);5*sin(r/10)*[cos(a),sin(a)]' +display_warp 10\fR \fBe (+):\fR Shortcut for command '\fBecho\fR'. \fBecho (+):\fR message\fR Output specified message on the error output. (equivalent to shortcut command '\fBe\fR'). Command selection (if any) stands for displayed call stack subset instead of image indices. When invoked with a '\fB+\fR' prefix (i.e. '\fB+echo\fR'), the command output its message on stdout rather than stderr. \fBecho_file:\fR filename,message\fR Output specified message, appending it to specified output file. (similar to '\fBecho\fR' for specified output file stream). \fBfont:\fR { 'Font_name' | font_number | font.gmz },_font_height[%]>0,_is_bold={ 0:No | 1:Yes }\fR Return font identifier (variable name) that can be further used in command 'text\fR' as a custom font. '\fBFont name\fR' can be \fB{ Acme | Arial | ArialBlack | BlackOpsOne | BlackChancery | CabinSketch | Caprasimo | CarnevaleeFreakshow | CheeseBurger | Cheque | ChequeBlack | Chlorinar | ComicSansMS | CourierNew | Creepster | Georgia | Hidayatullah | Impact | Jaro | Lobster | LuckiestGuy | Macondo | MedievalSharp | OdinRounded | Oswald | PalatinoLinotype | PlayfairDisplay | Roboto | Satisfy | Sofia | SundayMilk | TexGyreAdventor | TimesNewRoman | TitanOne | Typewriter | Verdana }\fR. If a filename '\fBfont.gmz\fR' is specified, it must be a file converted with command 'font2gmz\fR'. \fBDefault values\fR: '\fBfont_height=64\fR' and '\fBis_bold=0\fR'. \fBExample:\fR [#1] 400,300,1,3 text "Hello World!",0.5~,0.5~,${"font \"Cheese Burger\",80"},1,255,255,128\fR \fBfont2gmz:\fR _font_name,_font_size>0,_font_qualifier\fR Convert specified font to G'MIC\fR format, so that it can be used as a custom font for command 'text\fR'. '\fBfont_name\fR' can be either a filename as '\fBfont.ttf\fR', or a '\fBGoogle Font Name\fR'. This command requires the command line tool 'cutycapt\fR' to be installed on your system. \fBBeware:\fR '\fBfont_size\fR' is the size of font used for the rendering, it does \fBnot\fR correspond to the font height. \fBDefault values\fR: '\fBfont_name=Sofia\fR', '\fBfont_size=24\fR' and '\fBfont_qualifier=""\fR'. \fBfunction1d:\fR 0<=smoothness<=1,x0>=0,y0,x1>=0,y1,...,xn>=0,yn\fR Insert continuous 1D spline function from specified list of keypoints (xk,yk) in range [0,max(xk)] (xk are positive integers). \fBExample:\fR [#1] function1d 1,0,0,10,30,40,20,70,30,80,0 +display_graph 400,300\fR \fBidentity:\fR _width>=0,_height>=0,_depth>=0\fR Insert an identity map of given size at the end of the image list. \fBDefault values\fR: '\fBheight=width\fR' and '\fBdepth=1\fR'. \fBExample:\fR [#1] identity 5,1 identity 8,8\fR \fBi (+):\fR Shortcut for command '\fBinput\fR'. \fBinput (+):\fR [type:]filename |\fR [type:]http://URL |\fR [selection]x_nb_copies>0 |\fR { width[%]>0 | [image_w] },{ _height[%]>0 | [image_h] },{ _depth[%]>0 | [image_d] },{ _spectrum[%]>0 | [image_s] },_{ value1,_value2,... | 'formula' } |\fR (value1{,|;|/|^}value2{,|;|/|^}...[:{x|y|z|c|,|;|/|^}]) |\fR 0\fR Insert a new image taken from a filename or from a copy of an existing image [index], or insert new image with specified dimensions and values. Single quotes may be omitted in '\fBformula\fR'. Specifying argument '\fB0\fR' inserts an '\fBempty\fR' image. (equivalent to shortcut command '\fBi\fR'). \fBDefault values\fR: '\fBnb_copies=1\fR', '\fBheight=depth=spectrum=1\fR' and '\fBvalue1=0\fR'. \fBExample:\fR [#1] input image.jpg\fR [#2] input (1,2,3;4,5,6;7,8,9^9,8,7;6,5,4;3,2,1)\fR [#3] image.jpg (1,2,3;4,5,6;7,8,9) (255^128^64) 400,400,1,3,'(x>w/2?x:y)*c'\fR \fBTutorial: \fR\fIhttps://gmic.eu/tutorial/input\fR \fBinput_565:\fR filename,width>0,height>0,reverse_endianness={ 0:No | 1:Yes }\fR Insert image data from a raw RGB-565 file, at the end in the list. \fBDefault value\fR: '\fBreverse_endianness=0\fR'. \fBib:\fR Shortcut for command '\fBinput_bytes\fR'. \fBinput_bytes:\fR filename\fR Input specified filename as a 1D array of bytes. (equivalent to shortcut command '\fBib\fR'). \fBinput_csv:\fR "filename",_delimiter,_read_data_as={ 0:Numbers | 1:Strings }\fR Insert array of strings or numbers, read from specified .csv file. A '\fBWxH\fR' image is inserted at the end in the list, with each vector-valued pixel '\fBI(x,y)\fR' encoding the content (number or string) of each cell. \fBDefault values\fR: '\fBdelimiter=,\fR' and '\fBread_data_as=1\fR'. \fBinput_cube:\fR "filename",_convert_1d_cluts_to_3d={ 0:No | 1:Yes }.\fR Insert CLUT data from a .cube filename (Adobe CLUT file format). \fBDefault value\fR: '\fBconvert_1d_cluts_to_3d=0\fR'. \fBinput_flo:\fR "filename"\fR Insert optical flow data from a .flo filename (vision.middlebury.edu file format). \fBig:\fR Shortcut for command '\fBinput_glob\fR'. \fBinput_glob:\fR pattern\fR Insert new images from several filenames that match the specified glob pattern. (equivalent to shortcut command '\fBig\fR'). \fBinput_gpl:\fR filename\fR Input specified filename as a .gpl palette data file. \fBinput_cached:\fR "basename.ext",_downloading_from_gmic_server\fR Input specified filename, assumed to be stored in one of the G'MIC\fR resource folder. If file not found and '\fBtry_downloading=1\fR', file is downloaded from the G'MIC\fR server and stored in the '\fB${-path_cache}\fR' folder. This command returns the full path to the corresponding file. '\fBdownloading_from_gmic_server\fR' can be \fB{ 0:No | 1:Yes, if file not found | 2:Yes, if file not in regular cache folder }\fR. \fBDefault value\fR: '\fBtry_downloading_from_gmic_server=1\fR'. \fBin:\fR Shortcut for command '\fBinput_normalized\fR'. \fBinput_normalized:\fR filename\fR Input specified filename and constrain its value range to be in [0,255]. (equivalent to shortcut command '\fBin\fR'). \fBinput_obj:\fR filename\fR Input specified 3D mesh from a .obj Wavefront file. \fBit:\fR Shortcut for command '\fBinput_text\fR'. \fBinput_text:\fR filename\fR Input specified text-data filename as a new image. (equivalent to shortcut command '\fBit\fR'). \fBlorem:\fR _width>0,_height>0\fR Input random image of specified size, retrieved from Internet. \fBDefault values\fR: '\fBwidth=height=800\fR'. \fBnetwork (+):\fR mode={ -1=Disabled | 0:Enabled w/o timeout | >0:Enabled w/ specified timeout in seconds }\fR Enable/disable load-from-network and set corresponding timeout. (Default mode is '\fBenabled w/o timeout\fR'). \fBo (+):\fR Shortcut for command '\fBoutput\fR'. \fBoutput (+):\fR [type:]filename,_format_options\fR Output selected images as one or several numbered file(s). (equivalent to shortcut command '\fBo\fR'). \fBDefault value\fR: 'format_options'=(undefined). \fBoutput_565:\fR "filename",reverse_endianness={ 0:No | 1:Yes }\fR Output selected images as raw RGB-565 files. \fBDefault value\fR: '\fBreverse_endianness=0\fR'. \fBoutput_csv:\fR "filename",_delimiter,_write_data_as={ 0:Numbers | 1:Strings }\fR Output selected ascii-encoded arrays as .csv files. \fBDefault values\fR: '\fBdelimiter=,\fR' and '\fBwrite_data_as=1\fR'. \fBoutput_cube:\fR "filename"\fR Output selected CLUTs as .cube files (Adobe CLUT format). \fBoutput_flo:\fR "filename"\fR Output selected optical flow as a .flo file (vision.middlebury.edu file format). \fBoutput_ggr:\fR filename,_gradient_name\fR Output selected images as .ggr gradient files (GIMP). If no gradient name is specified, it is deduced from the filename. \fBoutput_gmz:\fR filename,_datatype\fR Output selected images as .gmz files (G'MIC\fR native file format). '\fBdatatype\fR' can be \fB{ bool | uint8 | int8 | uint16 | int16 | uint32 | int32 | uint64 | int64 | float32 | float64 }\fR. \fBoutput_obj:\fR filename,_save_materials={ 0:No | 1:Yes }\fR Output selected 3D meshes as Wavefront 3D object files. Set '\fBsave_materials\fR' to '\fB1\fR' to produce a corresponding material file ('.mtl\fR') and possibly texture files. \fBBeware:\fR, the export to '.obj\fR' files may be quite slow for large 3D objects. \fBDefault value\fR: '\fBsave_materials=1\fR'. \fBot:\fR Shortcut for command '\fBoutput_text\fR'. \fBoutput_text:\fR filename\fR Output selected images as text-data filenames. (equivalent to shortcut command '\fBot\fR'). \fBon:\fR Shortcut for command '\fBoutputn\fR'. \fBoutputn:\fR filename,_index\fR Output selected images as automatically numbered filenames in repeat...done loops. (equivalent to shortcut command '\fBon\fR'). \fBop:\fR Shortcut for command '\fBoutputp\fR'. \fBoutputp:\fR prefix\fR Output selected images as prefixed versions of their original filenames. (equivalent to shortcut command '\fBop\fR'). \fBDefault value\fR: '\fBprefix=_\fR'. \fBow:\fR Shortcut for command '\fBoutputw\fR'. \fBoutputw:\fR Output selected images by overwriting their original location. (equivalent to shortcut command '\fBow\fR'). \fBox:\fR Shortcut for command '\fBoutputx\fR'. \fBoutputx:\fR extension1,_extension2,_...,_extensionN,_output_at_same_location={ 0:No | 1:Yes }\fR Output selected images with same base filenames but for N different extensions. (equivalent to shortcut command '\fBox\fR'). \fBDefault value\fR: '\fBoutput_at_same_location=0\fR'. \fBparse_cli:\fR _output_mode,_{ * | command_name }\fR Parse definition of '\fB@cli\fR'-documented commands and output info about them in specified output mode. '\fBoutput_mode\fR' can be \fB{ ascii | bashcompletion | html | images | print }\fR. \fBDefault values\fR: '\fBoutput_mode=print\fR' and '\fBcommand_name=*\fR'. \fBparse_gmd:\fR Parse and tokenize selected images, viewed as text strings formatted with the G'MIC\fR markdown syntax. \fBgmd2html:\fR _include_default_header_footer={ 0:None | 1:Reference | 2:Tutorial | 3:News } |\fR (no arg)\fR Convert selected gmd-formatted text images to html format. \fBDefault values\fR: '\fBinclude_default_header_footer=1\fR'. \fBgmd2ascii:\fR _max_line_length>0,_indent_forced_newlines>=0 |\fR (no arg)\fR Convert selected gmd-formatted text images to ascii format. \fBDefault values\fR: '\fBmax_line_length=80\fR' and '\fBindent_forced_newline=0\fR'. \fBparse_gui:\fR _outputmode,_{ * | filter_name}\fR Parse selected filter definitions and generate info about filters in selected output mode. '\fBoutputmode\fR' can be \fB{ gmicol | images | json | list | print | strings | update | zart }\fR. It is possible to define a custom output mode, by implementing the following commands ('\fBoutputmode\fR' must be replaced by the name of the custom user output mode): . '\fBparse_gui_outputmode\fR' : A command that outputs the parsing information with a custom format. . '\fBparse_gui_parseparams_outputmode\fR' (optional): A simple command that returns 0 or 1. It tells the parser whether parameters of matching filter must be analyzed (slower). . '\fBparse_gui_trigger_outputmode\fR' (optional): A command that is called by the parser just before parsing the set of each matching filters. Here is the list of global variables set by the parser, accessible in command '\fBparse_gui_outputmode\fR': '\fB$_nb_filters\fR': Number of matching filters. '\fB$_nongui\fR' (stored as an image): All merged lines in the file that do not correspond to '\fB#@gui\fR' lines. For each filter '\#F\fR' ('\fBF\fR' in range '[0,$_nb_filters-1]\fR'): * '\fB$_fF_name\fR' : Filter name. * '\fB$_fF_path\fR' : Full path. * '\fB$_fF_locale\fR' : Filter locale (empty, if not specified). * '\fB$_fF_command\fR' : Filter command. * '\fB$_fF_command_preview\fR' : Filter preview command (empty, if not specified). * '\fB$_fF_zoom_factor\fR' : Default zoom factor (empty, if not specified). * '\fB$_fF_preview_accuracy\fR' : Preview accuracy (can be \fB{ 0:Does not support zoom in/out | 1:Support zoom in/out | 2:Pixel-perfect }\fR). * '\fB$_fF_input_mode\fR' : Default preferred input mode (empty, if not specified). * '\fB$_fF_hide\fR' : Path of filter hidden by current filter (for localized filters, empty if not specified). * '\fB$_fF_nb_params\fR' : Number of parameters. For each parameter '\#P\fR' of the filter #F ('\fBP\fR' in range '[0,$_fF_nb_params-1]\fR'): * '\fB$_fF_pP_name\fR' : Parameter name. * '\fB$_fF_pP_type\fR' : Parameter type. * '\fB$_fF_pP_responsivity\fR' : Parameter responsivity (can be \fB{ 0:No | 1:Yes }\fR). * '\fB$_fF_pP_randomizable\fR' : Randomizable property of the parameter (can be \fB{ 0:No | 1:Yes }\fR). * '\fB$_fF_pP_visibility\fR' : Parameter visibility. * '\fB$_fF_pP_propagation\fR' : Propagation of the parameter visibility. * '\fB$_fF_pP_nb_args\fR' : Number of parameter arguments. For each argument '\#A\fR' of the parameter #P ('\fBA\fR' in range '[0,$_fF_pP_nb_args-1]\fR'): * '\fB$_fF_pP_aA\fR' : Argument value Default parameters: '\fBfilter_name=*\fR' and '\fBoutput_format=print\fR'. \fBpass (+):\fR _shared_state={ -1:Status only | 0:Non-shared (copy) | 1:Shared | 2:Adaptive }\fR Insert images from parent context of a custom command or a local environment. Command selection (if any) stands for a selection of images in the parent context. By default (adaptive shared state), selected images are inserted in a shared state if they do not belong to the context (selection) of the current custom command or local environment as well. Typical use of command '\fBpass\fR' concerns the design of custom commands that take images as arguments. This commands returns the list of corresponding indices in the status. \fBDefault value\fR: '\fBshared_state=2\fR'. \fBExample:\fR [#1] command "average : pass$""1 add[^-1] [-1] remove[-1] div 2" sample ? +mirror y +average[0] [1]\fR \fBplot:\fR _plot_type,_vertex_type,_xmin,_xmax,_ymin,_ymax,_exit_on_anykey={ 0:No | 1:Yes }\fR Display selected images or formula in an interactive viewer (use the instant display window [0] if opened). '\fBplot_type\fR' can be \fB{ 0:None | 1:Lines | 2:Splines | 3:Bar }\fR. '\fBvertex_type\fR' can be \fB{ 0:None | 1:Points | 2,3:Crosses | 4,5:Circles | 6,7:Squares }\fR. '\fBxmin\fR', '\fBxmax\fR', '\fBymin\fR', '\fBymax\fR' set the coordinates of the displayed xy-axes. \fBDefault values\fR: '\fBplot_type=1\fR', '\fBvertex_type=1\fR', '\fBxmin=xmax=ymin=ymax=0 (auto)\fR' and '\fBexit_on_anykey=0\fR'. \fBpoincare_disk:\fR _size>=0,_p>2,_q>2,_angle,_tiling={ 0:Triangular | 1:Polygonal },_nb_max_iter>=0,_xmin,_ymin,_xmax,_ymax\fR Return a 3-channels image of a poincare disk. Output channels are '\fB[x,y,it]\fR'. \fBDefault values\fR: '\fBsize=1024\fR', '\fBp=5\fR', '\fBq=3\fR', '\fBangle=0\fR', '\fBtiling=0\fR', '\fBnb_max_iter=20\fR', '\fBxmin=ymin=-1\fR' and '\fBxmax=ymax=1\fR'. \fBExample:\fR [#1] repeat 4 { poincare_disk 1024,{3+$>} channels[-1] 2 mod[-1] 3 neq[-1] 2 } rescale2d 50%\fR \fBportrait:\fR _size>0\fR Input random portrait image of specified size, retrieved from Internet. \fBDefault values\fR: '\fBsize=800\fR'. \fBp:\fR Shortcut for command '\fBprint\fR'. \fBprint:\fR Print information on selected images, on the standard error (stderr). (equivalent to shortcut command '\fBp\fR'). When invoked with a '\fB+\fR' prefix (i.e. '\fB+print\fR'), the command outputs on '\fBstdout\fR' rather than on '\fBstderr\fR'. \fBrandom_patches:\fR _nb_patches>0,_patch_size>0\fR Generate a set of square color patches containing random geometric shapes, returned as a volumetric image. \fBDefault values\fR: '\fBnb_patches=16\fR' and '\fBpatch_size=64\fR'. \fBExample:\fR [#1] random_patches 16,64 split z append_tiles ,\fR \fBrandom_pattern:\fR _width>0,_height>0,_min_detail_level>=0\fR Insert a new RGB image of specified size at the end of the image list, rendered with a random pattern. \fBDefault values\fR: '\fBwidth=height=512\fR' and '\fBmin_detail_level=2\fR'. \fBExample:\fR [#1] repeat 6 { random_pattern 256 }\fR \fBscreen (+):\fR _x0[%],_y0[%],_x1[%],_y1[%]\fR Take screenshot, optionally grabbed with specified coordinates, and insert it at the end of the image list. \fBselect:\fR feature_type,_X[%]>=0,_Y[%]>=0,_Z[%]>=0,_exit_on_anykey={ 0:No | 1:Yes },_is_multiaxes_selection={ 0:No | 1:Yes }\fR Interactively select a feature from selected images (use the instant display window [0] if opened). '\fBfeature_type\fR' can be \fB{ 0:Point | 1:Segment | 2:Rectangle | 3:Ellipse }\fR. Arguments '\fBX\fR','\fBY\fR','\fBZ\fR' determine the initial selection view, for 3D volumetric images. The retrieved feature is returned as a 3D vector (if '\fBfeature_type==0\fR') or as a 6d vector (if '\fBfeature_type!=0\fR') containing the feature coordinates. \fBDefault values\fR: '\fBfeature_type=2\fR', '\fBX=Y=Z=50%\fR', '\fBexit_on_anykey=0\fR' and '\fBis_multiaxes_selection=1\fR'. \fBserialize (+):\fR _datatype,_is_compressed={ 0:No | 1:Yes },_store_names={ 0:No | 1:Yes }\fR Serialize selected list of images into a single image, optionally in a compressed form. '\fBdatatype\fR' can be \fB{ auto | uint8 | int8 | uint16 | int16 | uint32 | int32 | uint64 | int64 | float32 | float64 }\fR. Specify '\fBdatatype\fR' if all selected images have a range of values constrained to a particular datatype, in order to minimize the memory footprint. The resulting image has only integers values in [0,255] and can then be saved as a raw image of unsigned chars (doing so will output a valid .cimg[z] or .gmz file). If '\fBstore_names\fR' is set to '\fB1\fR', serialization uses the .gmz format to store data in memory (otherwise the .cimg[z] format). \fBDefault values\fR: '\fBdatatype=auto\fR', '\fBis_compressed=1\fR' and '\fBstore_names=1\fR'. \fBExample:\fR [#1] image.jpg +serialize uint8 +unserialize[-1]\fR \fBshape_circle:\fR _size>=0\fR Input a 2D circle binary shape with specified size. \fBDefault value\fR: '\fBsize=512\fR'. \fBExample:\fR [#1] shape_circle ,\fR \fBshape_cupid:\fR _size>=0\fR Input a 2D cupid binary shape with specified size. \fBDefault value\fR: '\fBsize=512\fR'. \fBExample:\fR [#1] shape_cupid ,\fR \fBshape_diamond:\fR _size>=0\fR Input a 2D diamond binary shape with specified size. \fBDefault value\fR: '\fBsize=512\fR'. \fBExample:\fR [#1] shape_diamond ,\fR \fBshape_dragon:\fR _size>=0,_recursion_level>=0,_angle\fR Input a 2D Dragon curve with specified size. \fBDefault value\fR: '\fBsize=512\fR', '\fBrecursion_level=18\fR' and '\fBangle=0\fR'. \fBExample:\fR [#1] shape_dragon ,\fR \fBshape_fern:\fR _size>=0,_density[%]>=0,_angle,0<=_opacity<=1,_type={ 0:Asplenium adiantum-nigrum | 1:Thelypteridaceae }\fR Input a 2D Barnsley fern with specified size. \fBDefault value\fR: '\fBsize=512\fR', '\fBdensity=50%\fR', '\fBangle=30\fR', '\fBopacity=0.3\fR' and '\fBtype=0\fR'. \fBExample:\fR [#1] shape_fern ,\fR \fBshape_gear:\fR _size>=0,_nb_teeth>0,0<=_height_teeth<=100,0<=_offset_teeth<=100,0<=_inner_radius<=100\fR Input a 2D gear binary shape with specified size. \fBDefault value\fR: '\fBsize=512\fR', '\fBnb_teeth=12\fR', '\fBheight_teeth=20\fR', '\fBoffset_teeth=0\fR' and '\fBinner_radius=40\fR'. \fBExample:\fR [#1] shape_gear ,\fR \fBshape_heart:\fR _size>=0\fR Input a 2D heart binary shape with specified size. \fBDefault value\fR: '\fBsize=512\fR'. \fBExample:\fR [#1] shape_heart ,\fR \fBshape_hilbert:\fR _size>=0,_nb_recursions>=0\fR Input a 2D image of the Hilbert curve. \fBDefault values\fR: '\fBsize=512\fR' and '\fBnb_recursions=5\fR'. \fBExample:\fR [#1] shape_hilbert ,\fR \fBshape_menger:\fR _nb_iterations>=0\fR Input a 3D voxelized representation of the Menger sponge. \fBDefault value\fR: '\fBnb_iterations=3\fR'. \fBExample:\fR [#1] shape_menger 4 surfels3d , color3d 200 m3d 3\fR \fBshape_mosely:\fR _nb_iterations>=0\fR Input a 3D voxelized representation of the Mosely snowflake. \fBDefault value\fR: '\fBnb_iterations=3\fR'. \fBExample:\fR [#1] shape_mosely 4 surfels3d , color3d 200 m3d 3\fR \fBshape_peano:\fR _size>=0,_nb_recursions>=0\fR Input a 2D image of the Peano curve. \fBDefault values\fR: '\fBsize=512\fR' and '\fBnb_recursions=3\fR'. \fBExample:\fR [#1] shape_peano ,\fR \fBshape_polygon:\fR _size>=0,_nb_vertices>=3,_angle\fR Input a 2D polygonal binary shape with specified geometry. \fBDefault value\fR: '\fBsize=512\fR', '\fBnb_vertices=5\fR' and '\fBangle=0\fR'. \fBExample:\fR [#1] repeat 6 { shape_polygon 256,{3+$>} }\fR \fBshape_rays:\fR _size>=0,_xcenter[%],_ycenter[%],_branches>0,_angle[%],_twist,0<=_perspective<=1,_is_antialias={ 0:No | 1:Yes }\fR Input a 3D binary spiral with specified size and attributes. \fBDefault values\fR: '\fBsize=512\fR', '\fBxcenter=50%\fR', '\fBycenter=50%\fR', '\fBbranches=7\fR', '\fBangle=50%\fR', '\fBtwist=0\fR', '\fBperspective=0.35\fR' and '\fBis_antialias=0\fR'. \fBExample:\fR [#1] shape_rays 400,50%,50%,7 shape_rays 400,50%,50%,3,0,3\fR \fBshape_snowflake:\fR size>=0,0<=_nb_recursions<=6\fR Input a 2D snowflake binary shape with specified size. \fBDefault values\fR: '\fBsize=512\fR' and '\fBnb_recursions=5\fR'. \fBExample:\fR [#1] repeat 6 { shape_snowflake 256,$> }\fR \fBshape_star:\fR _size>=0,_nb_branches>0,0<=_thickness<=1\fR Input a 2D star binary shape with specified size. \fBDefault values\fR: '\fBsize=512\fR', '\fBnb_branches=5\fR' and '\fBthickness=0.38\fR'. \fBExample:\fR [#1] repeat 9 { shape_star 256,{$>+2} }\fR \fBsh (+):\fR Shortcut for command '\fBshared\fR'. \fBshared (+):\fR x0[%],x1[%],y[%],z[%],c[%] |\fR y0[%],y1[%],z[%],c[%] |\fR z0[%],z1[%],c[%] |\fR c0[%],c1[%] |\fR c0[%] |\fR (no arg)\fR Insert shared buffers from (optionally points/rows/planes/channels of) selected images. Shared buffers cannot be returned by a command, nor a local environment. (equivalent to shortcut command '\fBsh\fR'). \fBExample:\fR [#1] image.jpg shared 1 blur[-1] 3 remove[-1]\fR [#2] image.jpg repeat s { shared 25%,75%,0,$> mirror[-1] x remove[-1] }\fR \fBTutorial: \fR\fIhttps://gmic.eu/oldtutorial/_shared\fR \fBsp:\fR Shortcut for command '\fBsample\fR'. \fBsample:\fR _name1={ ? | apples | balloons | barbara | boats | bottles | butterfly | cameraman | car | cat | cliff | chick | colorful | david | dog | duck | eagle | elephant | earth | flower | fruits | gmicky | gmicky_mahvin | gmicky_wilber | greece | gummy | house | inside | landscape | leaf | lena | leno | lion | mandrill | monalisa | monkey | parrots | pencils | peppers | portrait0 | portrait1 | portrait2 | portrait3 | portrait4 | portrait5 | portrait6 | portrait7 | portrait8 | portrait9 | roddy | rooster | rose | square | swan | teddy | tiger | tulips | wall | waterfall | zelda },_name2,...,_nameN,_width={ >=0 | 0 (auto) },_height = { >=0 | 0 (auto) } |\fR (no arg)\fR Input a new sample RGB image (optionally with specified size). (equivalent to shortcut command '\fBsp\fR'). Argument '\fBname\fR' can be replaced by an integer which serves as a sample index. \fBExample:\fR [#1] repeat 6 { sample }\fR \fBsrand (+):\fR value |\fR (no arg)\fR Set random generator seed. If no argument is specified, a random value is used as the random generator seed. \fBstore (+):\fR _is_compressed={ 0:No | 1:Yes },variable_name1,_variable_name2,...\fR Store selected images into one or several named variables. Selected images are transferred to the variables, and are so removed from the image list. (except if the prepended variant of the command '\fB+store[selection]\fR' is used). If a single variable name is specified, all images of the selection are assigned to the named variable. Otherwise, there must be as many variable names as images in the selection, and each selected image is assigned to each specified named variable. Use command 'input $variable_name\fR' to bring the stored images back in the list. \fBDefault value\fR: '\fBis_compressed=0\fR'. \fBExample:\fR [#1] sample eagle,earth store img1,img2 input $img2 $img1\fR \fBTutorial: \fR\fIhttps://gmic.eu/tutorial/store\fR \fBtestimage2d:\fR _width>0,_height>0,_spectrum>0\fR Input a 2D synthetic image. \fBDefault values\fR: '\fBwidth=512\fR', '\fBheight=width\fR' and '\fBspectrum=3\fR'. \fBExample:\fR [#1] testimage2d 512\fR \fBum:\fR Shortcut for command '\fBuncommand\fR'. \fBuncommand (+):\fR command_name[,_command_name2,...] |\fR *\fR Discard definition of specified custom commands. Set argument to '\fB*\fR' for discarding all existing custom commands. (equivalent to shortcut command '\fBum\fR'). \fBuniform_distribution:\fR nb_levels>=1,spectrum>=1\fR Input set of uniformly distributed spectrum-d points in [0,1]^spectrum. \fBExample:\fR [#1] uniform_distribution 64,3 * 255 +distribution3d circles3d[-1] 10\fR \fBunserialize (+):\fR Recreate lists of images from serialized image buffers, obtained with command '\fBserialize\fR'. \fBup:\fR Shortcut for command '\fBupdate\fR'. \fBupdate:\fR Update commands from the latest definition file on the G'MIC\fR server. (equivalent to shortcut command '\fBup\fR'). \fBv (+):\fR Shortcut for command '\fBverbose\fR'. \fBverbose (+):\fR level |\fR { + | - }\fR Set or increment/decrement the verbosity level. Default level is 0. (equivalent to shortcut command '\fBv\fR'). When '\fBlevel>0\fR', G'MIC\fR log messages are displayed on the standard error (stderr). \fBDefault value\fR: '\fBlevel=1\fR'. \fBwait (+):\fR delay |\fR (no arg)\fR Wait for a given delay (in ms), optionally since the last call to '\fBwait\fR'. or wait for a user event occurring on the selected instant display windows. '\fBdelay\fR' can be \fB{ <0:Delay+flush events | 0:Event | >0:Delay }\fR. Command selection (if any) stands for instant display window indices instead of image indices. If no window indices are specified and if '\fBdelay\fR' is positive, the command results in a '\fBhard\fR' sleep during specified delay. \fBDefault value\fR: '\fBdelay=0\fR'. \fBwarn (+):\fR _force_visible={ 0:No | 1:Yes },_message\fR Print specified warning message, on the standard error (stderr). Command selection (if any) stands for displayed call stack subset instead of image indices. \fBw (+):\fR Shortcut for command '\fBwindow\fR'. \fBwindow (+):\fR _width[%]>=-1,_height[%]>=-1,_normalization,_fullscreen,_pos_x[%],_pos_y[%],_title\fR Display selected images into an instant display window with specified size, normalization type, fullscreen mode and title. (equivalent to shortcut command '\fBw\fR'). If '\fBwidth\fR' or '\fBheight\fR' is set to -1, the corresponding dimension is adjusted to the window or image size. Specify '\fBpos_x\fR' and '\fBpos_y\fR' arguments only if the window has to be moved to the specified coordinates. Otherwise, they can be avoided. 'width'=0 or 'height'=0 closes the instant display window. '\fBnormalization\fR' can be \fB{ -1:Keep same | 0:None | 1:Always | 2:1st-time | 3:Auto }\fR. '\fBfullscreen\fR' can be \fB{ -1:Keep same | 0:No | 1:Yes }\fR. You can manage up to 10 different instant display windows by using the numbered variants '\fBw0\fR' (default, eq. to '\fBw\fR'),'\fBw1\fR',...,'\fBw9\fR' of the command '\fBw\fR'. Invoke '\fBwindow\fR' with no selection to make the window visible, if it has been closed by the user. \fBDefault values\fR: '\fBwidth=height=normalization=fullscreen=-1\fR' and '\fBtitle=(undefined)\fR'. \fB\fB11.3. List Manipulation\fR \fB -----------------\fR \fBk (+):\fR Shortcut for command '\fBkeep\fR'. \fBkeep (+):\fR Keep only selected images. (equivalent to shortcut command '\fBk\fR'). \fBExample:\fR [#1] image.jpg split x keep[0-50%:2] append x\fR [#2] image.jpg split x keep[^30%-70%] append x\fR \fBkn:\fR Shortcut for command '\fBkeep_named\fR'. \fBkeep_named:\fR "name1","name2",...\fR Keep all images with specified names from the list of images. Remove all images if no images with those names exist. (equivalent to shortcut command '\fBkn\fR'). \fBmv (+):\fR Shortcut for command '\fBmove\fR'. \fBmove (+):\fR position[%]\fR Move selected images at specified position. Images are actually inserted between current positions '\fBposition-1\fR' and '\fBposition\fR'. Note that the specified position may not correspond to the new position of the image after the \fImove\fR command (typically if moved image(s) are located before the specified position). (equivalent to shortcut command '\fBmv\fR'). \fBExample:\fR [#1] image.jpg split x,3 move[1] 0\fR [#2] image.jpg split x move[50%--1:2] 0 append x\fR \fBnm (+):\fR Shortcut for command '\fBname\fR'. \fB=> (+):\fR Shortcut for command '\fBname\fR'. \fBname (+):\fR "name1","name2",...,"nameN"\fR Set names of selected images. * If no explicit image selection is given, image selection is assumed to be '\fB[-N--1]\fR', where '\fBN\fR' is the number of specified arguments. * If '\fBN\fR' is higher than the number of images in selection, an error is thrown. * If '\fBN\fR' is lower than the number of images in selection, image names are assigned in a periodic way, i.e. 'name(selection[k]) = arg[k%N]\fR'. (equivalent to shortcut command '\fB=>\fR'). \fBExample:\fR [#1] image.jpg name image blur[image] 2\fR \fBTutorial: \fR\fIhttps://gmic.eu/tutorial/name\fR \fBrm (+):\fR Shortcut for command '\fBremove\fR'. \fBremove (+):\fR Remove selected images. (equivalent to shortcut command '\fBrm\fR'). \fBExample:\fR [#1] image.jpg split x remove[30%-70%] append x\fR [#2] image.jpg split x remove[0-50%:2] append x\fR \fBremove_duplicates:\fR Remove duplicates images in the selected images list. \fBExample:\fR [#1] (1,2,3,4,2,4,3,1,3,4,2,1) split x remove_duplicates append x\fR \fBremove_empty:\fR Remove empty images in the selected image list. \fBrmn:\fR Shortcut for command '\fBremove_named\fR'. \fBremove_named:\fR "name1","name2",...\fR Remove all images with specified names from the list of images. Does nothing if no images with those names exist. (equivalent to shortcut command '\fBrmn\fR'). \fBrv (+):\fR Shortcut for command '\fBreverse\fR'. \fBreverse (+):\fR Reverse positions of selected images. (equivalent to shortcut command '\fBrv\fR'). \fBExample:\fR [#1] image.jpg split x,3 reverse[-2,-1]\fR [#2] image.jpg split x,-16 reverse[50%-100%] append x\fR \fBsort_list:\fR _ordering={ +:Increasing | -:Decreasing },_criterion\fR Sort list of selected images according to the specified image criterion. \fBDefault values\fR: '\fBordering=+\fR', '\fBcriterion=i\fR'. \fBExample:\fR [#1] (1;4;7;3;9;2;4;7;6;3;9;1;0;3;3;2) split y sort_list +,i append y\fR \fB\fB11.4. Mathematical Operators\fR \fB ----------------------\fR \fBabs (+):\fR Compute the pointwise absolute values of selected images. \fBExample:\fR [#1] image.jpg +sub {ia} abs[-1]\fR [#2] 300,1,1,1,'cos(20*x/w)' +abs display_graph 400,300\fR \fBabscut (+):\fR min,_max,_offset\fR Cut the absolute values of pixel values in selected images, with specified range. For each value '\fBi\fR' of the selected images, compute '\fBcut(abs(i) + offset,min,max)*sign(i)\fR'. Thus, it only clamp/shift the absolute value of each pixel value while keeping its sign unchanged. \fBDefault values\fR: '\fBmax=inf\fR' and '\fBoffset=0\fR'. \fBExample:\fR [#1] 300,1,1,1,'cos(20*x/w)' +abscut 0,0.5 append c display_graph 400,300\fR \fBacos (+):\fR Compute the pointwise arccosine of selected images. \fBExample:\fR [#1] image.jpg +normalize -1,1 acos[-1]\fR [#2] 300,1,1,1,'cut(x/w+0.1*u,0,1)' +acos display_graph 400,300\fR \fBTutorial: \fR\fIhttps://gmic.eu/oldtutorial/trigonometric-and-inverse-trigonometric-commands\fR \fBacosh (+):\fR Compute the pointwise hyperbolic arccosine of selected images. \fB+ (+):\fR Shortcut for command '\fBadd\fR'. \fBadd (+):\fR value[%] |\fR [image] |\fR 'formula' |\fR (no arg)\fR Add specified value, image or mathematical expression to selected images, or compute the pointwise sum of selected images. (equivalent to shortcut command '\fB+\fR'). \fBExample:\fR [#1] image.jpg +add 30% cut 0,255\fR [#2] image.jpg +blur 5 normalize 0,255 add[1] [0]\fR [#3] image.jpg add '80*cos(80*(x/w-0.5)*(y/w-0.5)+c)' cut 0,255\fR [#4] image.jpg repeat 9 { +rotate[0] {$>*36},1,0,50%,50% } add div 10\fR \fB& (+):\fR Shortcut for command '\fBand\fR'. \fBand (+):\fR value[%] |\fR [image] |\fR 'formula' |\fR (no arg)\fR Compute the bitwise AND of selected images with specified value, image or mathematical expression, or compute the pointwise sequential bitwise AND of selected images. (equivalent to shortcut command '\fB&\fR'). \fBExample:\fR [#1] image.jpg and {128+64}\fR [#2] image.jpg +mirror x and\fR \fBargmax:\fR Compute the argmax of selected images. Return a single image with each pixel value being the index of the input image with maximal value. \fBExample:\fR [#1] image.jpg sample lena,lion,square +argmax\fR \fBargmaxabs:\fR Compute the argmaxabs of selected images. Return a single image with each pixel value being the index of the input image with maxabs value. \fBargmin:\fR Compute the argmin of selected images. Return a single image with each pixel value being the index of the input image with minimal value. \fBExample:\fR [#1] image.jpg sample lena,lion,square +argmin\fR \fBargminabs:\fR Compute the argminabs of selected images. Return a single image with each pixel value being the index of the input image with minabs value. \fBasin (+):\fR Compute the pointwise arcsine of selected images. \fBExample:\fR [#1] image.jpg +normalize -1,1 asin[-1]\fR [#2] 300,1,1,1,'cut(x/w+0.1*u,0,1)' +asin display_graph 400,300\fR \fBTutorial: \fR\fIhttps://gmic.eu/oldtutorial/trigonometric-and-inverse-trigonometric-commands\fR \fBasinh (+):\fR Compute the pointwise hyperbolic arcsine of selected images. \fBatan (+):\fR Compute the pointwise arctangent of selected images. \fBExample:\fR [#1] image.jpg +normalize 0,8 atan[-1]\fR [#2] 300,1,1,1,'4*x/w+u' +atan display_graph 400,300\fR \fBTutorial: \fR\fIhttps://gmic.eu/oldtutorial/trigonometric-and-inverse-trigonometric-commands\fR \fBatan2 (+):\fR [x_argument]\fR Compute the pointwise oriented arctangent of selected images. Each selected image is regarded as the y-argument of the arctangent function, while the specified image gives the corresponding x-argument. \fBExample:\fR [#1] (-1,1) (-1;1) resize 400,400,1,1,3 atan2[1] [0] keep[1] mod {pi/8}\fR \fBTutorial: \fR\fIhttps://gmic.eu/oldtutorial/trigonometric-and-inverse-trigonometric-commands\fR \fBatanh (+):\fR Compute the pointwise hyperbolic arctangent of selected images. \fB<< (+):\fR Shortcut for command '\fBbsl\fR'. \fBbsl (+):\fR value[%] |\fR [image] |\fR 'formula' |\fR (no arg)\fR Compute the bitwise left shift of selected images with specified value, image or mathematical expression, or compute the pointwise sequential bitwise left shift of selected images. (equivalent to shortcut command '\fB<<\fR'). \fBExample:\fR [#1] image.jpg bsl 'round(3*x/w,0)' cut 0,255\fR \fB>> (+):\fR Shortcut for command '\fBbsr\fR'. \fBbsr (+):\fR value[%] |\fR [image] |\fR 'formula' |\fR (no arg)\fR Compute the bitwise right shift of selected images with specified value, image or mathematical expression, or compute the pointwise sequential bitwise right shift of selected images. (equivalent to shortcut command '\fB>>\fR'). \fBExample:\fR [#1] image.jpg bsr 'round(3*x/w,0)' cut 0,255\fR \fBcos (+):\fR Compute the pointwise cosine of selected images. \fBExample:\fR [#1] image.jpg +normalize 0,{2*pi} cos[-1]\fR [#2] 300,1,1,1,'20*x/w+u' +cos display_graph 400,300\fR \fBTutorial: \fR\fIhttps://gmic.eu/oldtutorial/trigonometric-and-inverse-trigonometric-commands\fR \fBcosh (+):\fR Compute the pointwise hyperbolic cosine of selected images. \fBExample:\fR [#1] image.jpg +normalize -3,3 cosh[-1]\fR [#2] 300,1,1,1,'4*x/w+u' +cosh display_graph 400,300\fR \fBc (+):\fR Shortcut for command '\fBcut\fR'. \fBcut (+):\fR { value0[%] | [image0] },{ value1[%] | [image1] } |\fR [image]\fR Cut values of selected images in specified range. (equivalent to shortcut command '\fBc\fR'). \fBExample:\fR [#1] image.jpg +add 30% cut[-1] 0,255\fR [#2] image.jpg +cut 25%,75%\fR \fBdeg2rad:\fR Convert pointwise angle values of selected images, from degrees to radians (apply '\fBi*pi/180\fR'). \fB/ (+):\fR Shortcut for command '\fBdiv\fR'. \fBdiv (+):\fR value[%] |\fR [image] |\fR 'formula' |\fR (no arg)\fR Divide selected images by specified value, image or mathematical expression, or compute the pointwise quotient of selected images. (equivalent to shortcut command '\fB/\fR'). \fBExample:\fR [#1] image.jpg div '1+abs(cos(x/10)*sin(y/10))'\fR [#2] image.jpg +norm add[-1] 1 +div\fR \fB== (+):\fR Shortcut for command '\fBeq\fR'. \fBeq (+):\fR value[%] |\fR [image] |\fR 'formula' |\fR (no arg)\fR Compute the boolean equality of selected images with specified value, image or mathematical expression, or compute the boolean equality of selected images. (equivalent to shortcut command '\fB==\fR'). \fBExample:\fR [#1] image.jpg round 40 eq {round(ia,40)}\fR [#2] image.jpg +mirror x eq\fR \fBerf (+):\fR Compute the pointwise error function of selected images. \fBExample:\fR [#1] image.jpg +normalize 0,2 erf[-1]\fR [#2] 300,1,1,1,'7*x/w-3.5+u' +erf display_graph 400,300\fR \fBexp (+):\fR Compute the pointwise exponential of selected images. \fBExample:\fR [#1] image.jpg +normalize 0,2 exp[-1]\fR [#2] 300,1,1,1,'7*x/w+u' +exp display_graph 400,300\fR \fB>= (+):\fR Shortcut for command '\fBge\fR'. \fBge (+):\fR value[%] |\fR [image] |\fR 'formula' |\fR (no arg)\fR Compute the boolean 'greater or equal than' of selected images with specified value, image or mathematical expression, or compute the boolean 'greater or equal than' of selected images. (equivalent to shortcut command '\fB>=\fR'). \fBExample:\fR [#1] image.jpg ge {ia}\fR [#2] image.jpg +mirror x ge\fR \fB> (+):\fR Shortcut for command '\fBgt\fR'. \fBgt (+):\fR value[%] |\fR [image] |\fR 'formula' |\fR (no arg)\fR Compute the boolean '\fBgreater than\fR' of selected images with specified value, image or mathematical expression, or compute the boolean '\fBgreater than\fR' of selected images. (equivalent to shortcut command '\fB>\fR'). \fBExample:\fR [#1] image.jpg gt {ia}\fR [#2] image.jpg +mirror x gt\fR \fBinrange:\fR min[%],max[%],_include_min_boundary={ 0:No | 1:Yes },_include_max_boundary={ 0:No | 1:Yes }\fR Detect pixels whose values are in specified range '[min,max]\fR', in selected images. (equivalent to shortcut command '\fBir\fR'). \fBDefault value\fR: '\fBinclude_min_boundary=include_max_boundary=1\fR'. \fBExample:\fR [#1] image.jpg +inrange 25%,75%\fR \fBisinf:\fR Select '\fBinf\fR' values in selected images. \fBisnan:\fR Select '\fBnan\fR' values in selected images. \fB<= (+):\fR Shortcut for command '\fBle\fR'. \fBle (+):\fR value[%] |\fR [image] |\fR 'formula' |\fR (no arg)\fR Compute the boolean 'less or equal than' of selected images with specified value, image or mathematical expression, or compute the boolean 'less or equal than' of selected images. (equivalent to shortcut command '\fB<=\fR'). \fBExample:\fR [#1] image.jpg le {ia}\fR [#2] image.jpg +mirror x le\fR \fB< (+):\fR Shortcut for command '\fBlt\fR'. \fBlt (+):\fR value[%] |\fR [image] |\fR 'formula' |\fR (no arg)\fR Compute the boolean '\fBless than\fR' of selected images with specified value, image or mathematical expression, or compute the boolean '\fBless than\fR' of selected images. (equivalent to shortcut command '\fB<\fR'). \fBExample:\fR [#1] image.jpg lt {ia}\fR [#2] image.jpg +mirror x lt\fR \fBlog (+):\fR Compute the pointwise base-e logarithm of selected images. \fBExample:\fR [#1] image.jpg +add 1 log[-1]\fR [#2] 300,1,1,1,'7*x/w+u' +log display_graph 400,300\fR \fBlog10 (+):\fR Compute the pointwise base-10 logarithm of selected images. \fBExample:\fR [#1] image.jpg +add 1 log10[-1]\fR [#2] 300,1,1,1,'7*x/w+u' +log10 display_graph 400,300\fR \fBlog2 (+):\fR Compute the pointwise base-2 logarithm of selected images \fBExample:\fR [#1] image.jpg +add 1 log2[-1]\fR [#2] 300,1,1,1,'7*x/w+u' +log2 display_graph 400,300\fR \fBmax (+):\fR value[%] |\fR [image] |\fR 'formula' |\fR (no arg)\fR Compute the maximum between selected images and specified value, image or mathematical expression, or compute the pointwise maxima between selected images. \fBExample:\fR [#1] image.jpg +mirror x max\fR [#2] image.jpg max 'R=((x/w-0.5)^2+(y/h-0.5)^2)^0.5;255*R'\fR \fBmaxabs (+):\fR value[%] |\fR [image] |\fR 'formula' |\fR (no arg)\fR Compute the maxabs between selected images and specified value, image or mathematical expression, or compute the pointwise maxabs between selected images. \fBm/ (+):\fR Shortcut for command '\fBmdiv\fR'. \fBmdiv (+):\fR value[%] |\fR [image] |\fR 'formula' |\fR (no arg)\fR Compute the matrix division of selected matrices/vectors by specified value, image or mathematical expression, or compute the matrix division of selected images. (equivalent to shortcut command '\fBm/\fR'). \fBmed:\fR Compute the median of selected images. \fBExample:\fR [#1] image.jpg sample lena,lion,square +med\fR \fBmin (+):\fR value[%] |\fR [image] |\fR 'formula' |\fR (no arg)\fR Compute the minimum between selected images and specified value, image or mathematical expression, or compute the pointwise minima between selected images. \fBExample:\fR [#1] image.jpg +mirror x min\fR [#2] image.jpg min 'R=((x/w-0.5)^2+(y/h-0.5)^2)^0.5;255*R'\fR \fBminabs (+):\fR value[%] |\fR [image] |\fR 'formula' |\fR (no arg)\fR Compute the minabs between selected images and specified value, image or mathematical expression, or compute the pointwise minabs between selected images. \fB% (+):\fR Shortcut for command '\fBmod\fR'. \fBmod (+):\fR value[%] |\fR [image] |\fR 'formula' |\fR (no arg)\fR Compute the modulo of selected images with specified value, image or mathematical expression, or compute the pointwise sequential modulo of selected images. (equivalent to shortcut command '\fB%\fR'). \fBExample:\fR [#1] image.jpg +mirror x n. 1,255 round. mod\fR [#2] image.jpg mod 'R=((x/w-0.5)^2+(y/h-0.5)^2)^0.5;255*R'\fR \fBm* (+):\fR Shortcut for command '\fBmmul\fR'. \fBmmul (+):\fR value[%] |\fR [image] |\fR 'formula' |\fR (no arg)\fR Compute the matrix right multiplication of selected matrices/vectors by specified value, image or mathematical expression, or compute the matrix right multiplication of selected images. If the right-hand side image is vector-valued, this command multiplies each vector-valued pixels by the specified left-hand matrix. (equivalent to shortcut command '\fBm*\fR'). \fBExample:\fR [#1] (0,1,0;0,0,1;1,0,0) (1;2;3) +mmul\fR [#2] (0,1,0;0,0,1;1,0,0) image.jpg +mmul\fR \fB* (+):\fR Shortcut for command '\fBmul\fR'. \fBmul (+):\fR value[%] |\fR [image] |\fR 'formula' |\fR (no arg)\fR Multiply selected images by specified value, image or mathematical expression, or compute the pointwise product of selected images. (equivalent to shortcut command '\fB*\fR'). See also: \fIadd\fR, \fIsub\fR, \fIdiv\fR. \fBExample:\fR [#1] image.jpg +mul 2 cut 0,255\fR [#2] image.jpg (1,2,3,4,5,6,7,8) ri[-1] [0] mul[0] [-1]\fR [#3] image.jpg mul '1-3*abs(x/w-0.5)' cut 0,255\fR [#4] image.jpg +luminance negate[-1] +mul\fR \fB!= (+):\fR Shortcut for command '\fBneq\fR'. \fBneq (+):\fR value[%] |\fR [image] |\fR 'formula' |\fR (no arg)\fR Compute the boolean inequality of selected images with specified value, image or mathematical expression, or compute the boolean inequality of selected images. (equivalent to shortcut command '\fB!=\fR'). \fBExample:\fR [#1] image.jpg round 40 neq {round(ia,40)}\fR \fBoneminus:\fR For each selected image, compute one minus image. \fBExample:\fR [#1] image.jpg normalize 0,1 +oneminus\fR \fB| (+):\fR Shortcut for command '\fBor\fR'. \fBor (+):\fR value[%] |\fR [image] |\fR 'formula' |\fR (no arg)\fR Compute the bitwise OR of selected images with specified value, image or mathematical expression, or compute the pointwise sequential bitwise OR of selected images. (equivalent to shortcut command '\fB|\fR'). \fBExample:\fR [#1] image.jpg or 128\fR [#2] image.jpg +mirror x or\fR \fB^ (+):\fR Shortcut for command '\fBpow\fR'. \fBpow (+):\fR value[%] |\fR [image] |\fR 'formula' |\fR (no arg)\fR Raise selected images to the power of specified value, image or mathematical expression, or compute the pointwise sequential powers of selected images. (equivalent to shortcut command '\fB^\fR'). \fBExample:\fR [#1] image.jpg div 255 +pow 0.5 mul 255\fR [#2] image.jpg gradient pow 2 add pow 0.2\fR \fBrad2deg:\fR Convert pointwise angle values of selected images, from radians to degrees (apply '\fBi*180/pi\fR'). \fBrol (+):\fR value[%] |\fR [image] |\fR 'formula' |\fR (no arg)\fR Compute the bitwise left rotation of selected images with specified value, image or mathematical expression, or compute the pointwise sequential bitwise left rotation of selected images. \fBExample:\fR [#1] image.jpg rol 'round(3*x/w,0)' cut 0,255\fR \fBror (+):\fR value[%] |\fR [image] |\fR 'formula' |\fR (no arg)\fR Compute the bitwise right rotation of selected images with specified value, image or mathematical expression, or compute the pointwise sequential bitwise right rotation of selected images. \fBExample:\fR [#1] image.jpg ror 'round(3*x/w,0)' cut 0,255\fR \fBsign (+):\fR Compute the pointwise sign of selected images. \fBExample:\fR [#1] image.jpg +sub {ia} sign[-1]\fR [#2] 300,1,1,1,'cos(20*x/w+u)' +sign display_graph 400,300\fR \fBsin (+):\fR Compute the pointwise sine of selected images. \fBExample:\fR [#1] image.jpg +normalize 0,{2*pi} sin[-1]\fR [#2] 300,1,1,1,'20*x/w+u' +sin display_graph 400,300\fR \fBTutorial: \fR\fIhttps://gmic.eu/oldtutorial/trigonometric-and-inverse-trigonometric-commands\fR \fBsinc (+):\fR Compute the pointwise sinc function of selected images. \fBExample:\fR [#1] image.jpg +normalize {-2*pi},{2*pi} sinc[-1]\fR [#2] 300,1,1,1,'20*x/w+u' +sinc display_graph 400,300\fR \fBsinh (+):\fR Compute the pointwise hyperbolic sine of selected images. \fBExample:\fR [#1] image.jpg +normalize -3,3 sinh[-1]\fR [#2] 300,1,1,1,'4*x/w+u' +sinh display_graph 400,300\fR \fBsoftmax:\fR _temperature>0\fR Compute the softmax of selected images. \fBDefault value\fR: '\fBtemperature=1\fR'. \fBExample:\fR [#1] 100,1,1,1,"x0\fR Compute the softmin of selected images. \fBDefault value\fR: '\fBtemperature=1\fR'. \fBExample:\fR [#1] 100,1,1,1,"x=0\fR Apply gamma correction to selected images. \fBExample:\fR [#1] image.jpg +apply_gamma 2\fR \fBapply_mask:\fR "command",[opacity_mask],_max_opacity_mask\fR Apply specified command on selected images but only inside the specified mask. \fBDefault value\fR: '\fBmax_opacity_mask=1\fR'. \fBExample:\fR [#1] image.jpg 100%,100% noise. 10 blur. 2%,0 ge. 50% blur. 0.5% normalize. 0,1 +apply_mask.. "sepia whirls",[-1]\fR \fBbalance_gamma:\fR _ref_color1,...\fR Compute gamma-corrected color balance of selected image, with respect to specified reference color. \fBDefault value\fR: '\fBref_color1=128\fR'. \fBExample:\fR [#1] image.jpg +balance_gamma 128,64,64\fR \fBcast:\fR datatype_source,datatype_target\fR Cast the datatype of the image buffer from specified source type to specified target type. '\fBdatatype_source\fR' and '\fBdatatype_target\fR' can be \fB{ uint8 | int8 | uint16 | int16 | uint32 | int32 | uint64 | int64 | float32 | float64 }\fR. \fBcomplex2polar:\fR Compute complex to polar transforms of selected images. \fBExample:\fR [#1] image.jpg +fft complex2polar[-2,-1] log[-2] shift[-2] 50%,50%,0,0,2 remove[-1]\fR \fBcompress_clut:\fR Compress selected color LUTs as sequences of colored keypoints. \fBcompress_huffman:\fR [huffman_tree],_max_leaf_value\fR Compress selected images with Huffman coding. See also: \fIdecompress_huffman\fR, \fIhuffman_tree\fR. \fBcompress_rle:\fR _is_binary_data={ 0:No | 1:Yes },_maximum_sequence_length>=0\fR Compress selected images as 2xN data matrices, using RLE algorithm. Set '\fBmaximum_sequence_length=0\fR' to disable maximum length constraint. \fBDefault values\fR: '\fBis_binary_data=0\fR' and '\fBmaximum_sequence_length=0\fR'. \fBExample:\fR [#1] image.jpg rescale2d ,100 quantize 4 round +compress_rle , +decompress_rle[-1]\fR \fBcumulate (+):\fR { x | y | z | c }...{ x | y | z | c } |\fR (no arg)\fR Compute the cumulative function of specified image data, optionally along the specified axes. \fBExample:\fR [#1] image.jpg +histogram 256 +cumulate[-1] display_graph[-2,-1] 400,300,3\fR \fBdecompress_clut:\fR _width>0,_height>0,_depth>0\fR Decompress selected colored keypoints into 3D CLUTs, using a mixed RBF/PDE approach. \fBDefault values\fR: '\fBwidth=height=depth=33\fR' and '\fBreconstruction_colorspace=0\fR'. \fBdecompress_from_keypoints:\fR _width>0,_height>0,_depth>0 |\fR (no arg)\fR Decompress selected sets of keypoints as images (optionally with specified size). A set of keypoints is defined as a vector-valued image, such that: * The first pixel is a vector which encodes the '[ Width,Height,Depth ]\fR' of the decompressed image. * The second pixel is a vector which encodes '[ Min,Max,Use_RBF ]\fR', where '\fBMin\fR' and '\fBMax\fR' defines the value range of the decompressed image, and '\fBUse_RBF\fR' tells is the decompression scheme must use RBFs ('\fBUse_RBF=1\fR') or Multiscale Diffusion PDE's ('\fBUse_RBF=0\fR'). * The remaining pixels define the keypoint coordinates and values, as: - '[ x_k,y_k,z_k, v1_k,...,vN_k ]\fR' for a 3D target image of N-valued vectors. - '[ x_k,y_k, v1_k,...,vN_k ]\fR' for a 2D target image of N-valued vectors. - '[ x_k, v1_k,...,vN_k ]\fR' for a 1D target image of N-valued vectors. where the coordinates '\fBx_k\fR', '\fBy_k\fR' and '\fBz_k\fR' are defined respectively in ranges '\fB[0,Width-1]\fR', '\fB[0,Height-1]\fR' and '\fB[0,Depth-1]\fR'. If the '\fBwidth\fR', '\fBheight\fR' and '\fBdepth\fR' arguments are provided, they define the size of the decompressed image, : overriding then the original image size '[ Width,Height,Depth ]\fR' defined in the keypoints header. \fBdecompress_huffman:\fR [huffman_tree]\fR Decompress selected images with Huffman decoding. See also: \fIcompress_huffman\fR, \fIhuffman_tree\fR. \fBExample:\fR [#1] image.jpg huffman_tree compress_huffman.. . +decompress_huffman.. .\fR \fBdecompress_rle:\fR Decompress selected data vectors, using RLE algorithm. \fBdiscard (+):\fR _value1,_value2,... |\fR { x | y | z | c}...{ x | y | z | c},_value1,_value2,... |\fR (no arg)\fR Discard specified values in selected images or discard neighboring duplicate values, optionally only for the values along the first of a specified axis. If no arguments are specified, neighboring duplicate values are discarded. If all pixels of a selected image are discarded, an empty image is returned. \fBExample:\fR [#1] (1;2;3;4;3;2;1) +discard 2\fR [#2] (1,2,2,3,3,3,4,4,4,4) +discard x\fR \fBeigen2tensor:\fR Recompose selected pairs of eigenvalues/eigenvectors as 2x2 or 3x3 tensor fields. \fBTutorial: \fR\fIhttps://gmic.eu/tutorial/eigen2tensor\fR \fBendian (+):\fR _datatype\fR Reverse data endianness of selected images, optionally treating the pixel being of the specified datatype. '\fBdatatype\fR' can be \fB{ bool | uint8 | int8 | uint16 | int16 | uint32 | int32 | uint64 | int64 | float32 | float64 }\fR. This command does nothing for '\fBbool\fR', '\fBuint8\fR' and '\fBint8\fR' datatypes. \fBequalize (+):\fR _nb_levels[%]>0,_value_min[%],_value_max[%] |\fR (no arg)\fR Equalize histograms of selected images. If value range is specified, the equalization is done only for pixels in the specified value range. \fBDefault values\fR: '\fBnb_levels=256\fR', '\fBvalue_min=0%\fR' and '\fBvalue_max=100%\fR'. \fBExample:\fR [#1] image.jpg +equalize\fR [#2] image.jpg +equalize 4,0,128\fR \fBf (+):\fR Shortcut for command '\fBfill\fR'. \fBfill (+):\fR value1,_value2,... |\fR [image] |\fR 'formula'\fR Fill selected images with values read from the specified value list, existing image or mathematical expression. Single quotes may be omitted in '\fBformula\fR'. (equivalent to shortcut command '\fBf\fR'). \fBExample:\fR [#1] 4,4 fill 1,2,3,4,5,6,7\fR [#2] 4,4 (1,2,3,4,5,6,7) fill[-2] [-1]\fR [#3] 400,400,1,3 fill "X=x-w/2; Y=y-h/2; R=sqrt(X^2+Y^2); a=atan2(Y,X); R<=180?255*abs(cos(c+200*(x/w-0.5)*(y/h-0.5))):850*(a%(0.1*(c+1)))"\fR \fBTutorial: \fR\fIhttps://gmic.eu/tutorial/fill\fR \fBicp:\fR [reference],_affine_mode,_precision>0,_iter_max>=0\fR Apply affine transformation on vector-valued points of selected images, to match specified set of reference vectors, using the ICP algorithm (Iterative Closest Point\fR). A description of ICP is available at \fIhttps://en.wikipedia.org/wiki/Iterative_closest_point\fR. Argument '\fBaffine_mode\fR' tells about the type of affine transform applied. It can be: \fB{ 0:Free | 1:Rotation+Scaling | 2:Rotation-Only }\fR. \fBDefault values\fR: '\fBaffine_mode=0\fR', '\fBprecision=1e-3\fR' and '\fBiter_max=1000\fR'. \fBindex (+):\fR { [palette] | palette_name },0<=_dithering<=1,_map_colors={ 0:No | 1:Yes }\fR Index selected vector-valued images by specified vector-valued palette. '\fBpalette_name\fR' can be \fB{ default | hsv | lines | hot | cool | jet | flag | cube | rainbow | algae | amp |balance | curl | deep | delta | dense | diff | haline | ice | matter | oxy | phase | rain | solar | speed | tarn |tempo | thermal | topo | turbid | aurora | hocuspocus | srb2 | uzebox }\fR \fBDefault values\fR: '\fBdithering=0\fR' and '\fBmap_colors=0\fR'. \fBExample:\fR [#1] image.jpg +index 1,1,1\fR [#2] image.jpg (0;255;255^0;128;255^0;0;255) +index[-2] [-1],1,1\fR \fBTutorial: \fR\fIhttps://gmic.eu/tutorial/gindex\fR \fBir:\fR Shortcut for command '\fBinrange\fR'. \fBmap (+):\fR [palette],_boundary_conditions |\fR palette_name,_boundary_conditions\fR Map specified vector-valued palette to selected indexed images. Each output image has '\fBM*N\fR' channels, where '\fBM\fR' and '\fBN\fR' are the numbers of channels of, respectively, the corresponding input image and the '\fBpalette\fR' image. '\fBpalette_name\fR' can be \fB{ default | hsv | lines | hot | cool | jet | flag | cube | rainbow | algae | amp | balance | curl | deep | delta | dense | diff | gray | haline | ice | matter | oxy | phase | rain | random | solar | speed | tarn | tempo | thermal | topo | turbid | aurora | hocuspocus | srb2 | uzebox }\fR '\fBboundary_conditions\fR' can be \fB{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR. \fBDefault value\fR: '\fBboundary_conditions=0\fR'. \fBExample:\fR [#1] image.jpg +luminance map[-1] 3\fR [#2] image.jpg +rgb2ycbcr split[-1] c (0,255,0) resize[-1] 256,1,1,1,3 map[-4] [-1] remove[-1] append[-3--1] c ycbcr2rgb[-1]\fR \fBTutorial: \fR\fIhttps://gmic.eu/tutorial/map\fR \fBmix_channels:\fR (a00,...,aMN) |\fR [matrix]\fR Apply specified matrix to channels of selected images. \fBExample:\fR [#1] image.jpg +mix_channels (0,1,0;1,0,0;0,0,1)\fR \fBnegate:\fR base_value |\fR (no arg)\fR Negate image values. \fBDefault value\fR: '\fBbase_value=(undefined)\fR'. \fBExample:\fR [#1] image.jpg +negate\fR \fBnoise (+):\fR amplitude[%]>=0,_noise_type\fR Add random noise to selected images. '\fBnoise_type\fR' can be \fB{ 0:Gaussian | 1:Uniform | 2:Salt&pepper | 3:Poisson | 4:Rice }\fR. \fBDefault value\fR: '\fBnoise_type=0\fR'. \fBExample:\fR [#1] image.jpg +noise[0] 50,0 +noise[0] 50,1 +noise[0] 10,2 cut 0,255\fR [#2] 300,300,1,3 [0] noise[0] 20,0 noise[1] 20,1 +histogram 100 display_graph[-2,-1] 400,300,3\fR \fBnoise_hurl:\fR _amplitude>=0\fR Add hurl noise to selected images. \fBDefault value\fR: '\fBamplitude=10\fR'. \fBExample:\fR [#1] image.jpg +noise_hurl ,\fR \fBnoise_perlin:\fR _scale_x[%]>0,_scale_y[%]>0,_scale_z[%]>0,_seed_x,_seed_y,_seed_z\fR Render 2D or 3D Perlin noise on selected images, from specified coordinates. The Perlin noise is a specific type of smooth noise, described here: \fIhttps://en.wikipedia.org/wiki/Perlin_noise\fR. \fBDefault values\fR: '\fBscale_x=scale_y=scale_z=16\fR' and '\fBseed_x=seed_y=seed_z=0\fR'. \fBExample:\fR [#1] 500,500,1,3 noise_perlin ,\fR \fBnoise_poissondisk:\fR _radius[%]>0,_max_sample_attempts>0,_p_norm>0\fR Add poisson disk sampling noise to selected images. Implements the algorithm from the article "Fast Poisson Disk Sampling in Arbitrary Dimensions", by Robert Bridson (SIGGRAPH'2007). \fBDefault values\fR: '\fBradius=8\fR', '\fBmax_sample_attempts=30\fR' and '\fBp_norm=2\fR'. \fBExample:\fR [#1] 300,300 noise_poissondisk 8\fR \fBnormp:\fR p>=0\fR Compute the pointwise Lp-norm norm of vector-valued pixels in selected images. \fBDefault value\fR: '\fBp=2\fR'. \fBExample:\fR [#1] image.jpg +normp[0] 0 +normp[0] 1 +normp[0] 2 +normp[0] inf\fR \fBnorm1:\fR Compute the pointwise L1-norm of vector-valued pixels in selected images. \fBExample:\fR [#1] image.jpg +norm1\fR \fBTutorial: \fR\fIhttps://gmic.eu/tutorial/norm1\fR \fBnorm:\fR Shortcut for command '\fBnorm2\fR'. \fBnorm2:\fR Compute the pointwise L2-norm (euclidean norm) of vector-valued pixels in selected images. \fBExample:\fR [#1] image.jpg +norm\fR \fBTutorial: \fR\fIhttps://gmic.eu/tutorial/norm2\fR \fBn (+):\fR Shortcut for command '\fBnormalize\fR'. \fBnormalize (+):\fR { value0[%] | [image0] },{ value1[%] | [image1] },_constant_case_ratio |\fR [image]\fR Linearly normalize values of selected images in specified range. (equivalent to shortcut command '\fBn\fR'). \fBExample:\fR [#1] image.jpg split x,2 normalize[-1] 64,196 append x\fR \fBTutorial: \fR\fIhttps://gmic.eu/tutorial/normalize\fR \fBnormalize_l2:\fR Normalize selected images such that they have a unit L2 norm. \fBnormalize_sum:\fR Normalize selected images such that they have a unit sum. \fBExample:\fR [#1] image.jpg +histogram 256 normalize_sum[-1] display_graph[-1] 400,300\fR \fBorientation:\fR Compute the pointwise orientation of vector-valued pixels in selected images. \fBExample:\fR [#1] image.jpg +orientation +norm[-2] negate[-1] mul[-2] [-1] reverse[-2,-1]\fR \fBTutorial: \fR\fIhttps://gmic.eu/tutorial/orientation\fR \fBotsu:\fR _nb_levels>0\fR Hard-threshold the selected images using Otsu's method. The computed thresholds are returned as a list of values in the status. \fBDefault value\fR: '\fBnb_levels=256\fR'. \fBExample:\fR [#1] image.jpg luminance +otsu ,\fR \fBpolar2complex:\fR Compute polar to complex transforms of selected images. \fBquantize:\fR nb_levels>=1,_keep_values={ 0:No | 1:Yes },_quantization_type={ -1:Median-cut | 0:K-means | 1:Uniform }\fR Quantize selected images. \fBDefault value\fR: '\fBkeep_values=1\fR' and '\fBquantization_type=0\fR'. \fBExample:\fR [#1] image.jpg luminance +quantize 3\fR [#2] 200,200,1,1,'cos(x/10)*sin(y/10)' +quantize[0] 6 +quantize[0] 4 +quantize[0] 3 +quantize[0] 2\fR \fBquantize_area:\fR _min_area>0\fR Quantize selected images such that each flat region has an area greater or equal to '\fBmin_area\fR'. \fBDefault value\fR: '\fBmin_area=10\fR'. \fBExample:\fR [#1] image.jpg quantize 3 +blur 1 round[-1] +quantize_area[-1] 2\fR \fBrand (+):\fR { value0[%] | [image0] },_{ value1[%] | [image1] },_[pdf],_precision[%] |\fR [image]\fR Fill selected images with random values in the specified range. If no '\fB[pdf]\fR' (probability density function) is specified, random values follow a uniform distribution. Argument '\fBprecision\fR' tells about the number of distinct values that can be generated when a '\fB[pdf]\fR' is specified. \fBExample:\fR [#1] 400,400,1,3 rand -10,10 +blur 10 sign[-1]\fR [#2] (8,2,1) 50,50 rand[-1] 0,255,[-2]\fR [#3] 256 gaussian[-1] 30 line[-1] 47%,0,53%,0,1,0 500,500 rand[-1] 0,255,[-2] +histogram[-1] 256 display_graph[0,2] 640,480,3,0\fR \fBrand_sum:\fR sum>0,_random_function\fR Fill selected images with strictly positive, random, integer values, that sums to '\fBsum\fR'. For each image, '\fBsum\fR' must be greater or equal than '\fBwidth*height*depth*spectrum\fR'. \fBDefault value\fR: '\fBrandom_function=u\fR'. \fBExample:\fR [#1] 100 rand_sum 1000\fR \fBreplace:\fR source,target\fR Replace pixel values in selected images. \fBExample:\fR [#1] (1;2;3;4) +replace 2,3\fR \fBreplace_inf:\fR _expression\fR Replace all infinite values in selected images by specified expression. \fBExample:\fR [#1] (0;1;2) log +replace_inf 2\fR \fBreplace_infnan:\fR _expression\fR Replace all NaN and infinite values in selected images by specified expression. \fBreplace_nan:\fR _expression\fR Replace all NaN values in selected images by specified expression. \fBExample:\fR [#1] (-1;0;2) sqrt +replace_nan 2\fR \fBreplace_seq:\fR "search_seq","replace_seq"\fR Search and replace a sequence of values in selected images. \fBExample:\fR [#1] (1;2;3;4;5) +replace_seq "2,3,4","7,8"\fR \fBreplace_str:\fR "search_str","replace_str"\fR Search and replace a string in selected images (viewed as strings, i.e. sequences of character codes). \fBExample:\fR [#1] ('"Hello there, how are you ?"') +replace_str "Hello there","Hi David"\fR \fBround (+):\fR rounding_value>=0,_rounding_type |\fR (no arg)\fR Round values of selected images. '\fBrounding_type\fR' can be \fB{ -1:Backward | 0:Nearest | 1:Forward }\fR. \fBDefault value\fR: '\fBrounding_type=0\fR'. \fBExample:\fR [#1] image.jpg +round 100\fR [#2] image.jpg mul {pi/180} sin +round\fR \fBroundify:\fR gamma>=0\fR Apply roundify transformation on floating-point data, with specified gamma. \fBDefault value\fR: '\fBgamma=0\fR'. \fBExample:\fR [#1] 1000 fill '4*x/w' repeat 5 { +roundify[0] {$>*0.2} } append c display_graph 400,300\fR \fB= (+):\fR Shortcut for command '\fBset\fR'. \fBset (+):\fR value,_x[%],_y[%],_z[%],_c[%]\fR Set pixel value in selected images, at specified coordinates. (equivalent to shortcut command '\fB=\fR'). If specified coordinates are outside the image bounds, no action is performed. \fBDefault values\fR: '\fBx=y=z=c=0\fR'. \fBExample:\fR [#1] 2,2 set 1,0,0 set 2,1,0 set 3,0,1 set 4,1,1\fR [#2] image.jpg repeat 10000 { set 255,{u(100)}%,{u(100)}%,0,{u(100)}% }\fR \fBthreshold:\fR value[%],_is_soft_thresholding={ 0:No | 1:Yes }\fR Threshold values of selected images. '\fBsoft\fR' can be \fB{ 0:Hard-thresholding | 1:Soft-thresholding }\fR. \fBDefault value\fR: '\fBis_soft=0\fR'. \fBExample:\fR [#1] image.jpg +threshold[0] 50% +threshold[0] 50%,1\fR \fBTutorial: \fR\fIhttps://gmic.eu/tutorial/threshold\fR \fBunitnorm:\fR _p>=0\fR Compute the pointwise Lp-norm in selected images. \fBDefault value\fR: '\fBp=2\fR'. \fBExample:\fR [#1] image.jpg +unitnorm 2\fR \fBvector2tensor:\fR Convert selected vector fields to corresponding tensor fields. \fB\fB11.6. Colors\fR \fB ------\fR \fBadjust_colors:\fR -100<=_brightness<=100,-100<=_contrast<=100,-100<=_gamma<=100,-100<=_hue_shift<=100,-100<=_saturation<=100,_value_min,_value_max\fR Perform a global adjustment of colors on selected images. Range of correct image values are considered to be in [value_min,value_max] (e.g. [0,255]). If '\fBvalue_min==value_max==0\fR', value range is estimated from min/max values of selected images. Processed images have pixel values constrained in [value_min,value_max]. \fBDefault values\fR: '\fBbrightness=0\fR', '\fBcontrast=0\fR', '\fBgamma=0\fR', '\fBhue_shift=0\fR', '\fBsaturation=0\fR', '\fBvalue_min=value_max=0\fR'. \fBExample:\fR [#1] image.jpg +adjust_colors 0,30,0,0,30\fR \fBac:\fR Shortcut for command '\fBapply_channels\fR'. \fBapply_channels:\fR "command",color_channels,_value_action={ 0:None | 1:Cut | 2:Normalize }\fR Apply specified command on the chosen color channel(s) of each selected image. (equivalent to shortcut command '\fBac\fR'). Argument '\fBcolor_channels\fR' refers to a color space, and can be basically one of \fB{ all | rgba | [s]rgb | ryb | lrgb | ycbcr | lab | lch | hsv | hsi | hsl | cmy | cmyk | yiq }\fR. You can also make the processing focus on a few particular channels of this color space, by setting '\fBcolor_channels\fR' as '\fBcolorspace_channel\fR' (e.g. '\fBhsv_h\fR' for the hue). All channel values are considered to be provided in the [0,255] range. \fBDefault value\fR: '\fBvalue_action=0\fR'. \fBExample:\fR [#1] image.jpg +apply_channels "equalize blur 2",ycbcr_cbcr\fR \fBautoindex:\fR nb_colors>0,0<=_dithering<=1,_method={ 0:Median-cut | 1:K-means }\fR Index selected vector-valued images by adapted colormaps. \fBDefault values\fR: '\fBdithering=0\fR' and '\fBmethod=1\fR'. \fBExample:\fR [#1] image.jpg +autoindex[0] 4 +autoindex[0] 8 +autoindex[0] 16\fR \fBbayer2rgb:\fR _GM_smoothness,_RB_smoothness1,_RB_smoothness2\fR Transform selected RGB-Bayer sampled images to color images. \fBDefault values\fR: '\fBGM_smoothness=RB_smoothness=1\fR' and '\fBRB_smoothness2=0.5\fR'. \fBExample:\fR [#1] image.jpg rgb2bayer 0 +bayer2rgb 1,1,0.5\fR \fBbrightness:\fR strength\fR Change contrast of selected images, with specified strength. * If '\fBstrength\fR' is positive, image brightness is amplified. * If '\fBstrength\fR' is negative, image brightness is reduced. A typical value range for parameter '\fBstrength\fR' is [-100,100]. \fBExample:\fR [#1] image.jpg +brightness 20\fR \fBclut:\fR "clut_name",_resolution>0,_cut_and_round={ 0:No | 1:Yes }\fR Insert one of the 1189 predefined CLUTs at the end of the image list. '\fBclut_name\fR' can be \fB{ 12_years_a_slave | 1917 | 2-strip-process | 400_ft | 60s | 60s_faded | 60s_faded_alt | 7drk_21 | action_magenta_01 | action_red_01 | ad_astra | adventure_1453 | aerospace | agfa_apx_100 | agfa_apx_25 | agfa_precisa_100 | agfa_ultra_color_100 | agfa_vista_200 | agressive_highligjtes_recovery_5 | airdrop | aladdin | alberto_street | alien_green | ampio | amstragram | amstragram+ | analog_film_1 | analogfx_anno_1870_color | analogfx_old_style_i | analogfx_old_style_ii | analogfx_old_style_iii | analogfx_sepia_color | analogfx_soft_sepia_i | analogfx_soft_sepia_ii | anime | ant-man | apocalypse_this_very_moment | aqua | aqua_and_orange_dark | aquaman | arabica_12 | asistas | atomic_pink | atusa | autumn | autumn_leaves | ava_614 | avalanche | avengers_endgame | azrael_93 | baby_driver | bad_boys_for_life | basuco | bboyz_2 | bc_darkum | beach_aqua_orange | beach_faded_analog | beati | beauty_and_the_beast | berlin_sky | bisogno | black_and_white | black_panther | black_star | black_white_01 | black_white_02 | black_white_03 | black_white_04 | black_white_05 | black_white_06 | blade_runner | bleach_bypass | bleachbypass_1 | bleachbypass_2 | bleachbypass_3 | bleachbypass_4 | bleech_bypass_green | bleech_bypass_yellow_01 | blue_cold_fade | blue_dark | blue_house | blue_ice | blue_love_39 | blue_mono | blue_shadows_01 | bluearchitecture | bluehour | blues | bob_ford | bohemian_rhapsody | bombshell | bourbon_64 | boyado | bright_green_01 | bright_teal_orange | bright_warm | brightgreen | brown_mobster | brownbm | brownish | bw_1 | bw_10 | bw_2 | bw_3 | bw_4 | bw_5 | bw_6 | bw_7 | bw_8 | bw_9 | bw_but_yellow | byers_11 | calidum | candlelight | captain_marvel | caribe | chemical_168 | chrome_01 | cine-1 | cine-10 | cine-11 | cine-12 | cine-13 | cine-14 | cine-15 | cine-16 | cine-17 | cine-18 | cine-19 | cine-2 | cine-20 | cine-21 | cine-22 | cine-23 | cine-24 | cine-25 | cine-26 | cine-27 | cine-28 | cine-29 | cine-3 | cine-30 | cine-4 | cine-5 | cine-6 | cine-7 | cine-8 | cine-9 | cineblue | cinebm_4k | cinema | cinema_2 | cinema_3 | cinema_4 | cinema_5 | cinema_noir | cinematic-1 | cinematic-10 | cinematic-2 | cinematic-3 | cinematic-4 | cinematic-5 | cinematic-6 | cinematic-7 | cinematic-8 | cinematic-9 | cinematic_01 | cinematic_02 | cinematic_03 | cinematic_04 | cinematic_05 | cinematic_06 | cinematic_07 | cinematic_for_flog | cinematic_forest | cinematic_lady_bird | cinematic_mexico | city | city_7 | city_dust | city_of_god | classic_films_01 | classic_films_02 | classic_films_03 | classic_films_04 | classic_films_05 | classic_teal_and_orange | clayton_33 | clear | clear_teal_fade | clouseau_54 | cobi_3 | coffee_44 | cold_clear_blue | cold_clear_blue_1 | cold_ice | cold_simplicity_2 | coldchrome | color_rich | colore | colorful_0209 | colornegative | conflict_01 | contrail_35 | contrast_with_highlights_protection | contrasty_afternoon | contrasty_green | convold | cosa | creed_2 | crispautumn | crispromance | crispwarm | crispwinter | cross_process_cp_130 | cross_process_cp_14 | cross_process_cp_15 | cross_process_cp_16 | cross_process_cp_18 | cross_process_cp_3 | cross_process_cp_4 | cross_process_cp_6 | crushin | cubicle_99 | culor | d_o_1 | dark_blues_in_sunlight | dark_green_02 | dark_green_1 | dark_man_x | dark_orange_teal | dark_place_01 | darkandsomber | darkness | date_39 | day_4nite | day_for_night | day_to_night_kings_blue | deep | deep_blue | deep_dark_warm | deep_high_contrast | deep_teal_fade | deep_warm_fade | deepskintones_2 | deepskintones_3 | delicatessen | denoiser_simple_40 | desert_gold_37 | dimension | dimmer | directions_23 | django_25 | doctor_strange | domingo_145 | dream_1 | dream_85 | drop_green_tint_14 | dropblues | dunkirk | duotone_blue_red | earth_tone_boost | eda_0_2 | edgyember | elegance_38 | enchanted | ensaya | eterna_for_flog | expired_69 | expired_fade | expired_polaroid | extreme | fade | fade_to_green | faded | faded_47 | faded_alt | faded_analog | faded_extreme | faded_green | faded_pink-ish | faded_print | faded_retro_01 | faded_retro_02 | faded_vivid | fadedlook | fallcolors | falua | farkling | fatos | faux_infrared | faux_infrared_bw_1 | faux_infrared_color_p_2 | faux_infrared_color_p_3 | faux_infrared_color_r_0a | faux_infrared_color_r_0b | faux_infrared_color_yp_1 | fezzle | fg_cinebasic | fg_cinebright | fg_cinecold | fg_cinedrama | fg_cinetealorange_1 | fg_cinetealorange_2 | fg_cinevibrant | fg_cinewarm | fgcinebasic | fgcinebright | fgcinecold | fgcinedrama | fgcinetealorange_1 | fgcinetealorange_2 | fgcinevibrant | fgcinewarm | fight_club | film_0987 | film_9879 | film_gb-19 | film_high_contrast | film_print_01 | film_print_02 | filmic | filo | flat_30 | flat_blue_moon | flavin | flog_to_rec_709 | foggynight | folger_50 | ford_v_ferrari | foresta | formula_b | french_comedy | frosted | frostedbeachpicnic | fuji_160c | fuji_160c_+ | fuji_160c_++ | fuji_160c_- | fuji_3510_constlclip | fuji_3510_constlmap | fuji_3510_cuspclip | fuji_3513_constlclip | fuji_3513_constlmap | fuji_3513_cuspclip | fuji_400h | fuji_400h_+ | fuji_400h_++ | fuji_400h_- | fuji_800z | fuji_800z_+ | fuji_800z_++ | fuji_800z_- | fuji_astia_100_generic | fuji_astia_100f | fuji_fp-100c | fuji_fp-100c_+ | fuji_fp-100c_++ | fuji_fp-100c_+++ | fuji_fp-100c_++_alt | fuji_fp-100c_- | fuji_fp-100c_-- | fuji_fp-100c_alt | fuji_fp-100c_cool | fuji_fp-100c_cool_+ | fuji_fp-100c_cool_++ | fuji_fp-100c_cool_- | fuji_fp-100c_cool_-- | fuji_fp-100c_negative | fuji_fp-100c_negative_+ | fuji_fp-100c_negative_++ | fuji_fp-100c_negative_+++ | fuji_fp-100c_negative_++_alt | fuji_fp-100c_negative_- | fuji_fp-100c_negative_-- | fuji_fp-3000b | fuji_fp-3000b_+ | fuji_fp-3000b_++ | fuji_fp-3000b_+++ | fuji_fp-3000b_- | fuji_fp-3000b_-- | fuji_fp-3000b_hc | fuji_fp-3000b_negative | fuji_fp-3000b_negative_+ | fuji_fp-3000b_negative_++ | fuji_fp-3000b_negative_+++ | fuji_fp-3000b_negative_- | fuji_fp-3000b_negative_-- | fuji_fp-3000b_negative_early | fuji_fp_100c | fuji_hdr | fuji_neopan_1600 | fuji_neopan_1600_+ | fuji_neopan_1600_++ | fuji_neopan_1600_- | fuji_neopan_acros_100 | fuji_provia_100_generic | fuji_provia_100f | fuji_provia_400f | fuji_provia_400x | fuji_sensia_100 | fuji_superia_100 | fuji_superia_100_+ | fuji_superia_100_++ | fuji_superia_100_- | fuji_superia_1600 | fuji_superia_1600_+ | fuji_superia_1600_++ | fuji_superia_1600_- | fuji_superia_200 | fuji_superia_200_xpro | fuji_superia_400 | fuji_superia_400_+ | fuji_superia_400_++ | fuji_superia_400_- | fuji_superia_800 | fuji_superia_800_+ | fuji_superia_800_++ | fuji_superia_800_- | fuji_superia_hg_1600 | fuji_superia_reala_100 | fuji_superia_x-tra_800 | fuji_velvia_100_generic | fuji_velvia_50 | fuji_xtrans_iii_acros | fuji_xtrans_iii_acros+g | fuji_xtrans_iii_acros+r | fuji_xtrans_iii_acros+ye | fuji_xtrans_iii_astia | fuji_xtrans_iii_classic_chrome | fuji_xtrans_iii_mono | fuji_xtrans_iii_mono+g | fuji_xtrans_iii_mono+r | fuji_xtrans_iii_mono+ye | fuji_xtrans_iii_pro_neg_hi | fuji_xtrans_iii_pro_neg_std | fuji_xtrans_iii_provia | fuji_xtrans_iii_sepia | fuji_xtrans_iii_velvia | fusion_88 | futuristicbleak_1 | futuristicbleak_2 | futuristicbleak_3 | futuristicbleak_4 | going_for_a_walk | golden | golden_bright | golden_fade | golden_mono | golden_night_softner_43 | golden_sony_37 | golden_vibrant | goldengate | goldentime | goldfx_bright_spring_breeze | goldfx_bright_summer_heat | goldfx_hot_summer_heat | goldfx_perfect_sunset_01min | goldfx_perfect_sunset_05min | goldfx_perfect_sunset_10min | goldfx_spring_breeze | goldfx_summer_heat | good_morning | green_15 | green_2025 | green_action | green_afternoon | green_and_orange | green_blues | green_book | green_conflict | green_day_01 | green_day_02 | green_g_09 | green_indoor | green_light | green_mono | green_yellow | greenish_contrasty | greenish_fade | greenish_fade_1 | gremerta | greyhound | hackmanite | hallowen_dark | happyness_133 | hard_teal_orange | hardboost | harsh_day | harsh_sunset | helios | herderite | heulandite | hiddenite | highlights_protection | hilutite | hitman | hlg_1_1 | honey_light | hong_kong | horrorblue | howlite | huesio | husmes | huyan | hydracore | hyla_68 | hypersthene | hypnosis | hypressen | i_tonya | ideo | ilford_delta_100 | ilford_delta_3200 | ilford_delta_3200_+ | ilford_delta_3200_++ | ilford_delta_3200_- | ilford_delta_400 | ilford_fp_4_plus_125 | ilford_hp_5 | ilford_hp_5_+ | ilford_hp_5_++ | ilford_hp_5_- | ilford_hp_5_plus_400 | ilford_hps_800 | ilford_pan_f_plus_50 | ilford_xp_2 | inception | indoor_blue | industrial_33 | infrared_-_dust_pink | instantc | j | jarklin | jojo_rabbit | joker | jumanji_the_next_level | jurassic_world_fallen_kingdom | justice_league | justpeachy | jwick_21 | k_tone_vintage_kodachrome | kahve_3 | kh_1 | kh_10 | kh_2 | kh_3 | kh_4 | kh_5 | kh_6 | kh_7 | kh_8 | kh_9 | killstreak | kingsman_the_golden_circle | knives_out | kodak_2383_constlclip | kodak_2383_constlmap | kodak_2383_cuspclip | kodak_2393_constlclip | kodak_2393_constlmap | kodak_2393_cuspclip | kodak_bw_400_cn | kodak_e-100_gx_ektachrome_100 | kodak_ektachrome_100_vs | kodak_ektachrome_100_vs_generic | kodak_ektar_100 | kodak_elite_100_xpro | kodak_elite_chrome_200 | kodak_elite_chrome_400 | kodak_elite_color_200 | kodak_elite_color_400 | kodak_elite_extracolor_100 | kodak_hie_hs_infra | kodak_kodachrome_200 | kodak_kodachrome_25 | kodak_kodachrome_64 | kodak_kodachrome_64_generic | kodak_portra_160 | kodak_portra_160_+ | kodak_portra_160_++ | kodak_portra_160_- | kodak_portra_160_nc | kodak_portra_160_nc_+ | kodak_portra_160_nc_++ | kodak_portra_160_nc_- | kodak_portra_160_vc | kodak_portra_160_vc_+ | kodak_portra_160_vc_++ | kodak_portra_160_vc_- | kodak_portra_400 | kodak_portra_400_+ | kodak_portra_400_++ | kodak_portra_400_- | kodak_portra_400_nc | kodak_portra_400_nc_+ | kodak_portra_400_nc_++ | kodak_portra_400_nc_- | kodak_portra_400_uc | kodak_portra_400_uc_+ | kodak_portra_400_uc_++ | kodak_portra_400_uc_- | kodak_portra_400_vc | kodak_portra_400_vc_+ | kodak_portra_400_vc_++ | kodak_portra_400_vc_- | kodak_portra_800 | kodak_portra_800_+ | kodak_portra_800_++ | kodak_portra_800_- | kodak_portra_800_hc | kodak_t-max_100 | kodak_t-max_3200 | kodak_t-max_400 | kodak_tmax_3200 | kodak_tmax_3200_+ | kodak_tmax_3200_++ | kodak_tmax_3200_- | kodak_tmax_3200_alt | kodak_tri-x_400 | kodak_tri-x_400_+ | kodak_tri-x_400_++ | kodak_tri-x_400_- | kodak_tri-x_400_alt | korben_214 | la_la_land | landscape | landscape_01 | landscape_02 | landscape_03 | landscape_04 | landscape_05 | landscape_1 | landscape_10 | landscape_2 | landscape_3 | landscape_4 | landscape_5 | landscape_6 | landscape_7 | landscape_8 | landscape_9 | lateafternoonwanderlust | latesunset | lavark | lc_1 | lc_10 | lc_2 | lc_3 | lc_4 | lc_5 | lc_6 | lc_7 | lc_8 | lc_9 | lenox_340 | levex | life_giving_tree | light | light_blown | litore | little_women | logan | lomo | lomography_redscale_100 | lomography_x-pro_slide_200 | london_nights | longbeachmorning | loro | lotta | louetta | low_altitude | low_contrast_blue | low_key_01 | lucky_64 | lushgreen | lushgreensummer | mad_max_fury_road | maesky | magenta_day | magenta_day_01 | magenta_dream | magenta_yellow | magentacoffee | magichour | marriage_story | matrix | mckinnon_75 | memories | mercato | metropolis | milo_5 | minimalistcaffeination | modern_film | modern_films_01 | modern_films_02 | modern_films_03 | modern_films_04 | modern_films_05 | modern_films_06 | modern_films_07 | molti | mono_2 | mono_tinted | monochrome | monochrome_1 | monochrome_2 | moody_1 | moody_10 | moody_2 | moody_3 | moody_4 | moody_5 | moody_6 | moody_7 | moody_8 | moody_9 | moonlight | moonlight_01 | moonlight_2 | moonrise | morning_6 | morroco_16 | mostly_blue | mother! | motus | moviz_1 | moviz_10 | moviz_11 | moviz_12 | moviz_13 | moviz_14 | moviz_15 | moviz_16 | moviz_17 | moviz_18 | moviz_19 | moviz_2 | moviz_20 | moviz_21 | moviz_22 | moviz_23 | moviz_24 | moviz_25 | moviz_26 | moviz_27 | moviz_28 | moviz_29 | moviz_3 | moviz_30 | moviz_31 | moviz_32 | moviz_33 | moviz_34 | moviz_35 | moviz_36 | moviz_37 | moviz_38 | moviz_39 | moviz_4 | moviz_40 | moviz_41 | moviz_42 | moviz_43 | moviz_44 | moviz_45 | moviz_46 | moviz_47 | moviz_48 | moviz_5 | moviz_6 | moviz_7 | moviz_8 | moviz_9 | mucca | mute_shift | muted_01 | muted_fade | mysticpurplesunset | nah | natural_01 | natural_02 | natural_03 | natural_vivid | naturalboost | negative | nemesis | neon_770 | neutral | neutral_pump | neutral_teal_orange | neutral_warm_fade | newspaper | night_01 | night_02 | night_03 | night_04 | night_05 | night_blade_4 | night_king_141 | night_spy | night_view | nightfromday | nightlife | nigrum | no_time_to_die | nostalgiahoney | nostalgic | nw-1 | nw-10 | nw-2 | nw-3 | nw-4 | nw-5 | nw-6 | nw-7 | nw-8 | nw-9 | old_west | once_upon_a_time | once_upon_a_time_in_hollywood | onda | only_red | only_red_and_blue | operation_yellow | orange_dark_4 | orange_dark_7 | orange_dark_look | orange_tone | orange_underexposed | orangeandblue | oranges | padre | paladin | paladin_1875 | parasite | partia | pasadena_21 | passing_by | perso | picola | pink_fade | pirates_of_the_caribbean | pitaya_15 | pmcinematic_01 | pmcinematic_02 | pmcinematic_03 | pmcinematic_04 | pmcinematic_05 | pmcinematic_06 | pmcinematic_07 | pmnight_01 | pmnight_02 | pmnight_03 | pmnight_04 | pmnight_05 | polaroid_664 | polaroid_665 | polaroid_665_+ | polaroid_665_++ | polaroid_665_- | polaroid_665_-- | polaroid_665_negative | polaroid_665_negative_+ | polaroid_665_negative_- | polaroid_665_negative_hc | polaroid_667 | polaroid_669 | polaroid_669_+ | polaroid_669_++ | polaroid_669_+++ | polaroid_669_- | polaroid_669_-- | polaroid_669_cold | polaroid_669_cold_+ | polaroid_669_cold_- | polaroid_669_cold_-- | polaroid_672 | polaroid_690 | polaroid_690_+ | polaroid_690_++ | polaroid_690_- | polaroid_690_-- | polaroid_690_cold | polaroid_690_cold_+ | polaroid_690_cold_++ | polaroid_690_cold_- | polaroid_690_cold_-- | polaroid_690_warm | polaroid_690_warm_+ | polaroid_690_warm_++ | polaroid_690_warm_- | polaroid_690_warm_-- | polaroid_polachrome | polaroid_px-100uv+_cold | polaroid_px-100uv+_cold_+ | polaroid_px-100uv+_cold_++ | polaroid_px-100uv+_cold_+++ | polaroid_px-100uv+_cold_- | polaroid_px-100uv+_cold_-- | polaroid_px-100uv+_warm | polaroid_px-100uv+_warm_+ | polaroid_px-100uv+_warm_++ | polaroid_px-100uv+_warm_+++ | polaroid_px-100uv+_warm_- | polaroid_px-100uv+_warm_-- | polaroid_px-680 | polaroid_px-680_+ | polaroid_px-680_++ | polaroid_px-680_- | polaroid_px-680_-- | polaroid_px-680_cold | polaroid_px-680_cold_+ | polaroid_px-680_cold_++ | polaroid_px-680_cold_++_alt | polaroid_px-680_cold_- | polaroid_px-680_cold_-- | polaroid_px-680_warm | polaroid_px-680_warm_+ | polaroid_px-680_warm_++ | polaroid_px-680_warm_- | polaroid_px-680_warm_-- | polaroid_px-70 | polaroid_px-70_+ | polaroid_px-70_++ | polaroid_px-70_+++ | polaroid_px-70_- | polaroid_px-70_-- | polaroid_px-70_cold | polaroid_px-70_cold_+ | polaroid_px-70_cold_++ | polaroid_px-70_cold_- | polaroid_px-70_cold_-- | polaroid_px-70_warm | polaroid_px-70_warm_+ | polaroid_px-70_warm_++ | polaroid_px-70_warm_- | polaroid_px-70_warm_-- | polaroid_time_zero_expired | polaroid_time_zero_expired_+ | polaroid_time_zero_expired_++ | polaroid_time_zero_expired_- | polaroid_time_zero_expired_-- | polaroid_time_zero_expired_--- | polaroid_time_zero_expired_cold | polaroid_time_zero_expired_cold_- | polaroid_time_zero_expired_cold_-- | polaroid_time_zero_expired_cold_--- | portrait | portrait_1 | portrait_10 | portrait_2 | portrait_3 | portrait_4 | portrait_5 | portrait_6 | portrait_7 | portrait_8 | portrait_9 | progressen | protect_highlights_01 | prussian_blue | pseudogrey | purple | purple_2 | quraqqq_12 | radar | randas | red_afternoon_01 | red_day_01 | red_dream_01 | redblueyellow | reds | reds_oranges_yellows | reeve_38 | remy_24 | rest_33 | retro | retro_brown_01 | retro_magenta_01 | retro_summer_3 | retro_yellow_01 | rocketman | rollei_ir_400 | rollei_ortho_25 | rollei_retro_100_tonal | rollei_retro_80s | rotate_muted | rotate_vibrant | rotated | rotated_crush | satid | saturated_blue | saving_private_damon | scala | science_fiction | scrittle | sea | seges | selor | sensum | separation | serenity | seringe_4 | serpent | seventies_magazine | sevsuz | shade_kings_ink | shadow_king_39 | shine | sicario | sino | skin_tones | slog_to_rec_709_basic | slog_to_rec_709_contrasty | slog_to_rec_709_crush_shadows | slog_to_rec_709_green_correction | smart_contrast | smokey | smooth_clear | smooth_cromeish | smooth_fade | smooth_green_orange | smooth_sailing | smooth_teal_orange | soft_fade | softblackandwhite | softwarming | solarized_color | solarized_color_2 | soldi | spider-man_far_from_home | spotlight | springmorning | sprocket_231 | spy_29 | standard | star_wars_the_rise_of_skywalker | strano | street | stringa | studio_skin_tone_shaper | subtle_blue | subtle_green | subtle_yellow | sully | summer | summer_alt | sunlight_love_11 | sunlightlove | sunny | sunny_alt | sunny_rich | sunny_warm | sunset | sunset_aqua_orange | sunset_intense_violet_blue | sunset_violet_mood | super_warm | super_warm_rich | sutro_fx | sweet_bubblegum | sweet_gelatto | taşdemirrr_1 | taiga | take_off | tarraco | teal-orange_for_flog | teal_fade | teal_moonlight | tealmagentagold | tealorange | tealorange_1 | tealorange_2 | tealorange_3 | technicalfx_backlight_filter | teigen_28 | tenet | tensiongreen_1 | tensiongreen_2 | tensiongreen_3 | tensiongreen_4 | terra_4 | the_dark_knight | the_darkest_hour | the_gentelmen | the_grand_budapest_hotel | the_hurt_locker | the_irishman | the_lighthouse | the_lobster | the_martian | the_matrices | the_revenant | the_shape_of_water | the_social_network | the_two_popes | the_way_back | thor_ragnarok | thriller_2 | tirare | toastedgarden | top_gun_maverick | trent_18 | true_colors_8 | turkiest_42 | tutto | tweed_71 | ultra_water | uncut_gems | undeniable | undeniable_2 | underwater | unknown | upglow | urban_01 | urban_02 | urban_03 | urban_04 | urban_05 | urban_cowboy | uzbek_bukhara | uzbek_marriage | uzbek_samarcande | valize | valsky | velvetia | venom | very_warm_greenish | vfb_21 | vibrant | vibrant_alien | vibrant_contrast | vibrant_cromeish | victory | vintage | vintage_01 | vintage_02 | vintage_03 | vintage_04 | vintage_05 | vintage_163 | vintage_alt | vintage_brighter | vintage_chrome | vintage_mob | vintage_warmth_1 | violet_taste | vireo_37 | vita | vivid | vubes | war_for_the_planet_of_the_apes | warm | warm_dark_contrasty | warm_fade | warm_fade_1 | warm_highlight | warm_neutral | warm_sunset_red | warm_teal | warm_vintage | warm_yellow | wavefire | waves | well_see | western | western_6 | westernlut_2 | westernlut_2_13 | whiter_whites | wingspan | winterlighthouse | wipe | wolf_of_wall_street | wonder_woman | wooden_gold_20 | x-men_dark_phoenix | yangabuz_8 | yellow_55b | yellow_film_01 | yellowstone | you_can_do_it | zed_32 | zeke_39 | zilverfx_bw_solarization | zilverfx_infrared | zilverfx_vintage_bw | zombieland_double_tap }\fR \fBDefault values\fR: '\fBresolution=33\fR' and '\fBcut_and_round=1\fR'. \fBExample:\fR [#1] clut summer clut alien_green,17 clut orange_dark4,48\fR \fBclut2hald:\fR Convert selected 3D CLUTs to 2D HaldCLUTs. \fBExample:\fR [#1] clut summer +clut2hald\fR \fBcmy2rgb:\fR Convert color representation of selected images from CMY to RGB. \fBcmyk2rgb:\fR Convert color representation of selected images from CMYK to RGB. \fBcolorblind:\fR type={ 0:Protanopia | 1:Protanomaly | 2:Deuteranopia | 3:Deuteranomaly | 4:Tritanopia | 5:Tritanomaly | 6:Achromatopsia | 7:Achromatomaly }\fR Simulate color blindness vision. Simulation method by Vienot, Brettel & Mollon (1999), "Digital video colormaps for checking the legibility of displays by dichromats". The dichromacy matrices of the paper were adapted to sRGB (RGB->XYZ). Anomalous trichromacy simulated via linear interpolation with the identity and a factor of 0.6. \fBExample:\fR [#1] image.jpg +colorblind 0\fR \fBcolormap:\fR nb_levels>=0,_method={ 0:Median-cut | 1:K-means },_sort_vectors\fR Estimate best-fitting colormap with '\fBnb_levels\fR' entries, to index selected images. Specify '\fBnb_levels==0\fR' to extract all existing colors of an image. '\fBsort_vectors\fR' can be \fB{ 0:Do not sort | 1:By increasing norm | 2:By decreasing occurrence }\fR. \fBDefault value\fR: '\fBmethod=1\fR' and '\fBsort_vectors=1\fR'. \fBExample:\fR [#1] image.jpg +colormap[0] 4 +colormap[0] 8 +colormap[0] 16\fR \fBTutorial: \fR\fIhttps://gmic.eu/oldtutorial/_colormap\fR \fBcompose_channels:\fR _operator\fR Compose all channels of each selected image, using specified arithmetic operator (+,-,or,min,...). \fBDefault value\fR: '\fBoperator=+\fR'. \fBExample:\fR [#1] image.jpg +compose_channels and\fR \fBTutorial: \fR\fIhttps://gmic.eu/tutorial/compose_channels\fR \fBcontrast:\fR strength\fR Change contrast of selected images, with specified strength. * If '\fBstrength\fR' is positive, image contrast is amplified. * If '\fBstrength\fR' is negative, image contrast is reduced. A typical value range for parameter '\fBstrength\fR' is [-100,100]. \fBExample:\fR [#1] image.jpg +contrast 20\fR \fBcount_colors:\fR _count_until={ 0:None | >0:Max number of counted colors }\fR Count number of distinct colors in selected images until it reaches the specified max number of counted colors. Set '\fBcount_until\fR' to '\fB0\fR' to disable limit on counted colors. This command returns the number of distinct colors for each image (separated by commas). \fBdeltaE:\fR [image],_metric={ 0:DeltaE_1976 | 1:DeltaE_2000 },"_to_Lab_command"\fR Compute the CIE DeltaE color difference between selected images and specified [image]. Argument '\fBto_Lab_command\fR' is a command able to convert colors of [image] into a Lab representation. \fBDefault values\fR: '\fBmetric=1\fR' and '\fBto_Lab_command="srgb2lab"\fR'. \fBExample:\fR [#1] image.jpg +blur 2 +deltaE[0] [1],1,srgb2lab\fR \fBdirection2rgb:\fR Compute RGB representation of selected 2D direction fields. \fBExample:\fR [#1] image.jpg luminance gradient append c blur 2 orientation +direction2rgb\fR \fBditheredbw:\fR Create dithered B&W version of selected images. \fBExample:\fR [#1] image.jpg +equalize ditheredbw[-1]\fR \fBfc:\fR Shortcut for command '\fBfill_color\fR'. \fBfill_color:\fR col1,...,colN\fR Fill selected images with specified color. (equivalent to shortcut command '\fBfc\fR'). \fBExample:\fR [#1] image.jpg +fill_color 255,0,255\fR \fBTutorial: \fR\fIhttps://gmic.eu/oldtutorial/_fill_color\fR \fBgradient2rgb:\fR _is_orientation={ 0:No | 1:Yes }\fR Compute RGB representation of 2D gradient of selected images. \fBDefault value\fR: '\fBis_orientation=0\fR'. \fBExample:\fR [#1] image.jpg +gradient2rgb 0 equalize[-1]\fR \fBhald2clut:\fR Convert selected 2D HaldCLUTs to 3D CLUTs. \fBhcy2rgb:\fR Convert color representation of selected images from HCY to RGB. \fBhsi2rgb:\fR Convert color representation of selected images from HSI to RGB. \fBhsi82rgb:\fR Convert color representation of selected images from HSI8 to RGB. \fBhsl2rgb:\fR Convert color representation of selected images from HSL to RGB. \fBhsl82rgb:\fR Convert color representation of selected images from HSL8 to RGB. \fBhsv2rgb:\fR Convert color representation of selected images from HSV to RGB. \fBExample:\fR [#1] (0,360;0,360^0,0;1,1^1,1;1,1) resize 400,400,1,3,3 hsv2rgb\fR \fBhsv82rgb:\fR Convert color representation of selected images from HSV8 to RGB. \fBint2rgb:\fR Convert color representation of selected images from INT24 to RGB. \fBipremula:\fR Convert selected images with premultiplied alpha colors to normal colors. See also: \fIpremula\fR. \fBjzazbz2rgb:\fR illuminant={ 0:D50 | 1:D65 | 2:E } |\fR (no arg)\fR Convert color representation of selected images from RGB to Jzazbz. \fBDefault value\fR: '\fBilluminant=2\fR'. \fBjzazbz2xyz:\fR Convert color representation of selected images from RGB to XYZ. \fBlab2lch:\fR Convert color representation of selected images from Lab to Lch. \fBlab2rgb:\fR illuminant={ 0:D50 | 1:D65 | 2:E } |\fR (no arg)\fR Convert color representation of selected images from Lab to RGB. \fBDefault value\fR: '\fBilluminant=2\fR'. \fBExample:\fR [#1] (50,50;50,50^-3,3;-3,3^-3,-3;3,3) resize 400,400,1,3,3 lab2rgb\fR \fBlab2srgb:\fR illuminant={ 0:D50 | 1:D65 | 2:E } |\fR (no arg)\fR Convert color representation of selected images from Lab to sRGB. \fBDefault value\fR: '\fBilluminant=2\fR'. \fBExample:\fR [#1] (50,50;50,50^-3,3;-3,3^-3,-3;3,3) resize 400,400,1,3,3 lab2rgb\fR \fBlab82srgb:\fR illuminant={ 0:D50 | 1:D65 | 2:E } |\fR (no arg)\fR Convert color representation of selected images from Lab8 to sRGB. \fBDefault value\fR: '\fBilluminant=2\fR'. \fBExample:\fR [#1] (50,50;50,50^-3,3;-3,3^-3,-3;3,3) resize 400,400,1,3,3 lab2rgb\fR \fBlab2xyz:\fR illuminant={ 0:D50 | 1:D65 | 2:E } |\fR (no arg)\fR Convert color representation of selected images from Lab to XYZ. \fBDefault value\fR: '\fBilluminant=2\fR'. \fBlab82rgb:\fR illuminant={ 0:D50 | 1:D65 | 2:E } |\fR (no arg)\fR Convert color representation of selected images from Lab8 to RGB. \fBDefault value\fR: '\fBilluminant=2\fR'. \fBlch2lab:\fR Convert color representation of selected images from Lch to Lab. \fBlch2rgb:\fR illuminant={ 0:D50 | 1:D65 | 2:E } |\fR (no arg)\fR Convert color representation of selected images from Lch to RGB. \fBDefault value\fR: '\fBilluminant=2\fR'. \fBlch82rgb:\fR illuminant={ 0:D50 | 1:D65 | 2:E } |\fR (no arg)\fR Convert color representation of selected images from Lch8 to RGB. \fBDefault value\fR: '\fBilluminant=2\fR'. \fBluminance:\fR Compute luminance of selected sRGB images. \fBExample:\fR [#1] image.jpg +luminance\fR \fBTutorial: \fR\fIhttps://gmic.eu/tutorial/luminance\fR \fBlightness:\fR Compute lightness of selected sRGB images. \fBExample:\fR [#1] image.jpg +lightness\fR \fBlut_contrast:\fR _nb_colors>1,_min_rgb_value\fR Generate a RGB colormap where consecutive colors have high contrast. This function performs a specific score maximization to generate the result, so it may take some time when '\fBnb_colors\fR' is high. \fBDefault values\fR: '\fBnb_colors=256\fR' and '\fBmin_rgb_value=64\fR'. \fBmap_clut:\fR [clut] | "clut_name"\fR Map specified RGB color LUT to selected images. \fBExample:\fR [#1] image.jpg uniform_distribution {2^6},3 mirror[-1] x +map_clut[0] [1]\fR \fBtransfer_histogram:\fR [style],_nb_levels>0,_color_channels\fR Transfer the channel-wise histograms of the specified style image to selected images. Argument '\fBcolor channels\fR' is the same as with command '\fBapply_channels\fR'. \fBDefault value\fR: '\fBnb_levels=256\fR' and '\fBcolor_channels=all\fR'. \fBExample:\fR [#1] image.jpg 100,100,1,3,"u([256,200,100])" +transfer_histogram[0] [1]\fR \fBtransfer_pca:\fR [style],_color_channels\fR Transfer the mean and the covariance matrix of specified vector-valued style image to selected images. Argument '\fBcolor channels\fR' is the same as with command '\fBapply_channels\fR'. \fBDefault value\fR: '\fBcolor_channels=all\fR'. \fBExample:\fR [#1] sample lena,earth +transfer_pca[0] [1]\fR \fBtransfer_rgb:\fR [style],_rgb_smoothness>0,_beta>0,_regul_iterations>=0,_brightness_constraint>=0,_transfer_avg_std={ 0:No | 1:Avg-only | 2 |\fR Avg-Std },_colorspace={ 0:srgb | 1:lrgb | 2:ycbcr | 3:lab },_resolution3d>0,[color_constraints],_lambda>=0\fR Transfer RGB colors from specified style image to selected images, using 3D variational registration. When '\fB[color_constraints]\fR' is provided, it must be a 6D image where each point has the meaning: [ Rimg,Gimg,Bimg, Rstyle,Gstyle,Bstyle ] \fBDefault values\fR: '\fBrgb_smoothness=0.01\fR', '\fBbeta=1\fR', '\fBregul_iterations=3\fR', '\fBbrightness_constraint=0.35\fR', '\fBtransfer_avg_std=0\fR', '\fBcolorspace=0\fR', '\fBresolution3d=32\fR', '\fB[color_constraints]=(undefined)\fR' and '\fBlambda=1000\fR'. \fBExample:\fR [#1] sample colorful,eagle +transfer_rgb[0] [1]\fR [#2] sample pencils,wall +transfer_rgb[0] [1]\fR \fBmix_rgb:\fR a11,a12,a13,a21,a22,a23,a31,a32,a33\fR Apply 3x3 specified matrix to RGB colors of selected images. \fBDefault values\fR: '\fBa11=1\fR', '\fBa12=a13=a21=0\fR', '\fBa22=1\fR', '\fBa23=a31=a32=0\fR' and '\fBa33=1\fR'. \fBExample:\fR [#1] image.jpg +mix_rgb 0,1,0,1,0,0,0,0,1\fR \fBTutorial: \fR\fIhttps://gmic.eu/tutorial/mix_rgb\fR \fBoklab2rgb:\fR Convert color representation of selected images from OKlab to RGB. (see color space definition at: \fIhttps://bottosson.github.io/posts/oklab/\fR ). See also: \fIrgb2oklab\fR. \fBpalette:\fR palette_name | palette_number\fR Input specified color palette at the end of the image list. '\fBpalette_name\fR' can be \fB{ default | hsv | lines | hot | cool | jet | flag | cube | rainbow | parula | spring | summer | autumn | winter | bone | copper | pink | vga | algae | amp | balance | curl | deep | delta | dense | diff | gray | haline | ice | matter | oxy | phase | rain | solar | speed | tarn | tempo | thermal | topo | turbid | aurora | hocuspocus | srb2 | uzebox | amiga7800 | amiga7800mess | fornaxvoid1 }\fR \fBExample:\fR [#1] palette hsv\fR \fBpremula:\fR Convert selected images with normal colors to premultiplied alpha colors. After conversion, alpha channel of resulting images has value in [0,1] range. See also: \fIipremula\fR. \fBpseudogray:\fR _max_increment>=0,_JND_threshold>=0,_bits_depth>0\fR Generate pseudogray colormap with specified increment and perceptual threshold. If '\fBJND_threshold\fR' is 0, no perceptual constraints are applied. \fBDefault values\fR: '\fBmax_increment=5\fR', '\fBJND_threshold=2.3\fR' and '\fBbits_depth=8\fR'. \fBExample:\fR [#1] pseudogray 5\fR \fBrandom_clut:\fR Generate a 33x33x33 random 3D color LUT. \fBExample:\fR [#1] image.jpg random_clut +map_clut.. .\fR \fBrandom_clut:\fR _seed = { >=0 | -1 }\fR Generate a 33x33x33 random 3D color LUT. If specified '\fBseed\fR' is positive, it is used as a seed for the random number generator @cli : (so that using the same seed will return the same CLUT). \fBExample:\fR [#1] image.jpg random_clut +map_clut.. .\fR \fBreplace_color:\fR tolerance[%]>=0,smoothness[%]>=0,src1,src2,...,dest1,dest2,...\fR Replace pixels from/to specified colors in selected images. \fBExample:\fR [#1] image.jpg +replace_color 40,3,204,153,110,255,0,0\fR \fBretinex:\fR _value_offset>0,_colorspace={ hsi | hsv | lab | lrgb | rgb | ycbcr },0<=_min_cut<=100,0<=_max_cut<=100,_sigma_low>0,_sigma_mid>0,_sigma_high>0\fR Apply multi-scale retinex algorithm on selected images to improve color consistency. (as described on the page: \fIhttp://www.ipol.im/pub/art/2014/107/\fR). \fBDefault values\fR: '\fBoffset=1\fR', '\fBcolorspace=hsv\fR', '\fBmin_cut=1\fR', '\fBmax_cut=1\fR', '\fBsigma_low=15\fR','\fBsigma_mid=80\fR' and '\fBsigma_high=250\fR'. \fBrgb:\fR _min_RGB_value,_max_RGB_value |\fR (no arg)\fR Return a random int-valued RGB color. \fBrgba:\fR _min_RGB_value,_max_RGB_value,_min_A_value,_max_A_value |\fR (no_arg)\fR Return a random int-valued RGBA color. \fBrgb2bayer:\fR _start_pattern=0,_color_grid=0\fR Transform selected color images to RGB-Bayer sampled images. \fBDefault values\fR: '\fBstart_pattern=0\fR' and '\fBcolor_grid=0\fR'. \fBExample:\fR [#1] image.jpg +rgb2bayer 0\fR \fBrgb2cmy:\fR Convert color representation of selected images from RGB to CMY. \fBExample:\fR [#1] image.jpg rgb2cmy split c\fR \fBrgb2cmyk:\fR Convert color representation of selected images from RGB to CMYK. \fBExample:\fR [#1] image.jpg rgb2cmyk split c\fR [#2] image.jpg rgb2cmyk split c fill[3] 0 append c cmyk2rgb\fR \fBrgb2hcy:\fR Convert color representation of selected images from RGB to HCY. \fBExample:\fR [#1] image.jpg rgb2hcy split c\fR \fBrgb2hsi:\fR Convert color representation of selected images from RGB to HSI. \fBExample:\fR [#1] image.jpg rgb2hsi split c\fR \fBrgb2hsi8:\fR Convert color representation of selected images from RGB to HSI8. \fBExample:\fR [#1] image.jpg rgb2hsi8 split c\fR \fBrgb2hsl:\fR Convert color representation of selected images from RGB to HSL. \fBExample:\fR [#1] image.jpg rgb2hsl split c\fR [#2] image.jpg rgb2hsl +split c add[-3] 100 mod[-3] 360 append[-3--1] c hsl2rgb\fR \fBrgb2hsl8:\fR Convert color representation of selected images from RGB to HSL8. \fBExample:\fR [#1] image.jpg rgb2hsl8 split c\fR \fBrgb2hsv:\fR Convert color representation of selected images from RGB to HSV. \fBExample:\fR [#1] image.jpg rgb2hsv split c\fR [#2] image.jpg rgb2hsv +split c add[-2] 0.3 cut[-2] 0,1 append[-3--1] c hsv2rgb\fR \fBrgb2hsv8:\fR Convert color representation of selected images from RGB to HSV8. \fBExample:\fR [#1] image.jpg rgb2hsv8 split c\fR \fBrgb2int:\fR Convert color representation of selected images from RGB to INT24 scalars. \fBExample:\fR [#1] image.jpg rgb2int\fR \fBrgb2jzazbz:\fR illuminant={ 0:D50 | 1:D65 | 2:E } |\fR (no arg)\fR Convert color representation of selected images from RGB to Jzazbz. \fBDefault value\fR: '\fBilluminant=2\fR'. \fBrgb2lab:\fR illuminant={ 0:D50 | 1:D65 | 2:E } |\fR (no arg)\fR Convert color representation of selected images from RGB to Lab. \fBDefault value\fR: '\fBilluminant=2\fR'. \fBrgb2lab8:\fR illuminant={ 0:D50 | 1:D65 | 2:E } |\fR (no arg)\fR Convert color representation of selected images from RGB to Lab8. \fBDefault value\fR: '\fBilluminant=2\fR'. \fBExample:\fR [#1] image.jpg rgb2lab8 split c\fR \fBrgb2lch:\fR illuminant={ 0:D50 | 1:D65 | 2:E } |\fR (no arg)\fR Convert color representation of selected images from RGB to Lch. \fBDefault value\fR: '\fBilluminant=2\fR'. \fBExample:\fR [#1] image.jpg rgb2lch split c\fR \fBrgb2lch8:\fR illuminant={ 0:D50 | 1:D65 | 2:E } |\fR (no arg)\fR Convert color representation of selected images from RGB to Lch8. \fBDefault value\fR: '\fBilluminant=2\fR'. \fBExample:\fR [#1] image.jpg rgb2lch8 split c\fR \fBrgb2luv:\fR Convert color representation of selected images from RGB to LUV. \fBExample:\fR [#1] image.jpg rgb2luv split c\fR \fBrgb2oklab:\fR Convert color representation of selected images from RGB to Oklab. (see color space definition at: \fIhttps://bottosson.github.io/posts/oklab/\fR ). See also: \fIoklab2rgb\fR. \fBrgb2ryb:\fR Convert color representation of selected images from RGB to RYB. \fBExample:\fR [#1] image.jpg rgb2ryb split c\fR \fBrgb2srgb:\fR Convert color representation of selected images from linear RGB to sRGB. \fBrgb2xyz:\fR illuminant={ 0:D50 | 1:D65 | 2:E } |\fR (no arg)\fR Convert color representation of selected images from RGB to XYZ. \fBDefault value\fR: '\fBilluminant=2\fR'. \fBExample:\fR [#1] image.jpg rgb2xyz split c\fR \fBrgb2xyz8:\fR illuminant={ 0:D50 | 1:D65 | 2:E } |\fR (no arg)\fR Convert color representation of selected images from RGB to XYZ8. \fBDefault value\fR: '\fBilluminant=2\fR'. \fBExample:\fR [#1] image.jpg rgb2xyz8 split c\fR \fBrgb2yiq:\fR Convert color representation of selected images from RGB to YIQ. \fBExample:\fR [#1] image.jpg rgb2yiq split c\fR \fBrgb2yiq8:\fR Convert color representation of selected images from RGB to YIQ8. \fBExample:\fR [#1] image.jpg rgb2yiq8 split c\fR \fBrgb2ycbcr:\fR Convert color representation of selected images from RGB to YCbCr. \fBExample:\fR [#1] image.jpg rgb2ycbcr split c\fR \fBrgb2yuv:\fR Convert color representation of selected images from RGB to YUV. \fBExample:\fR [#1] image.jpg rgb2yuv split c\fR \fBrgb2yuv8:\fR Convert color representation of selected images from RGB to YUV8. \fBExample:\fR [#1] image.jpg rgb2yuv8 split c\fR \fBremove_opacity:\fR Remove opacity channel of selected images. \fBryb2rgb:\fR Convert color representation of selected images from RYB to RGB. \fBselect_color:\fR tolerance[%]>=0,col1,...,colN\fR Select pixels with specified color in selected images. \fBExample:\fR [#1] image.jpg +select_color 40,204,153,110\fR \fBTutorial: \fR\fIhttps://gmic.eu/oldtutorial/_select_color\fR \fBsepia:\fR Apply sepia tones effect on selected images. \fBExample:\fR [#1] image.jpg sepia\fR \fBsolarize:\fR Solarize selected images. \fBExample:\fR [#1] image.jpg solarize\fR \fBsplit_colors:\fR _max_nb_outputs>=0\fR Split selected images as several single-colored outputs. One selected image can be split as at most '\fBmax_nb_outputs\fR' images. Output images are sorted by decreasing color occurrence and have an additional alpha-channel. If '\fBmax_nb_outputs==0\fR', there are as many outputs as different colors in the input images. \fBDefault values\fR: '\fBmax_nb_outputs=0\fR'. \fBExample:\fR [#1] image.jpg quantize 5 +split_colors , display_rgba\fR \fBsplit_opacity:\fR Split color and opacity parts of selected images. This command returns 1 or 2 images for each selected image, depending on whether it has an opacity channel. \fBsplit_vector:\fR keep_splitting_values={ +:Increasing | -:Decreasing },value1,_value2,...\fR Split selected images into multiple parts, where specified vector '\fB[value1,_value2,...]\fR' is the separator. \fBsrgb2lab:\fR illuminant={ 0:D50 | 1:D65 | 2:E } |\fR (no arg)\fR Convert color representation of selected images from sRGB to Lab. \fBDefault value\fR: '\fBilluminant=2\fR'. \fBExample:\fR [#1] image.jpg srgb2lab split c\fR [#2] image.jpg srgb2lab +split c mul[-2,-1] 2.5 append[-3--1] c lab2srgb\fR \fBsrgb2lab8:\fR illuminant={ 0:D50 | 1:D65 | 2:E } |\fR (no arg)\fR Convert color representation of selected images from sRGB to Lab8. \fBDefault value\fR: '\fBilluminant=2\fR'. \fBsrgb2rgb:\fR Convert color representation of selected images from sRGB to linear RGB. \fBto_a:\fR Force selected images to have an alpha channel. \fBto_color:\fR Force selected images to be in color mode (RGB or RGBA). \fBto_colormode:\fR mode={ 0:Adaptive | 1:G | 2:GA | 3:RGB | 4:RGBA }\fR Force selected images to be in a given color mode. \fBDefault value\fR: '\fBmode=0\fR'. \fBto_gray:\fR Force selected images to be in GRAY mode. \fBExample:\fR [#1] image.jpg +to_gray\fR \fBto_graya:\fR Force selected images to be in GRAYA mode. \fBto_pseudogray:\fR _max_step>=0,_is_perceptual_constraint={ 0:No | 1:Yes },_bits_depth>0\fR Convert selected scalar images ([0-255]-valued) to pseudo-gray color images. \fBDefault values\fR: '\fBmax_step=5\fR', '\fBis_perceptual_constraint=1\fR' and '\fBbits_depth=8\fR'. The original pseudo-gray technique has been introduced by Rich Franzen \fIhttp://r0k.us/graphics/pseudoGrey.html\fR. Extension of this technique to arbitrary increments for more tones, has been done by David Tschumperlé. \fBto_rgb:\fR Force selected images to be in RGB mode. \fBto_rgba:\fR Force selected images to be in RGBA mode. \fBto_automode:\fR Force selected images to be in the most significant color mode. This commands checks for useless alpha channel (all values equal to 255), as well as detects grayscale images encoded as color images. \fBxyz2jzazbz:\fR Convert color representation of selected images from XYZ to RGB. \fBxyz2lab:\fR illuminant={ 0:D50 | 1:D65 | 2:E } |\fR (no arg)\fR Convert color representation of selected images from XYZ to Lab. \fBDefault value\fR: '\fBilluminant=2\fR'. \fBxyz2rgb:\fR illuminant={ 0:D50 | 1:D65 | 2:E } |\fR (no arg)\fR Convert color representation of selected images from XYZ to RGB. \fBDefault value\fR: '\fBilluminant=2\fR'. \fBxyz82rgb:\fR illuminant={ 0:D50 | 1:D65 | 2:E } |\fR (no arg)\fR Convert color representation of selected images from XYZ8 to RGB. \fBDefault value\fR: '\fBilluminant=2\fR'. \fBycbcr2rgb:\fR Convert color representation of selected images from YCbCr to RGB. \fByiq2rgb:\fR Convert color representation of selected images from YIQ to RGB. \fByiq82rgb:\fR Convert color representation of selected images from YIQ8 to RGB. \fByuv2rgb:\fR Convert color representation of selected images from YUV to RGB. \fByuv82rgb:\fR Convert selected images from YUV8 to RGB color bases. \fB\fB11.7. Geometry Manipulation\fR \fB ---------------------\fR \fBa (+):\fR Shortcut for command '\fBappend\fR'. \fBappend (+):\fR [image],axis,_centering |\fR axis,_centering\fR Append specified image to selected images, or all selected images together, along specified axis. (equivalent to shortcut command '\fBa\fR'). '\fBaxis\fR' can be \fB{ x | y | z | c }\fR. Usual '\fBcentering\fR' values are \fB{ 0:left-justified | 0.5:centered | 1:right-justified }\fR. \fBDefault value\fR: '\fBcentering=0\fR'. \fBExample:\fR [#1] image.jpg split y,10 reverse append y\fR [#2] image.jpg repeat 5 { +rows[0] 0,{10+18*$>}% } remove[0] append x,0.5\fR [#3] image.jpg append[0] [0],y\fR \fBappend_tiles:\fR _M>=0,_N>=0,0<=_centering_x<=1,0<=_centering_y<=1\fR Append MxN selected tiles as new images. If '\fBN\fR' is set to 0, number of rows is estimated automatically. If '\fBM\fR' is set to 0, number of columns is estimated automatically. If '\fBM\fR' and '\fBN\fR' are both set to '\fB0\fR', auto-mode is used. If '\fBM\fR' or '\fBN\fR' is set to 0, only a single image is produced. '\fBcentering_x\fR' and '\fBcentering_y\fR' tells about the centering of tiles when they have different sizes. \fBDefault values\fR: '\fBM=0\fR', '\fBN=0\fR', '\fBcentering_x=centering_y=0.5\fR'. \fBExample:\fR [#1] image.jpg split xy,4 append_tiles ,\fR \fBapply_scales:\fR "command",number_of_scales>0,_min_scale[%]>=0,_max_scale[%]>=0,_scale_gamma>0,_interpolation\fR Apply specified command on different scales of selected images. '\fBinterpolation\fR' can be \fB{ 0:None | 1:Nearest | 2:Average | 3:Linear | 4:Grid | 5:Bicubic | 6:Lanczos }\fR. \fBDefault value\fR: '\fBmin_scale=25%\fR', '\fBmax_scale=100%\fR' and '\fBinterpolation=3\fR'. \fBExample:\fR [#1] image.jpg apply_scales "blur 5 sharpen 1000",4\fR \fBarrange:\fR _"layout",-1<=_align_or_scale_factor<=1,_output_layers={ 0:Single | 1:Multiple (volumetric) | 2:Multiple (named) },_"processing_command"\fR Arrange selected images according to a specified layout, described as a string. '\fBlayout\fR' describes how images are combined together, using the following symbols (case-insensitive): * A number: Refers to one of the selected images, by its index. * '\fB?\fR' : A random image index. * '\fBX\fR' : Mirrors what follows horizontally (left-right flip). * '\fBY\fR' : Mirrors what follows vertically (top-bottom flip). * '\fBR\fR' : Rotates what follows by 90 degrees clockwise. * '\fBL\fR' : Rotates what follows by 90 degrees counter-clockwise. * '\fBH\fR' : Puts what follows side by side, horizontally (left / right). * '\fBV\fR' : Puts what follows one above the other, vertically (top / bottom). * '\fBB\fR' : Same as '\fBH\fR' or '\fBV\fR', but automatically picks whichever gives the most balanced (square-looking) result. * '\fBQ\fR' : Rotates what follows by a random multiple of 90 degrees. * '\fBF\fR' : Flips what follows randomly, along the x-axis or the y-axis. * '\fBM\fR' : Merges what follows randomly, either horizontally or vertically. Any other character (e.g. '\fB;\fR' or '\fB:\fR') can be used as a separator between two numbers to avoid ambiguity (e.g. to distinguish images '\fB0\fR' and '\fB1\fR' from a single image '\fB01\fR'). Images get combined together two by two. For instance: * '\fB"H0:1"\fR' puts images 0 and 1 side by side. * '\fB"V0:1"\fR' stacks images 0 and 1 on top of each other. * '\fB"VH0:1H2:3"\fR' first forms two horizontal pairs (0,1) and (2,3), then stack those two pairs vertically, resulting in a 2x2 grid. * '\fB"H0R1"\fR' puts image 0 next to image 1 rotated 90 degrees clockwise. Four predefined shortcuts are also available for '\fBlayout\fR', to quickly arrange all selected images at once without having to spell out a full layout string: * '\fB"H"\fR' : Concatenates all selected images horizontally, in order. * '\fB"V"\fR' : Concatenates all selected images vertically, in order. * '\fB"AH"\fR' : Automatically arranges all images into a grid, with a number of columns greater than or equal to the number of rows. * '\fB"AV"\fR' : Does the same as '\fBAH\fR', but with a number of rows greater than or equal to the number of columns. '\fBalign_or_scale_factor\fR' controls how images of different sizes are combined together: * When positive, images get resized to a common size: '\fB0\fR' shrinks to the smallest size involved, '\fB1\fR' grows to the largest, and intermediate values interpolate between both. * When negative, images keep their original size instead, and are simply placed next to each other. Its absolute value then sets the alignment between images of different sizes ('\fB0\fR': top-left, '\fB0.5\fR':centered, '\fB1\fR':bottom-right). '\fBoutput_layers\fR' sets whether the result is a single, flattened image ('\fBSingle\fR'), or a single volumetric image whose slices are the individual, resized and positioned images ('\fBMultiple\fR'), each one exactly as it would appear in the final composition. '\fBprocessing_command\fR' is an optional G'MIC\fR command (or pipeline of commands) applied to each image individually, just after it has been resized and right before it gets placed into the composition (e.g. to add a colored border, apply a filter, etc.). \fBDefault values\fR: '\fBlayout=AH\fR', '\fBalign_or_scale_factor=0.5\fR', '\fBoutput_layers=0\fR' and '\fBprocessing_command=""\fR'. \fBExample:\fR [#1] sample colorful,eagle,cat,dog +arrange "VH0:1H2:3"\fR [#2] sample cat,dog,monkey,duck +arrange AH,-0.5\fR [#3] sample colorful,eagle,cat,dog,flower,rose arrange AH\fR [#4] sample colorful,eagle,duck +arrange VH0R1:2,,,"sepia shrink xy,20 frame xy,8,255 frame xy,12,0"\fR \fBautocrop:\fR _axes,_value1,_value2,...\fR Autocrop selected images according to specified axes and values. '\fBaxes\fR' can be \fB{ x | y | z | c | xy | xz | xc | yz | yc | zc | xyz | xyc | xzc | yzc | xyzc }\fR. If no '\fBaxes\fR' are provided, autocrop is assumed to be spatial only (e.g. '\fBaxes=xyz\fR'). If no value arguments are provided, cropping value is automatically guessed. \fBDefault values\fR: '\fBaxes=xyz\fR'. See also: \fIautocrop_coords\fR. \fBExample:\fR [#1] 400,400,1,3 fill_color 64,128,255 ellipse 50%,50%,120,120,0,1,255 +autocrop\fR \fBautocrop_components:\fR _threshold[%],_min_area[%]>=0,_is_high_connectivity={ 0:No | 1:Yes },_output_type={ 0:Crop | 1:Segmentation | 2:Coordinates }\fR Autocrop and extract connected components in selected images, according to a mask given as the last channel of each of the selected image (e.g. alpha-channel). \fBDefault values\fR: '\fBthreshold=0%\fR', '\fBmin_area=0.1%\fR', '\fBis_high_connectivity=0\fR' and '\fBoutput_type=1\fR'. \fBExample:\fR [#1] 256,256 noise 0.1,2 eq 1 dilate_circ 20 label_fg 0,1 normalize 0,255 +neq 0 *[-1] 255 append c +autocrop_components ,\fR \fBautocrop_coords:\fR _axes,_value1,_value2,...\fR Return coordinates of the bounding box that would be used to autocrop selected images, according to specified axes and values. '\fBaxes\fR' can be \fB{ x | y | z | c | xy | xz | xc | yz | yc | zc | xyz | xyc | xzc | yzc | xyzc }\fR. If no '\fBaxes\fR' are provided, autocrop is assumed to be spatial only (e.g. '\fBaxes=xyz\fR'). If no value arguments are provided, cropping value is automatically guessed. If input image is constant and equal to the crop value, -1 is returned for all output coordinates. \fBDefault values\fR: '\fBaxes=xyz\fR'. See also: \fIautocrop\fR. \fBautocrop_seq:\fR value1,value2,... | auto\fR Autocrop selected images using the crop geometry of the last one by specified vector-valued intensity, or by automatic guessing the cropping value. \fBDefault value\fR: auto mode. \fBExample:\fR [#1] image.jpg +fill[-1] 0 ellipse[-1] 50%,50%,30%,20%,0,1,1 autocrop_seq 0\fR \fBchannels:\fR c0[%],_c1[%],_boundary_conditions\fR Keep only specified channels of selected images. '\fBboundary_conditions\fR' can be \fB{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR. \fBDefault values\fR: '\fBc1=c0\fR' and '\fBboundary_conditions=0\fR'. \fBExample:\fR [#1] image.jpg channels 1\fR [#2] image.jpg luminance channels 0,2\fR \fBcolumns:\fR x0[%],_x1[%],_boundary_conditions\fR Keep only specified columns of selected images. '\fBboundary_conditions\fR' can be \fB{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR. \fBDefault values\fR: '\fBx1=x0\fR' and '\fBboundary_conditions=0\fR'. \fBExample:\fR [#1] image.jpg columns -25%,50%\fR \fBz (+):\fR Shortcut for command '\fBcrop\fR'. \fBcrop (+):\fR x0[%],x1[%],_boundary_conditions |\fR x0[%],y0[%],x1[%],y1[%],_boundary_conditions |\fR x0[%],y0[%],z0[%],x1[%],y1[%],z1[%],_boundary_conditions |\fR x0[%],y0[%],z0[%],c0[%],x1[%],y1[%],z1[%],c1[%],_boundary_conditions\fR Crop selected images with specified region coordinates. (equivalent to shortcut command '\fBz\fR'). '\fBboundary_conditions\fR' can be \fB{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR. \fBDefault value\fR: '\fBboundary_conditions=0\fR'. \fBExample:\fR [#1] image.jpg +crop -230,-230,280,280,1 crop[0] -230,-230,280,280,0\fR [#2] image.jpg crop 25%,25%,75%,75%\fR \fBelevate:\fR _depth,_is_plain={ 0:No | 1:Yes },_is_colored={ 0:No | 1:Yes }\fR Elevate selected 2D images into 3D volumes. \fBDefault values\fR: '\fBdepth=64\fR', '\fBis_plain=1\fR' and '\fBis_colored=1\fR'. \fBExample:\fR [#1] sample colorful,64 +elevate 32\fR \fBexpand:\fR axes,size[%],_boundary_conditions={ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR Expand selected images along the specified axes. '\fBaxes\fR' can be \fB{ x | y | z | c | xy | xz | xc | yz | yc | zc | xyz | xyc | xzc | yzc | xyzc }\fR. \fBDefault value\fR: '\fBboundary_conditions=0\fR'. \fBExample:\fR [#1] image.jpg expand xy,30\fR \fBextract:\fR "condition",_output_type={ 0:XYZC-coords | 1:XYZ-coords | 2:Scalar-values | 3:Vector-values | 4:XYZC-coords + scalar value | 5:XYZ-coords + vector-values }\fR Extract a list of coordinates or values from selected image, where specified mathematical condition holds. For N coordinates matching, result is a 1xNx1x4 image. \fBDefault values\fR: '\fBoutput_type=0\fR'. \fBExample:\fR [#1] sp lena +extract "norm(I)>128",3\fR \fBextract_region:\fR [label_image],_extract_xyz_coordinates={ 0:No | 1:Yes },_label_1,...,_label_M\fR Extract all pixels of selected images whose corresponding label in '\fB[label_image]\fR' is equal to '\fBlabel_m\fR', and output them as M column images. \fBDefault value\fR: '\fBextract_xyz_coordinates=0\fR'. \fBExample:\fR [#1] image.jpg +blur 3 quantize. 4,0 +extract_region[0] [1],0,1,3\fR \fBmirror (+):\fR { x | y | z }...{ x | y | z }\fR Mirror selected images along specified axes. \fBExample:\fR [#1] image.jpg +mirror y +mirror[0] c\fR [#2] image.jpg +mirror x +mirror y append_tiles 2,2\fR \fBpermute (+):\fR permutation\fR Permute selected image axes by specified permutation. '\fBpermutation\fR' is a combination of the character set \fB{x|y|z|c}\fR, e.g. '\fBxycz\fR', '\fBcxyz\fR', ... \fBExample:\fR [#1] image.jpg permute yxzc\fR \fBrs:\fR Shortcut for command '\fBrescale2d\fR'. \fBrescale2d:\fR _width[%]={ 0:Any | >0 },_height[%]={ 0:Any | >0 },-1=<_interpolation<=6,_mode={ 0:Inside | 1:Padded-inside | 2:Outside | 3:Cropped-outside }\fR Resize selected 2D images while preserving aspect ratio. '\fBinterpolation\fR' can be \fB{ -1:Status only | 0:None | 1:Nearest | 2:Average | 3:Linear | 4=Grid | 5=Bicubic | 6=Lanczos }\fR. When '\fBinterpolation==-1\fR', image size is actually not modified, but the size that would have been used for the last selected image is returned in the status value. Each resized image size is computed according to the specified '\fBmode\fR': * If '\fBmode==0\fR', image size is \fBat most\fR '\fB(width,height)\fR'. * If '\fBmode==1\fR' or '\fBmode==3\fR', image size is \fBexactly\fR '\fB(width,height)\fR'. * If '\fBmode==2\fR', image size is \fBat least\fR '\fB(width,height)\fR'. (equivalent to shortcut command '\fBrs\fR'). \fBDefault values\fR: '\fBwidth=height=0\fR', '\fBinterpolation=2\fR' and '\fBmode=0\fR'. \fBrs3d:\fR Shortcut for command '\fBrescale3d\fR'. \fBrescale3d:\fR _width[%]={ 0:Any | >0 },_height[%]={ 0:Any | >0 },_depth[%]={ 0:Any | >0 },-1=<_interpolation<=6,_mode={ 0:Inside | 1:Padded-inside | 2:Outside | 3 |\fR Cropped-outside }\fR Resize selected 3D images while preserving aspect ratio. '\fBinterpolation\fR' can be \fB{ -1:Status only | 0:None | 1:Nearest | 2:Average | 3:Linear | 4=Grid | 5=Bicubic | 6=Lanczos }\fR. When '\fBinterpolation==-1\fR', image size is actually not modified, but the size that would have been used for the last selected image is returned in the status value. Each resized image size is computed according to the specified '\fBmode\fR': * If '\fBmode==0\fR', image size is \fBat most\fR '\fB(width,height)\fR'. * If '\fBmode==1\fR' or '\fBmode==3\fR', image size is \fBexactly\fR '\fB(width,height)\fR'. * If '\fBmode==2\fR', image size is \fBat least\fR '\fB(width,height)\fR'. (equivalent to shortcut command '\fBrs3d\fR'). \fBDefault values\fR: '\fBwidth=height=depth=0\fR', '\fBinterpolation=2\fR' and '\fBmode=0\fR'. \fBr (+):\fR Shortcut for command '\fBresize\fR'. \fBresize (+):\fR {[image_w] | width[%]>0},_{[image_h] | height[%]>0},_{[image_d] | depth[%]>0},_{[image_s] | spectrum[%]>0},_interpolation,_boundary_conditions,_ax, _ay,_az,_ac\fR Resize selected images with specified geometry. (equivalent to shortcut command '\fBr\fR'). '\fBinterpolation\fR' can be \fB{ -1:None (memory content) | 0:None | 1:Nearest | 2:Average | 3:Linear | 4=Grid | 5=Bicubic | 6=Lanczos }\fR. '\fBboundary_conditions\fR' has different meanings, according to the chosen '\fBinterpolation\fR' mode : . When 'interpolation=={ -1 | 1 | 2 | 4 }', '\fBboundary_conditions\fR' is meaningless. . When '\fBinterpolation==0\fR', '\fBboundary_conditions\fR' can be \fB{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR. . When 'interpolation=={ 3 | 5 | 6 }', '\fBboundary_conditions\fR' can be \fB{ 0:None | 1:Neumann }\fR. '\fBax,ay,az,ac\fR' set the centering along each axis when '\fBinterpolation=0 or 4\fR' (set to '\fB0\fR' by default, must be defined in range [0,1]). \fBDefault values\fR: '\fBinterpolation=1\fR', '\fBboundary_conditions=0\fR' and '\fBax=ay=az=ac=0\fR'. \fBExample:\fR [#1] image.jpg +resize[-1] 256,128,1,3,2 +resize[-1] 120%,120%,1,3,0,1,0.5,0.5 +resize[-1] 120%,120%,1,3,0,0,0.2,0.2 +resize[-1] [0],[0],1,3,4\fR \fBri:\fR Shortcut for command '\fBresize_as_image\fR'. \fBresize_as_image:\fR [reference],_interpolation,_boundary_conditions,_ax,_ay,_az,_ac\fR Resize selected images to the geometry of specified [reference] image. (equivalent to shortcut command '\fBri\fR'). \fBDefault values\fR: '\fBinterpolation=1\fR', '\fBboundary_conditions=0\fR' and '\fBax=ay=az=ac=0\fR'. \fBExample:\fR [#1] image.jpg sample duck +resize_as_image[-1] [-2]\fR \fBresize_displacement:\fR width[%]>0,_height[%]>0,_depth[%]>0\fR Resize selected displacement fields with specified geometry. During the process, the displacement vectors are also scaled by the corresponding ratios along each axis. \fBDefault values\fR: '\fBheight=100%\fR' and '\fBdepth=100%\fR'. \fBresize_mn:\fR width[%]>=0,_height[%]>=0,_depth[%]>=0,_B_value,_C_value\fR Resize selected images with Mitchell-Netravali filter (cubic). For details about the method, see: \fIhttps://de.wikipedia.org/wiki/Mitchell-Netravali-Filter\fR. \fBDefault values\fR: '\fBheight=100%\fR', '\fBdepth=100%\fR', '\fBB=0.3333\fR' and '\fBC=0.3333\fR'. \fBExample:\fR [#1] image.jpg rescale2d 32 resize_mn 800%,800%\fR \fBresize_pow2:\fR _interpolation,_boundary_conditions,_ax,_ay,_az,_ac\fR Resize selected images so that each dimension is a power of 2. '\fBinterpolation\fR' can be \fB{ -1:None (memory content) | 0:None | 1:Nearest | 2:Average | 3:Linear | 4:Grid | 5:Bicubic | 6:Lanczos }\fR. '\fBboundary_conditions\fR' has different meanings, according to the chosen '\fBinterpolation\fR' mode : . When 'interpolation=={ -1 | 1 | 2 | 4 }', '\fBboundary_conditions\fR' is meaningless. . When '\fBinterpolation==0\fR', '\fBboundary_conditions\fR' can be \fB{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR. . When 'interpolation=={ 3 | 5 | 6 }', '\fBboundary_conditions\fR' can be \fB{ 0:None | 1:Neumann }\fR. '\fBax,ay,az,ac\fR' set the centering along each axis when '\fBinterpolation=0\fR' (set to '\fB0\fR' by default, must be defined in range [0,1]). \fBDefault values\fR: '\fBinterpolation=0\fR', '\fBboundary_conditions=0\fR' and '\fBax=ay=az=ac=0\fR'. \fBExample:\fR [#1] image.jpg +resize_pow2[-1] 0\fR \fBrotate (+):\fR angle,_interpolation,_boundary_conditions,_center_x[%],_center_y[%] |\fR u,v,w,angle,interpolation,boundary_conditions,_center_x[%],_center_y[%],_center_z[%]\fR Rotate selected images with specified angle (in deg.), and optionally 3D axis (u,v,w). '\fBinterpolation\fR' can be \fB{ 0:None | 1:Linear | 2:Bicubic }\fR. '\fBboundary_conditions\fR' can be \fB{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR. When a rotation center (cx,cy,_cz) is specified, the size of the image is preserved. \fBDefault values\fR: '\fBinterpolation=1\fR', '\fBboundary_conditions=0\fR' and '\fBcenter_x=center_y=(undefined)\fR'. \fBExample:\fR [#1] image.jpg +rotate -25,1,2,50%,50% rotate[0] 25\fR \fBrotate_tileable:\fR angle,_max_size_factor>=0\fR Rotate selected images by specified angle and make them tileable. If resulting size of an image is too big, the image is replaced by a 1x1 image. \fBDefault values\fR: '\fBmax_size_factor=8\fR'. \fBExample:\fR [#1] sample colorful,128 +rotate_tileable 16\fR \fBrows:\fR y0[%],_y1[%],_boundary_conditions\fR Keep only specified rows of selected images. '\fBboundary_conditions\fR' can be \fB{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR. \fBDefault values\fR: '\fBy1=y0\fR' and '\fBboundary_conditions=0\fR'. \fBExample:\fR [#1] image.jpg rows -25%,50%\fR \fBscale2x:\fR Double XY-size of selected images, using the Scale2x algorithm. \fBExample:\fR [#1] image.jpg threshold 50% resize 50%,50% +scale2x\fR \fBscale2x_cnn:\fR _sharpness>=0\fR Double XY-size of selected images, using a convolutional neural network. \fBDefault value\fR: '\fBsharpness=1.25\fR'. \fBExample:\fR [#1] image.jpg rescale2d 128 +scale2x_cnn ,\fR \fBscale3x:\fR Triple XY-size of selected images, using the Scale3x algorithm. \fBExample:\fR [#1] image.jpg threshold 50% resize 33%,33% +scale3x\fR \fBscale_dcci2x:\fR _edge_threshold>=0,_exponent>0,_extend_1px={ 0:No | 1:Yes }\fR Double XY-size of selected images, using a directional cubic convolution interpolation, as described in \fIhttps://en.wikipedia.org/wiki/Directional_Cubic_Convolution_Interpolation\fR. \fBDefault values\fR: '\fBedge_threshold=1.15\fR', '\fBexponent=5\fR' and '\fBextend_1px=0\fR'. \fBExample:\fR [#1] image.jpg rescale2d 128 +scale_dcci2x ,\fR \fBseamcarve:\fR _width[%]>=0,_height[%]>=0,_is_priority_channel={ 0:No | 1:Yes },_is_antialiasing={ 0:No | 1:Yes },_maximum_seams[%]>=0\fR Resize selected images with specified 2D geometry, using the seam-carving algorithm. \fBDefault values\fR: '\fBheight=100%\fR', '\fBis_priority_channel=0\fR', '\fBis_antialiasing=1\fR' and '\fBmaximum_seams=25%\fR'. \fBExample:\fR [#1] image.jpg seamcarve 60%\fR \fBshift (+):\fR vx[%],_vy[%],_vz[%],_vc[%],_boundary_conditions,_interpolation={ 0:Nearest_neighbor | 1:Linear }\fR Shift selected images by specified displacement vector. Displacement vector can be non-integer in which case linear interpolation should be chosen. '\fBboundary_conditions\fR' can be \fB{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR. \fBDefault value\fR: '\fBboundary_conditions=0\fR' and '\fBinterpolation=0\fR'. \fBExample:\fR [#1] image.jpg +shift[0] 50%,50%,0,0,0 +shift[0] 50%,50%,0,0,1 +shift[0] 50%,50%,0,0,2\fR \fBshrink:\fR axes,size[%],_boundary_conditions={ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR Shrink selected images along the specified axes. '\fBaxes\fR' can be \fB{ x | y | z | c | xy | xz | xc | yz | yc | zc | xyz | xyc | xzc | yzc | xyzc }\fR. \fBDefault value\fR: '\fBboundary_conditions=0\fR'. \fBExample:\fR [#1] image.jpg shrink xy,100\fR \fBslices:\fR z0[%],_z1[%],_boundary_conditions\fR Keep only specified slices of selected images. '\fBboundary_conditions\fR' can be \fB{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR. \fBDefault values\fR: '\fBz1=z0\fR' and '\fBboundary_conditions=0\fR'. \fBsort (+):\fR _ordering={ +:Increasing | -:Decreasing },_axis={ x | y | z | c }\fR Sort pixel values of selected images. If '\fBaxis\fR' is specified, the sorting is done according to the data of the first column/row/slice/channel of selected images. \fBDefault values\fR: '\fBordering=+\fR' and '\fBaxis=(undefined)\fR'. \fBExample:\fR [#1] 64 rand 0,100 +sort display_graph 400,300,3\fR \fBs (+):\fR Shortcut for command '\fBsplit\fR'. \fBsplit (+):\fR { x | y | z | c }...{ x | y | z | c },_split_mode[%],_max_parts>0 |\fR keep_splitting_values={ +:Increasing | -:Decreasing },_{ x | y | z | c }...{ x | y | z | c },value1,_value2,... |\fR (no arg)\fR Split selected images along specified axes, or regarding to a sequence of scalar values (optionally along specified axes). (equivalent to shortcut command '\fBs\fR'). Argument '\fBsplit_mode\fR' determines how the split is done. It can be : * '\fB0\fR': Split image according to consecutive constant values; * '\fBN\fR' (where '\fBN\fR' is a positive integer): Split image into '\fBN\fR' homogeneous parts; * '\fB-N[%]\fR' (where '\fBN\fR' is a positive integer): Split image as blocks of size '\fBN\fR'(optionally specified as a percentage of the image dimension). When specified, '\fBmax_parts\fR' defines a limit in the number of resulting images. \fBDefault value\fR: '\fBN=-1\fR'. \fBExample:\fR [#1] image.jpg split c\fR [#2] image.jpg split y,3\fR [#3] image.jpg split x,-128\fR [#4] image.jpg split x,-30%,2\fR [#5] 1,20,1,1,"1,2,3,4" +split -,2,3 append[1--1] y\fR [#6] (1,2,2,3,3,3,4,4,4,4) +split x,0 append[1--1] y\fR \fBsplit_tiles:\fR M!=0,_N!=0,_is_homogeneous={ 0:No | 1:Yes }\fR Split selected images as a MxN array of tiles. If M or N is negative, it stands for the tile size instead. \fBDefault values\fR: '\fBN=M\fR' and '\fBis_homogeneous=0\fR'. \fBExample:\fR [#1] image.jpg +local split_tiles 5,4 blur 3,0 sharpen 700 append_tiles 4,5 done\fR \fBundistort:\fR -1<=_amplitude<=1,_aspect_ratio,_zoom,_center_x[%],_center_y[%],_boundary_conditions\fR Correct barrel/pincushion distortions occurring with wide-angle lens. References: [1] Zhang Z. (1999). Flexible camera calibration by viewing a plane from unknown orientation. [2] Andrew W. Fitzgibbon (2001). Simultaneous linear estimation of multiple view geometry and lens distortion. '\fBboundary_conditions\fR' can be \fB{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR. \fBDefault values\fR: '\fBamplitude=0.25\fR', '\fBaspect_ratio=0\fR', '\fBzoom=0\fR', '\fBcenter_x=center_y=50%\fR' and '\fBboundary_conditions=0\fR'. \fBy (+):\fR Shortcut for command '\fBunroll\fR'. \fBunroll (+):\fR _axis={ x | y | z | c }\fR Unroll selected images along specified axis. (equivalent to shortcut command '\fBy\fR'). \fBDefault value\fR: '\fBaxis=y\fR'. \fBExample:\fR [#1] (1,2,3;4,5,6;7,8,9) +unroll y\fR \fBupscale_smart:\fR width[%],_height[%],_depth,_smoothness>=0,_anisotropy=[0,1],sharpening>=0\fR Upscale selected images with an edge-preserving algorithm. \fBDefault values\fR: '\fBheight=100%\fR', '\fBdepth=100%\fR', '\fBsmoothness=2\fR', '\fBanisotropy=0.4\fR' and '\fBsharpening=10\fR'. \fBExample:\fR [#1] image.jpg rescale2d ,100 +upscale_smart 500%,500% append x\fR \fBvolumetric2d:\fR _x[%],_y[%],_z[%],_separator_size>=0\fR Convert selected 3D volumetric images into a 2D representation. \fBDefault values\fR: '\fBx=y=z=50%\fR' and '\fBseparator_size=0\fR'. \fBExample:\fR [#1] image.jpg rescale2d 64 animate noise,0,100,50 cut 0,255 append z volumetric2d 50%,50%,50%,1\fR \fB\fB11.8. Filtering\fR \fB ---------\fR \fBbandpass:\fR _min_freq[%],_max_freq[%]\fR Apply bandpass filter to selected images. \fBDefault values\fR: '\fBmin_freq=0\fR' and '\fBmax_freq=20%\fR'. \fBExample:\fR [#1] image.jpg bandpass 1%,3%\fR \fBTutorial: \fR\fIhttps://gmic.eu/oldtutorial/_bandpass\fR \fBbilateral (+):\fR [guide],std_deviation_s[%]>=0,std_deviation_r[%]>=0,_sampling_s>=0,_sampling_r>=0 |\fR std_deviation_s[%]>=0,std_deviation_r[%]>=0,_sampling_s>=0,_sampling_r>=0\fR Blur selected images by anisotropic (optionally joint/cross) bilateral filtering. If a guide image is provided, it is used to drive the smoothing filter. A guide image must be of the same xyz-size as the selected images. Set '\fBsampling\fR' arguments to '\fB0\fR' for automatic adjustment. \fBExample:\fR [#1] image.jpg repeat 5 { bilateral 10,10 }\fR \fBb (+):\fR Shortcut for command '\fBblur\fR'. \fBblur (+):\fR std_deviation[%]>=0,_boundary_conditions,_kernel |\fR axes,std_deviation[%]>=0,_boundary_conditions,_kernel\fR Blur selected images by a Deriche or gaussian filter (recursive implementation). (equivalent to shortcut command '\fBb\fR'). '\fBboundary_conditions\fR' can be \fB{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR. '\fBkernel\fR' can be \fB{ 0:Deriche | 1:Gaussian }\fR. When specified, argument '\fBaxes\fR' is a sequence of \fB{ x | y | z | c }\fR. Specifying one axis multiple times apply also the blur multiple times. \fBDefault values\fR: '\fBboundary_conditions=1\fR' and '\fBkernel=1\fR'. \fBExample:\fR [#1] image.jpg +blur 5,0 +blur[0] 5,1\fR [#2] image.jpg +blur y,10%\fR \fBTutorial: \fR\fIhttps://gmic.eu/oldtutorial/_blur\fR \fBblur_angular:\fR amplitude[%],_center_x[%],_center_y[%]\fR Apply angular blur on selected images. \fBDefault values\fR: '\fBcenter_x=center_y=50%\fR'. \fBExample:\fR [#1] image.jpg blur_angular 2%\fR \fBTutorial: \fR\fIhttps://gmic.eu/oldtutorial/_blur_angular\fR \fBblur_bloom:\fR _amplitude>=0,_ratio>=0,_nb_iter>=0,_blend_operator={ + | max | min },_kernel={ 0:Deriche | 1:Gaussian | 2:Box | 3:Triangle | 4:Quadratic }, _normalize_scales={ 0:No | 1:Yes },_axes\fR Apply a bloom filter that blend multiple blur filters of different radii, resulting in a larger but sharper glare than a simple blur. When specified, argument '\fBaxes\fR' is a sequence of \fB{ x | y | z | c }\fR. Specifying one axis multiple times apply also the blur multiple times. Reference: Masaki Kawase, "Practical Implementation of High Dynamic Range Rendering", GDC 2004. \fBDefault values\fR: '\fBamplitude=1\fR', '\fBratio=2\fR', '\fBnb_iter=5\fR', '\fBblend_operator=+\fR', '\fBkernel=1\fR', '\fBnormalize_scales=0\fR' and '\fBaxes=(all)\fR' \fBExample:\fR [#1] image.jpg blur_bloom ,\fR \fBblur_linear:\fR amplitude1[%],_amplitude2[%],_angle,_boundary_conditions={ 0:Dirichlet | 1:Neumann }\fR Apply linear blur on selected images, with specified angle and amplitudes. \fBDefault values\fR: '\fBamplitude2=0\fR', '\fBangle=0\fR' and '\fBboundary_conditions=1\fR'. \fBExample:\fR [#1] image.jpg blur_linear 10,0,45\fR \fBTutorial: \fR\fIhttps://gmic.eu/oldtutorial/_blur_linear\fR \fBblur_radial:\fR amplitude[%],_center_x[%],_center_y[%]\fR Apply radial blur on selected images. \fBDefault values\fR: '\fBcenter_x=center_y=50%\fR'. \fBExample:\fR [#1] image.jpg blur_radial 2%\fR \fBTutorial: \fR\fIhttps://gmic.eu/oldtutorial/_blur_radial\fR \fBblur_selective:\fR sigma>=0,_edges>0,_nb_scales>0\fR Blur selected images using selective gaussian scales. \fBDefault values\fR: '\fBsigma=5\fR', '\fBedges=0.5\fR' and '\fBnb_scales=5\fR'. \fBExample:\fR [#1] image.jpg noise 20 cut 0,255 +local[-1] repeat 4 { blur_selective , } done\fR \fBTutorial: \fR\fIhttps://gmic.eu/oldtutorial/_blur_selective\fR \fBboxfilter (+):\fR size[%]>=0,_order,_boundary_conditions,_nb_iter>=0 |\fR axes,size[%]>=0,_order,_boundary_conditions,_nb_iter>=0\fR Blur selected images by a box filter of specified size (fast recursive implementation). '\fBorder\fR' can be \fB{ 0:Smooth | 1:1st-derivative | 2:2nd-derivative }\fR. '\fBboundary_conditions\fR' can be \fB{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR. When specified, argument '\fBaxes\fR' is a sequence of \fB{ x | y | z | c }\fR. Specifying one axis multiple times apply also the blur multiple times. \fBDefault values\fR: '\fBorder=0\fR', '\fBboundary_conditions=1\fR' and '\fBnb_iter=1\fR'. \fBExample:\fR [#1] image.jpg +boxfilter 5%\fR [#2] image.jpg +boxfilter y,3,1\fR \fBbump2normal:\fR Convert selected bumpmaps to normalmaps. \fBExample:\fR [#1] 300,300 circle 50%,50%,128,1,255 blur 2% +bump2normal\fR \fBclosing:\fR size>=0 |\fR size_x>=0,size_y>=0,_size_z>=0 |\fR [kernel],_boundary_conditions,_is_real={ 0:Binary-mode | 1:Real-mode }\fR Apply morphological closing to selected images. '\fBboundary_conditions\fR' can be \fB{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR. \fBDefault values\fR: '\fBsize_z=1\fR', '\fBboundary_conditions=1\fR' and '\fBis_real=0\fR'. \fBExample:\fR [#1] image.jpg +closing 10\fR \fBclosing_circ:\fR _size>=0,_is_real={ 0:No | 1:Yes }\fR Apply circular dilation of selected images by specified size. \fBDefault values\fR: '\fBboundary_conditions=1\fR' and '\fBis_real=0\fR'. \fBExample:\fR [#1] image.jpg +closing_circ 7\fR \fBconvolve (+):\fR [mask],_boundary_conditions,_is_normalized={ 0:No | 1:Yes },_channel_mode,_xcenter,_ycenter,_zcenter,_xstride>0,_ystride>0,_zstride>0,_xdilation, _ydilation,_zdilation,_xoffset,_yoffset,_zoffset,_xsize>=0,_ysize>=0,_zsize>=0\fR Convolve selected images by specified mask. '\fBboundary_conditions\fR' can be \fB{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR. '\fBchannel_mode\fR' can be \fB{ 0:All | 1:One-for-one | 2:Partial sum | 3:Full sum }\fR. \fBNote:\fR For each of the parameter groups 'center\fR' ('\fBxcenter\fR','\fBycenter\fR','\fBzcenter\fR'), 'stride\fR' ('\fBxstride\fR', '\fBystride\fR','\fBzstride\fR'), 'dilation\fR' ('\fBxdilation\fR','\fBydilation\fR','\fBzdilation\fR'), 'offset\fR' ('\fBxoffset\fR','\fByoffset\fR', '\fBzoffset\fR') and 'size\fR' ('\fBxsize\fR','\fBysize\fR','\fBzsize\fR'), either all three components must be specified, or none of them. It is not allowed to set only one or two components of a given group (e.g. specifying '\fBxoffset\fR' without also specifying '\fByoffset\fR' and '\fBzoffset\fR' is invalid). \fBDefault values\fR: '\fBboundary_conditions=1\fR', '\fBis_normalized=0\fR', '\fBchannel_mode=1\fR', '\fBxcenter=ycenter=zcenter=(undefined)\fR', '\fBxstride=ystride=zstride=1\fR', '\fBxdilation=ydilation=zdilation=1\fR','\fBxoffset=yoffset=zoffset=0\fR' and '\fBxsize=ysize=zsize=(input_size/stride)\fR'. \fBExample:\fR [#1] image.jpg (0,1,0;1,-4,1;0,1,0) convolve[-2] [-1] keep[-2]\fR [#2] image.jpg (0,1,0) resize[-1] 130,1,1,1,3 +convolve[0] [1]\fR \fBTutorial: \fR\fIhttps://gmic.eu/oldtutorial/_convolve\fR \fBconvolve_fft:\fR [mask],_boundary_conditions\fR Convolve selected images with specified mask, in the fourier domain. '\fBboundary_conditions\fR' can be \fB{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR. \fBExample:\fR [#1] image.jpg 100%,100% gaussian[-1] 20,1,45 +convolve_fft[0] [1]\fR \fBcorrelate (+):\fR [mask],_boundary_conditions,_is_normalized={ 0:No | 1:Yes },_channel_mode,_xcenter,_ycenter,_zcenter,_xstride>0,_ystride>0,_zstride>0,_xdilation, _ydilation,_zdilation,_xoffset,_yoffset,_zoffset,_xsize>=0,_ysize>=0,_zsize>=0\fR Correlate selected images by specified mask. '\fBboundary_conditions\fR' can be \fB{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR. '\fBchannel_mode\fR' can be \fB{ 0:All | 1:One-for-one | 2:Partial sum | 3:Full sum }\fR. \fBNote:\fR For each of the parameter groups 'center\fR' ('\fBxcenter\fR','\fBycenter\fR','\fBzcenter\fR'), 'stride\fR' ('\fBxstride\fR', '\fBystride\fR','\fBzstride\fR'), 'dilation\fR' ('\fBxdilation\fR','\fBydilation\fR','\fBzdilation\fR'), 'offset\fR' ('\fBxoffset\fR','\fByoffset\fR', '\fBzoffset\fR') and 'size\fR' ('\fBxsize\fR','\fBysize\fR','\fBzsize\fR'), either all three components must be specified, or none of them. It is not allowed to set only one or two components of a given group (e.g. specifying '\fBxoffset\fR' without also specifying '\fByoffset\fR' and '\fBzoffset\fR' is invalid). \fBDefault values\fR: '\fBboundary_conditions=1\fR', '\fBis_normalized=0\fR', '\fBchannel_mode=1\fR', '\fBxcenter=ycenter=zcenter=-1\fR', '\fBxstride=ystride=zstride=1\fR', '\fBxdilation=ydilation=zdilation=1\fR','\fBxoffset=yoffset=zoffset=0\fR' and '\fBxsize=ysize=zsize=(input_size/stride)\fR'. \fBExample:\fR [#1] image.jpg (0,1,0;1,-4,1;0,1,0) correlate[-2] [-1] keep[-2]\fR [#2] image.jpg +crop 40%,40%,60%,60% +correlate[0] [-1],0,1\fR \fBcross_correlation:\fR [mask]\fR Compute cross-correlation of selected images with specified mask. \fBExample:\fR [#1] image.jpg +shift -30,-20 +cross_correlation[0] [1]\fR \fBcurvature:\fR Compute isophote curvatures on selected images. \fBExample:\fR [#1] image.jpg blur 10 curvature\fR \fBdct:\fR _{ x | y | z }...{ x | y | z } |\fR (no arg)\fR Compute the discrete cosine transform of selected images, optionally along the specified axes only. Output images are always evenly sized, so this command may change the size of the selected images. \fBDefault values\fR: (no arg) See also: \fIidct\fR. \fBExample:\fR [#1] image.jpg +dct +idct[-1] abs[-2] +[-2] 1 log[-2]\fR \fBTutorial: \fR\fIhttps://gmic.eu/oldtutorial/_dct-and-idct\fR \fBdeblur:\fR amplitude[%]>=0,_nb_iter>=0,_dt>=0,_regul>=0,_regul_type={ 0:Tikhonov | 1:Meancurv. | 2:TV }\fR Deblur image using a regularized Jansson-Van Cittert algorithm. \fBDefault values\fR: '\fBnb_iter=10\fR', '\fBdt=20\fR', '\fBregul=0.7\fR' and '\fBregul_type=1\fR'. \fBExample:\fR [#1] image.jpg blur 3 +deblur 3,40,20,0.01\fR \fBdeblur_goldmeinel:\fR sigma>=0,_nb_iter>=0,_acceleration>=0,_kernel_type={ 0:Deriche | 1:Gaussian }.\fR Deblur selected images using Gold-Meinel algorithm \fBDefault values\fR: '\fBnb_iter=8\fR', '\fBacceleration=1\fR' and '\fBkernel_type=1\fR'. \fBExample:\fR [#1] image.jpg +blur 1 +deblur_goldmeinel[-1] 1\fR \fBdeblur_richardsonlucy:\fR sigma>=0, nb_iter>=0, _kernel_type={ 0:Deriche | 1:Gaussian }.\fR Deblur selected images using Richardson-Lucy algorithm. \fBDefault values\fR: '\fBnb_iter=50\fR' and '\fBkernel_type=1\fR'. \fBExample:\fR [#1] image.jpg +blur 1 +deblur_richardsonlucy[-1] 1\fR \fBdeconvolve_fft:\fR [kernel],_regularization>=0\fR Deconvolve selected images by specified mask in the fourier space. \fBDefault value\fR: '\fBregularization>=0\fR'. \fBExample:\fR [#1] image.jpg +gaussian 5 +convolve_fft[0] [1] +deconvolve_fft[-1] [1]\fR \fBdeinterlace:\fR _method\fR Deinterlace selected images ('\fBmethod\fR' can be \fB{ 0:Standard | 1:Motion-compensated }\fR). \fBDefault value\fR: '\fBmethod=0\fR'. \fBExample:\fR [#1] image.jpg +rotate 3,1,1,50%,50% resize 100%,50% resize 100%,200%,1,3,4 shift[-1] 0,1 add +deinterlace 1\fR \fBdenoise (+):\fR [guide],std_deviation_s[%]>=0,std_deviation_r[%]>=0,_patch_size>0,_lookup_size>0,_smoothness,_fast_approx={ 0:No | 1:Yes } |\fR std_deviation_s[%]>=0,std_deviation_r[%]>=0,_patch_size>0,_lookup_size>0,_smoothness,_fast_approx={ 0:No | 1:Yes }\fR Denoise selected images by non-local patch averaging. \fBDefault values\fR: '\fBpatch_size=5\fR', '\fBlookup_size=6\fR' and '\fBsmoothness=1\fR'. \fBExample:\fR [#1] image.jpg noise 20 cut 0,255 +denoise 8,8,7\fR \fBdenoise_haar:\fR _threshold>=0,_nb_scales>=0,_cycle_spinning>0\fR Denoise selected images using haar-wavelet thresholding with cycle spinning. Set '\fBnb_scales==0\fR' to automatically determine the optimal number of scales. \fBDefault values\fR: '\fBthreshold=1.4\fR', '\fBnb_scale=0\fR' and '\fBcycle_spinning=10\fR'. \fBExample:\fR [#1] image.jpg noise 20 cut 0,255 +denoise_haar[-1] 0.8\fR \fBdenoise_cnn:\fR _noise_level>=0,_patch_size>0\fR Denoise selected images using a convolutional neural network (CNN). Input value range should be [0,255]. Output value range is [0,255]. If '\fBstd_noise==0\fR', the noise level is automatically estimated for each selected image. \fBDefault value\fR: '\fBnoise_level=0 (auto)\fR' and '\fBpatch_size=64\fR'. \fBExample:\fR [#1] image.jpg noise 20 cut 0,255 +denoise_cnn 0\fR \fBdenoise_patchpca:\fR _strength>=0,_patch_size>0,_lookup_size>0,_spatial_sampling>0\fR Denoise selected images using the patch-pca algorithm. \fBDefault values\fR: '\fBpatch_size=7\fR', '\fBlookup_size=11\fR', '\fBdetails=1.8\fR' and '\fBspatial_sampling=5\fR'. \fBExample:\fR [#1] image.jpg +noise 20 cut[-1] 0,255 +denoise_patchpca[-1] ,\fR \fBderiche (+):\fR std_deviation[%]>=0,order={ 0 | 1 | 2 },axis={ x | y | z | c },_boundary_conditions\fR Apply Deriche recursive filter on selected images, along specified axis and with specified standard deviation, order and boundary conditions. '\fBboundary_conditions\fR' can be \fB{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR. \fBDefault value\fR: '\fBboundary_conditions=1\fR'. \fBExample:\fR [#1] image.jpg deriche 3,1,x\fR [#2] image.jpg +deriche 30,0,x deriche[-2] 30,0,y add\fR \fBTutorial: \fR\fIhttps://gmic.eu/oldtutorial/_deriche\fR \fBdilate (+):\fR size[%]>=0 |\fR size_x[%]>=0,size_y[%]>=0,size_z[%]>=0 |\fR [kernel],_boundary_conditions,_is_real={ 0:Binary-mode | 1:Real-mode }\fR Dilate selected images by a rectangular or the specified structuring element. '\fBboundary_conditions\fR' can be \fB{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR. \fBDefault values\fR: '\fBsize_z=1\fR', '\fBboundary_conditions=1\fR' and '\fBis_real=0\fR'. \fBExample:\fR [#1] image.jpg +dilate 10\fR \fBdilate_circ:\fR _size[%]>=0,_boundary_conditions,_is_real={ 0:No | 1:Yes }\fR Apply circular dilation of selected images by specified size. '\fBboundary_conditions\fR' can be \fB{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR. \fBDefault values\fR: '\fBboundary_conditions=1\fR' and '\fBis_real=0\fR'. \fBExample:\fR [#1] image.jpg +dilate_circ 7\fR \fBdilate_oct:\fR _size[%]>=0,_boundary_conditions,_is_real={ 0:No | 1:Yes }\fR Apply octagonal dilation of selected images by specified size. \fBDefault values\fR: '\fBboundary_conditions=1\fR' and '\fBis_real=0\fR'. \fBExample:\fR [#1] image.jpg +dilate_oct 7\fR \fBdilate_threshold:\fR size_x>=1,size_y>=1,size_z>=1,_threshold>=0,_boundary_conditions\fR Dilate selected images in the (X,Y,Z,I) space. '\fBboundary_conditions\fR' can be \fB{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR. \fBDefault values\fR: '\fBsize_y=size_x\fR', '\fBsize_z=1\fR', '\fBthreshold=255\fR' and '\fBboundary_conditions=1\fR'. \fBdivergence:\fR Compute divergence of selected vector fields. \fBExample:\fR [#1] image.jpg luminance +gradient append[-2,-1] c divergence[-1]\fR \fBdog:\fR _sigma1[%]>=0,_sigma2[%]>=0\fR Compute difference of gaussian on selected images. \fBDefault values\fR: '\fBsigma1=2%\fR' and '\fBsigma2=3%\fR'. \fBExample:\fR [#1] image.jpg dog 2,3\fR \fBdiffusiontensors:\fR _sharpness>=0,0<=_anisotropy<=1,_alpha[%],_sigma[%],is_sqrt={ 0:No | 1:Yes }\fR Compute the diffusion tensors of selected images for edge-preserving smoothing algorithms. \fBDefault values\fR: '\fBsharpness=0.7\fR', '\fBanisotropy=0.3\fR', '\fBalpha=0.6\fR', '\fBsigma=1.1\fR' and '\fBis_sqrt=0\fR'. \fBExample:\fR [#1] image.jpg diffusiontensors 0.8 abs pow 0.2\fR \fBTutorial: \fR\fIhttps://gmic.eu/oldtutorial/_diffusiontensors\fR \fBerode (+):\fR size[%]>=0 |\fR size_x[%]>=0,size_y[%]>=0,_size_z[%]>=0 |\fR [kernel],_boundary_conditions,_is_real={ 0:Binary-mode | 1:Real-mode }\fR Erode selected images by a rectangular or the specified structuring element. '\fBboundary_conditions\fR' can be \fB{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR. \fBDefault values\fR: '\fBsize_z=1\fR', '\fBboundary_conditions=1\fR' and '\fBis_real=0\fR'. \fBExample:\fR [#1] image.jpg +erode 10\fR \fBerode_circ:\fR _size[%]>=0,_boundary_conditions,_is_real={ 0:No | 1:Yes }\fR Apply circular erosion of selected images by specified size. '\fBboundary_conditions\fR' can be \fB{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR. \fBDefault values\fR: '\fBboundary_conditions=1\fR' and '\fBis_real=0\fR'. \fBExample:\fR [#1] image.jpg +erode_circ 7\fR \fBerode_oct:\fR _size[%]>=0,_boundary_conditions,_is_real={ 0:No | 1:Yes }\fR Apply octagonal erosion of selected images by specified size. \fBDefault values\fR: '\fBboundary_conditions=1\fR' and '\fBis_real=0\fR'. \fBExample:\fR [#1] image.jpg +erode_oct 7\fR \fBerode_threshold:\fR size_x>=1,size_y>=1,size_z>=1,_threshold>=0,_boundary_conditions\fR Erode selected images in the (X,Y,Z,I) space. '\fBboundary_conditions\fR' can be \fB{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR. \fBDefault values\fR: '\fBsize_y=size_x\fR', '\fBsize_z=1\fR', '\fBthreshold=255\fR' and '\fBboundary_conditions=1\fR'. \fBfft (+):\fR _{ x | y | z }...{ x | y | z }\fR Compute the direct fourier transform (real and imaginary parts) of selected images, optionally along the specified axes only. See also: \fIifft\fR. \fBExample:\fR [#1] image.jpg luminance +fft append[-2,-1] c norm[-1] log[-1] shift[-1] 50%,50%,0,0,2\fR [#2] image.jpg w2:=int(w/2) h2:=int(h/2) fft shift $w2,$h2,0,0,2 ellipse $w2,$h2,30,30,0,1,0 shift -$w2,-$h2,0,0,2 ifft remove[-1]\fR \fBTutorial: \fR\fIhttps://gmic.eu/oldtutorial/_fft\fR \fBg (+):\fR Shortcut for command '\fBgradient\fR'. \fBgradient:\fR { x | y | z | c }...{ x | y | z | c },_scheme,_boundary_conditions |\fR (no arg)\fR Compute the gradient components (first derivatives) of selected images, along specified axes. (equivalent to shortcut command '\fBg\fR'). '\fBscheme\fR' can be \fB{ -1:Backward | 0:Centered | 1:Forward | 2:Sobel | 3:Rotation-invariant (default) | 4:Deriche | 5:Vanvliet | 6:FB-Maxabs }\fR. '\fBboundary_conditions\fR' can be \fB{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR. (no arg) compute all significant components. \fBDefault values\fR: '\fBscheme=0\fR' and '\fBboundary_conditions=1\fR'. \fBExample:\fR [#1] image.jpg gradient\fR \fBTutorial: \fR\fIhttps://gmic.eu/oldtutorial/_gradient\fR \fBgradient_norm:\fR _scheme,_boundary_conditions |\fR (no arg)\fR Compute the gradient norm of selected images. '\fBscheme\fR' can be \fB{ -1:Backward | 0:Centered | 1:Forward | 2:Sobel | 3:Rotation-invariant (default) | 4:Deriche | 5:Vanvliet | 6:FB-Maxabs }\fR. '\fBboundary_conditions\fR' can be \fB{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR. \fBDefault values\fR: '\fBscheme=0\fR' and '\fBboundary_conditions=1\fR'. \fBExample:\fR [#1] image.jpg gradient_norm equalize\fR \fBTutorial: \fR\fIhttps://gmic.eu/oldtutorial/_gradient_norm\fR \fBgradient_orientation:\fR _dimension={ 1 | 2 | 3 }\fR Compute N-d gradient orientation of selected images. \fBDefault value\fR: '\fBdimension=3\fR'. \fBExample:\fR [#1] image.jpg +gradient_orientation 2\fR \fBguided (+):\fR [guide],radius[%]>=0,regularization[%]>=0 |\fR radius[%]>=0,regularization[%]>=0\fR Blur selected images by guided image filtering. If a guide image is provided, it is used to drive the smoothing process. A guide image must be of the same xyz-size as the selected images. This command implements the filtering algorithm described in: He, Kaiming; Sun, Jian; Tang, Xiaoou, "Guided Image Filtering", IEEE Transactions on Pattern Analysis and Machine Intelligence, vol.35, no.6, pp.1397,1409, June 2013 \fBExample:\fR [#1] image.jpg +guided 5,400\fR \fBhaar:\fR scale>0\fR Compute the direct haar multiscale wavelet transform of selected images. See also: \fIihaar\fR. \fBTutorial: \fR\fIhttps://gmic.eu/oldtutorial/_haar\fR \fBheat_flow:\fR _nb_iter>=0,_dt,_keep_sequence={ 0:No | 1:Yes }\fR Apply iterations of the heat flow on selected images. \fBDefault values\fR: '\fBnb_iter=10\fR', '\fBdt=30\fR' and '\fBkeep_sequence=0\fR'. \fBExample:\fR [#1] image.jpg +heat_flow 20\fR \fBhessian:\fR { xx | xy | xz | yy | yz | zz }...{ xx | xy | xz | yy | yz | zz },_boundary_conditions |\fR (no arg) :\fR Compute the hessian components (second derivatives) of selected images along specified axes. '\fBboundary_conditions\fR' can be \fB{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR. (no arg) compute all significant components. \fBDefault value\fR: '\fBboundary_conditions=1\fR'. \fBExample:\fR [#1] image.jpg hessian\fR \fBidct:\fR _{ x | y | z }...{ x | y | z } |\fR (no arg)\fR Compute the inverse discrete cosine transform of selected images, optionally along the specified axes only. Output images are always evenly sized, so this command may change the size of the selected images. (dct images obtained with the '\fBdct\fR' command are evenly sized anyway). \fBDefault values\fR: (no arg) See also: \fIdct\fR. \fBTutorial: \fR\fIhttps://gmic.eu/oldtutorial/_dct-and-idct\fR \fBiee:\fR Compute gradient-orthogonal-directed 2nd derivative of image(s). \fBExample:\fR [#1] image.jpg iee\fR \fBifft (+):\fR _{ x | y | z }...{ x | y | z }\fR Compute the inverse fourier transform (real and imaginary parts) of selected images. optionally along the specified axes only. See also: \fIfft\fR. \fBTutorial: \fR\fIhttps://gmic.eu/oldtutorial/_fft\fR \fBihaar:\fR scale>0\fR Compute the inverse haar multiscale wavelet transform of selected images. See also: \fIhaar\fR. \fBTutorial: \fR\fIhttps://gmic.eu/oldtutorial/_haar\fR \fBilaplacian:\fR { nb_iterations>0 | 0 },_[initial_estimate]\fR Invert selected Laplacian images. If given '\fBnb_iterations\fR' is '\fB0\fR', inversion is done in Fourier space (single iteration), otherwise, by applying '\fBnb_iterations\fR' of a Laplacian-inversion PDE flow. Note that the resulting inversions are just estimation of possible/approximated solutions. \fBDefault values\fR: '\fBnb_iterations=0\fR', '\fBaxes=(undefined)\fR' and '\fB[initial_estimated]=(undefined)\fR'. \fBExample:\fR [#1] image.jpg +laplacian +ilaplacian[-1] 0\fR \fBinn:\fR Compute gradient-directed 2nd derivative of image(s). \fBExample:\fR [#1] image.jpg inn\fR \fBinpaint (+):\fR [mask] |\fR [mask],0,_fast_method |\fR [mask],_patch_size>=1,_lookup_size>=1,_lookup_factor>=0,_lookup_increment!=0,_blend_size>=0,0<=_blend_threshold<=1,_blend_decay>=0,_blend_scales>=1, _is_blend_outer={ 0:No | 1:Yes }\fR Inpaint selected images by specified mask. If no patch size (or 0) is specified, inpainting is done using a fast average or median algorithm. Otherwise, it used a patch-based reconstruction method, that can be very time consuming. '\fBfast_method\fR' can be \fB{ 0:Low-connectivity average | 1:High-connectivity average | 2:Low-connectivity median | 3:High-connectivity median }\fR. \fBDefault values\fR: '\fBpatch_size=0\fR', '\fBfast_method=1\fR', '\fBlookup_size=22\fR', '\fBlookup_factor=0.5\fR', '\fBlookup_increment=1\fR', '\fBblend_size=0\fR', '\fBblend_threshold=0\fR', '\fBblend_decay=0.05\fR', '\fBblend_scales=10\fR' and '\fBis_blend_outer=1\fR'. \fBExample:\fR [#1] image.jpg 100%,100% ellipse 50%,50%,30,30,0,1,255 ellipse 20%,20%,30,10,0,1,255 +inpaint[-2] [-1] remove[-2]\fR [#2] image.jpg 100%,100% circle 30%,30%,30,1,255,0,255 circle 70%,70%,50,1,255,0,255 +inpaint[0] [1],5,15,0.5,1,9,0 remove[1]\fR \fBinpaint_pde:\fR [mask],_nb_scales[%],_diffusion_type={ 0:Isotropic | 1:Delaunay-guided | 2:Edge-guided | 3:Mask-guided },_diffusion_iter>=0\fR Inpaint selected images by specified mask using a multiscale transport-diffusion algorithm. Argument '\fBnb_scales\fR' sets the number of scales used in the multi-scale resolution scheme. * When the '\fB%\fR' qualifier is used for '\fBnb_scales\fR', the number of used scales is relative to 'nb_scales_max = ceil(log2(max(w,h,d)))\fR'. * When '\fBnb_scales<0\fR', it determines the minimum image size encountered at the lowest scale. If '\fBdiffusion_type==3\fR', non-zero values of the mask (e.g. a distance function) are used to guide the diffusion process. \fBDefault values\fR: '\fBnb_scales=-9\fR', '\fBdiffusion_type=1\fR' and '\fBdiffusion_iter=20\fR'. \fBExample:\fR [#1] image.jpg 100%,100% ellipse[-1] 30%,30%,40,30,0,1,255 +inpaint_pde[0] [1]\fR \fBinpaint_flow:\fR [mask],_nb_global_iter>=0,_nb_local_iter>=0,_dt>0,_alpha>=0,_sigma>=0\fR Apply iteration of the inpainting flow on selected images. \fBDefault values\fR: '\fBnb_global_iter=10\fR', '\fBnb_local_iter=100\fR', '\fBdt=5\fR', '\fBalpha=1\fR' and '\fBsigma=3\fR'. \fBExample:\fR [#1] image.jpg 100%,100% ellipse[-1] 30%,30%,40,30,0,1,255 inpaint_flow[0] [1]\fR \fBinpaint_holes:\fR maximal_area[%]>=0,_tolerance>=0,_is_high_connectivity={ 0:No | 1:Yes }\fR Inpaint all connected regions having an area less than specified value. \fBDefault values\fR: '\fBmaximal_area=4\fR', '\fBtolerance=0\fR' and '\fBis_high_connectivity=0\fR'. \fBExample:\fR [#1] image.jpg noise 5%,2 +inpaint_holes 8,40\fR \fBinpaint_morpho:\fR [mask]\fR Inpaint selected images by specified mask using morphological operators. \fBExample:\fR [#1] image.jpg 100%,100% ellipse[-1] 30%,30%,40,30,0,1,255 +inpaint_morpho[0] [1]\fR \fBinpaint_matchpatch:\fR [mask],_nb_scales={ 0:Auto | >0 },_patch_size>0,_nb_iterations_per_scale>0,_blend_size>=0,_allow_outer_blending={ 0:No | 1:Yes }, _is_already_initialized={ 0:No | 1:Yes }\fR Inpaint selected images by specified binary mask, using a multi-scale matchpatch algorithm. \fBDefault values\fR: '\fBnb_scales=0\fR', '\fBpatch_size=9\fR', '\fBnb_iterations_per_scale=10\fR', '\fBblend_size=5\fR', '\fBallow_outer_blending=1\fR' and '\fBis_already_initialized=0\fR'. \fBExample:\fR [#1] image.jpg 100%,100% ellipse[-1] 30%,30%,40,30,0,1,255 +inpaint_matchpatch[0] [1]\fR \fBkuwahara:\fR size>0\fR Apply Kuwahara filter of specified size on selected images. \fBExample:\fR [#1] image.jpg kuwahara 9\fR \fBlaplacian:\fR Compute Laplacian of selected images. \fBExample:\fR [#1] image.jpg laplacian\fR \fBlic:\fR _amplitude>0,_channels>0\fR Render the LIC representation of selected vector fields. \fBDefault values\fR: '\fBamplitude=30\fR' and '\fBchannels=1\fR'. \fBExample:\fR [#1] 400,400,1,2,'[x,y]-[w,h]/2' +lic 200,3 quiver[-2] [-2],10,1,1,1,255\fR \fBmap_tones:\fR _threshold>=0,_gamma>=0,_smoothness>=0,nb_iter>=0\fR Apply a tone mapping operator on selected images, based on Poisson equation. \fBDefault values\fR: '\fBthreshold=0.1\fR', '\fBgamma=0.8\fR', '\fBsmoothness=0.5\fR' and '\fBnb_iter=30\fR'. \fBExample:\fR [#1] image.jpg +map_tones ,\fR \fBmap_tones_fast:\fR _radius[%]>=0,_power>=0\fR Apply a fast tone mapping operator on selected images. \fBDefault values\fR: '\fBradius=3%\fR' and '\fBpower=0.3\fR'. \fBExample:\fR [#1] image.jpg +map_tones_fast ,\fR \fBmeancurvature_flow:\fR _nb_iter>=0,_dt,_keep_sequence={ 0:No | 1:Yes }\fR Apply iterations of the mean curvature flow on selected images. \fBDefault values\fR: '\fBnb_iter=10\fR', '\fBdt=30\fR' and '\fBkeep_sequence=0\fR'. \fBExample:\fR [#1] image.jpg +meancurvature_flow 20\fR \fBmedian (+):\fR size>=0,_threshold>0\fR Apply (optionally thresholded) median filter on selected images with structuring element size x size. \fBExample:\fR [#1] image.jpg +median 5\fR \fBmerge_alpha:\fR Merge selected alpha detail scales into a single image. Alpha detail scales have been obtained with command \fIsplit_alpha\fR. \fBnlmeans:\fR [guide],_patch_radius>0,_spatial_bandwidth>0,_tonal_bandwidth>0,_patch_measure_command |\fR _patch_radius>0,_spatial_bandwidth>0,_tonal_bandwidth>0,_patch_measure_command\fR Apply non-local-means denoising by Buades et al. (2005) on selected images. The patch is a gaussian function of '\fBstd_patch_radius\fR'. The spatial kernel is a rectangle of radius '\fBspatial_bandwidth\fR'. The tonal kernel is exponential ('exp(-d^2/_tonal_bandwidth^2)\fR') with 'd\fR' the euclidean distance between image patches. \fBDefault values\fR: '\fBpatch_radius=4\fR', '\fBspatial_bandwidth=4\fR', '\fBtonal_bandwidth=10\fR' and '\fBpatch_measure_command=-norm\fR'. \fBExample:\fR [#1] image.jpg +noise 10 nlmeans[-1] 4,4,{0.6*${-std_noise}}\fR \fBnlmeans_core:\fR _reference_image,_scaling_map,_patch_radius>0,_spatial_bandwidth>0\fR Apply non-local-means denoising using an image for weighting and a map for scaling \fBnormalize_local:\fR _amplitude>=0,_radius>0,_n_smooth[%]>=0,_a_smooth[%]>=0,_is_cut={ 0:No | 1:Yes },_min=0,_max=255\fR Normalize selected images locally. \fBDefault values\fR: '\fBamplitude=3\fR', '\fBradius=16\fR', '\fBn_smooth=4%\fR', '\fBa_smooth=2%\fR', '\fBis_cut=1\fR', '\fBmin=0\fR' and '\fBmax=255\fR'. \fBExample:\fR [#1] image.jpg normalize_local 8,10\fR \fBnormalized_cross_correlation:\fR [mask]\fR Compute normalized cross-correlation of selected images with specified mask. \fBExample:\fR [#1] image.jpg +shift -30,-20 +normalized_cross_correlation[0] [1]\fR \fBopening:\fR size>=0 |\fR size_x>=0,size_y>=0,_size_z>=0 |\fR [kernel],_boundary_conditions,_is_real={ 0:Binary-mode | 1:Real-mode }\fR Apply morphological opening to selected images. '\fBboundary_conditions\fR' can be \fB{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR. \fBDefault values\fR: '\fBsize_z=1\fR', '\fBboundary_conditions=1\fR' and '\fBis_real=0\fR'. \fBExample:\fR [#1] image.jpg +opening 10\fR \fBopening_circ:\fR _size>=0,_is_real={ 0:No | 1:Yes }\fR Apply circular opening of selected images by specified size. \fBDefault values\fR: '\fBboundary_conditions=1\fR' and '\fBis_real=0\fR'. \fBExample:\fR [#1] image.jpg +opening_circ 7\fR \fBpercentile:\fR [mask],0<=_min_percentile[%]<=100,0<=_max_percentile[%]<=100.\fR Apply the percentile averaging filter to selected images. \fBDefault values\fR: '\fBmin_percentile=0\fR' and '\fBmax_percentile=100\fR'. \fBExample:\fR [#1] image.jpg shape_circle 11,11 +percentile[0] [1],25,75\fR \fBperonamalik_flow:\fR K_factor>0,_nb_iter>=0,_dt,_keep_sequence={ 0:No | 1:Yes }\fR Apply iterations of the Perona-Malik flow on selected images. \fBDefault values\fR: '\fBK_factor=20\fR', '\fBnb_iter=5\fR', '\fBdt=5\fR' and '\fBkeep_sequence=0\fR'. \fBExample:\fR [#1] image.jpg +heat_flow 20\fR \fBphase_correlation:\fR [destination]\fR Estimate translation vector between selected source images and specified destination. \fBExample:\fR [#1] image.jpg +shift -30,-20 +phase_correlation[0] [1] unroll[-1] y\fR \fBpde_flow:\fR _nb_iter>=0,_dt,_velocity_command,_keep_sequence={ 0:No | 1:Yes }\fR Apply iterations of a generic PDE flow on selected images. \fBDefault values\fR: '\fBnb_iter=10\fR', '\fBdt=30\fR', '\fBvelocity_command=laplacian\fR' and '\fBkeep_sequence=0\fR'. \fBExample:\fR [#1] image.jpg +pde_flow 20\fR \fBperiodize_poisson:\fR Periodize selected images using a Poisson solver in Fourier space. \fBExample:\fR [#1] image.jpg +periodize_poisson array 2,2,2\fR \fBrbf:\fR dx,_x0,_x1,_phi(r),_is_affine_term={ 0:No | 1:Yes } |\fR dx,dy,_x0,_y0,_x1,_y1,_phi(r),_is_affine_term |\fR dx,dy,dz,x0,y0,z0,x1,y1,z1,phi(r)_is_affine_term\fR Reconstruct 1D/2D or 3D image from selected sets of keypoints, by RBF-interpolation. A set of keypoints is represented by a vector-valued image, where each pixel represents a single keypoint. Vector components of a keypoint have the following meaning: - For 1D reconstruction: [ x_k, f1(x_k),...fN(x_k) ]. - For 2D reconstruction: [ x_k,y_k, f1(x_k,y_k),...,fN(x_k,y_k) ]. - For 3D reconstruction: [ x_k,y_k,z_k, f1(x_k,y_k,z_k),...,fN(x_k,y_k,z_k) ]. Values '\fBx_k\fR','\fBy_k\fR' and '\fBz_k\fR' are the spatial coordinates of keypoint '\fBk\fR'. Values '\fBf1(),..,fN()\fR' are the '\fBN\fR' components of the vector value of keypoint '\fBk\fR'. The command reconstructs an image with specified size '\fBdx'x'dy'x'dz\fR', with '\fBN\fR' channels. If '\fBaffine_term==1\fR', the reconstruction function includes an affine term. \fBDefault values\fR: '\fBx0=y0=z0=0\fR', '\fBx1=dx-1\fR', '\fBy1=dy-1\fR', '\fBz1=dz-1\fR', '\fBphi(r)=r*log(1+r)\fR' and '\fBaffine_term=0\fR'. \fBExample:\fR [#1] sample colorful,400 100%,100% noise_poissondisk. 10 1,{is},1,5 eval[-2] "begin(p=0);i?(I[#-1,p++]=[x,y,I(#0)])" to_rgb[1] mul[0,1] dilate_circ[0] 5 +rbf[-1] {0,[w,h]} c[-1] 0,255\fR [#2] 32,1,1,5,u([400,400,255,255,255]) rbf 400,400 c 0,255\fR \fBred_eye:\fR 0<=_threshold<=100,_smoothness>=0,0<=attenuation<=1\fR Attenuate red-eye effect in selected images. \fBDefault values\fR: '\fBthreshold=75\fR', '\fBsmoothness=3.5\fR' and '\fBattenuation=0.1\fR'. \fBExample:\fR [#1] image.jpg +red_eye ,\fR \fBremove_hotpixels:\fR _mask_size>0, _threshold[%]>0\fR Remove hot pixels in selected images. \fBDefault values\fR: '\fBmask_size=3\fR' and '\fBthreshold=10%\fR'. \fBExample:\fR [#1] image.jpg noise 10,2 +remove_hotpixels ,\fR \fBremove_pixels:\fR number_of_pixels[%]>=0\fR Remove specified number of pixels (i.e. set them to 0) from the set of non-zero pixels in selected images. \fBExample:\fR [#1] image.jpg +remove_pixels 50%\fR \fBrolling_guidance:\fR std_deviation_s[%]>=0,std_deviation_r[%]>=0,_precision>=0\fR Apply the rolling guidance filter on selected image. Rolling guidance filter is a fast image abstraction filter, described in: "Rolling Guidance Filter", Qi Zhang Xiaoyong, Shen Li, Xu Jiaya Jia, ECCV'2014. \fBDefault values\fR: '\fBstd_deviation_s=4\fR', '\fBstd_deviation_r=10\fR' and '\fBprecision=0.5\fR'. \fBExample:\fR [#1] image.jpg +rolling_guidance , +-\fR \fBsharpen:\fR amplitude>=0 |\fR amplitude>=0,edge>=0,_alpha[%],_sigma[%]\fR Sharpen selected images by inverse diffusion or shock filters methods. '\fBedge\fR' must be specified to enable shock-filter method. \fBDefault values\fR: '\fBedge=0\fR', '\fBalpha=0\fR' and '\fBsigma=0\fR'. \fBExample:\fR [#1] image.jpg sharpen 300\fR [#2] image.jpg blur 5 sharpen 300,1\fR \fBsharpen_alpha:\fR _amplitude[%]>=0,_nb_scales>0,0<=_anisotropy<=1,0<=_minimize_alpha<=1\fR Sharpen selected images using a multi-scale and alpha boosting algorithm. \fBDefault values\fR: '\fBamplitude=1\fR', '\fBnb_scales=5\fR', '\fBanisotropy=0\fR' and '\fBminimize_alpha=1\fR'. \fBsmooth (+):\fR amplitude[%]>=0,_sharpness>=0,0<=_anisotropy<=1,_alpha[%],_sigma[%],_dl>0,_da>0,_precision>0,_interpolation,_fast_approx={ 0:No | 1:Yes } |\fR nb_iterations>=0,_sharpness>=0,_anisotropy,_alpha,_sigma,_dt>0,0 |\fR [tensor_field],_amplitude>=0,_dl>0,_da>0,_precision>0,_interpolation,_fast_approx={ 0:No | 1:Yes } |\fR [tensor_field],_nb_iters>=0,_dt>0,0\fR Smooth selected images anisotropically using diffusion PDE's, with specified field of diffusion tensors. '\fBinterpolation\fR' can be \fB{ 0:Nearest | 1:Linear | 2:Runge-kutta }\fR. \fBDefault values\fR: '\fBsharpness=0.7\fR', '\fBanisotropy=0.3\fR', '\fBalpha=0.6\fR', '\fBsigma=1.1\fR', '\fBdl=0.8\fR', '\fBda=30\fR', '\fBprecision=2\fR', '\fBinterpolation=0\fR' and '\fBfast_approx=1\fR'. \fBExample:\fR [#1] image.jpg repeat 3 smooth 40,0,1,1,2 done\fR [#2] image.jpg 100%,100%,1,2 rand[-1] -100,100 repeat 2 smooth[-1] 100,0.2,1,4,4 done warp[0] [-1],1,1,1\fR \fBTutorial: \fR\fIhttps://gmic.eu/oldtutorial/_smooth\fR \fBsplit_freq:\fR smoothness[%]>0\fR Split selected images into low and high frequency parts. \fBExample:\fR [#1] image.jpg split_freq 2%\fR \fBsolve_poisson:\fR "laplacian_command",_nb_iterations>=0,_time_step>0,_nb_scales>=0\fR Solve Poisson equation so that applying '\fBlaplacian[n]\fR' is close to the result of '\fBlaplacian_command[n]\fR'. Solving is performed using a multi-scale gradient descent algorithm. If '\fBnb_scales=0\fR', the number of scales is automatically determined. \fBDefault values\fR: '\fBnb_iterations=60\fR', '\fBdt=5\fR' and '\fBnb_scales=0\fR'. \fBExample:\fR [#1] image.jpg command "foo : gradient x" +solve_poisson foo +foo[0] +laplacian[1]\fR \fBsplit_alpha:\fR _nb_scales[%]={ 0:Auto | -S<0 | N>0 },_subsample={ 0:No | 1:Yes },0<=_anisotropy<=1,0<=_minimize_alpha<=1\fR Split selected images into alpha detail scales. If '\fBnb_scales==-S\fR', the lowest scale has a size of at least '\fBSxS\fR'. Parameter '\fBanisotropy\fR' is only considered when '\fBsubsample=0\fR'. Image reconstruction is done with command \fImerge_alpha\fR. \fBDefault values\fR: '\fBnb_scales=0\fR', '\fBsubsample=0\fR', '\fBanisotropy=0\fR' and '\fBminimize_alpha=1\fR'. \fBsplit_details:\fR _nb_scales[%]={ 0:Auto | -S<0 | N>0 },_base_scale[%]>=0,_detail_scale[%]>=0\fR Split selected images into '\fBnb_scales\fR' detail scales. If '\fBbase_scale\fR' = '\fBdetail_scale\fR' = 0, the image decomposition is done with '\fBa trous\fR' wavelets. Otherwise, it uses laplacian pyramids with linear standard deviations. \fBDefault values\fR: '\fBnb_scales=0\fR', '\fBbase_scale=0\fR' and '\fBdetail_scale=0\fR'. \fBExample:\fR [#1] image.jpg split_details ,\fR \fBstructuretensors:\fR _scheme={ 0:Centered | 1:Forward/backward }\fR Compute the structure tensor field of selected images. \fBDefault value\fR: '\fBscheme=0\fR'. \fBExample:\fR [#1] image.jpg structuretensors abs pow 0.2\fR \fBTutorial: \fR\fIhttps://gmic.eu/oldtutorial/_structuretensors\fR \fBsolidify:\fR _smoothness[%]>=0,_diffusion_type={ 0:Isotropic | 1:Delaunay-guided | 2:Edge-oriented },_diffusion_iter>=0\fR Solidify selected transparent images. \fBDefault values\fR: '\fBsmoothness=75%\fR', '\fBdiffusion_type=1\fR' and '\fBdiffusion_iter=20\fR'. \fBExample:\fR [#1] image.jpg 100%,100% circle[-1] 50%,50%,25%,1,255 append c +solidify , display_rgba\fR \fBsyntexturize:\fR _width[%]>0,_height[%]>0\fR Resynthesize '\fBwidth'x'height\fR' versions of selected micro-textures by phase randomization. The texture synthesis algorithm is a straightforward implementation of the method described in : \fIhttp://www.ipol.im/pub/art/2011/ggm_rpn/\fR. \fBDefault values\fR: '\fBwidth=height=100%\fR'. \fBExample:\fR [#1] image.jpg crop 2,282,50,328 +syntexturize 320,320\fR \fBsyntexturize_matchpatch:\fR _width[%]>0,_height[%]>0,_nb_scales>=0,_patch_size>0,_blending_size>=0,_precision>=0\fR Resynthesize '\fBwidth'x'height\fR' versions of selected micro-textures using a patch-matching algorithm. If '\fBnbscales==0\fR', the number of scales used is estimated from the image size. \fBDefault values\fR: '\fBwidth=height=100%\fR', '\fBnb_scales=0\fR', '\fBpatch_size=7\fR', '\fBblending_size=5\fR' and '\fBprecision=1\fR'. \fBExample:\fR [#1] image.jpg crop 25%,25%,75%,75% syntexturize_matchpatch 512,512\fR \fBtv_flow:\fR _nb_iter>=0,_dt,_keep_sequence={ 0:No | 1:Yes }\fR Apply iterations of the total variation flow on selected images. \fBDefault values\fR: '\fBnb_iter=10\fR', '\fBdt=30\fR' and '\fBkeep_sequence=0\fR'. \fBExample:\fR [#1] image.jpg +tv_flow 40\fR \fBunsharp:\fR radius[%]>=0,_amount>=0,_threshold[%]>=0\fR Apply an unsharp mask on selected images. \fBDefault values\fR: '\fBamount=2\fR' and '\fBthreshold=0\fR'. \fBExample:\fR [#1] image.jpg blur 3 +unsharp 1.5,15 cut 0,255\fR \fBunsharp_octave:\fR _nb_scales>0,_radius[%]>=0,_amount>=0,threshold[%]>=0\fR Apply octave sharpening on selected images. \fBDefault values\fR: '\fBnb_scales=4\fR', '\fBradius=1\fR', '\fBamount=2\fR' and '\fBthreshold=0\fR'. \fBExample:\fR [#1] image.jpg blur 3 +unsharp_octave 4,5,15 cut 0,255\fR \fBvanvliet (+):\fR std_deviation[%]>=0,order={ 0 | 1 | 2 | 3 },axis={ x | y | z | c },_boundary_conditions\fR Apply Vanvliet recursive filter on selected images, along specified axis and with specified standard deviation, order and boundary conditions. '\fBboundary_conditions\fR' can be \fB{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR. \fBDefault value\fR: '\fBboundary_conditions=1\fR'. \fBExample:\fR [#1] image.jpg +vanvliet 3,1,x\fR [#2] image.jpg +vanvliet 30,0,x vanvliet[-2] 30,0,y add\fR \fBvoronoi:\fR Compute the discrete Voronoi diagram of non-zero pixels in selected images. \fBExample:\fR [#1] 400,400,1,3 eval "repeat(50,I(v([w,w]-1)) = v([255,255,255]))" +voronoi +gradient_norm. eq. 0 *[-2,-1]\fR \fBwatermark_fourier:\fR text,_size>0\fR Add a textual watermark in the frequency domain of selected images. \fBDefault value\fR: '\fBsize=33\fR'. \fBExample:\fR [#1] image.jpg +watermark_fourier "Watermarked!" +display_fft remove[-3,-1] normalize 0,255 append[-4,-2] y append[-2,-1] y\fR \fBwatershed (+):\fR [priority_image],_is_high_connectivity={ 0:No | 1:Yes }\fR Compute the watershed transform of selected images. \fBDefault value\fR: '\fBis_high_connectivity=1\fR'. \fBExample:\fR [#1] 400,400 noise 0.2,2 eq 1 +distance 1 mul[-1] -1 label[-2] watershed[-2] [-1] mod[-2] 256 map[-2] 0 reverse\fR \fB\fB11.9. Features Extraction\fR \fB -------------------\fR \fBarea:\fR tolerance>=0,is_high_connectivity={ 0:No | 1:Yes }\fR Compute area of connected components in selected images. \fBDefault values\fR: '\fBis_high_connectivity=0\fR'. \fBExample:\fR [#1] image.jpg luminance stencil[-1] 1 +area 0\fR \fBTutorial: \fR\fIhttps://gmic.eu/oldtutorial/_area\fR \fBarea_fg:\fR tolerance>=0,is_high_connectivity={ 0:No | 1:Yes }\fR Compute area of connected components for non-zero values in selected images. Similar to '\fBarea\fR' except that 0-valued pixels are not considered. \fBDefault values\fR: '\fBis_high_connectivity=0\fR'. \fBExample:\fR [#1] image.jpg luminance stencil[-1] 1 +area_fg 0\fR \fBat_curve:\fR x0[%],y0[%],z0[%],...,xN[%],yn[%],zn[%]\fR Retrieve pixels of the selected images belonging to the specified cubic spline curve that passes across the specified points. \fBExample:\fR [#1] image.jpg +at_curve 0,0,0,80%,50%,0,100%,100%,0\fR \fBat_quadrangle:\fR x0[%],y0[%],x1[%],y1[%],x2[%],y2[%],x3[%],y3[%],_interpolation,_boundary_conditions |\fR x0[%],y0[%],z0[%],x1[%],y1[%],z1[%],x2[%],y2[%],z2[%],x3[%],y3[%],z3[%],_interpolation,_boundary_conditions\fR Retrieve pixels of the selected images belonging to the specified 2D or 3D quadrangle. '\fBinterpolation\fR' can be \fB{ 0:Nearest-neighbor | 1:Linear | 2:Cubic }\fR. '\fBboundary_conditions\fR' can be \fB{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR. \fBExample:\fR [#1] image.jpg params=5%,5%,95%,5%,60%,95%,40%,95% +at_quadrangle $params polygon.. 4,$params,0.5,255\fR \fBbarycenter:\fR Compute the barycenter vector of pixel values. \fBExample:\fR [#1] 256,256 ellipse 50%,50%,20%,20%,0,1,1 deform 20 +barycenter +ellipse[-2] {@0,1},5,5,0,10\fR \fBbetti:\fR Compute Betti numbers B0,B1 and B2 from selected 3D binary shapes. Values B0,B1 and B2 are returned in the status. When multiple images are selected, the B0,B1,B2 of each image are concatenated in the status. (see '\fBhttps://en.wikipedia.org/wiki/Betti_number\fR' for details about Betti numbers). \fBcanny:\fR _sigma[%]>=0,_low_threshold>=0,_high_threshold>=0\fR Locate image edges using Canny edge detector. \fBDefault values\fR: '\fBsigma=1\fR', '\fBlow_threshold=0.05\fR', '\fBhigh_threshold=0.15\fR'. \fBExample:\fR [#1] image.jpg canny 1\fR \fBdelaunay:\fR _output_type={ 0:Image | 1:Coordinates/triangles }\fR Generate discrete 2D Delaunay triangulation of non-zero pixels in selected images. Input images must be scalar. Each pixel of the output image is a triplet (a,b,c) meaning the pixel belongs to the Delaunay triangle '\fBABC\fR' where '\fBa\fR','\fBb\fR','\fBc\fR' are the labels of the pixels '\fBA\fR','\fBB\fR','\fBC\fR'. \fBExample:\fR [#1] 400,400 rand 32,255 100%,100% noise. 0.4,2 eq. 1 mul +delaunay\fR [#2] image.jpg 100%,100% noise. 2,2 eq. 1 delaunay. +blend shapeaverage0\fR \fBdetect_skin:\fR 0<=tolerance<=1,_skin_x,_skin_y,_skin_radius>=0\fR Detect skin in selected color images and output a skin membership probability map. Detection is performed using CbCr chromaticity data of skin pixels. If arguments '\fBskin_x\fR', '\fBskin_y\fR' and '\fBskin_radius\fR' are provided, skin pixels are learnt from the sample pixels inside the circle located at ('\fBskin_x\fR','\fBskin_y\fR') with radius '\fBskin_radius\fR'. \fBDefault value\fR: '\fBtolerance=0.5\fR' and '\fBskin_x=skin_y=radius=-1\fR'. \fBdisplacement (+):\fR [reference],_smoothness,_precision>=0,_nb_scales>=0,_iteration_max>=0,mode={ 0:Backward | 1:Forward },_[guide]\fR Estimate displacement field from specified reference image (source) to selected images (targets). If '\fBsmoothness>=0\fR', regularization type is set to Tikhonov, else to TV (Total Variation). If '\fBnbscales==0\fR', the number of scales used is estimated from the image size. \fBDefault values\fR: '\fBsmoothness=0.1\fR', '\fBprecision=7\fR', '\fBnb_scales=0\fR', '\fBiteration_max=1000\fR', '\fBmode=0\fR', and '\fB[guide]=(unused)\fR'. \fBExample:\fR [#1] image.jpg +rotate 3,1,0,50%,50% +displacement[-1] [-2] quiver[-1] [-1],15,1,1,1,{1.5*iM}\fR \fBdistance (+):\fR isovalue[%],_metric |\fR isovalue[%],[metric],_method\fR Compute the unsigned distance function to specified isovalue, optionally according to a custom metric. '\fBmetric\fR' can be \fB{ 0:Chebyshev | 1:Manhattan | 2:Euclidean | 3:Squared-euclidean }\fR. '\fBmethod\fR' can be \fB{ 0:Fast-marching | 1:Low-connectivity dijkstra | 2:High-connectivity dijkstra | 3:1+Return path | 4:2+Return path }\fR. \fBDefault value\fR: '\fBmetric=2\fR' and '\fBmethod=0\fR'. \fBExample:\fR [#1] image.jpg threshold 20% distance 0 pow 0.3\fR [#2] 400,400 set 1,50%,50% +distance[0] 1,2 +distance[0] 1,1 distance[0] 1,0 mod 32 threshold 16 append c\fR \fBTutorial: \fR\fIhttps://gmic.eu/oldtutorial/_distance\fR \fBedgels:\fR x0,y0,_n0,_is_high_connectivity={ 0:No | 1:Yes }\fR Extract one or several lists of edgels (and their normals) that defines a 2D binary silhouette. When specified (i.e. '\fB!=-1\fR'), arguments '\fBx0,y0,n0\fR' are the coordinates of the starting edgel, which must be located on an edge of the binary silhouette. * If '\fBx0,y0\fR' and '\fBn0\fR' are specified, only a single list of edgels is returned. * If only '\fBx0,y0\fR' are specified (meaning '\fBn0=-1\fR'), up to 4 lists of edgels can be returned, all starting from the same point (x0,y0). * If no arguments are specified (meaning '\fBx0=y0=n0=-1\fR'), all possible lists of edgels are returned. A list of edgels is returned as an image with 3 channels '\fB[x,y,n]\fR' where '\fBx\fR' and '\fBy\fR' are the 2D coordinates of the edgel pixel, and '\fBn\fR' is the orientation of its associated canonical normal (which can be \fB{ 0:[1,0] | 1:[0,1] | 2:[-1,0] | 3:[0,-1] }\fR. \fBDefault values\fR: '\fBx0=y0=n0=-1\fR' and '\fBis_high_connectivity=1\fR'. \fBedges:\fR _threshold[%]>=0\fR Estimate contours of selected images. \fBDefault value\fR: '\fBedges=15%\fR' \fBExample:\fR [#1] image.jpg +edges 15%\fR \fBfftpolar:\fR Compute fourier transform of selected images, as centered magnitude/phase images. \fBExample:\fR [#1] image.jpg fftpolar ellipse 50%,50%,10,10,0,1,0 ifftpolar\fR \fBhistogram (+):\fR nb_levels[%]>0,_min_value[%],_max_value[%]\fR Compute the histogram of selected images. If value range is set, the histogram is estimated only for pixels in the specified value range. Argument '\fBmax_value\fR' must be specified if '\fBmin_value\fR' is set. \fBDefault values\fR: '\fBmin_value=0%\fR' and '\fBmax_value=100%\fR'. \fBExample:\fR [#1] image.jpg +histogram 64 display_graph[-1] 400,300,3\fR \fBhistogram_masked:\fR [mask],nb_levels[%]>0,_min_value[%],_max_value[%]\fR Compute the masked histogram of selected images. \fBDefault values\fR: '\fBmin_value=0%\fR' and '\fBmax_value=100%\fR'. \fBhistogram_nd:\fR nb_levels[%]>0,_value0[%],_value1[%]\fR Compute the 1D, 2D or 3D histogram of selected multi-channels images (having 1,2 or 3 channels). If value range is set, the histogram is estimated only for pixels in the specified value range. \fBDefault values\fR: '\fBvalue0=0%\fR' and '\fBvalue1=100%\fR'. \fBExample:\fR [#1] image.jpg channels 0,1 +histogram_nd 256\fR \fBhistogram_cumul:\fR _nb_levels>0,_is_normalized={ 0:No | 1:Yes },_val0[%],_val1[%]\fR Compute cumulative histogram of selected images. \fBDefault values\fR: '\fBnb_levels=256\fR', '\fBis_normalized=0\fR', '\fBval0=0%\fR' and '\fBval1=100%\fR'. \fBExample:\fR [#1] image.jpg +histogram_cumul 256 histogram[0] 256 display_graph 400,300,3\fR \fBhistogram_pointwise:\fR nb_levels[%]>0,_value0[%],_value1[%]\fR Compute the histogram of each vector-valued point of selected images. If value range is set, the histogram is estimated only for values in the specified value range. \fBDefault values\fR: '\fBvalue0=0%\fR' and '\fBvalue1=100%\fR'. \fBhough:\fR _width>0,_height>0,gradient_norm_voting={ 0:No | 1:Yes }\fR Compute hough transform (theta,rho) of selected images. \fBDefault values\fR: '\fBwidth=512\fR', '\fBheight=width\fR' and '\fBgradient_norm_voting=1\fR'. \fBExample:\fR [#1] image.jpg +blur 1.5 hough[-1] 400,400 blur[-1] 0.5 add[-1] 1 log[-1]\fR \fBhuffman_tree:\fR Generate Huffman coding tree from the statistics of all selected images. Huffman tree is returned as a 1xN image inserted at the end of the image list, representing the '\fBN\fR' vector-valued leafs/nodes of the tree, encoded as '[ value,parent,child0,child1 ]\fR'. Last row of the returned image corresponds to the tree root. Selected images must contain only positive integer values. Return maximal value of the input data in the status. See also: \fIcompress_huffman\fR, \fIdecompress_huffman\fR. \fBifftpolar:\fR Compute inverse fourier transform of selected images, from centered magnitude/phase images. \fBimg2patches:\fR patch_size>0,_overlap[%]>0,_boundary_conditions\fR Decompose selected 2D images into (possibly overlapping) patches and stack them along the z-axis. '\fBoverlap\fR' must be in range '\fB[0,patch_size-1]\fR'. '\fBboundary_conditions\fR' can be \fB{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR. \fBDefault values\fR: '\fBoverlap=0\fR' and '\fBboundary_conditions=0\fR'. See also: \fIpatches2img\fR. \fBExample:\fR [#1] image.jpg img2patches 64\fR \fBisophotes:\fR _nb_levels>0\fR Render isophotes of selected images on a transparent background. \fBDefault value\fR: '\fBnb_levels=64\fR' \fBExample:\fR [#1] image.jpg blur 2 isophotes 6 dilate_circ 5 display_rgba\fR \fBlabel (+):\fR _tolerance>=0,is_high_connectivity={ 0:No | 1:Yes },_is_L2_norm={ 0:No | 1:Yes }\fR Label connected components in selected images. If '\fBis_L2_norm=1\fR', tolerances are compared against L2-norm, otherwise L1-norm is used. \fBDefault values\fR: '\fBtolerance=0\fR', '\fBis_high_connectivity=0\fR' and '\fBis_L2_norm=1\fR'. \fBExample:\fR [#1] image.jpg luminance threshold 60% label normalize 0,255 map 0\fR [#2] 400,400 set 1,50%,50% distance 1 mod 16 threshold 8 label mod 255 map 2\fR \fBTutorial: \fR\fIhttps://gmic.eu/oldtutorial/_label\fR \fBlabel_fg:\fR tolerance>=0,is_high_connectivity={ 0:No | 1:Yes },_is_L2_norm={ 0:No | 1:Yes }\fR Label connected components for non-zero values (foreground) in selected images. Similar to '\fBlabel\fR' except that 0-valued pixels are not labeled. If '\fBis_L2_norm=1\fR', tolerances are compared against L2-norm, otherwise L1-norm is used. \fBDefault value\fR: '\fBis_high_connectivity=0\fR' and '\fBis_L2_norm=1\fR'. \fBlaar:\fR Extract the largest axis-aligned rectangle in non-zero areas of selected images. Rectangle coordinates are returned in status, as a sequence of numbers x0,y0,x1,y1. \fBExample:\fR [#1] shape_cupid 256 coords=${-laar} normalize 0,255 to_rgb rectangle $coords,0.5,0,128,0\fR \fBmax_patch:\fR _patch_size>=1\fR Return locations of maximal values in local patch-based neighborhood of given size for selected images. \fBDefault value\fR: '\fBpatch_size=16\fR'. \fBExample:\fR [#1] image.jpg norm +max_patch 16\fR \fBmin_patch:\fR _patch_size>=1\fR Return locations of minimal values in local patch-based neighborhood of given size for selected images. \fBDefault value\fR: '\fBpatch_size=16\fR'. \fBExample:\fR [#1] image.jpg norm +min_patch 16\fR \fBminimal_path:\fR x0[%]>=0,y0[%]>=0,z0[%]>=0,x1[%]>=0,y1[%]>=0,z1[%]>=0,_is_high_connectivity={ 0:No | 1:Yes }\fR Compute minimal path between two points on selected potential maps. \fBDefault value\fR: '\fBis_high_connectivity=0\fR'. \fBExample:\fR [#1] image.jpg +gradient_norm fill[-1] 1/(1+i) minimal_path[-1] 0,0,0,100%,100%,0 pointcloud[-1] 0 *[-1] 280 to_rgb[-1] ri[-1] [-2],0 or\fR \fBmse:\fR [reference]\fR Return the MSE (Mean-Squared Error) between selected images and specified reference image. This command does not modify the images. It returns a value or a list of values in the status. \fBmse_matrix:\fR Compute MSE (Mean-Squared Error) matrix between selected images. \fBExample:\fR [#1] image.jpg +noise 30 +noise[0] 35 +noise[0] 38 cut. 0,255 +mse_matrix\fR \fBpatches2img:\fR width>0,height>0,_overlap[%]>0,_overlap_std[%]\fR Recompose 2D images from their selected patch representations. '\fBoverlap\fR' must be in range '\fB[0,patch_size-1]\fR' where '\fBpatch_size\fR' is the width/height of the selected image. '\fBoverlap_std\fR' is the standard deviation of the gaussian weights used for reconstructing overlapping patches. If '\fBoverlap_std\fR' is set to '\fB-1\fR', uniform weights are used rather than gaussian. \fBDefault value\fR: '\fBoverlap=0\fR' and '\fBoverlap_std=-1\fR'. See also: \fIimg2patches\fR. \fBExample:\fR [#1] image.jpg +img2patches 32,0,3 mirror[-1] xy patches2img[-1] {0,[w,h]}\fR \fBpatches:\fR patch_width>0,patch_height>0,patch_depth>0,x0,y0,z0,_x1,_y1,_z1,...,_xN,_yN,_zN\fR Extract N+1 patches from selected images, centered at specified locations. \fBExample:\fR [#1] image.jpg +patches 64,64,1,153,124,0,184,240,0,217,126,0,275,38,0\fR \fBpca:\fR _output_mode,_target_dim[%]>0,_normalization_mode={ 0:None | 1:Center | 2:Center+scale }\fR Perform PCA (Principal Component Analysis) on selected images, viewed as sets of vector-valued samples '\fBXk\fR'. Bits of '\fBoutput_mode\fR' selects what output data are returned on the image stack: * '\fB1\fR': Output image of vector-valued samples 'Yk = Mt*(Xk - avg)/std\fR', that are the projections of the '\fBXk\fR' in a vector sub-space of (lower) dimension '\fBtarget_dim\fR'. '\fBavg\fR' is the average vector of all '\fBXk\fR' (or zero vector if '\fBnormalization_mode==0\fR'). '\fBstd\fR' is the standard deviation vector of all '\fBXk\fR' (or all-ones vector if '\fBnormalization_mode<2\fR'). '\fBMt\fR' is the transpose of '\fBM\fR', the matrix of the '\fBtarget_dim\fR' first eigenvectors (arranged by columns) of the covariance matrix of the '\fBXk\fR'. * '\fB2\fR': Output vector '\fBavg\fR': average of the '\fBXk\fR'. * '\fB4\fR': Output vector '\fBstd\fR': standard deviations of the '\fBXk\fR'. * '\fB8\fR': Output matrix '\fBM\fR': projection matrix (orthonormal). Knowing '\fBavg\fR', '\fBstd\fR' and '\fBM\fR' makes it possible to (approximately) retro-project the '\fBYk\fR' in the initial vector space, by computing 'Xk = avg + std*M*Yk\fR' for each image pixel. \fBDefault values\fR: '\fBoutput_mode=15\fR', '\fBtarget_dim=100%\fR' and '\fBnormalization_mode=1\fR'. \fBExample:\fR [#1] shape_dragonfly 400 mul 128 0 eval.. "i?da_push([x,y])" da_freeze. pca. 11,2 eval "C = I[#-2,0]; M = transpose(crop(#-1),2); repeat(2,k, polygon(#0,-2,C-1000*M[2*k,2],C+1000*M[2*k,2],1,0xF0F0F0F0,180)); ellipse(#0,C,5,5,0,1,255)" k[0]\fR \fBmatchpatch (+):\fR [patch_image],patch_width>=1,_patch_height>=1,_patch_depth>=1,_nb_iterations>=0,_nb_randoms>=0,_occurence_penalization,_output_score={ 0:No | 1:Yes },_[guide]\fR Estimate correspondence map between selected images and specified patch image, using a patch-matching algorithm. Each pixel of the returned correspondence map gives the location (p,q) of the closest patch in the specified patch image. If '\fBoutput_score=1\fR', the third channel also gives the corresponding matching score for each patch as well. If '\fBpatch_penalization\fR' is >=0, SSD is penalized with patch occurrences. If '\fBpatch_penalization\fR' is <0, SSD is inf-penalized when distance between patches are less than '\fB-patch_penalization\fR'. \fBDefault values\fR: '\fBpatch_height=patch_width\fR', '\fBpatch_depth=1\fR', '\fBnb_iterations=5\fR', '\fBnb_randoms=5\fR', '\fBoccurence_penalization=0\fR', '\fBoutput_score=0\fR' and '\fBguide=(undefined)\fR'. \fBExample:\fR [#1] image.jpg sample colorful +matchpatch[0] [1],3 +warp[-2] [-1],0\fR \fBmatchpatch_alt:\fR [patch_image],_patch_width>=1,_patch_height>=1,_patch_depth>=1,_nb_iterations>=0,_nb_randoms>=0,_occurrence_penalization>=0,_output_score={ 0:No | 1:Yes },_[guide]\fR Implementation of the \fImatchpatch\fR command as an alternative custom command (slower). \fBDefault values\fR: '\fBpatch_height=patch_width\fR', '\fBpatch_depth=1\fR', '\fBnb_iterations=5\fR', '\fBnb_randoms=5\fR', '\fBoccurrence_penalization=0\fR', '\fBoutput_score=0\fR' and '\fBguide=(undefined)\fR'. \fBExample:\fR [#1] image.jpg sample colorful +matchpatch_alt[0] [1],3 +warp[-2] [-1],0\fR \fBplot2value:\fR Retrieve values from selected 2D graph plots. \fBExample:\fR [#1] 400,300,1,1,'y>300*abs(cos(x/10+2*u))' +plot2value +display_graph[-1] 400,300\fR \fBpointcloud:\fR _type = { -X:-X-opacity | 0:Binary | 1:Cumulative | 2:Label | 3:Retrieve coordinates },_width,_height>0,_depth>0\fR Render a set of point coordinates, as a point cloud in a 1D/2D or 3D binary image (or do the reverse, i.e. retrieve coordinates of non-zero points from a rendered point cloud). Input point coordinates can be a NxMx1x1, Nx1x1xM or 1xNx1xM image, where '\fBN\fR' is the number of points, and M the point coordinates. If 'M'>3, the 3-to-M components sets the (M-3)-dimensional color at each point. Parameters '\fBwidth\fR','\fBheight\fR' and '\fBdepth\fR' are related to the size of the final image : - If set to 0, the size is automatically set along the specified axis. - If set to N>0, the size along the specified axis is N. - If set to N<0, the size along the specified axis is at most N. Points with coordinates that are negative or higher than specified ('\fBwidth\fR','\fBheight\fR','\fBdepth\fR') are not plotted. \fBDefault values\fR: '\fBtype=0\fR' and '\fBmax_width=max_height=max_depth=0\fR'. \fBExample:\fR [#1] 3000,2 rand 0,400 +pointcloud 0 dilate[-1] 3\fR [#2] 3000,2 rand 0,400 {w} {w},3 rand[-1] 0,255 append y +pointcloud 0 dilate[-1] 3\fR \fBpsnr:\fR [reference],_max_value>0\fR Return PSNR (Peak Signal-to-Noise Ratio) between selected images and specified reference image. This command does not modify the images. It returns a value or a list of values in the status. \fBDefault value\fR: '\fBmax_value=255\fR'. \fBpsnr_matrix:\fR _max_value>0\fR Compute PSNR (Peak Signal-to-Noise Ratio) matrix between selected images. \fBDefault value\fR: '\fBmax_value=255\fR'. \fBExample:\fR [#1] image.jpg +noise 30 +noise[0] 35 +noise[0] 38 cut. 0,255 +psnr_matrix\fR \fBsegment_watershed:\fR _threshold>=0\fR Apply watershed segmentation on selected images. \fBDefault values\fR: '\fBthreshold=2\fR'. \fBExample:\fR [#1] image.jpg segment_watershed 2\fR \fBshape2bump:\fR _resolution>=0,0<=_weight_std_max_avg<=1,_dilation,_smoothness>=0\fR Estimate bumpmap from binary shape in selected images. \fBDefault value\fR: '\fBresolution=256\fR', '\fBweight_std_max=0.75\fR', '\fBdilation=0\fR' and '\fBsmoothness=100\fR'. \fBskeleton:\fR _boundary_conditions={ 0:Dirichlet | 1:Neumann }\fR Compute skeleton of binary shapes using distance transform and constrained thinning. \fBDefault value\fR: '\fBboundary_conditions=1\fR'. \fBExample:\fR [#1] shape_cupid 320 +skeleton 0\fR \fBslic:\fR size>0,_regularity>=0,_nb_iterations>0\fR Segment selected 2D images with superpixels, using the SLIC algorithm (Simple Linear Iterative Clustering). Scalar images of increasingly labeled pixels are returned. Reference paper: Achanta, R., Shaji, A., Smith, K., Lucchi, A., Fua, P., & Susstrunk, S. (2010). SLIC Superpixels (No. EPFL-REPORT-149300). \fBDefault values\fR: '\fBsize=16\fR', '\fBregularity=10\fR' and '\fBnb_iterations=10\fR'. \fBExample:\fR [#1] image.jpg +srgb2lab slic[-1] 16 +blend shapeaverage f[-2] "j(1,0)==i && j(0,1)==i" *[-1] [-2]\fR \fBssd_patch:\fR [patch],_use_fourier={ 0:No | 1:Yes },_boundary_conditions\fR Compute fields of SSD between selected images and specified patch. Argument '\fBboundary_conditions\fR' is valid only when '\fBuse_fourier=0\fR'. '\fBboundary_conditions\fR' can be \fB{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR. \fBDefault value\fR: '\fBuse_fourier=0\fR' and '\fBboundary_conditions=0\fR'. \fBExample:\fR [#1] image.jpg +crop 20%,20%,35%,35% +ssd_patch[0] [1],0,0\fR \fBssim:\fR [reference],_patch_size>0,_max_value>0\fR Compute the Structural Similarity Index Measure (SSIM) between selected images and specified reference image. This command does not modify the images, it just returns a value or a list of values in the status. When '\fBdownsampling_factor\fR' is specified with an ending '\fB%\fR', its value is equal to '\fB1+(patch_size-1)*spatial_factor%\fR'. SSIM is a measure introduced in the following paper: Wang, Zhou, et al.\fR, "Image quality assessment: from error visibility to structural similarity.", in IEEE transactions on image processing 13.4 (2004): 600-612. The implementation of this command is a direct translation of the reference code (in Matlab), found at: https://ece.uwaterloo.ca/~z70wang/research/ssim/ \fBDefault values\fR: '\fBpatch_size=11\fR', and '\fBmax_value=255\fR'. \fBssim_matrix:\fR _patch_size>0,_max_value>0\fR Compute SSIM (Structural Similarity Index Measure) matrix between selected images. \fBDefault values\fR: '\fBpatch_size=11\fR', and '\fBmax_value=255\fR'. \fBExample:\fR [#1] image.jpg +noise 30 +noise[0] 35 +noise[0] 38 cut. 0,255 +ssim_matrix\fR \fBthinning:\fR _boundary_conditions={ 0:Dirichlet | 1:Neumann }\fR Compute skeleton of binary shapes using morphological thinning (beware, this is a quite slow iterative process) \fBDefault value\fR: '\fBboundary_conditions=1\fR'. \fBExample:\fR [#1] shape_cupid 320 +thinning\fR \fBtones:\fR N>0\fR Get N tones masks from selected images. \fBExample:\fR [#1] image.jpg +tones 3\fR \fBtopographic_map:\fR _nb_levels>0,_smoothness\fR Render selected images as topographic maps. \fBDefault values\fR: '\fBnb_levels=16\fR' and '\fBsmoothness=2\fR'. \fBExample:\fR [#1] image.jpg topographic_map 10\fR \fBtsp:\fR _precision>=0\fR Try to solve the '\fBtravelling salesman\fR' problem, using a combination of greedy search and 2-opt algorithms. Selected images must have dimensions Nx1x1xC to represent N cities each with C-dimensional coordinates. This command re-order the selected data along the x-axis so that the point sequence becomes a shortest path. \fBDefault values\fR: '\fBprecision=256\fR'. \fBExample:\fR [#1] 256,1,1,2 rand 0,512 tsp , 512,512,1,3 repeat w#0 circle[-1] {0,I[$>]},2,1,255,255,255 line[-1] {0,boundary=2;[I[$>],I[$>+1]]},1,255,128,0 done keep[-1]\fR \fBvariance_patch:\fR _patch_size>=1\fR Compute variance of each images patch centered at (x,y), in selected images. \fBDefault value\fR: '\fBpatch_size=16\fR' \fBExample:\fR [#1] image.jpg +variance_patch\fR \fB\fB11.10. Image Drawing\fR \fB -------------\fR \fBarrow:\fR x0[%],y0[%],x1[%],y1[%],_thickness[%]>=0,_head_length[%]>=0,_head_thickness[%]>=0,_opacity,_pattern,_color1,...\fR Draw specified arrow on selected images. '\fBpattern\fR' is an hexadecimal number starting with '\fB0x\fR' which can be omitted even if a color is specified. If a pattern is specified, the arrow is drawn outlined instead of filled. \fBDefault values\fR: '\fBthickness=1%\fR', '\fBhead_length=10%\fR', '\fBhead_thickness=3%\fR', '\fBopacity=1\fR', '\fBpattern=(undefined)\fR' and '\fBcolor1=0\fR'. \fBExample:\fR [#1] 400,400,1,3 repeat 100 arrow 50%,50%,{u(100)}%,{u(100)}%,3,20,10,0.3,${-rgb} done\fR \fBaxes:\fR x0,x1,y0,y1,_font_height>=0,_opacity,_pattern,_color1,...\fR Draw xy-axes on selected images. '\fBpattern\fR' is an hexadecimal number starting with '\fB0x\fR' which can be omitted even if a color is specified. To draw only one x-axis at row Y, set both '\fBy0\fR' and '\fBy1\fR' to Y. To draw only one y-axis at column X, set both '\fBx0\fR' and '\fBx1\fR' to X. \fBDefault values\fR: '\fBfont_height=14\fR', '\fBopacity=1\fR', '\fBpattern=(undefined)\fR' and '\fBcolor1=0\fR'. \fBExample:\fR [#1] 400,400,1,3,255 axes -1,1,1,-1\fR \fBball:\fR _size>0,_R,_G,_B,_ambient>=0,_diffuse>=0,_specular>=0,_shininess>=0,_light_x,_light_y,_light_z\fR Input a 2D RGBA colored ball sprite, rendered using the Phong illumination model. \fBDefault values\fR: '\fBsize=64\fR', '\fBR=200\fR', '\fBG=R\fR', '\fBB=R\fR', '\fBambient=0.25\fR', '\fBdiffuse=1\fR', '\fBspecular=1\fR', '\fBshininess=20\fR', '\fBlight_x=1.5\fR', '\fBlight_y=-1.5\fR' and '\fBlight_z=1\fR'. \fBExample:\fR [#1] repeat 9 { ball {int(1.5^($>+4))},${-rgb} } append_tiles 3,3\fR \fBchessboard:\fR size1>0,_size2>0,_offset1,_offset2,_angle,_opacity,_color1,...,_color2,...\fR Draw chessboard on selected images. \fBDefault values\fR: '\fBsize2=size1\fR', '\fBoffset1=offset2=0\fR', '\fBangle=0\fR', '\fBopacity=1\fR', '\fBcolor1=0\fR' and '\fBcolor2=255\fR'. \fBExample:\fR [#1] image.jpg chessboard 32,32,0,0,25,0.3,255,128,0,0,128,255\fR \fBcie1931:\fR Draw CIE-1931 chromaticity diagram on selected images. \fBExample:\fR [#1] 500,400,1,3 cie1931\fR \fBcircle:\fR x[%],y[%],R[%],_opacity,_pattern,_color1,...\fR Draw specified colored circle on selected images. A radius of '\fB100%\fR' stands for '\fBsqrt(width^2+height^2)\fR'. '\fBpattern\fR' is an hexadecimal number starting with '\fB0x\fR' which can be omitted even if a color is specified. If a pattern is specified, the circle is drawn outlined instead of filled. \fBDefault values\fR: '\fBopacity=1\fR', '\fBpattern=(undefined)\fR' and '\fBcolor1=0\fR'. \fBExample:\fR [#1] image.jpg repeat 300 circle {u(100)}%,{u(100)}%,{u(30)},0.3,${-rgb} done circle 50%,50%,100,0.7,255\fR \fBclose_binary:\fR 0<=_endpoint_rate<=100,_endpoint_connectivity>=0,_spline_distmax>=0,_segment_distmax>=0,0<=_spline_anglemax<=180,_spline_roundness>=0,_area_min>=0, _allow_self_intersection={ 0:No | 1:Yes }\fR Automatically close open shapes in binary images (defining white strokes on black background). \fBDefault values\fR: '\fBendpoint_rate=75\fR', '\fBendpoint_connectivity=2\fR', '\fBspline_distmax=80\fR', '\fBsegment_distmax=20\fR', '\fBspline_anglemax=90\fR', '\fBspline_roundness=1\fR','\fBarea_min=100\fR', '\fBallow_self_intersection=1\fR'. \fBcurve:\fR [xy_coordinates],_thickness>0,_tilt,_tilt_strength[%],_is_closed={ 0:No | 1:Yes },_opacity,_color1,...\fR Draw specified parameterized curve on selected images. Arguments are: * '\fB[xy_coordinates]\fR' is the set of XY-coordinates of the curve, specified as a 2-channels image. * '\fBthickness\fR' is the thickness of the drawing, specified in pixels. * '\fBtilt\fR' is an angle, specified in degrees. * '\fBtilt_strength\fR' must be a floating-point in [0,1] (or in [0,100] if specified as a percentage). * '\fBis_closed\fR' is a boolean which indicates whether the curve is closed. \fBDefault values\fR: '\fBthickness=0\fR', '\fBtilt=45\fR' \fBExample:\fR [#1] image.jpg srand 3 16,1,1,4,u s. c,2 rbf[-2,-1] 1000,0,1 n[-2] 10,{w#0-10} n[-1] 10,{h#0-10} a[-2,-1] c curve[-2] [-1],6,0,0,0,1,0,128,0\fR \fBellipse (+):\fR x[%],y[%],R[%],r[%],_angle,_opacity,_pattern,_color1,...\fR Draw specified colored ellipse on selected images. A radius of '\fB100%\fR' stands for '\fBsqrt(width^2+height^2)\fR'. '\fBpattern\fR' is an hexadecimal number starting with '\fB0x\fR' which can be omitted even if a color is specified. If a pattern is specified, the ellipse is drawn outlined instead of filled. \fBDefault values\fR: '\fBopacity=1\fR', '\fBpattern=(undefined)\fR' and '\fBcolor1=0\fR'. \fBExample:\fR [#1] image.jpg repeat 300 ellipse {u(100)}%,{u(100)}%,{u(30)},{u(30)},{u(180)},0.3,${-rgb} done ellipse 50%,50%,100,100,0,0.7,255\fR \fBflood (+):\fR x[%],_y[%],_z[%],_tolerance>=0,_is_high_connectivity={ 0:No | 1:Yes },_opacity,_color1,...\fR Flood-fill selected images using specified value and tolerance. \fBDefault values\fR: '\fBy=z=0\fR', '\fBtolerance=0\fR', '\fBis_high_connectivity=0\fR', '\fBopacity=1\fR' and '\fBcolor1=0\fR'. \fBExample:\fR [#1] image.jpg repeat 1000 flood {u(100)}%,{u(100)}%,0,20,0,1,${-rgb} done\fR \fBgaussian:\fR _sigma1[%],_sigma2[%],_angle\fR Draw a centered gaussian on selected images, with specified standard deviations and orientation. \fBDefault values\fR: '\fBsigma1=3\fR', '\fBsigma2=sigma1\fR' and '\fBangle=0\fR'. \fBExample:\fR [#1] 400,400 gaussian 100,30,45\fR \fBTutorial: \fR\fIhttps://gmic.eu/oldtutorial/_gaussian\fR \fBgraph:\fR [function_image],_plot_type,_vertex_type,_ytop,_ybottom,_opacity,_pattern,_color1,...\fR Draw specified function graph on selected images. '\fBplot_type\fR' can be \fB{ 0:None | 1:Lines | 2:Splines | 3:Bar }\fR. '\fBvertex_type\fR' can be \fB{ 0:None | 1:Points | 2,3:Crosses | 4,5:Circles | 6,7:Squares }\fR. '\fBpattern\fR' is an hexadecimal number starting with '\fB0x\fR' which can be omitted even if a color is specified. \fBDefault values\fR: '\fBplot_type=1\fR', '\fBvertex_type=1\fR', '\fBytop=ybottom=0 (auto)\fR', '\fBopacity=1\fR', '\fBpattern=(undefined)\fR' and '\fBcolor1=0\fR'. \fBExample:\fR [#1] image.jpg +rows 50% blur[-1] 3 split[-1] c div[0] 1.5 graph[0] [1],2,0,0,0,1,255,0,0 graph[0] [2],2,0,0,0,1,0,255,0 graph[0] [3],2,0,0,0,1,0, 0,255 keep[0]\fR \fBgrid:\fR size_x[%]>=0,size_y[%]>=0,_offset_x[%],_offset_y[%],_opacity,_pattern,_color1,...\fR Draw xy-grid on selected images. '\fBpattern\fR' is an hexadecimal number starting with '\fB0x\fR' which can be omitted even if a color is specified. \fBDefault values\fR: '\fBoffset_x=offset_y=0\fR', '\fBopacity=1\fR', '\fBpattern=(undefined)\fR' and '\fBcolor1=0\fR'. \fBExample:\fR [#1] image.jpg grid 10%,10%,0,0,0.5,255\fR [#2] 400,400,1,3,255 grid 10%,10%,0,0,0.3,0xCCCCCCCC,128,32,16\fR \fBj (+):\fR Shortcut for command '\fBimage\fR'. \fBimage (+):\fR [sprite],_x[%|~],_y[%|~],_z[%|~],_c[%|~],_opacity,_[opacity_mask],_max_opacity_mask\fR Draw specified sprite on selected images. (equivalent to shortcut command '\fBj\fR'). If one of the x,y,z or c argument ends with a '\fB~\fR', its value is expected to be a centering ratio (in [0,1]) rather than a position. Usual centering ratio are \fB{ 0:left-justified | 0.5:centered | 1:right-justified }\fR. \fBDefault values\fR: '\fBx=y=z=c=0\fR', '\fBopacity=1\fR', '\fBopacity_mask=(undefined)\fR' and '\fBmax_opacity_mask=1\fR'. \fBExample:\fR [#1] image.jpg +crop 40%,40%,60%,60% resize[-1] 200%,200%,1,3,5 frame[-1] xy,2,0 image[0] [-1],30%,30% keep[0]\fR \fBja:\fR Shortcut for command '\fBimagealpha\fR'. \fBimagealpha:\fR [sprite],_x[%|~],_y[%|~],_z[%|~],_c[%|~],_opacity\fR Draw specified sprite on selected images, considering that the sprite's last channel is the drawing's alpha. (equivalent to shortcut command '\fBja\fR'). If one of the x,y,z or c argument ends with a '\fB~\fR', its value is expected to be a centering ratio (in [0,1]) rather than a position. Usual centering ratio are \fB{ 0:left-justified | 0.5:centered | 1:right-justified }\fR. \fBDefault values\fR: '\fBx=y=z=c=0\fR' and '\fBopacity=1\fR'. \fBline (+):\fR x0[%],y0[%],x1[%],y1[%],_opacity,_pattern,_color1,...\fR Draw specified colored line on selected images. '\fBpattern\fR' is an hexadecimal number starting with '\fB0x\fR' which can be omitted even if a color is specified. \fBDefault values\fR: '\fBopacity=1\fR', '\fBpattern=(undefined)\fR' and '\fBcolor1=0\fR'. \fBExample:\fR [#1] image.jpg repeat 500 line 50%,50%,{u(w)},{u(h)},0.5,${-rgb} done line 0,0,100%,100%,1,0xCCCCCCCC,255 line 100%,0,0,100%,1,0xCCCCCCCC,255\fR \fBline_aa:\fR x0[%],y0[%],x1[%],y1[%],_opacity,_color1,...\fR Draw specified antialiased colored line on selected images. \fBDefault values\fR: '\fBopacity=1\fR' and '\fBcolor1=0\fR'. \fBExample:\fR [#1] 512,512,1,3 repeat 100 line_aa {v([w,h,w,h])-1},1,${-rgb} done\fR \fBspline:\fR x0[%],y0[%],u0[%],v0[%],x1[%],y1[%],u1[%],v1[%],_opacity,_color1,...\fR Draw specified colored spline curve on selected images (cubic hermite spline). \fBDefault values\fR: '\fBopacity=1\fR' and '\fBcolor1=0\fR'. \fBExample:\fR [#1] image.jpg repeat 30 { spline {u(100)}%,{u(100)}%,{u(-600,600)},{u(-600,600)},{u(100)}%,{u(100)}%,{u(-600,600)},{u(-600,600)},1,${-rgb} }\fR \fBthickcircle:\fR x[%],y[%],R[%],_thickness>=0,_opacity,_color1,...\fR Draw specified colored thick outlined circle on selected images. \fBDefault values\fR: '\fBthickness=3\fR', '\fBopacity=1\fR' and '\fBcolor1=0\fR'. \fBExample:\fR [#1] 400,400 repeat 15 { R:=lerp(10,190,$%) thickcircle 200,200,$R,2,1,$R } n 0,255 map 7\fR \fBthickellipse:\fR x[%],y[%],R[%],r[%],_angle,_thickness>=0,_opacity,_color1,...\fR Draw specified colored thick outlined ellipse on selected images. \fBDefault values\fR: '\fBthickness=3\fR', '\fBopacity=1\fR' and '\fBcolor1=0\fR'. \fBExample:\fR [#1] image.jpg repeat 300 thickellipse {u(100)}%,{u(100)}%,{u(50)},{u(50)},{u(180)},3,0.6,${-rgb} done thickellipse 50%,50%,200,100,0,5,0.7,255\fR \fBthickline:\fR x0[%],y0[%],x1[%],y1[%],_thickness,_opacity,_color1\fR Draw specified colored thick line on selected images. \fBDefault values\fR: '\fBthickness=2\fR', '\fBopacity=1\fR' and '\fBcolor1=0\fR'. \fBExample:\fR [#1] 400,400,1,3 repeat 100 thickline {u([w,h,w,h,5])},0.5,${-rgb} done\fR \fBthickpolygon:\fR N>=1,x1[%],y1[%],...,xN[%],yN[%],_thickness>=0,_opacity,_color1,... |\fR [coords],_thickness>=0,_opacity,_color1,...\fR Draw specified colored thick outlined N-vertices polygon on selected images. If '\fBthickness<0\fR', the command draws an open polygon rather than a closed polygon. \fBDefault values\fR: '\fBthickness=3\fR', '\fBopacity=1\fR', and '\fBcolor1=0\fR'. \fBExample:\fR [#1] image.jpg thickpolygon 4,20%,20%,80%,30%,80%,70%,20%,80%,5,1,0,255,0\fR [#2] image.jpg 2,16,1,1,'u(x?h#0:w#0)' thickpolygon[-2] [-1],5,1,255,0,255 remove[-1]\fR \fBthickspline:\fR x0[%],y0[%],u0[%],v0[%],x1[%],y1[%],u1[%],v1[%],_thickness,_opacity,_color1,...\fR Draw specified colored thick spline curve on selected images (cubic hermite spline). \fBDefault values\fR: '\fBthickness=3\fR', '\fBopacity=1\fR' and '\fBcolor1=0\fR'. \fBExample:\fR [#1] image.jpg repeat 30 { thickspline {u(100)}%,{u(100)}%,{u(-600,600)},{u(-600,600)},{u(100)}%,{u(100)}%,{u(-600,600)},{u(-600,600)},3,1, ${-rgb} }\fR \fBmandelbrot:\fR z0r,z0i,z1r,z1i,_iteration_max>=0,_is_julia={ 0:No | 1:Yes },_c0r,_c0i,_opacity\fR Draw mandelbrot/julia fractal on selected images. \fBDefault values\fR: '\fBiteration_max=100\fR', '\fBis_julia=0\fR', '\fBc0r=c0i=0\fR' and '\fBopacity=1\fR'. \fBExample:\fR [#1] 400,400 mandelbrot -2.5,-2,2,2,1024 map 0 +blur 2 elevation3d[-1] -0.2\fR \fBmarble:\fR _image_weight,_pattern_weight,_angle,_amplitude,_sharpness>=0,_anisotropy>=0,_alpha,_sigma,_cut_low>=0,_cut_high>=0\fR Render marble like pattern on selected images. \fBDefault values\fR: '\fBimage_weight=0.2\fR', '\fBpattern_weight=0.1\fR', '\fBangle=45\fR', '\fBamplitude=0\fR', '\fBsharpness=0.4\fR' and '\fBanisotropy=0.8\fR', '\fBalpha=0.6\fR', '\fBsigma=1.1\fR' and '\fBcut_low=cut_high=0\fR'. \fBExample:\fR [#1] image.jpg +marble ,\fR \fBmaze:\fR _width>0,_height>0,_cell_size>0\fR Input maze with specified size. \fBExample:\fR [#1] maze 30,20 negate normalize 0,255\fR \fBmaze_mask:\fR _cellsize>0\fR Input maze according to size and shape of selected mask images. Mask may contain disconnected shapes. \fBExample:\fR [#1] 0 text "G'MIC",0,0,53,1,1 dilate 3 autocrop 0 frame xy,1,0 maze_mask 8 dilate 3 negate mul 255\fR \fBnewton_fractal:\fR z0r,z0i,z1r,z1i,_angle,0<=_descent_method<=2,_iteration_max>=0,_convergence_precision>0,_expr_p(z),_expr_dp(z),_expr_d2p(z)\fR Draw newton fractal on selected images, for complex numbers in range (z0r,z0i) - (z1r,z1i). Resulting images have 3 channels whose meaning is [ last_zr, last_zi, nb_iter_used_for_convergence ]. '\fBdescent_method\fR' can be \fB{ 0:Secant | 1:Newton | 2:Householder }\fR. \fBDefault values\fR: '\fBangle=0\fR', '\fBdescent_method=1\fR', '\fBiteration_max=200\fR', '\fBconvergence_precision=0.01\fR', '\fBexpr_p(z)=z^^3-1\fR', '\fBexpr_dp(z)=3*z^^2\fR' and '\fBexpr_d2z(z)=6*z\fR'. \fBExample:\fR [#1] 400,400 newton_fractal -1.5,-1.5,1.5,1.5,0,2,200,0.01,"z^^6 + z^^3 - 1","6*z^^5 + 3*z^^2","30*z^^4 + 6*z" f "[ atan2(i1,i0)*90+20,1, cut(i2/30,0.2,0.7) ]" hsl2rgb\fR \fBpack_sprites:\fR [sprite_set],_nb_scales>=1,0<_min_scale<=100,_allow_rotation={ 0:None | 1:180 deg. | 2:90 deg. | 3:Any },_spacing,_max_attempts>0\fR Try to randomly pack as many sprites as possible onto the '\fBempty\fR' areas of an image. Sprites may be optionally rotated and scaled during the packing process. Selected image is the canvas that will be filled with the sprites. The zero values of its alpha channel defines the potential locations for drawing the sprites. '\fB[sprite_set]\fR' defines the set of sprites considered for filling the canvas. The zero values of their alpha channels defines the sprite shape. Sprite packing is done on random locations and iteratively with decreasing scales. '\fBnb_scales\fR' sets the number of decreasing scales considered for all specified sprites to be packed. '\fBmin_scale\fR' (in %) sets the minimal size considered for packing (specified as a percentage of the original sprite size). '\fBspacing\fR' can be positive or negative. '\fBmax_attempts\fR' defines the maximum number of attempts to pack a sprite for each scale. \fBDefault values\fR: '\fBnb_scales=1\fR', '\fBmin_scale=25\fR', '\fBallow_rotation=0\fR', '\fBspacing=1\fR' and '\fBmax_attempts=512\fR'. \fBExample:\fR [#1] shape_heart 512 negate normalize 0,255 channels -3,0 repeat 2 { ball 48,${-rgb} } +pack_sprites[0] [^0],5,15\fR \fBpiechart:\fR label_height>=0,label_R,label_G,label_B,"label1",value1,R1,G1,B1,...,"labelN",valueN,RN,GN,BN\fR Draw pie chart on selected (RGB) images. \fBExample:\fR [#1] image.jpg piechart 25,0,0,0,"Red",55,255,0,0,"Green",40,0,255,0,"Blue",30,128,128,255,"Other",5,128,128,128\fR \fBplasma:\fR _alpha,_beta,_scale>=0\fR Draw a random colored plasma fractal on selected images. This command implements the so-called '\fBDiamond-Square\fR' algorithm. \fBDefault values\fR: '\fBalpha=1\fR', '\fBbeta=1\fR' and '\fBscale=8\fR'. \fBExample:\fR [#1] 400,400,1,3 plasma 1\fR \fBTutorial: \fR\fIhttps://gmic.eu/oldtutorial/_plasma\fR \fBpoint (+):\fR x[%],_y[%],_z[%],_opacity,_color1,...\fR Set specified colored pixel on selected images. \fBDefault values\fR: '\fBz=0\fR', '\fBopacity=1\fR' and '\fBcolor1=0\fR'. \fBExample:\fR [#1] image.jpg repeat 10000 point {u(100)}%,{u(100)}%,0,1,${-rgb} done\fR \fBpolka_dots:\fR diameter>=0,_density,_offset1,_offset2,_angle,_aliasing,_shading,_opacity,_color,...\fR Draw dots pattern on selected images. \fBDefault values\fR: '\fBdensity=20\fR', '\fBoffset1=offset2=50\fR', '\fBangle=0\fR', '\fBaliasing=10\fR', '\fBshading=1\fR', '\fBopacity=1\fR' and '\fBcolor=255\fR'. \fBExample:\fR [#1] image.jpg polka_dots 10,15,0,0,20,10,1,0.5,0,128,255\fR \fBpolygon (+):\fR N>=1,x1[%],y1[%],...,xN[%],yN[%],_opacity,_pattern,_color1,... |\fR [coords],_opacity,_pattern,_color1,...\fR Draw specified colored N-vertices polygon on selected images. '\fBpattern\fR' is an hexadecimal number starting with '\fB0x\fR' which can be omitted even if a color is specified. If a pattern is specified, the polygon is drawn outlined instead of filled. Adding a '\fB-\fR' sign before '\fBpattern\fR' makes the command draw an open polyline rather than a closed polygon. \fBDefault values\fR: '\fBopacity=1\fR', '\fBpattern=(undefined)\fR' and '\fBcolor1=0\fR'. \fBExample:\fR [#1] image.jpg polygon 4,20%,20%,80%,30%,80%,70%,20%,80%,0.3,0,255,0 polygon 4,20%,20%,80%,30%,80%,70%,20%,80%,1,0xCCCCCCCC,255\fR [#2] image.jpg 2,16,1,1,'u(x?h#0:w#0)' polygon[-2] [-1],0.6,255,0,255 remove[-1]\fR \fBquiver:\fR [function_image],_sampling[%]>0,_factor>=0,_is_arrow={ 0:No | 1:Yes },_opacity,_color1,...\fR Draw specified 2D vector/orientation field on selected images. \fBDefault values\fR: '\fBsampling=5%\fR', '\fBfactor=1\fR', '\fBis_arrow=1\fR', '\fBopacity=1\fR', '\fBpattern=(undefined)\fR' and '\fBcolor1=0\fR'. \fBExample:\fR [#1] 100,100,1,2,'!c?x-w/2:y-h/2' 500,500,1,3,255 quiver[-1] [-2],10\fR [#2] image.jpg +rescale2d ,600 luminance[0] gradient[0] mul[1] -1 reverse[0,1] append[0,1] c blur[0] 8 orientation[0] quiver[1] [0],20,1,1,0.8,255\fR \fBrectangle:\fR x0[%],y0[%],x1[%],y1[%],_opacity,_pattern,_color1,...\fR Draw specified colored rectangle on selected images. '\fBpattern\fR' is an hexadecimal number starting with '\fB0x\fR' which can be omitted even if a color is specified. If a pattern is specified, the rectangle is drawn outlined instead of filled. \fBDefault values\fR: '\fBopacity=1\fR', '\fBpattern=(undefined)\fR' and '\fBcolor1=0\fR'. \fBExample:\fR [#1] image.jpg repeat 30 { rectangle {u(100)}%,{u(100)}%,{u(100)}%,{u(100)}%,0.3,${-rgb} }\fR \fBrorschach:\fR 'smoothness[%]>=0','mirroring={ 0:None | 1:X | 2:Y | 3:XY }\fR Render rorschach-like inkblots on selected images. \fBDefault values\fR: '\fBsmoothness=5%\fR' and '\fBmirroring=1\fR'. \fBExample:\fR [#1] 400,400 rorschach 3%\fR \fBsierpinski:\fR recursion_level>=0\fR Draw Sierpinski triangle on selected images. \fBDefault value\fR: '\fBrecursion_level=7\fR'. \fBExample:\fR [#1] image.jpg sierpinski 7\fR \fBspiralbw:\fR width>0,_height>0,_is_2dcoords={ 0:No | 1:Yes }\fR Input a 2D rectangular spiral image with specified size. \fBDefault values\fR: '\fBheight=width\fR' and '\fBis_2dcoords=0\fR'. \fBExample:\fR [#1] spiralbw 16\fR [#2] image.jpg spiralbw {[w,h]},1 +warp[0] [1],0,1,1 +warp[2] [1],2,1,1\fR \fBtetraedron_shade:\fR x0,y0,z0,x1,y1,z1,x2,y2,z2,x3,y3,z3,R0,G0,B0,...,R1,G1,B1,...,R2,G2,B2,...,R3,G3,B3,...\fR Draw tetraedron with interpolated colors on selected (volumetric) images. \fBt (+):\fR Shortcut for command '\fBtext\fR'. \fBtext (+):\fR text,_x[%|~],_y[%|~],_{ font_height[%]>=0 | custom_font },_opacity,_color1,...\fR Draw specified colored text string on selected images. (equivalent to shortcut command '\fBt\fR'). If one of the x or y argument ends with a '\fB~\fR', its value is expected to be a centering ratio (in [0,1]) rather than a position. Usual centering ratio are \fB{ 0:left-justified | 0.5:centered | 1:right-justified }\fR. Sizes '\fB13\fR' and '\fB128\fR' are special and correspond to binary fonts (no-antialiasing). Any other font size is rendered with anti-aliasing. Specifying an empty target image resizes it to new dimensions such that the image contains the entire text string. A custom font can be specified as a variable name that stores an image list of 256 or 512 items (512 for 256 character sprites + 256 associated opacities), or as an image selection that is a serialized version of such an image list. \fBDefault values\fR: '\fBx=y=0.01~\fR', '\fBfont_height=16\fR', '\fBopacity=1\fR' and '\fBcolor1=0\fR'. \fBExample:\fR [#1] image.jpg rescale2d ,600 div 2 y=0 repeat 30 { text {2*$>}" : This is a nice text!",10,$y,{2*$>},0.9,255 y+={2*$>} }\fR [#2] 0 text "G'MIC",0,0,23,1,255\fR \fBto:\fR Shortcut for command '\fBtext_outline\fR'. \fBtext_outline:\fR text,_x[%|~],_y[%|~],{ _font_height[%]>0 | custom_font },_outline>=0,_opacity,_color1,...\fR Draw specified colored and outlined text string on selected images. If one of the x or y argument ends with a '\fB~\fR', its value is expected to be a centering ratio (in [0,1]) rather than a position. Usual centering ratio are \fB{ 0:left-justified | 0.5:centered | 1:right-justified }\fR. \fBDefault values\fR: '\fBx=y=0.01~\fR', '\fBfont_height=7.5%\fR', '\fBoutline=2\fR', '\fBopacity=1\fR', '\fBcolor1=color2=color3=255\fR' and '\fBcolor4=255\fR'. \fBExample:\fR [#1] image.jpg text_outline "Hi there!",10,10,63,3\fR \fBtriangle_shade:\fR x0,y0,x1,y1,x2,y2,R0,G0,B0,...,R1,G1,B1,...,R2,G2,B2,...\fR Draw triangle with interpolated colors on selected images. \fBExample:\fR [#1] image.jpg triangle_shade 20,20,400,100,120,200,255,0,0,0,255,0,0,0,255\fR \fBtruchet:\fR _scale>0,_radius>=0,_pattern_type={ 0:Straight | 1:Curved }\fR Fill selected images with random truchet patterns. \fBDefault values\fR: '\fBscale=32\fR', '\fBradius=5\fR' and '\fBpattern_type=1\fR'. \fBExample:\fR [#1] 400,300 truchet ,\fR \fBturbulence:\fR _radius>0,_octaves={ 1,2,3...,12 },_alpha>0,_difference={ -10,10 },_mode={ 0,1,2,3 }\fR Render fractal noise or turbulence on selected images. \fBDefault values\fR: '\fBradius=32\fR', '\fBoctaves=6\fR', '\fBalpha=3\fR', '\fBdifference=0\fR' and '\fBmode=0\fR'. \fBExample:\fR [#1] 400,400,1,3 turbulence 16\fR \fBTutorial: \fR\fIhttps://gmic.eu/oldtutorial/_turbulence\fR \fByinyang:\fR Draw a yin-yang symbol on selected images. \fBExample:\fR [#1] 400,400 yinyang\fR \fB\fB11.11. Matrix Computation\fR \fB ------------------\fR \fBdiagonal:\fR Transform selected vectors as diagonal matrices. \fBExample:\fR [#1] 1,10,1,1,'y' +diagonal\fR \fBdijkstra:\fR starting_vertex>=0,_ending_vertex={ -1:None | >=0 }\fR Compute minimal distances/paths in selected graphs, from specified '\fBstarting_vertex\fR' to all other vertices (optionally only until '\fBending_vertex\fR' has been reached). A graph of '\fBN\fR' vertices is specified as a '\fBNxN\fR' adjacency matrix giving the weights of all edges connecting vertices (set to '\fBinf\fR' when two vertices are not connected). This command returns a '\fB1xNx1x2\fR' image containing the '\fB[distance,parent]\fR' information : - '\fBdistance\fR' is the minimal distance from vertex '\fB#y\fR' to the '\fBstarting_vertex\fR' (i.e. the sum of edge weights composing the minimal path between these two vertices). - '\fBparent\fR' is the index of the next vertex that must be followed to reach the '\fBstarting_vertex\fR' through the minimal path. \fBDefault value\fR: '\fBending_vertex=-1\fR' \fBeigen (+):\fR Compute the eigenvalues and eigenvectors of selected symmetric matrices or matrix fields. If one selected image has 3 or 6 channels, it is regarded as a field of 2x2 or 3x3 symmetric matrices, whose eigen elements are computed at each point of the field. \fBExample:\fR [#1] (1,0,0;0,2,0;0,0,3) +eigen\fR [#2] image.jpg structuretensors blur 2 eigen split[0] c\fR \fBTutorial: \fR\fIhttps://gmic.eu/oldtutorial/_eigen\fR \fBeye:\fR _size>0\fR Insert an identity matrix of given size at the end of the image list. \fBExample:\fR [#1] eye 3 eye 7 eye 10\fR \fBfitsamples:\fR nb_samples>0,_relevant_dimension[%]>0,_average_vector_varname,_dilation_vector_varname,_orientation_matrix_varname\fR Generate '\fBnb_samples\fR' vectors having the same multivariate gaussian distribution as the vectors of the selected images. Each input represents a set of '\fBM\fR' vectors of dimension '\fBN\fR' (with M>1) (specified as an image with size '\fBMxNx1x1\fR', '\fBMx1xNx1\fR', '\fBMx1x1xN\fR', '\fB1xMxNx1\fR', '\fB1xMx1xN\fR' or '\fB1x1xMxN\fR'). The command returns a new set of random vectors with similar geometry. \fBDefault values\fR: '\fBrelevant_dimension=100%\fR', and '\fBaverage_vector_varname=orientation_matrix_varname=dilation_matrix_varname=(undefined)\ fR'. \fBinvert:\fR Inverse selected matrices (or compute Moore-Penrose pseudoinverse for non-square matrices). \fBExample:\fR [#1] (0,1,0;0,0,1;1,0,0) +invert\fR \fBmeigen:\fR m>=1\fR Compute an approximation of the '\fBm\fR' largest eigenvalues and eigenvectors of selected symmetric matrices, using the Arnoldi iteration method (https://en.wikipedia.org/wiki/Arnoldi_iteration). A larger '\fBm\fR' goes with better numerical precision. \fBExample:\fR [#1] (1,0,0;0,2,0;0,0,3) +meigen 3\fR \fBmproj (+):\fR [dictionary],_method,_max_iter={ 0:Auto | >0 },_max_residual>=0\fR Find best matching projection of selected matrices onto the span of an over-complete dictionary D, using the orthogonal projection or Matching Pursuit algorithm. Selected images are 2D-matrices in which each column represent a signal to project. '\fB[dictionary]\fR' is a matrix in which each column is an element of the dictionary D. '\fBmethod\fR' tells what projection algorithm must be applied. It can be: \ - 0 = orthogonal projection (least-squares solution using LU-based solver). \ - 1 = matching pursuit. \ - 2 = matching pursuit, with a single orthogonal projection step at the end. \ - >=3 = orthogonal matching pursuit where an orthogonal projection step is performed \ every '\fBmethod-2\fR' iterations. '\fBmax_iter\fR' sets the max number of iterations processed for each signal. If set to '\fB0\fR' (default), '\fBmax_iter\fR' is equal to the number of columns in D. (only meaningful for matching pursuit and its variants). '\fBmax_residual\fR' gives a stopping criterion on signal reconstruction accuracy. (only meaningful for matching pursuit and its variants). For each selected image, the result is returned as a matrix W whose columns correspond to the weights associated to each column of D, such that the matrix product D*W is an approximation of the input matrix. \fBDefault values\fR: '\fBmethod=0\fR', '\fBmax_iter=0\fR' and '\fBmax_residual=1e-6\fR'. \fBorthogonalize:\fR _mode = { 0:orthogonalize | 1:orthonormalize }\fR Orthogonalize or orthonormalize selected matrices, using Modified Gram-Schmidt process. \fBDefault value\fR: '\fBmode=0\fR'. \fBpoweriteration:\fR _nb_eigenvectors>0,_epsilon>0,_max_iter>0\fR Compute the '\fBnb_eigenvectors\fR' largest eigenvectors of the selected symmetric matrices, using the power iteration algorithm. \fBDefault values\fR: '\fBnb_eigenvectors=1\fR', '\fBepsilon=1e-5\fR' and '\fBmax_iter=100\fR'. \fBqr (+):\fR _is_reduced_form={ 0:No | 1:Yes },_is_pivoting={ 0:No | 1:Yes }\fR Compute QR decomposition of selected matrices (optionally with pivoting). Assuming a selected image A is a matrix of size m×n (m rows, n columns), this command returns the matrices Q and R, so that A = Q*R. * Q is an orthogonal matrix, of size '\fBm×m\fR' if '\fBis_reduced_form==0\fR', or '\fBm×min(m,n)\fR' otherwise. * R is an upper-trianguler matrix of size '\fBm×n\fR' if '\fBis_reduced_form==0\fR' or '\fBmin(m,n)×n\fR' otherwise. * Q^T*Q = Id. * If n>m, only the first m×m part of R is upper triangular. If '\fBis_pivoting\fR' is enabled, an additional image of column permutations is returned. \fBDefault values\fR: '\fBis_reduced_form=1\fR' and '\fBis_pivoting=0\fR'. \fBExample:\fR [#1] 10,10,1,1,'v(100)' +qr +mmul[-2,-1]\fR \fBsolve (+):\fR [image]\fR Solve linear system AX = B for selected B-matrices and specified A-matrix. If the system is under- or over-determined, the least squares or minimal norm solution is returned. \fBExample:\fR [#1] (0,1,0;1,0,0;0,0,1) (1;2;3) +solve[-1] [-2]\fR \fBsvd (+):\fR Compute SVD decomposition of selected matrices. \fBExample:\fR [#1] 10,10,1,1,'x==y?x+u(-0.2,0.2):0' +svd\fR \fBtranspose:\fR Transpose selected matrices. \fBExample:\fR [#1] image.jpg +transpose\fR \fBtrisolve:\fR [image]\fR Solve tridiagonal system AX = B for selected B-vectors and specified tridiagonal A-matrix. Tridiagonal matrix must be stored as a 3 column vector, where 2nd column contains the diagonal coefficients, while 1st and 3rd columns contain the left and right coefficients. \fBExample:\fR [#1] (0,0,1;1,0,0;0,1,0) (1;2;3) +trisolve[-1] [-2]\fR \fB\fB11.12. 3D Meshes\fR \fB ---------\fR \fB+3d (+):\fR Shortcut for command '\fBadd3d\fR'. \fBadd3d (+):\fR tx,_ty,_tz |\fR [object3d] |\fR (no arg)\fR Shift selected 3D objects with specified displacement vector, or merge them with specified 3D object, or merge all selected 3D objects together. (equivalent to shortcut command '\fB+3d\fR'). \fBDefault values\fR: '\fBty=tz=0\fR'. \fBExample:\fR [#1] sphere3d 10 repeat 5 { +add3d[-1] 10,{u(-10,10)},0 color3d[-1] ${-rgb} } add3d\fR [#2] repeat 20 { torus3d 15,2 color3d[-1] ${-rgb} mul3d[-1] 0.5,1 if $>%2 rotate3d[-1] 0,1,0,90 fi add3d[-1] 70 add3d rotate3d[-1] 0,0,1,18 }\fR \fBanimate3d:\fR nb_frames>0,_step_angle_x,_step_angle_y,_step_angle_z,_zoom_factor,0<=_fake_shadow_level<=100,_[background]\fR Generate 3D animation frames of rotating 3D objects. Frames are stacked along the z-axis (volumetric image). Frame size is the same as the size of the '\fB[background]\fR' image (or 800x800 if no background specified). \fBDefault values\fR: '\fBstep_angle_x=0\fR', '\fBstep_angle_y=5\fR', '\fBstep_angle_z=0\fR', '\fBzoom_factor=1\fR', '\fBfake_shadow_level=50\fR' and '\fBbackground=(undefined)\fR'. \fBapply_camera3d:\fR pos_x,pos_y,pos_z,target_x,target_y,target_z,up_x,up_y,up_z\fR Apply 3D camera matrix to selected 3D objects. \fBDefault values\fR: '\fBtarget_x=0\fR', '\fBtarget_y=0\fR', '\fBtarget_z=0\fR', '\fBup_x=0\fR', '\fBup_y=-1\fR' and '\fBup_z=0\fR'. \fBapply_matrix3d:\fR a11,a12,a13,...,a31,a32,a33\fR Apply specified 3D rotation matrix to selected 3D objects. \fBExample:\fR [#1] torus3d 10,1 +apply_matrix3d {mul(rot(1,0,1,-15°),[1,0,0,0,2,0,0,0,8],3)}\fR \fBarray3d:\fR size_x>=1,_size_y>=1,_size_z>=1,_offset_x[%],_offset_y[%],_offset_y[%]\fR Duplicate a 3D object along the X,Y and Z axes. \fBDefault values\fR: '\fBsize_y=1\fR', '\fBsize_z=1\fR' and '\fBoffset_x=offset_y=offset_z=100%\fR'. \fBExample:\fR [#1] torus3d 10,1 +array3d 5,5,5,110%,110%,300%\fR \fBarrow3d:\fR x0,y0,z0,x1,y1,z1,_radius[%]>=0,_head_length[%]>=0,_head_radius[%]>=0\fR Input 3D arrow with specified starting and ending 3D points. \fBDefault values\fR: '\fBradius=5%\fR', '\fBhead_length=25%\fR' and '\fBhead_radius=15%\fR'. \fBExample:\fR [#1] repeat 10 { a:=$>*2*pi/10 arrow3d 0,0,0,{cos($a)},{sin($a)},-0.5 } +3d\fR \fBaxes3d:\fR _size_x,_size_y,_size_z,_font_size>0,_label_x,_label_y,_label_z,_is_origin={ 0:No | 1:Yes }\fR Input 3D axes with specified sizes along the x,y and z orientations. \fBDefault values\fR: '\fBsize_x=size_y=size_z=1\fR', '\fBfont_size=23\fR', '\fBlabel_x=X\fR', '\fBlabel_y=Y\fR', '\fBlabel_z=Z\fR' and '\fBis_origin=1\fR' \fBExample:\fR [#1] axes3d ,\fR \fBboundingbox3d:\fR Replace selected 3D objects by their 3D bounding boxes. \fBExample:\fR [#1] torus3d 100,30 +boundingbox3d +3d[-1] [-2]\fR \fBbox3d:\fR _size_x,_size_y,_size_z\fR Input 3D box at (0,0,0), with specified geometry. \fBDefault values\fR: '\fBsize_x=1\fR' and '\fBsize_z=size_y=size_x\fR'. \fBExample:\fR [#1] box3d 100,40,30 +primitives3d 1 color3d[-2] ${-rgb}\fR \fBc3d:\fR Shortcut for command '\fBcenter3d\fR'. \fBcenter3d:\fR Center selected 3D objects at (0,0,0). (equivalent to shortcut command '\fBc3d\fR'). \fBExample:\fR [#1] repeat 100 { circle3d {u(100)},{u(100)},{u(100)},2 } add3d color3d[-1] 255,0,0 +center3d color3d[-1] 0,255,0 add3d\fR \fBchainring3d:\fR _nb_links>=3,_x_scale>0,_y_scale>0,_z_scale>0\fR Input 3D chain ring with specified geometry. '\fBnb_links\fR' should be preferably even. \fBDefault values\fR: '\fBnb_links=16\fR', '\fBx_scale=0.5\fR', '\fBy_scale=1\fR' and '\fBz_scale=1\fR'. \fBExample:\fR [#1] chainring3d\fR \fBcircle3d:\fR _x0,_y0,_z0,_radius>=0\fR Input 3D circle at specified coordinates. \fBDefault values\fR: '\fBx0=y0=z0=0\fR' and '\fBradius=1\fR'. \fBExample:\fR [#1] repeat 500 { a:=$>*pi/250 circle3d {cos(3*$a)},{sin(2*$a)},0,{$a/50} color3d[-1] ${-rgb},0.4 } add3d\fR \fBcircles3d:\fR _radius>=0,_is_outlined={ 0:No | 1:Yes }\fR Convert specified 3D objects to sets of 3D circles with specified radius. \fBDefault values\fR: '\fBradius=1\fR' and '\fBis_outlined=1\fR'. \fBExample:\fR [#1] image.jpg luminance rescale2d ,40 threshold 50% * 255 pointcloud3d color3d[-1] 255,255,255 circles3d 0.7\fR \fBcol3d:\fR Shortcut for command '\fBcolor3d\fR'. \fBcolor3d:\fR R,_G,_B,_opacity\fR Set the color (and optionally opacity) of selected 3D objects. (equivalent to shortcut command '\fBcol3d\fR'). \fBDefault value\fR: '\fBB=G=R\fR' and '\fBopacity=(undefined)\fR'. \fBExample:\fR [#1] torus3d 100,10 repeat 7 { +rotate3d[-1] 1,0,0,20 color3d[-1] ${-rgb} } add3d\fR \fBcolorcube3d:\fR _is_wireframe={ 0:No | 1:Yes }\fR Input 3D color cube. \fBDefault value\fR: '\fBis_wireframe=0\fR'. \fBExample:\fR [#1] colorcube3d mode3d 2 +primitives3d 1\fR \fBcolorize3d:\fR _color_function,_passed_images_for_color_function\fR Colorize primitives of selected 3D objects, according to a specified function. * '\fBcolor_function\fR' returns a G,GA,RGB or RGBA vector that can depend on variables '\fBx\fR','\fBy\fR' and '\fBz\fR', which are defined as the barycenter coordinates for each primitive. * '\fBpassed_images_for_color_function\fR' can be specified as a selection (e.g. '\fB[0,2]\fR') of images that will be inserted at the end of the image list while modifying 3D objects, so that the '\fBcolor_function\fR' can have access to their content. \fBDefault values\fR: '\fBcolor_function=[x,y,z]\fR' and '\fBpassed_images_for_color_function=\fR'. \fBExample:\fR [#1] torus3d 100,40,640,100 c3d n3d mul3d 256 +3d 128,128,128 sample colorful,257 colorize3d[0] "I(#-1,x,y,0)",[1]\fR \fBcone3d:\fR _radius,_height,_nb_subdivisions>0\fR Input 3D cone at (0,0,0), with specified geometry. \fBDefault value\fR: '\fBradius=1\fR','\fBheight=1\fR' and '\fBnb_subdivisions=24\fR'. \fBExample:\fR [#1] cone3d 10,40 +primitives3d 1 color3d[-2] ${-rgb}\fR \fBcubes3d:\fR _size>=0\fR Convert specified 3D objects to sets of 3D cubes with specified size. \fBDefault value\fR: '\fBsize=1\fR'. \fBExample:\fR [#1] image.jpg luminance rescale2d ,40 threshold 50% * 255 pointcloud3d color3d[-1] 255,255,255 cubes3d 1\fR \fBcup3d:\fR _resolution>0\fR Input 3D cup object. \fBDefault value\fR: '\fBresolution=128\fR'. \fBExample:\fR [#1] cup3d ,\fR \fBcurve3d:\fR _"x(t)",_"y(t)",_"z(t)",_"r(t)",_resolution>1,_tmin,_tmax,_nb_sides>=0,_cap_style={ 0:Open | 1 |\fR Capped | 2 |\fR Closed }\fR Input 3D curve with specified parameterization. If '\fBr(t)==0\fR' or '\fBnb_sides<3\fR', the generated 3D object is composed of segments only. \fBDefault values\fR: '\fBx(t)=cos(2*pi*t)\fR', '\fBy(t)=sin(2*pi*t)\fR', '\fBz(t)=t\fR', '\fBr(t)=0.025\fR', '\fBresolution=128\fR', '\fBtmin=0\fR', '\fBtmax=1\fR', '\fBnb_sides=16\fR' and '\fBcap_style=1\fR'. \fBExample:\fR [#1] curve3d ,\fR \fBcylinder3d:\fR _radius,_height,_nb_subdivisions>0\fR Input 3D cylinder at (0,0,0), with specified geometry. \fBDefault value\fR: '\fBradius=1\fR','\fBheight=1\fR' and '\fBnb_subdivisions=24\fR'. \fBExample:\fR [#1] cylinder3d 10,40 +primitives3d 1 color3d[-2] ${-rgb}\fR \fBdelaunay3d:\fR Generate 3D Delaunay triangulations from selected images. One assumes that the selected input images are binary images containing the set of points to mesh. The output 3D object is a mesh composed of non-oriented triangles. \fBExample:\fR [#1] 500,500 noise 0.05,2 eq 1 * 255 +delaunay3d color3d[1] 255,128,0 dilate_circ[0] 5 to_rgb[0] +object3d[0] [1],0,0,0,1,1 max[-1] [0]\fR \fBdepthmap3d:\fR [object3d],_x[%],_y[%],_z_,is_double_sided={ 0:No | 1:Yes },_is_zbuffer={ 0:No | 1:Yes },_focal\fR Draw depth map of specified 3D object on selected images. \fBDefault values\fR: '\fBx=y=50%\fR', '\fBz=0\fR' and '\fBis_zbuffer=1\fR'. All other arguments take their default values from the 3D environment variables. \fBExample:\fR [#1] gmic3d center3d normalize3d rotate3d 0,1,0,45 mul3d 360 400,400 depthmap3d[-1] [-2] snapshot3d[-2] 400\fR \fBdistribution3d:\fR Get 3D color distribution of selected images. \fBExample:\fR [#1] image.jpg distribution3d colorcube3d primitives3d[-1] 1 add3d\fR \fB/3d (+):\fR Shortcut for command '\fBdiv3d\fR'. \fBdiv3d (+):\fR factor |\fR factor_x,factor_y,_factor_z\fR Scale selected 3D objects isotropically or anisotropically, with the inverse of specified factors. (equivalent to shortcut command '\fB/3d\fR'). \fBDefault value\fR: '\fBfactor_z=1\fR'. \fBExample:\fR [#1] torus3d 5,2 repeat 5 { +add3d[-1] 12,0,0 div3d[-1] 1.2 color3d[-1] ${-rgb} } add3d\fR \fBdb3d:\fR Shortcut for command '\fBdouble3d\fR'. \fBdouble3d:\fR _is_double_sided={ 0:No | 1:Yes }\fR Enable/disable double-sided mode for 3D rendering. (equivalent to shortcut command '\fBdb3d\fR'). \fBDefault value\fR: '\fBis_double_sided=1\fR'. \fBExample:\fR [#1] mode3d 1 repeat 2 { torus3d 100,30 rotate3d[-1] 1,1,0,60 double3d $> snapshot3d[-1] 400 }\fR \fBelevation3d:\fR { z-factor | [elevation_map] | 'formula' },base_height={ -1 | >=0 } |\fR (no arg)\fR Generate 3D elevation of selected images, optionally with a specified elevation map. When invoked with (no arg) or '\fBz-factor\fR', the elevation map is computed as the pointwise L2 norm of the pixel values. Otherwise, the elevation map is taken from the specified image or formula. \fBExample:\fR [#1] image.jpg +blur 5 elevation3d. 0.75\fR [#2] 128,128,1,3,u(255) plasma 10,3 blur 4 sharpen 10000 n 0,255 elevation3d[-1] 'X=(x-64)/6;Y=(y-64)/6;-100*exp(-(X^2+Y^2)/30)*abs(cos(X)*sin(Y)) '\fR \fBempty3d:\fR Input empty 3D object. \fBExample:\fR [#1] empty3d\fR \fBextract_textures3d:\fR Extract texture data from selected 3D objects. \fBExample:\fR [#1] image.jpg imagesphere3d 10,10 +extract_textures3d\fR \fBextrude3d:\fR _depth>0,_resolution>0,_smoothness[%]>=0\fR Generate extruded 3D object from selected binary XY-profiles. \fBDefault values\fR: '\fBdepth=16\fR', '\fBresolution=1024\fR' and '\fBsmoothness=0.5%\fR'. \fBExample:\fR [#1] image.jpg threshold 50% extrude3d 16\fR \fBf3d:\fR Shortcut for command '\fBfocal3d\fR'. \fBfocal3d:\fR focal\fR Set 3D focal. (equivalent to shortcut command '\fBf3d\fR'). Set '\fBfocal\fR' to 0 to enable parallel projection (instead of perspective). Set negative '\fBfocal\fR' will disable 3D sprite zooming. \fBDefault value\fR: '\fBfocal=700\fR'. \fBExample:\fR [#1] repeat 5 { torus3d 100,30 rotate3d[-1] 1,1,0,60 focal3d {$<*90} snapshot3d[-1] 400 } remove[0]\fR \fBfov3d:\fR fov_angle>=0,_image_resolution>0\fR Set 3D focal to match specified field of vision angle (in degree) for rendering a 3D object in an image with specified resolution. Return corresponding value of the focal in status. \fBDefault value\fR: '\fBfov_angle=45\fR' and '\fBimage_size=max(w,h)\fR' (max size of the latest image). \fBgaussians3d:\fR _size>0,0<=_opacity<=1\fR Convert selected 3D objects into set of 3D gaussian-shaped sprites. \fBExample:\fR [#1] image.jpg rescale2d ,32 distribution3d gaussians3d 20 colorcube3d primitives3d[-1] 1 +3d\fR \fBgmic3d:\fR Input a 3D G'MIC\fR logo. \fBExample:\fR [#1] gmic3d +primitives3d 1\fR \fBgyroid3d:\fR _resolution>0,_zoom\fR Input 3D gyroid at (0,0,0), with specified resolution. \fBDefault values\fR: '\fBresolution=32\fR' and '\fBzoom=5\fR'. \fBExample:\fR [#1] gyroid3d 48 +primitives3d 1\fR \fBhistogram3d:\fR Get 3D color histogram of selected images. \fBExample:\fR [#1] image.jpg rescale2d 64 histogram3d circles3d 3 opacity3d. 0.75 colorcube3d primitives3d[-1] 1 add3d\fR \fBimage6cube3d:\fR Generate 3D mapped cubes from 6-sets of selected images. \fBExample:\fR [#1] image.jpg animate flower,"30,0","30,5",6 image6cube3d\fR \fBimageblocks3d:\fR _maximum_elevation,_smoothness[%]>=0\fR Generate 3D blocks from selected images. Transparency of selected images is taken into account. \fBDefault values\fR: '\fBmaximum_elevation=10\fR' and '\fBsmoothness=0\fR'. \fBExample:\fR [#1] image.jpg rescale2d ,32 imageblocks3d -20 mode3d 3\fR \fBimagecube3d:\fR Generate 3D mapped cubes from selected images. \fBExample:\fR [#1] image.jpg imagecube3d\fR \fBimageplane3d:\fR Generate 3D mapped planes from selected images. \fBExample:\fR [#1] image.jpg imageplane3d\fR \fBimagepyramid3d:\fR Generate 3D mapped pyramids from selected images. \fBExample:\fR [#1] image.jpg imagepyramid3d\fR \fBimagerubik3d:\fR _xy_tiles>=1,0<=xy_shift<=100,0<=z_shift<=100\fR Generate 3D mapped rubik's cubes from selected images. \fBDefault values\fR: '\fBxy_tiles=3\fR', '\fBxy_shift=5\fR' and '\fBz_shift=5\fR'. \fBExample:\fR [#1] image.jpg imagerubik3d ,\fR \fBimagesphere3d:\fR _resolution1>=3,_resolution2>=3\fR Generate 3D mapped sphere from selected images. \fBDefault values\fR: '\fBresolution1=32\fR' and '\fBresolutions2=16\fR'. \fBExample:\fR [#1] image.jpg imagesphere3d 32,16\fR \fBisoline3d (+):\fR isovalue[%] |\fR 'formula',value,_x0,_y0,_x1,_y1,_size_x[%]>0,_size_y[%]>0\fR Extract 3D isolines with specified value from selected images or from specified formula. \fBDefault values\fR: '\fBx0=y0=-3\fR', '\fBx1=y1=3\fR' and '\fBsize_x=size_y=256\fR'. \fBExample:\fR [#1] image.jpg blur 1 isoline3d 50%\fR [#2] isoline3d 'X=x-w/2;Y=y-h/2;(X^2+Y^2)%20',10,-10,-10,10,10\fR \fBisosurface3d (+):\fR isovalue[%] |\fR 'formula',value,_x0,_y0,_z0,_x1,_y1,_z1,_size_x[%]>0,_size_y[%]>0,_size_z[%]>0\fR Extract 3D isosurfaces with specified value from selected images or from specified formula. \fBDefault values\fR: '\fBx0=y0=z0=-3\fR', '\fBx1=y1=z1=3\fR' and '\fBsize_x=size_y=size_z=32\fR'. \fBExample:\fR [#1] image.jpg rescale2d ,128 luminance threshold 50% expand z,2 blur 1 isosurface3d 50% mul3d 1,1,30\fR [#2] isosurface3d 'x^2+y^2+abs(z)^abs(4*cos(x*y*z*3))',3\fR \fBlabel3d:\fR "text",font_height>=0,_opacity,_color1,...\fR Generate 3D text label. \fBDefault values\fR: '\fBfont_height=13\fR', '\fBopacity=1\fR' and '\fBcolor=255,255,255\fR'. \fBlabel_points3d:\fR _label_size>0,_opacity\fR Add a numbered label to all vertices of selected 3D objects. \fBDefault values\fR: '\fBlabel_size=13\fR' and '\fBopacity=0.8\fR'. \fBExample:\fR [#1] torus3d 100,40,6,6 label_points3d 23,1 mode3d 1\fR \fBlathe3d:\fR _resolution>0,_smoothness[%]>=0,_max_angle>=0\fR Generate 3D object from selected binary XY-profiles. \fBDefault values\fR: '\fBresolution=128\fR', '\fBsmoothness=0.5%\fR' and '\fBmax_angle=361\fR'. \fBExample:\fR [#1] 300,300 rand -1,1 blur 40 sign normalize 0,255 lathe3d ,\fR \fBl3d (+):\fR Shortcut for command '\fBlight3d\fR'. \fBlight3d (+):\fR position_x,position_y,position_z |\fR [texture] |\fR (no arg)\fR Set the light coordinates or the light texture for 3D rendering. (equivalent to shortcut command '\fBl3d\fR'). (no arg) resets the 3D light to default. \fBExample:\fR [#1] torus3d 100,30 specs3d 1.2 repeat 5 { light3d {$>*100},0,-300 +snapshot3d[0] 400 } remove[0]\fR \fBline3d:\fR x0,y0,z0,x1,y1,z1\fR Input 3D line at specified coordinates. \fBExample:\fR [#1] repeat 100 { a:=$>*pi/50 line3d 0,0,0,{cos(3*$a)},{sin(2*$a)},0 color3d. ${-rgb} } add3d\fR \fBlines3d:\fR _length>=0\fR Convert specified 3D objects to sets of 3D horizontal segments with specified length. \fBDefault values\fR: '\fBlength=1\fR'. \fBExample:\fR [#1] torus3d 100,40 +lines3d 20\fR \fBlissajous3d:\fR resolution>1,a,A,b,B,c,C\fR Input 3D lissajous curves 'x(t)=sin(a*t+A*2*pi)\fR', 'y(t)=sin(b*t+B*2*pi)\fR', 'z(t)=sin(c*t+C*2*pi)\fR'. \fBDefault values\fR: '\fBresolution=1024\fR', '\fBa=2\fR', '\fBA=0\fR', '\fBb=1\fR', '\fBB=0\fR', '\fBc=0\fR' and '\fBC=0\fR'. \fBExample:\fR [#1] lissajous3d ,\fR \fBm3d:\fR Shortcut for command '\fBmode3d\fR'. \fBmode3d:\fR _mode\fR Set static 3D rendering mode. (equivalent to shortcut command '\fBm3d\fR'). '\fBmode\fR' can be \fB{ -1:Bounding-box | 0:Dots | 1:Wireframe | 2:Flat | 3:Flat-shaded | 4:Gouraud-shaded | 5:Phong-shaded }\fR. Bounding-box mode ('\fBmode==-1\fR') is active only for the interactive 3D viewer. \fBDefault value\fR: '\fBmode=4\fR'. \fBExample:\fR [#1] (0,1,2,3,4,5) repeat w { torus3d 100,30 rotate3d[-1] 1,1,0,60 mode3d {0,@$>} snapshot3d[-1] 300 } remove[0]\fR \fBmd3d:\fR Shortcut for command '\fBmoded3d\fR'. \fBmoded3d:\fR _mode\fR Set dynamic 3D rendering mode for interactive 3D viewer. (equivalent to shortcut command '\fBmd3d\fR'). '\fBmode\fR' can be \fB{ -1:Bounding-box | 0:Dots | 1:Wireframe | 2:Flat | 3:Flat-shaded | 4:Gouraud-shaded | 5:Phong-shaded }\fR. \fBDefault value\fR: '\fBmode=-1\fR'. \fB*3d (+):\fR Shortcut for command '\fBmul3d\fR'. \fBmul3d (+):\fR factor |\fR factor_x,factor_y,_factor_z\fR Scale selected 3D objects isotropically or anisotropically, with specified factors. (equivalent to shortcut command '\fB*3d\fR'). \fBDefault value\fR: '\fBfactor_z=1\fR'. \fBExample:\fR [#1] torus3d 5,2 repeat 5 { +add3d[-1] 10,0,0 mul3d[-1] 1.2 color3d[-1] ${-rgb} } add3d\fR \fBmt3d:\fR Shortcut for command '\fBmultithreaded3d\fR'. \fBmultithreaded3d:\fR _is_multi_threaded_rendering={ 0:No | 1:Yes }\fR Enable/disable multi-threaded 3D rendering. (equivalent to shortcut command '\fBmt3d\fR'). \fBDefault value\fR: '\fBis_multithreaded_rendering=0\fR'. \fBn3d:\fR Shortcut for command '\fBnormalize3d\fR'. \fBnormalize3d:\fR Normalize selected 3D objects to unit size. (equivalent to shortcut command '\fBn3d\fR'). \fBExample:\fR [#1] repeat 100 { circle3d {u(3)},{u(3)},{u(3)},0.1 } add3d color3d[-1] 255,0,0 +normalize3d[-1] color3d[-1] 0,255,0 add3d\fR \fBnormalmap3d:\fR [object3d],_x[%],_y[%],_z_,is_double_sided={ 0:No | 1:Yes },_is_zbuffer={ 0:No | 1:Yes },_focal\fR Draw normal map of specified 3D object on selected images. \fBDefault values\fR: '\fBx=y=50%\fR', '\fBz=0\fR' and '\fBis_zbuffer=1\fR'. All other arguments take their default values from the 3D environment variables. \fBExample:\fR [#1] gmic3d center3d normalize3d rotate3d 0,1,0,45 mul3d 360 400,400,1,3 normalmap3d[-1] [-2] snapshot3d[-2] 400\fR \fBnormals3d:\fR output_mode={ 0:vertices | 1:primitives | 2:vertices+primitives }.\fR Estimate normals of selected 3D meshes, for vertices, primitives, or both. This command returns one of two images, having 6 channels : [ x,y,z,u,v,w ], where (x,y,z) is the origin of the normal vector, and (u,v,z) is the unit normal vector. \fBDefault value\fR: '\fBmode=2\fR'. \fBo3d:\fR Shortcut for command '\fBopacity3d\fR'. \fBj3d (+):\fR Shortcut for command '\fBobject3d\fR'. \fBobject3d (+):\fR [object3d],_x[%],_y[%],_z,_opacity,_rendering_mode,_is_double_sided={ 0:No | 1:Yes },_is_zbuffer={ 0:No | 1:Yes },_focal,_light_x,_light_y,_light_z, _specular_lightness,_specular_shininess,_is_multithreaded_rendering={ 0:No | 1:Yes }\fR Draw specified 3D object on selected images. (equivalent to shortcut command '\fBj3d\fR'). '\fBrendering_mode\fR' can be \fB{ 0:Dots | 1:Wireframe | 2:Flat | 3:Flat-shaded | 4:Gouraud-shaded | 5:Phong-shaded }\fR. \fBDefault values\fR: '\fBx=y=50%\fR', '\fBz=0\fR', '\fBopacity=1\fR' and '\fBis_zbuffer=1\fR'. All other arguments take their default values from the 3D environment variables. \fBExample:\fR [#1] image.jpg torus3d 100,10 cone3d 30,-120 add3d[-2,-1] rotate3d. 1,1,0,60 object3d[0] [-1],50%,50% keep[0]\fR \fBopacity3d:\fR opacity\fR Set opacity of selected 3D objects. (equivalent to shortcut command '\fBo3d\fR'). \fBExample:\fR [#1] torus3d 100,10 repeat 7 { +rotate3d[-1] 1,0,0,20 opacity3d[-1] {u} } add3d\fR \fBparametric3d:\fR _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,_smoothness>=0,_isovalue>=0\fR Input 3D object from specified parametric surface '(a,b) ⟶ (x(a,b),y(a,b),z(a,b))\fR'. \fBDefault values\fR: '\fBx=(2+cos(b))*sin(a)\fR', '\fBy=(2+cos(b))*cos(a)\fR', '\fBc=sin(b)\fR', '\fBamin=-pi\fR', '\fBamax=pi\fR', '\fBbmin=-pi\fR', '\fBbmax=pi\fR', '\fBres_a=512\fR', '\fBres_b=res_a\fR', '\fBres_x=64\fR', '\fBres_y=res_x\fR', '\fBres_z=res_y\fR', '\fBsmoothness=2%\fR' and '\fBisovalue=10%\fR'. \fBExample:\fR [#1] parametric3d ,\fR \fBpca_patch3d:\fR _patch_size>0,_M>0,_N>0,_normalize_input={ 0:No | 1:Yes },_normalize_output={ 0:No | 1:Yes },_lambda_xy\fR Get 3D patch-pca representation of selected images. The 3D patch-pca is estimated from M patches on the input image, and displayed as a cloud of N 3D points. \fBDefault values\fR: '\fBpatch_size=7\fR', '\fBM=1000\fR', '\fBN=3000\fR', '\fBnormalize_input=1\fR', '\fBnormalize_output=0\fR', and '\fBlambda_xy=0\fR'. \fBExample:\fR [#1] image.jpg pca_patch3d 7\fR \fBplane3d:\fR _size_x,_size_y,_nb_subdivisions_x>0,_nb_subdisivions_y>0\fR Input 3D plane at (0,0,0), with specified geometry. \fBDefault values\fR: '\fBsize_x=1\fR', '\fBsize_y=size_x\fR' and '\fBnb_subdivisions_x=nb_subdivisions_y=24\fR'. \fBExample:\fR [#1] plane3d 50,30 +primitives3d 1 color3d[-2] ${-rgb}\fR \fBpoint3d:\fR x0,y0,z0\fR Input 3D point at specified coordinates. \fBExample:\fR [#1] repeat 1000 { a:=$>*pi/500 point3d {cos(3*$a)},{sin(2*$a)},0 color3d[-1] ${-rgb} } add3d\fR \fBpointcloud3d:\fR Convert selected planar or volumetric images to 3D point clouds. \fBExample:\fR [#1] image.jpg luminance rescale2d ,100 threshold 50% mul 255 pointcloud3d color3d[-1] 255,255,255\fR \fBpose3d:\fR p1,...,p12\fR Apply 3D pose matrix to selected 3D objects. \fBExample:\fR [#1] torus3d 100,20 pose3d 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 snapshot3d 400\fR \fBp3d:\fR Shortcut for command '\fBprimitives3d\fR'. \fBprimitives3d:\fR mode\fR Convert primitives of selected 3D objects. (equivalent to shortcut command '\fBp3d\fR'). '\fBmode\fR' can be \fB{ 0:Points | 1:Outlines | 2:Non-textured }\fR. \fBExample:\fR [#1] sphere3d 30 primitives3d 1 torus3d 50,10 color3d[-1] ${-rgb} add3d\fR \fBprojections3d:\fR _x[%],_y[%],_z[%],_is_bounding_box={ 0:No | 1:Yes },nb_subdivisions>0\fR Generate 3D xy,xz,yz projection planes from specified volumetric images. \fBDefault values\fR: '\fBx=y=z=50%\fR', '\fBis_bounding_box=1\fR' and '\fBnb_subdividions=5\fR' \fBpyramid3d:\fR width,height\fR Input 3D pyramid at (0,0,0), with specified geometry. \fBExample:\fR [#1] pyramid3d 100,-100 +primitives3d 1 color3d[-2] ${-rgb}\fR \fBquadrangle3d:\fR x0,y0,z0,x1,y1,z1,x2,y2,z2,x3,y3,z3\fR Input 3D quadrangle at specified coordinates. \fBExample:\fR [#1] quadrangle3d -10,-10,10,10,-10,10,10,10,10,-10,10,10 repeat 10 { +rotate3d[-1] 0,1,0,30 color3d[-1] ${-rgb},0.6 } add3d mode3d 2\fR \fBrandom3d:\fR nb_points>=0\fR Input random 3D point cloud in [0,1]^3. \fBExample:\fR [#1] random3d 100 circles3d 0.1 opacity3d 0.5\fR \fBrv3d:\fR Shortcut for command '\fBreverse3d\fR'. \fBreverse3d:\fR Reverse primitive orientations of selected 3D objects. (equivalent to shortcut command '\fBrv3d\fR'). \fBExample:\fR [#1] torus3d 100,40 +reverse3d\fR \fBr3d (+):\fR Shortcut for command '\fBrotate3d\fR'. \fBrotate3d (+):\fR u,v,w,angle\fR Rotate selected 3D objects around specified axis with specified angle (in deg.). (equivalent to shortcut command '\fBr3d\fR'). \fBExample:\fR [#1] torus3d 100,10 repeat 7 { +rotate3d[-1] 1,0,0,20 } add3d\fR \fBrotation3d:\fR u,v,w,angle\fR Input 3x3 rotation matrix with specified axis and angle (in deg). \fBExample:\fR [#1] rotation3d 1,0,0,0 rotation3d 1,0,0,90 rotation3d 1,0,0,180\fR \fBsierpinski3d:\fR _recursion_level>=0,_width,_height\fR Input 3D Sierpinski pyramid. \fBDefault values\fR: '\fBrecursion_level=4\fR', '\fBwidth=1\fR' and '\fBheight=1\fR'. \fBExample:\fR [#1] sierpinski3d 3,100,-100 +primitives3d 1 color3d[-2] ${-rgb}\fR \fBsize3d:\fR Return bounding box size of the last selected 3D object. \fBskeleton3d:\fR _metric,_frame_type={ 0:Squares | 1:Diamonds | 2:Circles | 3:Auto },_skeleton_opacity,_frame_opacity,_is_frame_wireframe={ 0:No | 1:Yes }\fR Build 3D skeletal structure object from 2d binary shapes located in selected images. '\fBmetric\fR' can be \fB{ 0:Chebyshev | 1:Manhattan | 2:Euclidean }\fR. \fBDefault values\fR: '\fBmetric=2\fR', '\fBframe_type=3\fR', '\fBskeleton_opacity=1\fR' and '\fBframe_opacity=0.1\fR'. \fBExample:\fR [#1] shape_cupid 480 +skeleton3d ,\fR \fBsnapshot3d:\fR _size>0,_zoom>=0,_backgroundR,_backgroundG,_backgroundB,_backgroundA,_fov_angle>=0 |\fR [background_image],zoom>=0,_fov_angle>=0\fR Take 2D snapshots of selected 3D objects. Set '\fBzoom\fR' to 0 to disable object auto-scaling. \fBDefault values\fR: '\fBsize=1024\fR', '\fBzoom=1\fR', '\fB[background_image]=(unused)\fR' and '\fBfov_angle=45\fR'. \fBExample:\fR [#1] torus3d 100,20 rotate3d 1,1,0,60 snapshot3d 400,1.2,128,64,32\fR [#2] torus3d 100,20 rotate3d 1,1,0,60 sample ? +snapshot3d[0] [1],1.2\fR \fBsl3d:\fR Shortcut for command '\fBspecl3d\fR'. \fBspecl3d:\fR value>=0\fR Set lightness of 3D specular light. (equivalent to shortcut command '\fBsl3d\fR'). \fBDefault value\fR: '\fBvalue=0.25\fR'. \fBExample:\fR [#1] (0,0.3,0.6,0.9,1.2) repeat w { torus3d 100,30 rotate3d[-1] 1,1,0,60 color3d[-1] 255,0,0 specl3d {0,@$>} snapshot3d[-1] 400 } remove[0]\fR \fBss3d:\fR Shortcut for command '\fBspecs3d\fR'. \fBspecs3d:\fR value>=0\fR Set shininess of 3D specular light. (equivalent to shortcut command '\fBss3d\fR'). \fBDefault value\fR: '\fBvalue=0.1\fR'. \fBExample:\fR [#1] (0,0.3,0.6,0.9,1.2) repeat w { torus3d 100,30 rotate3d[-1] 1,1,0,60 color3d[-1] 255,0,0 specs3d {0,@$>} snapshot3d[-1] 400 } remove[0]\fR \fBsphere3d:\fR radius,_nb_recursions!=0 |\fR radius,_nb_phi>=3,_nb_theta>=3\fR Input 3D sphere at (0,0,0), with specified geometry. * If 2 arguments are specified: - If '\fBnb_recursions>0\fR', the sphere is generated using recursive subdivisions of an \fBicosahedron\fR. - If '\fBnb_recursions<0\fR', the sphere is generated using recursive subdividions of a \fBcube\fR. * If 3 arguments are specified, the sphere is generated using spherical coordinates discretization. \fBDefault value\fR: '\fBnb_recursions=3\fR'. \fBExample:\fR [#1] sphere3d 100 +primitives3d 1 color3d[-2] ${-rgb}\fR \fBspherical3d:\fR "radius_function(phi,theta)",_nb_recursions!=0 |\fR "radius_function(phi,theta)",_nb_phi>=3,_nb_theta>=3\fR Input 3D spherical object at (0,0,0), with specified geometry. Second and third arguments are the same as in command \fIsphere3d\fR. \fBDefault values\fR: '\fBnb_recursions=5\fR'. \fBExample:\fR [#1] spherical3d "abs(1+0.5*cos(3*phi)*sin(4*theta))" +primitives3d 1\fR \fBspline3d:\fR x0[%],y0[%],z0[%],u0[%],v0[%],w0[%],x1[%],y1[%],z1[%],u1[%],v1[%],w1[%],_nb_vertices>=2\fR Input 3D spline with specified geometry. \fBDefault values\fR: '\fBnb_vertices=128\fR'. \fBExample:\fR [#1] repeat 100 { spline3d {u},{u},{u},{u},{u},{u},{u},{u},{u},{u},{u},{u},128 color3d[-1] ${-rgb} } box3d 1 primitives3d[-1] 1 add3d\fR \fBs3d:\fR Shortcut for command '\fBsplit3d\fR'. \fBsplit3d:\fR Split selected 3D objects into feature vectors : \fB{ header, sizes, vertices, primitives, colors, opacities }\fR. (equivalent to shortcut command '\fBs3d\fR'). To recreate the 3D object, append all produced images along the y-axis (with command 'append y\fR'). \fBExample:\fR [#1] box3d 100 +split3d\fR \fBsprite3d:\fR Convert selected images as 3D sprites. Selected images with alpha channels are managed. \fBExample:\fR [#1] image.jpg sprite3d\fR \fBsprites3d:\fR [sprite],_sprite_has_alpha_channel={ 0:No | 1:Yes }\fR Convert selected 3D objects as a sprite cloud. Set '\fBsprite_has_alpha_channel\fR' to 1 to make the last channel of the selected sprite be a transparency mask. \fBDefault value\fR: '\fBmask_has_alpha_channel=0\fR'. \fBExample:\fR [#1] torus3d 100,20 image.jpg rescale2d[-1] ,64 100%,100% gaussian[-1] 30%,30% *[-1] 255 append[-2,-1] c +sprites3d[0] [1],1 display_rgba[-2]\fR \fBstar3d:\fR _nb_branches>0,0<=_thickness<=1\fR Input 3D star at position '(0,0,0)\fR', with specified geometry. \fBDefault values\fR: '\fBnb_branches=5\fR' and '\fBthickness=0.38\fR'. \fBExample:\fR [#1] star3d , +primitives3d 1 color3d[-2] ${-rgb}\fR \fBstreamline3d (+):\fR x[%],y[%],z[%],_L>=0,_dl>0,_interpolation,_is_backward={ 0:No | 1:Yes },_is_oriented={ 0:No | 1:Yes } |\fR 'formula',x,y,z,_L>=0,_dl>0,_interpolation,_is_backward={ 0:No | 1:Yes },_is_oriented={ 0:No | 1:Yes }\fR Extract 3D streamlines from selected vector fields or from specified formula. '\fBinterpolation\fR' can be \fB{ 0:Nearest integer | 1:1st-order | 2:2nd-order | 3:4th-order }\fR. \fBDefault values\fR: '\fBdl=0.1\fR', '\fBinterpolation=2\fR', '\fBis_backward=0\fR' and '\fBis_oriented=0\fR'. \fBExample:\fR [#1] 100,100,100,3 rand -10,10 blur 3 repeat 300 { +streamline3d[0] {u(100)},{u(100)},{u(100)},1000,1,1 color3d[-1] ${-rgb} } remove[0] box3d 100 primitives3d[-1] 1 add3d\fR \fB-3d (+):\fR Shortcut for command '\fBsub3d\fR'. \fBsub3d (+):\fR tx,_ty,_tz\fR Shift selected 3D objects with the opposite of specified displacement vector. (equivalent to shortcut command '\fB3d\fR'). \fBDefault values\fR: '\fBty=tz=0\fR'. \fBExample:\fR [#1] sphere3d 10 repeat 5 { +sub3d[-1] 10,{u(-10,10)},0 color3d[-1] ${-rgb} } add3d\fR \fBsubdivide3d:\fR Subdivide primitives of selected 3D objects. \fBsuperformula3d:\fR resolution>1,m>=1,n1,n2,n3\fR Input 2D superformula curve as a 3D object. \fBDefault values\fR: '\fBresolution=1024\fR', '\fBm=8\fR', '\fBn1=1\fR', '\fBn2=5\fR' and '\fBn3=8\fR'. \fBExample:\fR [#1] superformula3d ,\fR \fBsurfels3d:\fR 0<=_left_right_attenuation<=1,0<=_top_bottom_attenuation<=1,0<=_closer_further_attenuation<=1\fR Convert selected images to 3D objects composed of 3D surfels (or 2D edgels for 2D images). The binary shape is composed of all non-zero voxels. The resulting 3D object is colored according to the color of non zero voxels. \fBDefault values\fR: '\fBleft_right_attenuation=1\fR', '\fBtop_bottom_attenuation=1\fR' and '\fBcloser_further_attenuation=1\fR'. \fBExample:\fR [#1] 100,100,100 = 1,40%,40%,40% = 1,60%,60%,60% distance 1 lt 30% blur 3 gt 50% surfels3d 0.5,0.75,1\fR \fBtensors3d:\fR _radius_factor>=0,_shape={ 0:Box | >=N:Ellipsoid },_radius_min>=0\fR Generate 3D tensor fields from selected images. when 'shape'>0, it gives the ellipsoid shape precision. \fBDefault values\fR: '\fBradius_factor=1\fR', '\fBshape=2\fR' and '\fBradius_min=0.05\fR'. \fBExample:\fR [#1] 7,7,7,9,"U = unitnorm([x,y,z] - int([w,h,d]/2)); mul(U,U,3) + 0.3*eye(3)" tensors3d 0.8\fR \fBtext_pointcloud3d:\fR _"text1",_"text2",_smoothness\fR Input 3D text pointcloud from the two specified strings. \fBDefault values\fR: '\fBtext1="text1"\fR', '\fBtext2="text2"\fR' and '\fBsmoothness=1\fR'. \fBExample:\fR [#1] text_pointcloud3d "G'MIC","Rocks!"\fR \fBtext3d:\fR text,_{ font_height>=0 | custom_font },_depth>0,_smoothness\fR Input a 3D text object from specified text. \fBDefault values\fR: '\fBfont_height=53\fR', '\fBdepth=10\fR' and '\fBsmoothness=1.5\fR'. \fBExample:\fR [#1] text3d "G'MIC as a\n3D logo!"\fR \fBt3d:\fR Shortcut for command '\fBtexturize3d\fR'. \fBtexturize3d:\fR [ind_texture],_[ind_coords]\fR Texturize selected 3D objects with specified texture and coordinates. (equivalent to shortcut command '\fBt3d\fR'). When '\fB[ind_coords]\fR' is omitted, default XY texture projection is performed. \fBDefault value\fR: '\fBind_coords=(undefined)\fR'. \fBExample:\fR [#1] image.jpg torus3d 100,30 texturize3d[-1] [-2] keep[-1]\fR \fBtorus3d:\fR _radius1,_radius2,_nb_subdivisions1>2,_nb_subdivisions2>2\fR Input 3D torus at (0,0,0), with specified geometry. \fBDefault values\fR: '\fBradius1=1\fR', '\fBradius2=0.3\fR', '\fBnb_subdivisions1=24\fR' and '\fBnb_subdivisions2=12\fR'. \fBExample:\fR [#1] torus3d 10,3 +primitives3d 1 color3d[-2] ${-rgb}\fR \fBtriangle3d:\fR x0,y0,z0,x1,y1,z1,x2,y2,z2\fR Input 3D triangle at specified coordinates. \fBExample:\fR [#1] repeat 100 { a:=$>*pi/50 triangle3d 0,0,0,0,0,3,{cos(3*$a)},{sin(2*$a)},0 color3d[-1] ${-rgb} } add3d\fR \fBvolume3d:\fR Transform selected 3D volumetric images as 3D parallelepipedic objects. \fBExample:\fR [#1] image.jpg animate blur,0,5,30 append z volume3d\fR \fBvoxelize3d:\fR _max_resolution>0,_fill_interior={ 0:No | 1:Yes },_preserve_colors={ 0:No | 1:Yes }\fR Convert selected 3D objects as 3D volumetric images of binary voxels, using 3D mesh rasterization. \fBDefault values\fR: '\fBmax_resolution=128\fR', '\fBfill_interior=1\fR' and '\fBpreserve_colors=0\fR'. \fBweird3d:\fR _resolution>0\fR Input 3D weird object at (0,0,0), with specified resolution. \fBDefault value\fR: '\fBresolution=32\fR'. \fBExample:\fR [#1] weird3d 48 +primitives3d 1 color3d[-2] ${-rgb}\fR \fB\fB11.13. Flow Control\fR \fB ------------\fR \fBap:\fR Shortcut for command '\fBapply_parallel\fR'. \fBapply_parallel:\fR "command"\fR Apply specified command on each of the selected images, by parallelizing it for all images in the list. (equivalent to shortcut command '\fBap\fR'). \fBExample:\fR [#1] image.jpg +mirror x +mirror y apply_parallel "blur 3"\fR \fBapc:\fR Shortcut for command '\fBapply_parallel_channels\fR'. \fBapply_parallel_channels:\fR "command"\fR Apply specified command on each of the selected images, by parallelizing it for all channel of the images independently. (equivalent to shortcut command '\fBapc\fR'). \fBExample:\fR [#1] image.jpg apply_parallel_channels "blur 3"\fR \fBapo:\fR Shortcut for command '\fBapply_parallel_overlap\fR'. \fBapply_parallel_overlap:\fR "command",overlap[%],nb_threads={ 0:Auto | 1 | 2 | 4 | 8 | 16 }\fR Apply specified command on each of the selected images, by parallelizing it on '\fBnb_threads\fR' overlapped sub-images. (equivalent to shortcut command '\fBapo\fR'). '\fBnb_threads\fR' must be a power of 2. \fBDefault values\fR: '\fBoverlap=0\fR','\fBnb_threads=0\fR'. \fBExample:\fR [#1] image.jpg +apply_parallel_overlap "smooth 500,0,1",1\fR \fBat:\fR Shortcut for command '\fBapply_tiles\fR'. \fBapply_tiles:\fR "command",_tile_width[%]>0,_tile_height[%]>0,_tile_depth[%]>0,_overlap_width[%]>=0,_overlap_height[%]>=0,_overlap_depth[%]>=0,_boundary_conditions={ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR Apply specified command on each tile (neighborhood) of the selected images, optionally with overlapping tiles. (equivalent to shortcut command '\fBat\fR'). \fBDefault values\fR: '\fBtile_width=tile_height=tile_depth=10%\fR','\fBoverlap_width=overlap_height=overlap_depth=0\fR' and '\fBboundary_conditions=1\fR'. \fBExample:\fR [#1] image.jpg +equalize[0] 256 +apply_tiles[0] "equalize 256",16,16,1,50%,50%\fR \fBapply_timeout:\fR "command",_timeout={ 0:No timeout | >0:With specified timeout (in seconds) }\fR Apply a command with a timeout. Set variable '\fB$_is_timeout\fR' to '\fB1\fR' if timeout occurred, '\fB0\fR' otherwise. \fBDefault value\fR: '\fBtimeout=20\fR'. \fBcheck (+):\fR condition\fR Evaluate specified condition and display an error message if evaluated to false. \fBcheck3d (+):\fR _is_full_check={ 0:No | 1:Yes }\fR Check validity of selected 3D vector objects, and display an error message if one of the selected images is not a valid 3D vector object. Full 3D object check is slower but more precise. \fBDefault value\fR: '\fBis_full_check=1\fR'. \fBcontinue (+):\fR Go to end of current '\fBdo...while\fR', '\fBfor...done\fR', '\fBforeach...done\fR', '\fBlocal...done\fR' or '\fBrepeat...done\fR' block. \fBExample:\fR [#1] image.jpg repeat 10 blur 1 if 1==1 continue fi deform 10 done\fR \fBbreak (+):\fR Break current '\fBdo...while\fR', '\fBfor...done\fR', '\fBforeach...done\fR', '\fBlocal...done\fR' or '\fBrepeat...done\fR' block. \fBExample:\fR [#1] image.jpg repeat 10 blur 1 if 1==1 break fi deform 10 done\fR \fBdo (+):\fR Start a '\fBdo...while\fR' block. \fBExample:\fR [#1] image.jpg luminance i:=ia+2 do set 255,{u(100)}%,{u(100)}% while ia<$i\fR \fBdone (+):\fR End a '\fBfor/foreach/local/repeat...done\fR' block, and go to associated '\fBfor/foreach/repeat\fR' if iterations remain. (equivalent to shortcut command '\fB}\fR'). \fBelif (+):\fR condition\fR Start a '\fBelif...[else]...fi\fR' block if previous '\fBif\fR' was not verified and test if specified condition holds '\fBcondition\fR' is a mathematical expression, whose evaluation is interpreted as \fB{ 0:False | other:True }\fR. \fBTutorial: \fR\fIhttps://gmic.eu/tutorial/iffi\fR \fBelse (+):\fR Execute following commands if previous '\fBif\fR' or '\fBelif\fR' conditions failed. \fBTutorial: \fR\fIhttps://gmic.eu/tutorial/iffi\fR \fBfi (+):\fR End a '\fBif...[elif]...[else]...fi\fR' block. (equivalent to shortcut command '\fBfi\fR'). \fBTutorial: \fR\fIhttps://gmic.eu/tutorial/iffi\fR \fBerror (+):\fR message\fR Print specified error message on the standard error (stderr) and exit interpreter, except if error is caught by a '\fBonfail\fR' command. Command selection (if any) stands for displayed call stack subset instead of image indices. \fBeval (+):\fR expression\fR Evaluate specified math expression. * If no image selection is specified, the expression is evaluated only once and its result is set to status. * If image selection is specified, the expression is evaluated for all pixel values of the selected images. Status is unchanged. In this setting, '\fBeval\fR' is similar to \fIfill\fR without assigning the image values. \fBx (+):\fR Shortcut for command '\fBexec\fR'. \fBexec (+):\fR _is_verbose={ 0:No | 1:Yes },"command"\fR Execute external command using a system call. The status value is then set to the error code returned by the system call. If '\fBis_verbose=1\fR', the executed command is allowed to output on stdout/stderr. (equivalent to shortcut command '\fBx\fR'). \fBDefault value\fR: '\fBis_verbose=1\fR'. \fBxo:\fR Shortcut for command '\fBexec_out\fR'. \fBexec_out:\fR _mode,"command"\fR Execute external command using a system call, and return resulting 'stdout\fR' and/or 'stderr\fR'. '\fBmode\fR' can be \fB{ 0:Stdout | 1:Stderr | 2:Stdout+stderr }\fR. \fBfor (+):\fR condition\fR Start a 'for...done\fR' block. \fBExample:\fR [#1] image.jpg rescale2d ,32 400,400,1,3 x=0 for $x<400 image[1] [0],$x,$x x+=40 done\fR \fBforeach (+):\fR Start a '\fBforeach...done\fR' block, that iterates over all images in the selection, with a separate local environment for each one. \fBExample:\fR [#1] sample colorful,earth,duck,dog foreach[^2] +blur 10 sub normalize 0,255 done\fR \fBif (+):\fR condition\fR Start a '\fBif...[elif]...[else]...fi\fR' block and test if specified condition holds. '\fBcondition\fR' is a mathematical expression, whose evaluation is interpreted as \fB{ 0:False | other:True }\fR. \fBExample:\fR [#1] image.jpg if ia<64 add 50% elif ia<128 add 25% elif ia<192 sub 25% else sub 50% fi cut 0,255\fR \fBTutorial: \fR\fIhttps://gmic.eu/tutorial/iffi\fR \fBl (+):\fR Shortcut for command '\fBlocal\fR'. \fBlocal (+):\fR Start a '\fBlocal...[onfail]...done\fR' block, with selected images. (equivalent to shortcut command '\fBl\fR'). \fBExample:\fR [#1] image.jpg local[] 300,300,1,3 rand[0] 0,255 blur 4 sharpen 1000 done\fR [#2] image.jpg +local repeat 3 { deform 20 } done\fR \fBTutorial: \fR\fIhttps://gmic.eu/oldtutorial/_local\fR \fBnoarg (+):\fR Used in a custom command, '\fBnoarg\fR' tells the command that its argument list has not ultimately been used, and so they must be evaluated next in the G'MIC\fR pipeline, just as if the custom command takes no arguments at all. Use this command to write a custom command which can decide if it takes arguments or not. \fBonfail (+):\fR Execute following commands when an error is encountered in the body of the '\fBlocal...done\fR' block. The status value is set with the corresponding error message. \fBExample:\fR [#1] image.jpg +local blur -3 onfail mirror x done\fR \fBparallel (+):\fR _wait_threads,"command_1","command_2",...\fR Execute specified commands in parallel, each in a different thread. Parallel threads share the list of images. '\fBwait_threads\fR' can be \fB{ 0:When current environment ends | 1:Immediately }\fR. \fBDefault value\fR: '\fBwait_threads=1\fR'. \fBExample:\fR [#1] image.jpg [0] parallel "blur[0] 3","mirror[1] c"\fR \fBprogress (+):\fR 0<=value<=100 |\fR -1\fR Set the progress index of the current processing pipeline. This command is useful only when G'MIC\fR is used by an embedding application. \fBq (+):\fR Shortcut for command '\fBquit\fR'. \fBquit (+):\fR Quit G'MIC\fR interpreter. (equivalent to shortcut command '\fBq\fR'). \fBrepeat (+):\fR nb_iterations\fR Start '\fBnb_iterations\fR' iterations of a 'repeat...done\fR' block. '\fBnb_iterations\fR' is a mathematical expression that will be evaluated. \fBExample:\fR [#1] image.jpg split y repeat $! n=$> shift[$n] $<,0,0,0,2 done append y\fR [#2] image.jpg mode3d 2 repeat 4 imagecube3d rotate3d 1,1,0,40 snapshot3d 400,1.4 done\fR \fBTutorial: \fR\fIhttps://gmic.eu/oldtutorial/_repeat\fR \fBreturn (+):\fR Return from current custom command. \fBrprogress:\fR 0<=value<=100 | -1 | "command",0<=value_min<=100,0<=value_max<=100\fR Set the progress index of the current processing pipeline (relatively to previously defined progress bounds), or call the specified command with specified progress bounds. \fBrun:\fR "G'MIC pipeline"\fR Run specified G'MIC\fR pipeline. \fBskip (+):\fR item\fR Do nothing but skip specified item. \fBu (+):\fR Shortcut for command '\fBstatus\fR'. \fBstatus (+):\fR status_string\fR Set the current status. Used to define a returning value from a function. (equivalent to shortcut command '\fBu\fR'). \fBExample:\fR [#1] image.jpg command "foo : u0=Dark u1=Bright status ${u{ia>=128}}" text_outline ${-foo},2,2,23,2,1,255\fR \fBwhile (+):\fR condition\fR End a '\fBdo...while\fR' block and go back to associated '\fBdo\fR' if specified condition holds. '\fBcondition\fR' is a mathematical expression, whose evaluation is interpreted as \fB{ 0:False | other:True }\fR. \fB\fB11.14. Neural Networks\fR \fB ---------------\fR \fBnn_lib ::\fR Define the math functions that have to be included in a math expression, when using '\fBnn_lib\fR', the G'MIC\fR neural network library. This command sets string variable '\fB$_nn_lib\fR' and returns its content. \fBnn_add:\fR out,in0,in1,_in2,_in3\fR Add an '\fBadd\fR' layer (element-wise addition) to the current network. the '\fBin_k\fR' arguments can be layer names or constant values (all cannot be constant values though). \fBnn_append:\fR out,in0,in1,_in2,_in3,axis={ x | y | z | c }\fR Add an '\fBappend\fR' layer to the current network. All input layers '\fBin_k\fR' must have same dimensions (except along specified '\fBaxis\fR'). \fBnn_check_layer:\fR layer_name\fR Check that layer with specified name exists in the current network. \fBnn_clone:\fR out0,out1,in\fR Add a '\fBclone\fR' layer to the current network. \fBnn_columnpatch2d:\fR out,in,out_width>0,out_height>0,patch_size>0,_overlap>0\fR Add a '\fBcolumnpatch2d\fR' layer (rearrangement of matrix columns as image patches) to the current network. \fBDefault values\fR: '\fBoverlap=0\fR'. \fBnn_conv:\fR out,in,nb_channels>0,_kernel_width>0,_kernel_height>0,_kernel_depth>0,_stride_x>0,_stride_y>0,_stride_z>0,_dilation_x,_dilation_y,_dilation_z, _shrink_x>=0,_shrink_y>=0_,_shrink_z>=0,boundary_conditions,_learning_mode,_weight_decay>=0,_initialization\fR Add a '\fBconv\fR' layer (generic 1D/2D/3D convolutional layer) to the current network. '\fBboundary_conditions\fR' can be \fB{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR. '\fBlearning_mode\fR' can be \fB{ 0:No learning | 1:Weights only | 2:Biases only | 3:Weights+biases }\fR. '\fBinitialization\fR' can be \fB{ 0:Zero | 1:Identity | 2:Lecun-initialization | 3:He-initialization | 4:Residual He-initialization }\fR. \fBDefault values\fR: '\fBstride_x=stride_y=stride_z=1\fR', '\fBdilation_x=dilation_y=dilation_z=1\fR', '\fBshrink_x=shrink_y=shrink_z=0\fR', '\fBboundary_conditions=1\fR', '\fBlearning_mode=3\fR', '\fBweight_decay=0\fR' and '\fBinitialization=3\fR'. \fBnn_conv2d:\fR out,in,nb_channels>0,_kernel_size>0,_stride>0,_dilation,_shrink>=0,_boundary_conditions,_learning_mode,_weight_decay>=0,_initialization\fR Add a '\fBconv2d\fR' layer (2D convolutional layer) to the current network. '\fBboundary_conditions\fR' can be \fB{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR. '\fBlearning_mode\fR' can be \fB{ 0:No learning | 1:Weights only | 2:Biases only | 3:Weights+biases }\fR. '\fBinitialization\fR' can be \fB{ 0:Zero | 1:Identity | 2:Lecun-initialization | 3:He-initialization | 4:Residual He-initialization }\fR. \fBDefault values\fR: '\fBkernel_size=3\fR', '\fBstride=1\fR', '\fBdilation=1\fR', '\fBshrink=0\fR', '\fBboundary_conditions=1\fR', '\fBlearning_mode=3\fR', '\fBweight_decay=0\fR' and '\fBinitialization=3\fR'. \fBnn_conv3d:\fR out,in,nb_channels>0,_kernel_size>0,_stride>0,_dilation,_shrink>=0,_boundary_conditions,_learning_mode,_weight_decay>=0,_initialization\fR Add a '\fBconv3d\fR' layer (3D convolutional layer) to the current network. '\fBboundary_conditions\fR' can be \fB{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR. '\fBlearning_mode\fR' can be \fB{ 0:No learning | 1:Weights only | 2:Biases only | 3:Weights+biases }\fR. '\fBinitialization\fR' can be \fB{ 0:Zero | 1:Identity | 2:Lecun-initialization | 3:He-initialization | 4:Residual He-initialization }\fR. \fBDefault values\fR: '\fBkernel_size=3\fR', '\fBstride=1\fR', '\fBdilation=1\fR', '\fBshrink=0\fR', '\fBboundary_conditions=1\fR', '\fBlearning_mode=3\fR', '\fBweight_decay=0\fR' and '\fBinitialization=3\fR'. \fBnn_crop:\fR out,in,x0,y0,z0,c0,x1,y1,z1,c1,_boundary_conditions\fR Add a '\fBcrop\fR' layer to the current network. '\fBboundary_conditions\fR' can be \fB{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR. \fBDefault value\fR: '\fBboundary_conditions=0\fR'. \fBnn_div:\fR out,in0,in1\fR Add a '\fBdiv\fR' layer (element-wise division) to the current network. '\fBin0\fR' or '\fBin1\fR' can be layer names or constant values (both cannot be constant values though). \fBnn_dropout:\fR out,in,0<=dropout_rate<1\fR Add a '\fBdropout\fR' layer to the current network. \fBnn_fc:\fR out,in,nb_channels>0,_learning_mode,_weight_decay>=0,_initialization\fR Add a '\fBfc\fR' layer (fully connected layer) to the current network. '\fBlearning_mode\fR' can be \fB{ 0:No learning | 1:Weights only | 2:Biases only | 3:Weights+biases }\fR. '\fBinitialization\fR' can be \fB{ 0:Zero | 1:Identity | 2:Lecun-initialization | 3:He-initialization 4:Residual He-initialization }\fR. \fBDefault value\fR: '\fBlearning_mode=3\fR', '\fBweight_decay=0\fR' and '\fBinitialization=3\fR'. \fBnn_fft:\fR out,in,io_mode,_is_inverse={ 0:No | 1:Yes },_axes.\fR Add a '\fBfft\fR' layer (Fourier Transform) to the current network. Argument '\fBio_mode\fR' tells about the meaning of input/output data. It can be \fB{ 0:real → real | 1:(real,imag) → real | 2:real → (real, imag) | 3:(real,imag) → (real,imag) }\fR When dealing with '\fB(real,imag)\fR' data, the real and imaginary parts of the data (N channels each) are concatenated into a 2N-channels image. Argument '\fBaxes\fR' can be \fB{ 0 (all) | x | y | z | xy | xz | yz | xyz }\fR. \fBDefault value\fR: '\fBis_inverse=0\fR', '\fBaxes=0 (all)\fR'. \fBnn_init:\fR _network_name\fR Initialize new network with specified name, and select it as the current one. \fBDefault value\fR: '\fBnetwork_name=nn\fR'. \fBnn_input:\fR out,width,_height,_depth,_spectrum\fR Add a new '\fBinput\fR' to the current network. \fBDefault values\fR: '\fBheight=1\fR', '\fBdepth=1\fR' and '\fBspectrum=1\fR'. \fBnn_linear:\fR out,in,nb_channels>0,_axis={ x | y | z | c},_learning_mode,_weight_decay>=0,_initialization\fR Add a '\fBlinear\fR' layer to the current network. '\fBlearning_mode\fR' can be \fB{ 0:No learning | 1:Weights only | 2:Biases only | 3:Weights+biases }\fR. '\fBinitialization\fR' can be \fB{ 0:Zero | 1:Identity | 2:Lecun-initialization | 3:He-initialization 4:Residual He-initialization }\fR. \fBDefault value\fR: '\fBlearning_mode=3\fR', '\fBweight_decay=0\fR' and '\fBinitialization=3\fR'. \fBnn_load:\fR 'filename.gmz',_include_trainer_data={ 0:No | 1:Yes }\fR Load and initialize network (saved as a .gmz file). Network files can be only loaded in '\fB.gmz\fR' format. \fBDefault value\fR: '\fBinclude_trainer_data=1\fR'. \fBnn_loss_add:\fR out,in0,in1,...\fR Add a '\fBadd\fR' loss to the current network (sum of losses). \fBnn_loss_bce:\fR out,in,ground_truth,_weight\fR Add a '\fBbce\fR' loss to the current network (binary cross entropy). '\fBground_truth\fR' can be a layer output name or a scalar value (default: 0). \fBDefault value\fR: '\fBweight=1\fR'. \fBnn_loss_ce:\fR out,in,ground_truth,_weight\fR Add a '\fBce\fR' loss to the current network (cross entropy). '\fBground_truth\fR' can be a layer output name or a scalar value (default: 0). \fBDefault value\fR: '\fBweight=1\fR'. \fBnn_loss_l1:\fR out,in,_ground_truth,_weight\fR Add a '\fBl1\fR' loss to the current network (L1-norm). '\fBground_truth\fR' can be a layer output name or a scalar value (default: 0). \fBDefault value\fR: '\fBweight=1\fR'. \fBnn_loss_l2:\fR out,in,_ground_truth,_weight\fR Add a '\fBl2\fR' loss to the current network (L2-norm). '\fBground_truth\fR' can be a layer output name or a scalar value (default: 0). \fBDefault value\fR: '\fBweight=1\fR'. \fBnn_loss_lp:\fR out,in,_ground_truth,_p>0,_weight\fR Add a '\fBlp\fR' loss to the current network (Lp-norm). '\fBground_truth\fR' can be a layer output name or a scalar value (default: 0). \fBDefault value\fR: '\fBp=1.5\fR' and '\fBweight=1\fR'. \fBnn_loss_mse:\fR out,in,_ground_truth,_weight\fR Add a '\fBmse\fR' loss to the current network (mean-squared error). '\fBground_truth\fR' can be a layer output name or a scalar value (default: 0). \fBDefault value\fR: '\fBweight=1\fR'. \fBnn_loss_sigmoid_bce:\fR out,in,ground_truth,_weight\fR Add a '\fBsigmoid_bce\fR' loss to the current network (sigmoid followed by binary cross entropy). '\fBground_truth\fR' can be a layer output name or a scalar value (default: 0). Its value correspond to the desired probability (so, after the sigmoid). \fBDefault value\fR: '\fBweight=1\fR'. \fBnn_loss_smoothl1:\fR out,in,_ground_truth,_weight\fR Add a '\fBsmoothl1\fR' loss to the current network (smooth L1-norm). '\fBground_truth\fR' can be a layer output name or a scalar value (default: 0). \fBDefault value\fR: '\fBweight=1\fR'. \fBnn_loss_softmax_ce:\fR out,in,ground_truth,_weight\fR Add a '\fBsoftmax_ce\fR' loss to the current network (softmax followed by cross entropy). '\fBground_truth\fR' can be a layer output name or a scalar value (default: 0). \fBDefault value\fR: '\fBweight=1\fR'. \fBnn_maxpool2d:\fR out,in,_patch_size>1,_is_maxabs={ 0:No | 1:Yes }\fR Add a '\fBmaxpool2d\fR' layer (2D max pooling) to the current network. \fBDefault values\fR: '\fBpatch_size=2\fR' and '\fBis_maxabs=0\fR'. \fBnn_maxpool3d:\fR out,in,_patch_size>1,_is_maxabs={ 0:No | 1:Yes }\fR Add a '\fBmaxpool3d\fR' layer (3d max pooling) to the current network. \fBDefault values\fR: '\fBpatch_size=2\fR' and '\fBis_maxabs=0\fR'. \fBnn_mmul:\fR out,in0,in1\fR Add a '\fBmmul\fR' layer (matrix multiplication '\fBin0*in1\fR') to the current network. '\fBin0\fR' or '\fBin1\fR' must be of compatible size. \fBnn_mmult:\fR out,in0,in1\fR Add a '\fBmmult\fR' layer (matrix multiplication '\fBin0*in1^t\fR') to the current network. '\fBin0\fR' or '\fBin1\fR' must be of compatible size. \fBnn_mul:\fR out,in0,in1,_in2,_in3\fR Add a '\fBmul\fR' layer (element-wise multiplication) to the current network. the '\fBin_k\fR' arguments can be layer names or constant values (all cannot be constant values though). \fBnn_network:\fR _network_name\fR Get/set current network name (and initialize network if it does not already exist). This command returns the name of the current selected network. \fBnn_nl:\fR out,in,_activation\fR Add a '\fBnl\fR' layer (nonlinearity) to the current network. '\fBactivation\fR' can be \fB{ elu | gelu | leakyrelu | linear | log | normalize_l1 | normalize_l1_x | normalize_l1_y | normalize_l1_z | normalize_l1_c | normalize_l2 | normalize_l2_x | normalize_l2_y | normalize_l2_z | normalize_l2_c | relu | sigmoid | sin | sinc | softmax | softmax_x | softmax_y | softmax_z | softmax_c | sqr | sqrt | swish | tanh | z2 | z3 }\fR. \fBDefault value\fR: '\fBactivation=leakyrelu\fR'. \fBnn_noise:\fR out,in,_amplitude,_noise_type,_training_only={ 0:No | 1:Yes }\fR Add a '\fBnoise\fR' layer to the current network. '\fBnoise_type\fR' can be \fB{ 0:Gaussian | 1:Uniform | 2:Salt&pepper | 3:Poisson | 4:Rice }\fR. If '\fBtraining_only\fR' is set, the noise is applied to the input only during the network training phase. \fBDefault value\fR: '\fBamplitude=0.1\fR', '\fBnoise_type=0\fR' and '\fBtraining_only=1\fR'. \fBnn_norm:\fR out,in,p>=0,_axis={ 0 | x | y | z | c }\fR Add a '\fBnorm\fR' layer (Lp norm computation) to the current network. '\fBp\fR' can be \fB{ 0:Squared norm | >0:Lp-norm }\fR. \fBDefault values\fR: '\fBp=2\fR' and '\fBaxis=0\fR'. \fBnn_normalize:\fR out,in,axes,_normalization_type={ 0:Avg_std | 1:RMS },_group_x>=0,_group_y>=0,_group_z>=0,_group_c>=0,_learning_mode\fR Add a '\fBnormalize\fR' layer to the current network. This normalization layer is generic and can simulate the behavior of a Layernorm, an InstanceNorm, a GroupNorm, or a RMSNorm. '\fBaxes\fR' defines the shape used to compute the mean/std of the normalization. '\fBaxes\fR' can be \fB{ x | y | z | c | xy | xz | xc | yz | yc | xyz | xyc | xzc | yzc | xyzc }\fR. For instance : * '\fBaxes=c\fR' means the vector-valued pixels of the input image are normalized independently, according to the channel values. * '\fBaxes=xyz\fR' means each input channel of the input image is normalized independently, according to all (x,y,z) pixel values. When different from '\fB0\fR', a '\fBgroup_*\fR' argument forces the corresponding complementary axis to be split into '\fBN\fR' groups. '\fBlearning_mode\fR' can be \fB{ 0:No learning | 1:Gamma only | 2:Beta only | 3:Gamma+beta }\fR \fBDefault values\fR: '\fBnormalization_type=0\fR', '\fBgroup_x=group_y=group_z=group_c=0\fR' and '\fBlearning_mode=3\fR'. \fBnn_parameters:\fR out,width>0,_height>0,_depth>0,_spectrum>0,_learning_mode,_weight_decay>=0,_initialization\fR Add a '\fBparameters\fR' layer (4D grid of learnable parameters) to the current network. '\fBlearning_mode\fR' can be \fB{ 0:No learning | 1:Weights }\fR. '\fBinitialization\fR' can be \fB{ 0:Zero | 1:Identity | 2:Lecun-initialization | 3:He-initialization 4:Residual He-initialization }\fR. \fBDefault value\fR: '\fBheight=depth=spectrum=1\fR', '\fBlearning_mode=1\fR', '\fBweight_decay=0\fR' and '\fBinitialization=3\fR'. \fBnn_patchcolumn2d:\fR out,in,patch_size>0,_overlap>=0\fR Add a '\fBpatchcolumn2d\fR' layer (rearrangement of image patches as matrix columns) to the current network. \fBDefault value\fR: '\fBoverlap=0\fR'. \fBnn_patchdown2d:\fR out,in,_patch_size>1\fR Add a '\fBpatchdown2d\fR' layer (2D downscale by patch) to the current network. \fBDefault value\fR: '\fBpatch_size=2\fR'. \fBnn_patchdown3d:\fR out,in,_patch_size>1\fR Add a '\fBpatchdown3d\fR' layer (3D downscale by patch) to the current network. \fBDefault value\fR: '\fBpatch_size=2\fR'. \fBnn_patchup2d:\fR out,in,_patch_size>1\fR Add a '\fBpatchup2d\fR' layer (2D upscale by patch) to the current network. \fBDefault value\fR: '\fBpatch_size=2\fR'. \fBnn_patchup3d:\fR out,in,_patch_size>1\fR Add a '\fBpatchup3d\fR' layer (3D upscale by patch) to the current network. \fBDefault value\fR: '\fBpatch_size=2\fR'. \fBnn_permute:\fR out,in,permutation\fR Add a '\fBpermute\fR' layer (axes permutation) to the current network. \fBnn_print:\fR Print info on current network. \fBnn_rename:\fR out,in\fR Add a '\fBrename\fR' layer to the current network. \fBnn_reshape:\fR out,in,width>0,_height>0,_depth>0,_spectrum>0\fR Add a '\fBreshape\fR' layer to the current network. \fBDefault values\fR: '\fBheight=depth=spectrum=1\fR'. \fBnn_resize:\fR out,in,width[%]>0,_height[%]>0,_depth[%]>0,_spectrum[%]>0,_interpolation\fR Add a '\fBresize\fR' layer to the current network. '\fBinterpolation\fR' can be \fB{ -1:None (memory content) | 0:None | 1:Nearest | 2:Average | 3:Linear | 4=Grid | 5=Bicubic | 6=Lanczos }\fR. \fBDefault values\fR: '\fBheight=depth=spectrum=100%\fR' and '\fBinterpolation=3\fR'. \fBnn_run:\fR out,in,"command",_width[%]>0,_height[%]>0,_depth[%]>0,_spectrum[%]>0\fR Add a '\fBrun\fR' layer to the current network. \fBDefault values\fR: '\fBwidth=height=depth=spectrum=100%\fR'. \fBnn_save:\fR 'filename.gmz',_include_trainer_data={ 0:No | 1:Yes }\fR Save current network as a .gmz file. '.gmz\fR' is mandatory extension, specifying another file extension will throw an error. \fBDefault value\fR: '\fBinclude_trainer_data=1\fR'. \fBnn_size:\fR Return size of the current network (i.e. number of stored parameters). \fBnn_split:\fR out0,out1,_out2,_out3,in,axis={ x | y | z | c },_size_out0>0,_size_out1>0,_size_out2>0,_size_out3>0\fR Add a '\fBsplit\fR' layer to the current network. \fBDefault values\fR: '\fBsize2=size1=size0\fR'. \fBnn_store:\fR 'variable_name',_include_trainer_data={ 0:No | 1:Yes }\fR Store current network into a variable. \fBDefault value\fR: '\fBinclude_trainer_data=1\fR'. \fBnn_sub:\fR out,in0,in1\fR Add a '\fBsub\fR' layer (element-wise subtraction) to the current network. '\fBin0\fR' or '\fBin1\fR' can be layer names or constant values (both cannot be constant values though). \fBnn_sum:\fR out,in,_is_average={ 0:No | 1:Yes },_axis={ 0 | x | y | z | c }\fR Add a '\fBsum\fR' layer (sum or average computation) to the current network. \fBDefault values\fR: '\fBis_average=0\fR' and '\fBaxis=0\fR'. \fBnn_tmmul:\fR out,in0,in1\fR Add a '\fBtmmul\fR' layer (matrix multiplication '\fBin0^t.in1\fR') to the current network. '\fBin0\fR' or '\fBin1\fR' must be of compatible size. \fBnn_tmmult:\fR out,in0,in1\fR Add a '\fBtmmult\fR' layer (matrix multiplication '\fBin0^t.in1^t\fR') to the current network. '\fBin0\fR' or '\fBin1\fR' must be of compatible size. \fBnn_transpose:\fR out,in\fR Add a '\fBtranspose\fR' layer (matrix transpose) to the current network. \fBnn_trainer:\fR out,loss,_optimizer,_"optimizer_params",_scheduler,_"scheduler_params"\fR Add a network trainer to the current network, with specified optimizer and scheduler. '\fBoptimizer\fR' can be \fB{ adam | adamax | dtschump | sgd | rmsprop }\fR. '\fBscheduler\fR' can be \fB{ constant | linear | exponential | adaptive }\fR. * Value of '\fBoptimizer_params\fR' depends on the chosen optimizer: '\fBadam\fR', '\fBadamax\fR': (learning_rate,beta1,beta2,weight_decay,clip_gradient_min,clip_gradient_max). '\fBdtschump\fR': ( learning_rate,momentum,weight_decay,clip_gradient_min,clip_gradient_max ). '\fBrmsprop\fR': ( learning_rate,momentum,beta,weight_decay,clip_gradient_min,clip_gradient_max ). '\fBsgd\fR': ( learning_rate,momentum,weight_decay,clip_gradient_min,clip_gradient_max ). * Value of '\fBscheduler_params\fR' depends on the chosen scheduler: '\fBconstant\fR' : (none). '\fBadaptive\fR' : ( lr_min,lr_max,nb_warmup_iterations,nb_cooldown_iterations,patience_down,factor_down,patience_up,factor_up ). \fBDefault values\fR: '\fBoptimizer=adam\fR', '\fBoptimizer_params=(default)\fR', '\fBscheduler=constant\fR' and '\fBscheduler_params=(default)\fR'. \fBnn_varname:\fR layer_name\fR Return the variable name used in the math evaluator to store the output of the specified network layer. \fB\fB11.15. Arrays, Tiles and Frames\fR \fB ------------------------\fR \fBarray:\fR M>0,_N>0,_expand_type={ 0:Min | 1:Max | 2:All }\fR Create MxN array from selected images. \fBDefault values\fR: '\fBN=M\fR' and '\fBexpand_type=0\fR'. \fBExample:\fR [#1] image.jpg array 3,2,2\fR \fBarray_fade:\fR M>0,_N>0,0<=_fade_start<=100,0<=_fade_end<=100,_expand_type={0:Min | 1:Max | 2:All}\fR Create MxN array from selected images. \fBDefault values\fR: '\fBN=M\fR', '\fBfade_start=60\fR', '\fBfade_end=90\fR' and '\fBexpand_type=1\fR'. \fBExample:\fR [#1] image.jpg array_fade 3,2\fR \fBarray_mirror:\fR N>=0,_dir={ 0:X | 1:Y | 2:XY | 3:Tri-XY },_expand_type={ 0:No | 1:Yes }\fR Create 2^Nx2^N array from selected images. \fBDefault values\fR: '\fBdir=2\fR' and '\fBexpand_type=0\fR'. \fBExample:\fR [#1] image.jpg array_mirror 2\fR \fBarray_random:\fR Ms>0,_Ns>0,_Md>0,_Nd>0\fR Create MdxNd array of tiles from selected MsxNs source arrays. \fBDefault values\fR: '\fBNs=Ms\fR', '\fBMd=Ms\fR' and '\fBNd=Ns\fR'. \fBExample:\fR [#1] image.jpg +array_random 8,8,15,10\fR \fBframe:\fR axes,size[%]>=0,_col1,...,_colN\fR Insert outer frame in selected images, along the specified axes. '\fBaxes\fR' can be \fB{ x | y | z | xy | xz | yz | xyz }\fR. \fBDefault value\fR: '\fBaxes=xy\fR', '\fBsize=10%\fR', '\fBcol1=col2=col3=col4=255\fR'. \fBExample:\fR [#1] image.jpg frame xy,10%,255,128,0\fR \fBframe_blur:\fR _sharpness>0,_size>=0,_smoothness,_shading,_blur\fR Draw RGBA-colored round frame in selected images. \fBDefault values\fR: '\fBsharpness=10\fR', '\fBsize=30\fR', '\fBsmoothness=0\fR', '\fBshading=1\fR' and '\fBblur=3%\fR'. \fBExample:\fR [#1] image.jpg frame_blur 3,30,8,10%\fR \fBframe_cube:\fR _depth>=0,_centering_x,_centering_y,_left_side={ 0:Normal | 1:Mirror-X | 2:Mirror-Y | 3:Mirror-XY },_right_side,_lower_side,_upper_side\fR Insert 3D frames in selected images. \fBDefault values\fR: '\fBdepth=1\fR', '\fBcentering_x=centering_y=0\fR' and '\fBleft_side=right_side,lower_side=upper_side=0\fR'. \fBExample:\fR [#1] image.jpg frame_cube ,\fR \fBframe_fuzzy:\fR size_x[%]>=0,_size_y[%]>=0,_fuzziness>=0,_smoothness[%]>=0,_R,_G,_B,_A\fR Draw RGBA-colored fuzzy frame in selected images. \fBDefault values\fR: '\fBsize_y=size_x\fR', '\fBfuzziness=5\fR', '\fBsmoothness=1\fR' and '\fBR=G=B=A=255\fR'. \fBExample:\fR [#1] image.jpg frame_fuzzy 20\fR \fBframe_painting:\fR _size[%]>=0,0<=_contrast<=1,_profile_smoothness[%]>=0,_R,_G,_B,_vignette_size[%]>=0,_vignette_contrast>=0,_defects_contrast>=0, 0<=_defects_density<=100,_defects_size>=0,_defects_smoothness[%]>=0,_serial_number\fR Add a painting frame to selected images. \fBDefault values\fR: '\fBsize=10%\fR', '\fBcontrast=0.4\fR', '\fBprofile_smoothness=6%\fR', '\fBR=225\fR', '\fBG=200\fR', '\fBB=120\fR', '\fBvignette_size=2%\fR', '\fBvignette_contrast=400\fR', '\fBdefects_contrast=50\fR', '\fBdefects_density=10\fR', '\fBdefects_size=1\fR', '\fBdefects_smoothness=0.5%\fR' and '\fBserial_number=123456789\fR'. \fBExample:\fR [#1] image.jpg frame_painting ,\fR \fBframe_pattern:\fR M>=3,_constrain_size={ 0:No | 1:Yes } |\fR M>=3,_[frame_image],_constrain_size={ 0:No | 1:Yes }\fR Insert the selected pattern frame into the selected images. \fBDefault values\fR: '\fBpattern=0\fR' and '\fBconstrain_size=0\fR'. \fBExample:\fR [#1] image.jpg frame_pattern 8\fR \fBframe_round:\fR size_x[%]>=0,size_y[%]>=0,radius[%]>=0,_smoothness[%]>=0,_col1,...,_colN\fR Insert an inner round frame in selected images. \fBDefault values\fR: '\fBsize_x=size_y=5%, 'radius=30%\fR', '\fBsmoothness=0\fR' and '\fBcol=0,0,0,255\fR'. \fBframe_seamless:\fR frame_size>=0,_patch_size>0,_blend_size>=0,_frame_direction={ 0:Inner (preserve image size) | 1:Outer }\fR Insert a frame into selected images so that tiling the resulting image makes the seams less visible. \fBDefault values\fR: '\fBpatch_size=7\fR', '\fBblend_size=5\fR' and '\fBframe_direction=1\fR'. \fBExample:\fR [#1] image.jpg +frame_seamless 30 array 2,2\fR \fBimg2ascii:\fR _charset,_analysis_scale>0,_analysis_smoothness[%]>=0,_synthesis_scale>0,_output_ascii_filename\fR Render selected images as binary ascii art. This command returns the list of widths and heights (expressed as a number of characters) for each selected image. \fBDefault values\fR: '\fBcharset=[ascii charset]\fR', '\fBanalysis_scale=16\fR', '\fBanalysis_smoothness=20%\fR', '\fBsynthesis_scale=16\fR' and '\fB_output_ascii_filename=[undefined]\fR'. \fBExample:\fR [#1] image.jpg img2ascii ,\fR \fBimagegrid:\fR M>0,_N>0\fR Create MxN image grid from selected images. \fBDefault value\fR: '\fBN=M\fR'. \fBExample:\fR [#1] image.jpg imagegrid 16\fR \fBimagegrid_hexagonal:\fR _resolution>0,0<=_outline<=1\fR Create a hexagonal grids from selected images. \fBDefault values\fR: '\fBresolution=32\fR', '\fBoutline=0.1\fR' and '\fBis_antialiased=1\fR'. \fBExample:\fR [#1] image.jpg imagegrid_hexagonal 24\fR \fBimagegrid_triangular:\fR pattern_width>=1,_pattern_height>=1,_pattern_type,0<=_outline_opacity<=1,_outline_color1,...\fR Create triangular grids from selected images. '\fBpattern type\fR' can be \fB{ 0:Horizontal | 1:Vertical | 2:Crossed | 3:Cube | 4:Decreasing | 5:Increasing }\fR. \fBDefault values\fR: '\fBpattern_width=24\fR', '\fBpattern_height=pattern_width\fR', '\fBpattern_type=0\fR', '\fBoutline_opacity=0.1\fR' and '\fBoutline_color1=0\fR'. \fBExample:\fR [#1] image.jpg imagegrid_triangular 6,10,3,0.5\fR \fBmap_sprites:\fR _nb_sprites>=1,_allow_rotation={ 0:None | 1:90 deg. | 2:180 deg. }\fR Map a set of sprites (defined as the '\fBnb_sprites\fR' latest images of the selection) to other selected images, according to the luminosity of their pixel values. \fBExample:\fR [#1] image.jpg rescale2d ,48 repeat 16 ball {8+2*$>},${-rgb} mul[-1] {(1+$>)/16} done map_sprites 16\fR \fBpack:\fR is_ratio_constraint={ 0:No | 1:Yes },_sort_criterion\fR Pack selected images into a single image. The returned status contains the list of new (x,y) offsets for each input image. Parameter '\fBis_ratio_constraint\fR' indicates whether the resulting image should tend toward a square. \fBDefault values\fR: '\fBis_ratio_constraint=0\fR' and '\fBsort_criterion=max(w,h)\fR'. \fBExample:\fR [#1] image.jpg repeat 10 +rescale2d[-1] 75% balance_gamma[-1] ${-rgb} done pack 0\fR \fBpuzzle:\fR _width>0,_height>0,_M>=1,_N>=1,_curvature,_centering,_connectors_variability,_resolution>=1\fR Generate a binary puzzle mask with the specified size and geometry. \fBDefault values\fR: '\fBwidth=height=512\fR', '\fBM=N=5\fR', '\fBcurvature=0.5\fR', '\fBcentering=0.5\fR', '\fBconnectors_variability=0.5\fR' and '\fBresolution=64\fR'. \fBExample:\fR [#1] puzzle ,\fR \fBrotate_tiles:\fR angle,_M>0,N>0\fR Apply MxN tiled-rotation effect on selected images. \fBDefault values\fR: '\fBM=8\fR' and '\fBN=M\fR'. \fBExample:\fR [#1] image.jpg to_rgba rotate_tiles 10,8 drop_shadow 10,10 display_rgba\fR \fBshift_tiles:\fR M>0,_N>0,_amplitude\fR Apply MxN tiled-shift effect on selected images. \fBDefault values\fR: '\fBN=M\fR' and '\fBamplitude=20\fR'. \fBExample:\fR [#1] image.jpg +shift_tiles 8,8,10\fR \fBtaquin:\fR M>0,_N>0,_remove_tile={ 0:None | 1:First | 2:Last | 3:Random },_relief,_border_thickness[%],_border_outline[%],_outline_color\fR Create MxN taquin puzzle from selected images. \fBDefault value\fR: '\fBN=M\fR', '\fBrelief=50\fR', '\fBborder_thickness=5\fR', '\fBborder_outline=0\fR' and '\fBremove_tile=0\fR'. \fBExample:\fR [#1] image.jpg +taquin 8\fR \fBtunnel:\fR _level>=0,_factor>0,_centering_x,_centering_y,_opacity,_angle\fR Apply tunnel effect on selected images. \fBDefault values\fR: '\fBlevel=9\fR', '\fBfactor=80%\fR', '\fBcentering_x=centering_y=0.5\fR', '\fBopacity=1\fR' and '\fBangle=0\fR' \fBExample:\fR [#1] image.jpg tunnel 20\fR \fB\fB11.16. Artistic\fR \fB --------\fR \fBboxfitting:\fR _min_box_size>=1,_max_box_size>=0,_initial_density>=0,_min_spacing>0\fR Apply box fitting effect on selected images, as shown on the web page: \fIhttp://www.complexification.net/gallery/machines/boxFittingImg/\fR. \fBDefault values\fR: '\fBmin_box_size=1\fR', '\fBmax_box_size=0\fR', '\fBinitial_density=0.25\fR' and '\fBmin_spacing=1\fR'. \fBExample:\fR [#1] image.jpg boxfitting ,\fR \fBbrushify:\fR [brush],_brush_nb_sizes>=1,0<=_brush_min_size_factor<=1,_brush_nb_orientations>=1,_brush_light_type,0<=_brush_light_strength<=1,_brush_opacity, _painting_density[%]>=0,0<=_painting_contours_coherence<=1,0<=_painting_orientation_coherence<=1,_painting_coherence_alpha[%]>=0, _painting_coherence_sigma[%]>=0,_painting_primary_angle,0<=_painting_angle_dispersion<=1\fR Apply specified brush to create painterly versions of specified images. '\fBbrush_light_type\fR' can be \fB{ 0:None | 1:Flat | 2:Darken | 3:Lighten | 4:Full }\fR. \fBDefault values\fR: '\fBbrush_nb_sizes=3\fR', '\fBbrush_min_size_factor=0.66\fR', '\fBbrush_nb_orientations=12\fR', '\fBbrush_light_type=0\fR', '\fBbrush_light_strength=0.25\fR', '\fBbrush_opacity=0.8\fR', '\fBpainting_density=20%\fR', '\fBpainting_contours_coherence=0.9\fR', '\fBpainting_orientation_coherence=0.9\fR', '\fBpainting_coherence_alpha=1\fR', '\fBpainting_coherence_sigma=1\fR', '\fBpainting_primary_angle=0\fR', '\fBpainting_angle_dispersion=0.2\fR' \fBExample:\fR [#1] image.jpg 40,40 gaussian[-1] 10,4 spread[-1] 10,0 brushify[0] [1],1\fR \fBcartoon:\fR _smoothness,_sharpening,_threshold>=0,_thickness>=0,_color>=0,quantization>0\fR Apply cartoon effect on selected images. \fBDefault values\fR: '\fBsmoothness=3\fR', '\fBsharpening=150\fR', '\fBthreshold=20\fR', '\fBthickness=0.25\fR', '\fBcolor=1.5\fR' and '\fBquantization=8\fR'. \fBExample:\fR [#1] image.jpg cartoon 3,50,10,0.25,3,16\fR \fBcolor_ellipses:\fR _count>0,_radius>=0,_opacity>=0\fR Add random colored ellipses to selected images. \fBDefault values\fR: '\fBcount=400\fR', '\fBradius=5\fR' and '\fBopacity=0.1\fR'. \fBExample:\fR [#1] image.jpg +color_ellipses ,,0.15\fR \fBcubism:\fR _density>=0,0<=_thickness<=50,_max_angle,_opacity,_smoothness>=0\fR Apply cubism effect on selected images. \fBDefault values\fR: '\fBdensity=50\fR', '\fBthickness=10\fR', '\fBmax_angle=75\fR', '\fBopacity=0.7\fR' and '\fBsmoothness=0\fR'. \fBExample:\fR [#1] image.jpg cubism ,\fR \fBdraw_whirl:\fR _amplitude>=0\fR Apply whirl drawing effect on selected images. \fBDefault value\fR: '\fBamplitude=100\fR'. \fBExample:\fR [#1] image.jpg draw_whirl ,\fR \fBdrop_shadow:\fR _offset_x[%],_offset_y[%],_smoothness[%]>=0,_curvature_x,_curvature_y,_expand_size={ 0:No | 1:Yes }\fR Drop shadow behind selected images. \fBDefault values\fR: '\fBoffset_x=20\fR', '\fBoffset_y=offset_x\fR', '\fBsmoothness=5\fR', '\fBcurvature=0\fR' and '\fBexpand_size=1\fR'. \fBExample:\fR [#1] image.jpg drop_shadow 10,20,5,0.5 expand. xy,20 display_rgba\fR \fBdrop_shadow:\fR _offset_x[%],_offset_y[%],_smoothness[%]>=0,curvature_x>=0,curvature_y>=0,_expand_size={ 0:No | 1:Yes },_output_separate_layers={ 0:No | 1:Yes }\fR Drop shadow behind selected images. \fBDefault values\fR: '\fBoffset_x=20\fR', '\fBoffset_y=offset_x\fR', '\fBsmoothness=5\fR', '\fBcurvature_x=curvature_y=0\fR', '\fBexpand_size=1\fR' and '\fBoutput_separate_layers=0\fR'. \fBExample:\fR [#1] image.jpg drop_shadow 10,20,5,0.5 display_rgba\fR \fBellipsionism:\fR _R[%]>0,_r[%]>0,_smoothness[%]>=0,_opacity,_outline>0,_density>0\fR Apply ellipsionism filter to selected images. \fBDefault values\fR: '\fBR=10\fR', '\fBr=3\fR', '\fBsmoothness=1%\fR', '\fBopacity=0.7\fR', '\fBoutline=8\fR' and '\fBdensity=0.6\fR'. \fBExample:\fR [#1] image.jpg ellipsionism ,\fR \fBfire_edges:\fR _edges>=0,0<=_attenuation<=1,_smoothness>=0,_threshold>=0,_nb_frames>0,_starting_frame>=0,frame_skip>=0\fR Generate fire effect from edges of selected images. \fBDefault values\fR: '\fBedges=0.7\fR', '\fBattenuation=0.25\fR', '\fBsmoothness=0.5\fR', '\fBthreshold=25\fR', '\fBnb_frames=1\fR', '\fBstarting_frame=20\fR' and '\fBframe_skip=0\fR'. \fBExample:\fR [#1] image.jpg fire_edges ,\fR \fBfractalize:\fR 0<=detail_level<=1\fR Randomly fractalize selected images. \fBDefault value\fR: '\fBdetail_level=0.8\fR' \fBExample:\fR [#1] image.jpg fractalize ,\fR \fBglow:\fR _amplitude>=0\fR Add soft glow on selected images. \fBDefault value\fR: '\fBamplitude=1%\fR'. \fBExample:\fR [#1] image.jpg glow ,\fR \fBhalftone:\fR nb_levels>=2,_size_dark>=2,_size_bright>=2,_shape={ 0:Square | 1:Diamond | 2:Circle | 3:inv-square | 4:inv-diamond | 5:inv-circle },_smoothness[%]>=0\fR Apply halftone dithering to selected images. \fBDefault values\fR: '\fBnb_levels=5\fR', '\fBsize_dark=8\fR', '\fBsize_bright=8\fR', '\fBshape=5\fR' and '\fBsmoothness=0\fR'. \fBExample:\fR [#1] image.jpg halftone ,\fR \fBhardsketchbw:\fR _amplitude>=0,_density>=0,_opacity,0<=_edge_threshold<=100,_is_fast={ 0:No | 1:Yes }\fR Apply hard B&W sketch effect on selected images. \fBDefault values\fR: '\fBamplitude=1000\fR', '\fBsampling=3\fR', '\fBopacity=0.1\fR', '\fBedge_threshold=20\fR' and '\fBis_fast=0\fR'. \fBExample:\fR [#1] image.jpg +hardsketchbw 200,70,0.1,10 median[-1] 2 +local reverse blur[-1] 3 blend[-2,-1] overlay done\fR \fBhearts:\fR _density>=0\fR Apply heart effect on selected images. \fBDefault value\fR: '\fBdensity=10\fR'. \fBExample:\fR [#1] image.jpg hearts ,\fR \fBhoughsketchbw:\fR _density>=0,_radius>0,0<=_threshold<=100,0<=_opacity<=1,_votesize[%]>0\fR Apply a Hough B&W sketch effect on selected images. \fBDefault values\fR: '\fBdensity=100\fR', '\fBradius=3\fR', '\fBthreshold=100\fR', '\fBopacity=0.1\fR' and '\fBvotesize=100%\fR'. \fBExample:\fR [#1] image.jpg +houghsketchbw ,\fR \fBlightrays:\fR 100<=_density<=0,_center_x[%],_center_y[%],_ray_length>=0,_ray_attenuation>=0\fR Generate ray lights from the edges of selected images. \fBDefault values\fR: '\fBdensity=50%\fR', '\fBcenter_x=50%\fR', '\fBcenter_y=50%\fR', '\fBray_length=0.9\fR' and '\fBray_attenuation=0.5\fR'. \fBExample:\fR [#1] image.jpg +lightrays , + cut 0,255\fR \fBlight_relief:\fR _ambient_light,_specular_lightness,_specular_size,_darkness,_light_smoothness,_xl,_yl,_zl,_zscale,_opacity_is_heightmap={ 0:No | 1:Yes }\fR Apply a relief light effect to selected images. \fBDefault values\fR: '\fBambient_light=0.3\fR', '\fBspecular_lightness=0.5\fR', '\fBspecular_size=0.2\fR', '\fBdarkness=0\fR', '\fBxl=0.2\fR', '\fByl=zl=0.5\fR', '\fBzscale=1\fR', '\fBopacity=1\fR' and '\fBopacity_is_heightmap=0\fR'. \fBExample:\fR [#1] image.jpg blur 2 light_relief 0.3,4,0.1,0\fR \fBlinify:\fR 0<=_density<=100,_spreading>=0,_resolution[%]>0,_line_opacity>=0,_line_precision>0,_mode={ 0:Subtractive | 1:Additive }\fR Apply linify effect on selected images. The algorithm is inspired from the one described on the webpage \fIhttp://linify.me/about\fR. \fBDefault values\fR: '\fBdensity=50\fR', '\fBspreading=2\fR', '\fBresolution=40%\fR', '\fBline_opacity=10\fR', '\fBline_precision=24\fR' and '\fBmode=0\fR'. \fBExample:\fR [#1] image.jpg linify 60\fR \fBmosaic:\fR 0<=_density<=100\fR Create random mosaic from selected images. \fBDefault values\fR: '\fBdensity=30\fR'. \fBExample:\fR [#1] image.jpg mosaic , +fill "I!=J(1) || I!=J(0,1)?[0,0,0]:I"\fR \fBold_photo:\fR Apply old photo effect on selected images. \fBExample:\fR [#1] image.jpg old_photo\fR \fBpencilbw:\fR _size>=0,_amplitude>=0\fR Apply B&W pencil effect on selected images. \fBDefault values\fR: '\fBsize=0.3\fR' and '\fBamplitude=60\fR'. \fBExample:\fR [#1] image.jpg pencilbw ,\fR \fBpixelsort:\fR _ordering={ +:Increasing | -:Decreasing },_axis={ x | y | z | xy | yx },_[sorting_criterion],_[mask]\fR Apply a '\fBpixel sorting\fR' algorithm on selected images, as described on the page: \fIhttp://satyarth.me/articles/pixel-sorting/\fR. \fBDefault values\fR: '\fBordering=+\fR', '\fBaxis=x\fR' and '\fBsorting_criterion=mask=(undefined)\fR'. \fBExample:\fR [#1] image.jpg +norm +ge[-1] 30% +pixelsort[0] +,y,[1],[2]\fR \fBpolaroid:\fR _size1>=0,_size2>=0\fR Create polaroid effect in selected images. \fBDefault values\fR: '\fBsize1=10\fR' and '\fBsize2=20\fR'. \fBExample:\fR [#1] image.jpg to_rgba polaroid 5,30 rotate 20 drop_shadow , drgba\fR \fBpolygonize:\fR _warp_amplitude>=0,_smoothness[%]>=0,_min_area[%]>=0,_resolution_x[%]>0,_resolution_y[%]>0\fR Apply polygon effect on selected images. \fBDefault values\fR: '\fBwarp_amplitude=300\fR', '\fBsmoothness=2%\fR', '\fBmin_area=0.1%\fR', '\fBresolution_x=resolution_y=10%\fR'. \fBExample:\fR [#1] image.jpg +polygonize 100,10 fill[-1] "I!=J(1) || I!=J(0,1)?[0,0,0]:I"\fR \fBposter_edges:\fR 0<=_edge_threshold<=100,0<=_edge_shade<=100,_edge_thickness>=0,_edge_antialiasing>=0,0<=_posterization_level<=15,_posterization_antialiasing>=0\fR Apply poster edges effect on selected images. \fBDefault values\fR: '\fBedge_threshold=40\fR', '\fBedge_shade=5\fR', '\fBedge_thickness=0.5\fR', '\fBedge_antialiasing=10\fR', '\fBposterization_level=12\fR' and '\fBposterization_antialiasing=0\fR'. \fBExample:\fR [#1] image.jpg poster_edges ,\fR \fBposter_hope:\fR _smoothness>=0\fR Apply Hope stencil poster effect on selected images. \fBDefault value\fR: '\fBsmoothness=3\fR'. \fBExample:\fR [#1] image.jpg poster_hope ,\fR \fBrodilius:\fR 0<=_amplitude<=100,_0<=thickness<=100,_sharpness>=0,_nb_orientations>0,_offset,_color_mode={ 0:Darker | 1:Brighter }\fR Apply rodilius (fractalius-like) filter on selected images. \fBDefault values\fR: '\fBamplitude=10\fR', '\fBthickness=10\fR', '\fBsharpness=400\fR', '\fBnb_orientations=7\fR', '\fBoffset=0\fR' and '\fBcolor_mode=1\fR'. \fBExample:\fR [#1] image.jpg rodilius 12,10,300,10 normalize_local 10,6\fR [#2] image.jpg normalize_local 10,16 rodilius 10,4,400,16 smooth 60,0,1,1,4 normalize_local 10,16\fR \fBsketchbw:\fR _nb_angles>0,_start_angle,_angle_range>=0,_length>=0,_threshold>=0,_opacity,_bgfactor>=0,_density>0,_sharpness>=0,_anisotropy>=0,_smoothness>=0, _coherence>=0,_is_boost={ 0:No | 1:Yes },_is_curved={ 0:No | 1:Yes }\fR Apply sketch effect to selected images. \fBDefault values\fR: '\fBnb_angles=2\fR', '\fBstart_angle=45\fR', '\fBangle_range=180\fR', '\fBlength=30\fR', '\fBthreshold=3\fR', '\fBopacity=0.03\fR', '\fBbgfactor=0\fR', '\fBdensity=0.6\fR', '\fBsharpness=0.1\fR', '\fBanisotropy=0.6\fR', '\fBsmoothness=0.25\fR', '\fBcoherence=1\fR', '\fBis_boost=0\fR' and '\fBis_curved=1\fR'. \fBExample:\fR [#1] image.jpg +sketchbw 1 reverse blur[-1] 3 blend[-2,-1] overlay\fR \fBsponge:\fR _size>0\fR Apply sponge effect on selected images. \fBDefault value\fR: '\fBsize=13\fR'. \fBExample:\fR [#1] image.jpg sponge ,\fR \fBstained_glass:\fR _edges[%]>=0, shading>=0, is_thin_separators={ 0:No | 1:Yes }\fR Generate stained glass from selected images. \fBDefault values\fR: '\fBedges=40%\fR', '\fBshading=0.2\fR' and '\fBis_precise=0\fR'. \fBExample:\fR [#1] image.jpg stained_glass 20%,1 cut 0,20\fR \fBstars:\fR _density[%]>=0,_depth>=0,_size>0,_nb_branches>=1,0<=_thickness<=1,_smoothness[%]>=0,_R,_G,_B,_opacity\fR Add random stars to selected images. \fBDefault values\fR: '\fBdensity=10%\fR', '\fBdepth=1\fR', '\fBsize=32\fR', '\fBnb_branches=5\fR', '\fBthickness=0.38\fR', '\fBsmoothness=0.5\fR', '\fBR=G=B=200\fR' and '\fBopacity=1\fR'. \fBExample:\fR [#1] image.jpg stars ,\fR \fBstencil:\fR _radius[%]>=0,_smoothness>=0,_iterations>=0\fR Apply stencil filter on selected images. \fBDefault values\fR: '\fBradius=3\fR', '\fBsmoothness=1\fR' and '\fBiterations=8\fR'. \fBExample:\fR [#1] image.jpg +norm stencil. 2,1,4 +mul rm[0]\fR \fBstencilbw:\fR _edges>=0,_smoothness>=0\fR Apply B&W stencil effect on selected images. \fBDefault values\fR: '\fBedges=15\fR' and '\fBsmoothness=10\fR'. \fBExample:\fR [#1] image.jpg +stencilbw 40,4\fR \fBstylize:\fR [style_image],_fidelity_finest,_fidelity_coarsest,_fidelity_smoothness_finest>=0,_fidelity_smoothnes_coarsest>=0,0<=_fidelity_chroma<=1,_init_type, _init_resolution>=0,init_max_gradient>=0,_patch_size_analysis>0,_patch_size_synthesis>0,_patch_size_synthesis_final>0,_nb_matches_finest>=0, _nb_matches_coarsest>=0,_penalize_repetitions>=0,_matching_precision>=0,_scale_factor>1,_skip_finest_scales>=0,_"image_matching_command"\fR Transfer the colors and the textures from the specified style image to the selected images, using a multi-scale patch-matching algorithm. If instant display window[0] is opened, the steps of the image synthesis are displayed on it. '\fBinit_type\fR' can be \fB{ 0:Best-match | 1:Identity | 2:Randomized }\fR. \fBDefault values\fR: '\fBfidelity_finest=0.5\fR', '\fBfidelity_coarsest=2\fR', '\fBfidelity_smoothness_finest=3\fR', '\fBfidelity_smoothness_coarsest=0.5\fR', '\fBfidelity_chroma=0.1\fR', '\fBinit_type=0\fR', '\fBinit_resolution=16\fR', '\fBinit_max_gradient=0\fR', '\fBpatch_size_analysis=5\fR', '\fBpatch_size_synthesis=5\fR', '\fBpatch_size_synthesis_final=5\fR', '\fBnb_matches_finest=2\fR', '\fBnb_matchesc_coarsest=30\fR', '\fBpenalize_repetitions=2\fR', '\fBmatching_precision=2\fR', '\fBscale_factor=1.85\fR', '\fBskip_finest_scales=0\fR' and 'image_matching_command'="s c,-3 transfer_pca[0] [2] b[0,2] xy,0.7 n[0,2] 0,255 n[1, 2] 0,200 a[0,1] c a[1,2] c"'. \fBtetris:\fR _scale>0\fR Apply tetris effect on selected images. \fBDefault value\fR: '\fBscale=10\fR'. \fBExample:\fR [#1] image.jpg +tetris 10\fR \fBwarhol:\fR _M>0,_N>0,_smoothness>=0,_color>=0\fR Create MxN Andy Warhol-like artwork from selected images. \fBDefault values\fR: '\fBM=3\fR', '\fBN=M\fR', '\fBsmoothness=2\fR' and '\fBcolor=20\fR'. \fBExample:\fR [#1] image.jpg warhol 3,3,3,40\fR \fBweave:\fR _density>=0,0<=_thickness<=100,0<=_shadow<=100,_shading>=0,_fibers_amplitude>=0,_fibers_smoothness>=0,_angle,-1<=_x_curvature<=1,-1<=_y_curvature<=1\fR Apply weave effect to the selected images. '\fBangle\fR' can be \fB{ 0:0 deg. | 1:22.5 deg. | 2:45 deg. | 3:67.5 deg. }\fR. \fBDefault values\fR: '\fBdensity=6\fR', '\fBthickness=65\fR', '\fBshadow=40\fR', '\fBshading=0.5\fR', '\fBfibers_amplitude=0\fR', _'fibers_smoothness=0', '\fBangle=0\fR' and '\fBcurvature_x=curvature_y=0\fR' \fBExample:\fR [#1] image.jpg weave ,\fR \fBwhirls:\fR _texture>=0,_smoothness>=0,_darkness>=0,_lightness>=0\fR Add random whirl texture to selected images. \fBDefault values\fR: '\fBtexture=3\fR', '\fBsmoothness=6\fR', '\fBdarkness=0.5\fR' and '\fBlightness=1.8\fR'. \fBExample:\fR [#1] image.jpg whirls ,\fR \fB\fB11.17. Warpings\fR \fB --------\fR \fBdeform:\fR _amplitude[%]>=0,_interpolation,_boundary_conditions\fR Apply random smooth deformation on selected images. '\fBinterpolation\fR' can be \fB{ 0:None | 1:Linear | 2:Bicubic }\fR. '\fBboundary_conditions\fR' can be \fB{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR. \fBDefault values\fR: '\fBamplitude=10\fR', '\fBinterpolation=1\fR' and '\fBboundary_conditions=3\fR'. \fBExample:\fR [#1] image.jpg +deform[0] 10 +deform[0] 20\fR \fBeuclidean2polar:\fR _center_x[%],_center_y[%],_stretch_factor>0,_boundary_conditions={ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR Apply euclidean to polar transform on selected images. \fBDefault values\fR: '\fBcenter_x=center_y=50%\fR', '\fBstretch_factor=1\fR' and '\fBboundary_conditions=3\fR'. \fBExample:\fR [#1] image.jpg +euclidean2polar ,\fR \fBequirectangular2nadirzenith:\fR Transform selected equirectangular images to nadir/zenith rectilinear projections. \fBfisheye:\fR _center_x,_center_y,0<=_radius<=100,_amplitude>=0\fR Apply fish-eye deformation on selected images. \fBDefault values\fR: '\fBx=y=50\fR', '\fBradius=50\fR' and '\fBamplitude=1.2\fR'. \fBExample:\fR [#1] image.jpg +fisheye ,\fR \fBflower:\fR _amplitude,_frequency,_offset_r[%],_angle,_center_x[%],_center_y[%],_boundary_conditions={ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR Apply flower deformation on selected images. \fBDefault values\fR: '\fBamplitude=30\fR', '\fBfrequency=6\fR', '\fBoffset_r=0\fR', '\fBangle=0\fR', '\fBcenter_x=center_y=50%\fR' and '\fBboundary_conditions=3\fR'. \fBExample:\fR [#1] image.jpg +flower ,\fR \fBkaleidoscope:\fR _center_x[%],_center_y[%],_radius,_angle,_boundary_conditions={ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR Create kaleidoscope effect from selected images. \fBDefault values\fR: '\fBcenter_x=center_y=50%\fR', '\fBradius=100\fR', '\fBangle=30\fR' and '\fBboundary_conditions=3\fR'. \fBExample:\fR [#1] image.jpg kaleidoscope ,\fR \fBmap_sphere:\fR _width>0,_height>0,_radius,_dilation>0,_fading>=0,_fading_power>=0\fR Map selected images on a sphere. \fBDefault values\fR: '\fBwidth=height=512\fR', '\fBradius=100\fR', '\fBdilation=0.5\fR', '\fBfading=0\fR' and '\fBfading_power=0.5\fR'. \fBExample:\fR [#1] image.jpg map_sphere ,\fR \fBnadirzenith2equirectangular:\fR Transform selected nadir/zenith rectilinear projections to equirectangular images. \fBpolar2euclidean:\fR _center_x[%],_center_y[%],_stretch_factor>0,_boundary_conditions={ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR Apply polar to euclidean transform on selected images. \fBDefault values\fR: '\fBcenter_x=center_y=50%\fR', '\fBstretch_factor=1\fR' and '\fBboundary_conditions=3\fR'. \fBExample:\fR [#1] image.jpg +euclidean2polar ,\fR \fBraindrops:\fR _amplitude,_density>=0,_wavelength>=0,_merging_steps>=0\fR Apply raindrops deformation on selected images. \fBDefault values\fR: '\fBamplitude=80\fR','\fBdensity=0.1\fR', '\fBwavelength=1\fR' and '\fBmerging_steps=0\fR'. \fBExample:\fR [#1] image.jpg +raindrops ,\fR \fBripple:\fR _amplitude,_bandwidth,_shape={ 0:Block | 1:Triangle | 2:Sine | 3:Sine+ | 4:Random },_angle,_offset\fR Apply ripple deformation on selected images. \fBDefault values\fR: '\fBamplitude=10\fR', '\fBbandwidth=10\fR', '\fBshape=2\fR', '\fBangle=0\fR' and '\fBoffset=0\fR'. \fBExample:\fR [#1] image.jpg +ripple ,\fR \fBrotoidoscope:\fR _center_x[%],_center_y[%],_tiles>0,_smoothness[%]>=0,_boundary_conditions={ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR Create rotational kaleidoscope effect from selected images. \fBDefault values\fR: '\fBcenter_x=center_y=50%\fR', '\fBtiles=10\fR', '\fBsmoothness=1\fR' and '\fBboundary_conditions=3\fR'. \fBExample:\fR [#1] image.jpg +rotoidoscope ,\fR \fBspherize:\fR _radius[%]>=0,_strength,_smoothness[%]>=0,_center_x[%],_center_y[%],_ratio_x/y>0,_angle,_interpolation\fR Apply spherize effect on selected images. \fBDefault values\fR: '\fBradius=50%\fR', '\fBstrength=1\fR', '\fBsmoothness=0\fR', '\fBcenter_x=center_y=50%\fR', '\fBratio_x/y=1\fR', '\fBangle=0\fR' and '\fBinterpolation=1\fR'. \fBExample:\fR [#1] image.jpg grid 5%,5%,0,0,0.6,255 spherize ,\fR \fBsymmetrize:\fR _x[%],_y[%],_angle,_boundary_conditions={ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror },_is_antisymmetry={ 0:No | 1:Yes },_swap_sides={ 0:No | 1:Yes }\fR Symmetrize selected images with respect to the specified axis. \fBDefault values\fR: '\fBx=y=50%\fR', '\fBangle=90\fR', '\fBboundary_conditions=3\fR', '\fBis_antisymmetry=0\fR' and '\fBswap_sides=0\fR'. \fBExample:\fR [#1] image.jpg +symmetrize 50%,50%,45 +symmetrize[-1] 50%,50%,-45\fR \fBtransform_polar:\fR "expr_radius",_"expr_angle",_center_x[%],_center_y[%],_boundary_conditions={ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR Apply user-defined transform on polar representation of selected images. \fBDefault values\fR: '\fBexpr_radius=R-r\fR', '\fBexpr_rangle=a\fR', '\fBcenter_x=center_y=50%\fR' and '\fBboundary_conditions=3\fR'. \fBExample:\fR [#1] image.jpg +transform_polar[0] R*(r/R)^2,a +transform_polar[0] r,2*a\fR \fBtwirl:\fR _amplitude,_center_x[%],_center_y[%],_boundary_conditions={ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR Apply twirl deformation on selected images. \fBDefault values\fR: '\fBamplitude=1\fR', '\fBcenter_x=center_y=50%\fR' and '\fBboundary_conditions=3\fR'. \fBExample:\fR [#1] image.jpg twirl 0.6\fR \fBwarp (+):\fR [warping_field],_mode,_interpolation,_boundary_conditions,_nb_frames>0\fR Warp selected images with specified displacement field. '\fBmode\fR' can be \fB{ 0:Backward-absolute | 1:Backward-relative | 2:Forward-absolute | 3:Forward-relative }\fR. '\fBinterpolation\fR' can be \fB{ 0:Nearest-neighbor | 1:Linear | 2:Cubic }\fR. '\fBboundary_conditions\fR' can be \fB{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR. \fBDefault values\fR: '\fBmode=0\fR', '\fBinterpolation=1\fR', '\fBboundary_conditions=0\fR' and '\fBnb_frames=1\fR'. \fBExample:\fR [#1] image.jpg 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*(!c?cos(4*A):sin(8*A))' warp[-2] [-1],1,1,0 quiver[-1] [-1], 10,1,1,1,100\fR \fBTutorial: \fR\fIhttps://gmic.eu/oldtutorial/_warp\fR \fBwarp_patch:\fR [displacement_map],patch_width>=1,_patch_height>=1,_patch_depth>=1,_std_factor>0,_boundary_conditions,_fast_approximation={ 0:No | 1:Yes }\fR Patch-warp selected images, with specified 2D or 3D displacement map (in backward-absolute mode). Argument '\fBstd_factor\fR' sets the std of the gaussian weights for the patch overlap, equal to '\fBstd = std_factor*patch_size\fR'. '\fBboundary_conditions\fR' can be \fB{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR. \fBDefault values\fR: '\fBstd_factor=0.3\fR', '\fBboundary_conditions=3\fR' and '\fBfast_approximation=0\fR'. \fBwarp_perspective:\fR _x-angle,_y-angle,_zoom>0,_x-center,_y-center,_boundary_conditions={ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR Warp selected images with perspective deformation. \fBDefault values\fR: '\fBx-angle=1.5\fR', '\fBy-angle=0\fR', '\fBzoom=1\fR', '\fBx-center=y-center=50\fR' and '\fBboundary_conditions=2\fR'. \fBExample:\fR [#1] image.jpg warp_perspective ,\fR \fBwarp_rbf:\fR xs0[%],ys0[%],xt0[%],yt0[%],...,xsN[%],ysN[%],xtN[%],ytN[%]\fR Warp selected images using RBF-based interpolation. Each argument (xsk,ysk)-(xtk,ytk) corresponds to the coordinates of a keypoint respectively on the source and target images. The set of all keypoints define the overall image deformation. \fBExample:\fR [#1] image.jpg +warp_rbf 0,0,0,0,100%,0,100%,0,100%,100%,100%,100%,0,100%,0,100%,50%,50%,70%,50%,25%,25%,25%,75%\fR \fBwarp_seamless:\fR [displacement_map],_sigma[%]>0,_blend_dimension={ 0:Auto | 1:1D | 2:2D | 3:3D }\fR Warp selected 2D or 3D images by specified displacement field, using seamless blending. \fBDefault values\fR: '\fBsigma=5%\fR' and '\fBblend_dimension=0\fR'. \fBExample:\fR [#1] sp colorful,512 100%,100%,1,2,[x,y] l. { s xy,8 sort_list +,u append_tiles , } +warp[0] [1] +warp_seamless[0] [1]\fR \fBwater:\fR _amplitude,_smoothness>=0,_angle\fR Apply water deformation on selected images. \fBDefault values\fR: '\fBamplitude=30\fR', '\fBsmoothness=1.5\fR' and '\fBangle=45\fR'. \fBExample:\fR [#1] image.jpg water ,\fR \fBwave:\fR _amplitude>=0,_frequency>=0,_center_x,_center_y\fR Apply wave deformation on selected images. \fBDefault values\fR: '\fBamplitude=4\fR', '\fBfrequency=0.4\fR' and '\fBcenter_x=center_y=50\fR'. \fBExample:\fR [#1] image.jpg wave ,\fR \fBwind:\fR _amplitude>=0,_angle,0<=_attenuation<=1,_threshold\fR Apply wind effect on selected images. \fBDefault values\fR: '\fBamplitude=20\fR', '\fBangle=0\fR', '\fBattenuation=0.7\fR' and '\fBthreshold=20\fR'. \fBExample:\fR [#1] image.jpg +wind ,\fR \fBzoom:\fR _factor,_cx,_cy,_cz,_boundary_conditions={ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR Apply zoom factor to selected images. \fBDefault values\fR: '\fBfactor=1\fR', '\fBcx=cy=cz=0.5\fR' and '\fBboundary_conditions=0\fR'. \fBExample:\fR [#1] image.jpg +zoom[0] 0.6 +zoom[0] 1.5\fR \fB\fB11.18. Degradations\fR \fB ------------\fR \fBcracks:\fR 0<=_density<=100,_is_relief={ 0:No | 1:Yes },_opacity,_color1,...\fR Draw random cracks on selected images with specified color. \fBDefault values\fR: '\fBdensity=25\fR', '\fBis_relief=0\fR', '\fBopacity=1\fR' and '\fBcolor1=0\fR'. \fBExample:\fR [#1] image.jpg +cracks ,\fR \fBlight_patch:\fR _density>0,_darkness>=0,_lightness>=0\fR Add light patches to selected images. \fBDefault values\fR: '\fBdensity=10\fR', '\fBdarkness=0.9\fR' and '\fBlightness=1.7\fR'. \fBExample:\fR [#1] image.jpg +light_patch 20,0.9,4\fR \fBpixelate:\fR _scale_x>0,_scale_y>0,_scale_z>0\fR Pixelate selected images with specified scales. \fBDefault values\fR: '\fBscale_x=20\fR' and '\fBscale_y=scale_z=scale_x\fR'. \fBExample:\fR [#1] image.jpg +pixelate ,\fR \fBscanlines:\fR _amplitude,_bandwidth,_shape={ 0:Block | 1:Triangle | 2:Sine | 3:Sine+ | 4:Random },_angle,_offset\fR Apply a scanlines effect to selected images. \fBDefault values\fR: '\fBamplitude=60\fR', '\fBbandwidth=2\fR', '\fBshape=0\fR', '\fBangle=0\fR' and '\fBoffset=0\fR'. \fBExample:\fR [#1] image.jpg +scanlines ,\fR \fBshade_stripes:\fR _frequency>=0,_direction={ 0:Horizontal | 1:Vertical },_darkness>=0,_lightness>=0\fR Add shade stripes to selected images. \fBDefault values\fR: '\fBfrequency=5\fR', '\fBdirection=1\fR', '\fBdarkness=0.8\fR' and '\fBlightness=2\fR'. \fBExample:\fR [#1] image.jpg +shade_stripes 30\fR \fBshadow_patch:\fR _opacity>=0\fR Add shadow patches to selected images. \fBDefault value\fR: '\fBopacity=0.7\fR'. \fBExample:\fR [#1] image.jpg +shadow_patch 0.4\fR \fBshuffle:\fR Shuffle vectors of selected images with Fisher-Yates algorithm, as described in \fIhttps://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle\fR. \fBExample:\fR [#1] uniform_distribution 8,3 shuffle\fR \fBspread:\fR _dx[%]>=0,_dy[%]>=0,_dz[%]>=0\fR Spread pixel values of selected images randomly along x,y and z. \fBDefault values\fR: '\fBdx=3\fR', '\fBdy=dx\fR' and '\fBdz=0\fR'. \fBExample:\fR [#1] image.jpg +spread 3\fR \fBstripes_y:\fR _frequency>=0\fR Add vertical stripes to selected images. \fBDefault value\fR: '\fBfrequency=10\fR'. \fBExample:\fR [#1] image.jpg +stripes_y ,\fR \fBtexturize_canvas:\fR _amplitude>=0,_fibrousness>=0,_emboss_level>=0\fR Add paint canvas texture to selected images. \fBDefault values\fR: '\fBamplitude=20\fR', '\fBfibrousness=3\fR' and '\fBemboss_level=0.6\fR'. \fBExample:\fR [#1] image.jpg +texturize_canvas ,\fR \fBtexturize_paper:\fR Add paper texture to selected images. \fBExample:\fR [#1] image.jpg +texturize_paper\fR \fBvignette:\fR _strength>=0,0<=_radius_min<=100,0<=_radius_max<=100\fR Add vignette effect to selected images. \fBDefault values\fR: '\fBstrength=100\fR', '\fBradius_min=70\fR' and '\fBradius_max=90\fR'. \fBExample:\fR [#1] image.jpg vignette ,\fR \fBwatermark_visible:\fR _text,0<_opacity<1,_{ size>0 | font },_angle,_mode={ 0:Remove | 1:Add },_smoothness>=0\fR Add or remove a visible watermark on selected images (value range must be [0,255]). \fBDefault values\fR: '\fBtext=(c) G'MIC\fR', '\fBopacity=0.3\fR', '\fBsize=53\fR', '\fBangle=25\fR', '\fBmode=1\fR' and '\fBsmoothness=0\fR'. \fBExample:\fR [#1] image.jpg watermark_visible ,0.7\fR \fB\fB11.19. Blending and Fading\fR \fB -------------------\fR \fBblend:\fR [layer],blending_mode,_opacity[%],_selection_is={ 0:Base-layers | 1:Top-layers } |\fR blending_mode,_opacity[%]\fR Blend selected G,GA,RGB or RGBA images by specified layer or blend all selected images together, using specified blending mode. '\fBblending_mode\fR' can be { add | alpha | and | average | blue | burn | darken | difference | divide | dodge | edges | exclusion | freeze | grainextract | grainmerge | green | hardlight | hardmix | hue | interpolation | lchlightness | lighten | lightness | linearburn | linearlight | luminance | multiply | negation | or | overlay | pinlight | red | reflect | saturation | screen | seamless | seamless_mixed | shapeareamax | shapeareamax0 | shapeareamin | shapeareamin0 | shapeaverage | shapeaverage0 | shapemedian | shapemedian0 | shapemin | shapemin0 | shapemax | shapemax0 | shapeprevalent | softburn | softdodge | softlight | stamp | subtract | value | vividlight | xor }. '\fBopacity\fR' must be in range '\fB[0,1]\fR' (or '\fB[0%,100%]\fR'). \fBDefault values\fR: '\fBblending_mode=alpha\fR', '\fBopacity=1\fR' and '\fBselection_is=0\fR'. \fBExample:\fR [#1] image.jpg +drop_shadow , rescale2d[-1] ,200 rotate[-1] 20 +blend alpha display_rgba[-2]\fR [#2] image.jpg testimage2d {w},{h} blend overlay\fR [#3] command "ex : $""=arg repeat $""# +blend[0,1] ${arg{$>+1}} text_outline[-1] Mode:\" \"${arg{$>+1}},2,2,23,2,1,255 done" image.jpg testimage2d {w},{h} ex add,alpha,and,average,blue,burn,darken\fR [#4] command "ex : $""=arg repeat $""# +blend[0,1] ${arg{$>+1}} text_outline[-1] Mode:\" \"${arg{$>+1}},2,2,23,2,1,255 done" image.jpg testimage2d {w},{h} ex difference,divide,dodge,exclusion,freeze,grainextract,grainmerge\fR [#5] command "ex : $""=arg repeat $""# +blend[0,1] ${arg{$>+1}} text_outline[-1] Mode:\" \"${arg{$>+1}},2,2,23,2,1,255 done" image.jpg testimage2d {w},{h} ex green,hardlight,hardmix,hue,interpolation,lighten,lightness\fR [#6] command "ex : $""=arg repeat $""# +blend[0,1] ${arg{$>+1}} text_outline[-1] Mode:\" \"${arg{$>+1}},2,2,23,2,1,255 done" image.jpg testimage2d {w},{h} ex linearburn,linearlight,luminance,multiply,negation,or,overlay\fR [#7] command "ex : $""=arg repeat $""# +blend[0,1] ${arg{$>+1}} text_outline[-1] Mode:\" \"${arg{$>+1}},2,2,23,2,1,255 done" image.jpg testimage2d {w},{h} ex pinlight,red,reflect,saturation,screen,shapeaverage,softburn\fR [#8] command "ex : $""=arg repeat $""# +blend[0,1] ${arg{$>+1}} text_outline[-1] Mode:\" \"${arg{$>+1}},2,2,23,2,1,255 done" image.jpg testimage2d {w},{h} ex softdodge,softlight,stamp,subtract,value,vividlight,xor\fR \fBnblend:\fR [layer],blending_mode,_opacity[%],_selection_is={ 0:Base-layers | 1:Top-layers } |\fR blending_mode,_opacity[%]\fR \fBblend_edges:\fR smoothness[%]>=0\fR Blend selected images together using '\fBedges\fR' mode. \fBExample:\fR [#1] image.jpg testimage2d {w},{h} +blend_edges 0.8\fR \fBblend_fade:\fR [fading_shape]\fR Blend selected images together using specified fading shape. \fBExample:\fR [#1] image.jpg testimage2d {w},{h} 100%,100%,1,1,'cos(y/10)' normalize[-1] 0,1 +blend_fade[0,1] [2]\fR \fBblend_median:\fR Blend selected images together using '\fBmedian\fR' mode. \fBExample:\fR [#1] image.jpg testimage2d {w},{h} +mirror[0] y +blend_median\fR \fBblend_seamless:\fR _is_mixed_mode={ 0:No | 1:Yes },_inner_fading[%]>=0,_outer_fading[%]>=0\fR Blend selected images using a seamless blending mode (Poisson-based). \fBDefault values\fR: '\fBis_mixed=0\fR', '\fBinner_fading=0\fR' and '\fBouter_fading=100%\fR'. \fBfade_diamond:\fR 0<=_start<=100,0<=_end<=100\fR Create diamond fading from selected images. \fBDefault values\fR: '\fBstart=80\fR' and '\fBend=90\fR'. \fBExample:\fR [#1] image.jpg testimage2d {w},{h} +fade_diamond 80,85\fR \fBfade_linear:\fR _angle,0<=_start<=100,0<=_end<=100\fR Create linear fading from selected images. \fBDefault values\fR: '\fBangle=45\fR', '\fBstart=30\fR' and '\fBend=70\fR'. \fBExample:\fR [#1] image.jpg testimage2d {w},{h} +fade_linear 45,48,52\fR \fBfade_radial:\fR 0<=_start<=100,0<=_end<=100\fR Create radial fading from selected images. \fBDefault values\fR: '\fBstart=30\fR' and '\fBend=70\fR'. \fBExample:\fR [#1] image.jpg testimage2d {w},{h} +fade_radial 30,70\fR \fBfade_x:\fR 0<=_start<=100,0<=_end<=100\fR Create horizontal fading from selected images. \fBDefault values\fR: '\fBstart=30\fR' and '\fBend=70\fR'. \fBExample:\fR [#1] image.jpg testimage2d {w},{h} +fade_x 30,70\fR \fBfade_y:\fR 0<=_start<=100,0<=_end<=100\fR Create vertical fading from selected images. \fBDefault values\fR: '\fBstart=30\fR' and '\fBend=70\fR'. \fBExample:\fR [#1] image.jpg testimage2d {w},{h} +fade_y 30,70\fR \fBfade_z:\fR 0<=_start<=100,0<=_end<=100\fR Create transversal fading from selected images. \fBDefault values\fR: '\fBstart=30\fR' and '\fBend=70\fR'. \fBsub_alpha:\fR [base_image],0<=_minimize_alpha<=1\fR Compute the alpha-channel difference (opposite of alpha blending) between the selected images and the specified base image. The alpha difference A-B is defined as the image having '\fBminimal\fR' opacity, such that alpha_blend(B,A-B) = A. The '\fBminimize_alpha\fR' argument is used to relax the alpha minimality constraint. When set to '\fB1\fR', alpha is constrained to be minimal. When set to '\fB0\fR', alpha is maximal (i.e. '\fB255\fR'). \fBDefault value\fR: '\fBminimize_alpha=1\fR'. \fBExample:\fR [#1] image.jpg testimage2d {w},{h} +sub_alpha[0] [1] display_rgba\fR \fB\fB11.20. Image Sequences and Videos\fR \fB --------------------------\fR \fBanimate:\fR filter_name,"param1_start,...,paramN_start","param1_end,...,paramN_end",nb_frames>=0,_output_frames={ 0:No | 1:Yes },_output_filename |\fR delay>0,_back and forth={ 0:No | 1:Yes }\fR Animate filter from starting parameters to ending parameters or animate selected images in a display window. \fBDefault value\fR: '\fBdelay=30\fR'. \fBExample:\fR [#1] image.jpg animate flower,"0,3","20,8",9\fR \fBapply_camera:\fR _"command",_camera_index>=0,_skip_frames>=0,_output_filename\fR Apply specified command on live camera stream, and display it on display window [0]. This command requires features from the OpenCV library (not enabled in G'MIC\fR by default). \fBDefault values\fR: '\fBcommand=""\fR', '\fBcamera_index=0\fR' (default camera), '\fBskip_frames=0\fR' and '\fBoutput_filename=""\fR'. \fBapply_files:\fR "filename_pattern",_"command",_first_frame>=0,_last_frame={ >=0 | -1:Last },_frame_step>=1,_output_filename\fR Apply a G'MIC\fR command on specified input image files, in a streamed way. If a display window is opened, rendered frames are displayed in it during processing. The output filename may have extension '\fB.avi\fR' or '\fB.mp4\fR' (saved as a video), or any other usual image file extension (saved as a sequence of images). \fBDefault values\fR: '\fBcommand=(undefined)\fR', '\fBfirst_frame=0\fR', '\fBlast_frame=-1\fR', '\fBframe_step=1\fR' and '\fBoutput_filename=(undefined)\fR'. \fBapply_video:\fR video_filename,_"command",_first_frame>=0,_last_frame={ >=0 | -1:Last },_frame_step>=1,_output_filename\fR Apply a G'MIC\fR command on all frames of the specified input video file, in a streamed way. If a display window is opened, rendered frames are displayed in it during processing. The output filename may have extension '\fB.avi\fR' or '\fB.mp4\fR' (saved as a video), or any other usual image file extension (saved as a sequence of images). This command requires features from the OpenCV library (not enabled in G'MIC\fR by default). \fBDefault values\fR: '\fBfirst_frame=0\fR', '\fBlast_frame=-1\fR', '\fBframe_step=1\fR' and '\fBoutput_filename=(undefined)\fR'. \fBaverage_files:\fR "filename_pattern",_first_frame>=0,_last_frame={ >=0 | -1:Last },_frame_step>=1,_output_filename\fR Average specified input image files, in a streamed way. If a display window is opened, rendered frames are displayed in it during processing. The output filename may have extension '\fB.avi\fR' or '\fB.mp4\fR' (saved as a video), or any other usual image file extension (saved as a sequence of images). \fBDefault values\fR: '\fBfirst_frame=0\fR', '\fBlast_frame=-1\fR', '\fBframe_step=1\fR' and '\fBoutput_filename=(undefined)\fR'. \fBaverage_video:\fR video_filename,_first_frame>=0,_last_frame={ >=0 | -1:Last },_frame_step>=1,_output_filename\fR Average frames of specified input video file, in a streamed way. If a display window is opened, rendered frames are displayed in it during processing. The output filename may have extension '\fB.avi\fR' or '\fB.mp4\fR' (saved as a video), or any other usual image file extension (saved as a sequence of images). This command requires features from the OpenCV library (not enabled in G'MIC\fR by default). \fBDefault values\fR: '\fBfirst_frame=0\fR', '\fBlast_frame=-1\fR', '\fBframe_step=1\fR' and '\fBoutput_filename=(undefined)\fR'. \fBfade_files:\fR "filename_pattern",_nb_inner_frames>0,_first_frame>=0,_last_frame={ >=0 | -1:Last },_frame_step>=1,_output_filename\fR Generate a temporal fading from specified input image files, in a streamed way. If a display window is opened, rendered frames are displayed in it during processing. The output filename may have extension '\fBavi\fR' or '\fBmp4\fR' (saved as a video), or any other usual image file extension (saved as a sequence of images). \fBDefault values\fR: '\fBnb_inner_frames=10\fR', '\fBfirst_frame=0\fR', '\fBlast_frame=-1\fR', '\fBframe_step=1\fR' and '\fBoutput_filename=(undefined)\fR'. \fBfade_video:\fR video_filename,_nb_inner_frames>0,_first_frame>=0,_last_frame={ >=0 | -1:Last },_frame_step>=1,_output_filename\fR Create a temporal fading sequence from specified input video file, in a streamed way. If a display window is opened, rendered frames are displayed in it during processing. This command requires features from the OpenCV library (not enabled in G'MIC\fR by default). \fBDefault values\fR: '\fBnb_inner_frames=10\fR', '\fBfirst_frame=0\fR', '\fBlast_frame=-1\fR', '\fBframe_step=1\fR' and '\fBoutput_filename=(undefined)\fR'. \fBfiles2video:\fR "filename_pattern",_output_filename,_fps>0,_codec\fR Convert several files into a single video file. \fBDefault values\fR: '\fBoutput_filename=output.mp4\fR', '\fBfps=25\fR' and '\fBcodec=mp4v\fR'. \fBmedian_files:\fR "filename_pattern",_first_frame>=0,_last_frame={ >=0 | -1:Last },_frame_step>=1,_frame_rows[%]>=1,_is_fast_approximation={ 0:No | 1:Yes }\fR Compute the median frame of specified input image files, in a streamed way. If a display window is opened, rendered frame is displayed in it during processing. \fBDefault values\fR: '\fBfirst_frame=0\fR', '\fBlast_frame=-1\fR', '\fBframe_step=1\fR', '\fBframe_rows=20%\fR' and '\fBis_fast_approximation=0\fR'. \fBmedian_video:\fR video_filename,_first_frame>=0,_last_frame={ >=0 | -1:Last },_frame_step>=1,_frame_rows[%]>=1,_is_fast_approximation={ 0:No | 1:Yes }\fR Compute the median of all frames of an input video file, in a streamed way. If a display window is opened, rendered frame is displayed in it during processing. This command requires features from the OpenCV library (not enabled in G'MIC\fR by default). \fBDefault values\fR: '\fBfirst_frame=0\fR', '\fBlast_frame=-1\fR', '\fBframe_step=1\fR', '\fBframe_rows=100%\fR' and '\fBis_fast_approximation=1\fR'. \fBmorph:\fR nb_inner_frames>=1,_smoothness>=0,_precision>=0\fR Create morphing sequence between selected images. \fBDefault values\fR: '\fBsmoothness=0.1\fR' and '\fBprecision=7\fR'. \fBExample:\fR [#1] image.jpg +rotate 20,1,1,50%,50% morph 9\fR \fBmorph_files:\fR "filename_pattern",_nb_inner_frames>0,_smoothness>=0,_precision>=0,_first_frame>=0,_last_frame={ >=0 | -1:Last },_frame_step>=1,_output_filename\fR Generate a temporal morphing from specified input image files, in a streamed way. If a display window is opened, rendered frames are displayed in it during processing. The output filename may have extension '\fB.avi\fR' or '\fB.mp4\fR' (saved as a video), or any other usual image file extension (saved as a sequence of images). \fBDefault values\fR: '\fBnb_inner_frames=10\fR', '\fBsmoothness=0.1\fR', '\fBprecision=7\fR', '\fBfirst_frame=0\fR', '\fBlast_frame=-1\fR', '\fBframe_step=1\fR' and '\fBoutput_filename=(undefined)\fR'. \fBmorph_rbf:\fR nb_inner_frames>=1,xs0[%],ys0[%],xt0[%],yt0[%],...,xsN[%],ysN[%],xtN[%],ytN[%]\fR Create morphing sequence between selected images, using RBF-based interpolation. Each argument (xsk,ysk)-(xtk,ytk) corresponds to the coordinates of a keypoint respectively on the source and target images. The set of all keypoints define the overall image deformation. \fBmorph_video:\fR video_filename,_nb_inner_frames>0,_smoothness>=0,_precision>=0,_first_frame>=0,_last_frame={ >=0 | -1:Last },_frame_step>=1,_output_filename\fR Generate a temporal morphing from specified input video file, in a streamed way. If a display window is opened, rendered frames are displayed in it during processing. The output filename may have extension '\fB.avi\fR' or '\fB.mp4\fR' (saved as a video), or any other usual image file extension (saved as a sequence of images). This command requires features from the OpenCV library (not enabled in G'MIC\fR by default). \fBDefault values\fR: '\fBnb_inner_frames=10\fR', '\fBsmoothness=0.1\fR', '\fBprecision=7\fR', '\fBfirst_frame=0\fR', '\fBlast_frame=-1\fR', '\fBframe_step=1\fR' and '\fBoutput_filename=(undefined)\fR'. \fBregister_nonrigid:\fR [destination],_smoothness>=0,_precision>0,_nb_scale>=0\fR Register selected source images with specified destination image, using non-rigid warp. \fBDefault values\fR: '\fBsmoothness=0.2\fR', '\fBprecision=7\fR' and '\fBnb_scale=0(auto)\fR'. \fBExample:\fR [#1] image.jpg +rotate 20,1,1,50%,50% +register_nonrigid[0] [1]\fR \fBregister_rigid:\fR [destination],_smoothness>=0,_boundary_conditions={ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }\fR Register selected source images with specified destination image, using rigid warp (shift). \fBDefault values\fR: '\fBsmoothness=0.1%\fR' and '\fBboundary_conditions=0\fR'. \fBExample:\fR [#1] image.jpg +shift 30,20 +register_rigid[0] [1]\fR \fBtransition:\fR [transition_shape],nb_added_frames>=0,100>=shading>=0,_single_frame_only={ -1:Disabled | >=0 }\fR Generate a transition sequence between selected images. \fBDefault values\fR: '\fBshading=0\fR' and '\fBsingle_frame_only=-1\fR'. \fBExample:\fR [#1] image.jpg +mirror c 100%,100% plasma[-1] 1,1,6 transition[0,1] [2],5\fR \fBtransition3d:\fR _nb_frames>=2,_nb_xtiles>0,_nb_ytiles>0,_axis_x,_axis_y,_axis_z,_is_antialias={ 0:No | 1:Yes }\fR Create 3D transition sequence between selected consecutive images. '\fBaxis_x\fR', '\fBaxis_y\fR' and '\fBaxis_z\fR' can be set as mathematical expressions, depending on '\fBx\fR' and '\fBy\fR'. \fBDefault values\fR: '\fBnb_frames=10\fR', '\fBnb_xtiles=nb_ytiles=3\fR', '\fBaxis_x=1\fR', '\fBaxis_y=1\fR', '\fBaxis_z=0\fR' and '\fBis_antialias=1\fR'. \fBExample:\fR [#1] image.jpg +blur 5 transition3d 9 display_rgba\fR \fBvideo2files:\fR input_filename,_output_filename,_first_frame>=0,_last_frame={ >=0 | -1:Last },_frame_step>=1\fR Split the specified input video file into individual image files, one per frame. First and last frames as well as step between frames can be specified. \fBDefault values\fR: '\fBoutput_filename=frame.png\fR', '\fBfirst_frame=0\fR', '\fBlast_frame=-1\fR' and '\fBframe_step=1\fR'. \fB\fB11.21. Convenience Functions\fR \fB ---------------------\fR \fBadd_copymark:\fR Add copymark suffix in names of selected images. \fBalert:\fR _title,_message,_label_button1,_label_button2,...\fR Display an alert box and wait for user's choice. If a single image is in the selection, it is used as an icon for the alert box. \fBDefault values\fR: '\fBtitle=[G'MIC Alert]\fR' and 'message=This is an alert box.'. \fBarg0:\fR n>=0,_arg_0,...,_arg_N\fR Return the n-th argument of the specified argument list (where '\fBn\fR' goes from '\fB0\fR' to '\fBN\fR'). \fBarg1:\fR n>=1,_arg_1,...,_arg_N\fR Return the n-th argument of the specified argument list (where '\fBn\fR' goes from '\fB1\fR' to '\fBN\fR'). \fBarg2var:\fR variable_name,argument_1,...,argument_N\fR For each i in [1...N], set '\fBvariable_name$i=argument_i\fR'. The variable name should be global to make this command useful (i.e. starts by an underscore). \fBaverage_vectors:\fR Return the vector-valued average of the latest of the selected images. \fBbase642img:\fR "base64_string"\fR Decode given base64-encoded string as a newly inserted image at the end of the list. The argument string must have been generated using command '\fBimg2base64\fR'. \fBbase642uint8:\fR "base64_string"\fR Decode given base64-encoded string as a newly inserted 1-column image at the end of the list. The argument string must have been generated using command '\fBuint82base64\fR'. \fBbasename:\fR file_path,_variable_name_for_folder\fR Return the basename of a file path, and optionally its folder location. When specified '\fBvariable_name_for_folder\fR' must starts by an underscore (global variable accessible from calling function). \fBbin:\fR binary_int1,...\fR Print specified binary integers into their octal, decimal, hexadecimal and string representations. \fBbin2dec:\fR binary_int1,...\fR Convert specified binary integers into their decimal representations. \fBcat:\fR filename,_display_line_numbers={ 0:No | 1:Yes },_line_selection,\fR Print specified line selection of given filename on stdout. \fBDefault values\fR: '\fBdisplay_line_numbers=1\fR' and '\fBline_selection=^\fR'. \fBcolor2name:\fR R,G,B\fR Return the name (as a string, in English) that most matches the specified color. \fBcovariance_vectors:\fR _avg_outvarname\fR Return the covariance matrix of the vector-valued colors in the latest of the selected images (for arbitrary number of channels). Parameter '\fBavg_outvarname\fR' is used as a variable name that takes the value of the average vector-value. \fBda_freeze:\fR Convert each of the selected dynamic arrays into a 1-column image whose height is the number of array elements. \fBdate:\fR Return current date as a string '\fBYYYY/MM/DD\fR'. \fBdec:\fR decimal_int1,...\fR Print specified decimal integers into their binary, octal, hexadecimal and string representations. \fBdec2str:\fR decimal_int1,...\fR Convert specified decimal integers into their string representation. \fBdec2bin:\fR decimal_int1,...\fR Convert specified decimal integers into their binary representations. \fBdec2hex:\fR decimal_int1,...\fR Convert specified decimal integers into their hexadecimal representations. \fBdec2oct:\fR decimal_int1,...\fR Convert specified decimal integers into their octal representations. \fBfilename:\fR filename,_number1,_number2,...,_numberN\fR Return a filename numbered with specified indices. \fBfilename_rand:\fR Return a random filename for storing temporary data. \fBfilename_dated:\fR filename\fR Convert specified filename to one stamped with the current date ('filename_YYYYMMDD_HHMMSS.ext\fR'). \fBfiles (+):\fR _mode,path\fR Return the list of files and/or subdirectories from specified path. '\fBpath\fR' can optionally be a matching pattern. '\fBmode\fR' can be \fB{ 0:Files only | 1:Directories only | 2:Files + Directories }\fR. Add '\fB3\fR' to '\fBmode\fR' to return full paths instead of filenames only. \fBDefault value\fR: '\fBmode=5\fR'. \fBfiles2img:\fR _mode,path\fR Insert a new image where each vector-valued pixel is a string encoding the filenames returned by command \fIfiles\fR. Useful to manage list of filenames containing characters that have a special meaning in the G'MIC\fR language,such as spaces or commas. \fBfitratio_wh:\fR min_width,min_height,ratio_wh\fR Return a 2D size '\fBwidth,height\fR' which is bigger than '\fBmin_width,min_height\fR' and has the specified w/h ratio. \fBfitscreen:\fR width,height,_minimal_size[%]>0,_maximal_size[%]>0 |\fR [image],_minimal_size[%]>0,_maximal_size[%]>0\fR Return the '\fBideal\fR' size WxH for a window intended to display an image of specified size on screen. \fBDefault values\fR: '\fBdepth=1\fR', '\fBminimal_size=128\fR' and '\fBmaximal_size=85%\fR'. \fBfontchart:\fR display_mode.\fR Insert G'MIC\fR font chart at the end of the image list. '\fBdisplay_mode\fR' can be \fB{ 0: List of characters | N: List of fonts with height 'N'}\fR. \fBDefault value\fR: '\fBdisplay_mode=0\fR'. \fBExample:\fR [#1] fontchart 0 fontchart 64\fR \fBfps:\fR Return the number of time this function is called per second, or -1 if this info is not yet available. Useful to display the framerate when displaying animations. \fBhex:\fR hexadecimal_int1,...\fR Print specified hexadecimal integers into their binary, octal, decimal and string representations. \fBhex2dec:\fR hexadecimal_int1,...\fR Convert specified hexadecimal integers into their decimal representations. \fBhex2img:\fR "hexadecimal_string"\fR Insert new image 1xN at the end of the list with values specified by the given hexadecimal-encoded string. \fBhex2str:\fR hexadecimal_string\fR Convert specified hexadecimal string into a string. See also: \fIstr2hex\fR. \fBimg2base64:\fR _encoding={ 0:Base64 | 1:Base64url },_store_names={ 0:No | 1:Yes }\fR Encode selected images as a base64-encoded string. The images can be then decoded using command '\fBbase642img\fR'. \fBDefault values\fR: '\fBencoding=0\fR' and '\fBstore_names=1\fR'. \fBimg2hex:\fR Return representation of last image as an hexadecimal-encoded string. Input image must have values that are integers in [0,255]. \fBimg2str:\fR Return the content of the selected images, as special G'MIC\fR input strings. \fBindexof:\fR string,_arg_0,...,_arg_N\fR Return the lowest index '\fBi\fR' such that '\fBarg_i==string\fR'. If no '\fBarg_i\fR' matches, '\fB-1\fR' is returned. \fBis_mesh3d:\fR Return 1 if all of the selected images are 3D meshes, 0 otherwise. \fBis_change:\fR _value={ 0:False | 1:True }\fR Set or unset the '\fBis_change\fR' flag associated to the image list. This flag tells the interpreter whether the image list should be displayed when the pipeline ends. \fBDefault value\fR: '\fBvalue=1\fR'. \fBis_half:\fR Return 1 if the type of image pixels is limited to half-float. \fBis_ext:\fR filename,_extension\fR Return 1 if specified filename has a given extension. \fBis_image_arg:\fR string\fR Return 1 if specified string is a valid single image argument like '\fB[ind]\fR'. \fBis_pattern:\fR string\fR Return 1 if specified string looks like a drawing pattern '\fB0x......\fR'. \fBis_videofilename:\fR filename\fR Return 1 if extension of specified filename is typical from video files. \fBis_macos:\fR Return 1 if current computer OS is Darwin (MacOS), 0 otherwise. \fBis_windows:\fR Return 1 if current computer OS is Windows, 0 otherwise. \fBlof:\fR feature\fR Return the list of specified features (separated by commas) for each selected image. \fBmath_lib:\fR Return string that defines a set of several useful macros for the embedded math evaluator. \fBmad:\fR Return the MAD (Median Absolute Deviation) of the last selected image. The MAD is defined as MAD = med_i|x_i-med_j(x_j)| \fBmax_w:\fR Return the maximal width between selected images. \fBmax_h:\fR Return the maximal height between selected images. \fBmax_d:\fR Return the maximal depth between selected images. \fBmax_s:\fR Return the maximal spectrum between selected images. \fBmax_wh:\fR Return the maximal wxh size of selected images. \fBmax_ds:\fR Return the maximal dxs size of selected images. \fBmax_whd:\fR Return the maximal wxhxd size of selected images. \fBmax_whds:\fR Return the maximal wxhxdxs size of selected images. \fBmedian_vectors:\fR Return the median vector value of the last selected image (median computed channel by channel) \fBmin_w:\fR Return the minimal width between selected images. \fBmin_h:\fR Return the minimal height between selected images. \fBmin_d:\fR Return the minimal depth between selected images. \fBmin_s:\fR Return the minimal s size of selected images. \fBmin_wh:\fR Return the minimal wxh size of selected images. \fBmin_ds:\fR Return the minimal dxs size of selected images. \fBmin_whd:\fR Return the minimal wxhxd size of selected images. \fBmin_whds:\fR Return the minimal wxhxdxs size of selected images. \fBname2color:\fR name\fR Return the R,G,B color that matches the specified color name. \fBnmd (+):\fR Shortcut for command '\fBnamed\fR'. \fBnamed (+):\fR _mode,"name1","name2",...\fR Return the set of indices corresponding to images of the selection with specified names. After this command returns, the status contains a list of indices (unsigned integers), separated by commas (or an empty string if no images with those names have been found). (equivalent to shortcut command '\fBnmd\fR'). '\fBmode\fR' can be \fB{ 0:All indices (default) | 1:Lowest index | 2:Highest index | 3:All indices (case insensitive) | 4:Lowest index (case insensitive) | 5:Highest index (case insensitive)}\fR \fBnarg:\fR arg_1,arg_2,...,arg_N\fR Return number of specified arguments. \fBnormalize_filename:\fR filename\fR Return a "normalized" version of the specified filename, without spaces and capital letters. \fBoct:\fR octal_int1,...\fR Print specified octal integers into their binary, decimal, hexadecimal and string representations. \fBoct2dec:\fR octal_int1,...\fR Convert specified octal integers into their decimal representations. \fBpath_cache:\fR Return a path to store G'MIC\fR data files for one user (whose value is OS-dependent). \fBpath_cached_file:\fR "filename"\fR Return path of the specified cached file, or "" if file has not been yet cached. \fBpath_current:\fR Return current folder from where G'MIC\fR has been run. \fBpath_gimp:\fR Return a path to store GIMP configuration files for one user (whose value is OS-dependent). \fBpath_tmp:\fR Return a path to store temporary files (whose value is OS-dependent). \fBremove_copymark:\fR Remove copymark suffix in names of selected images. \fBreset:\fR Reset global parameters of the interpreter environment. \fBshell_cols:\fR Return the estimated number of columns of the current shell. \fBsize_value:\fR Return the size (in bytes) of image values. \fBstd_noise:\fR Return the estimated noise standard deviation of the last selected image. \fBstr:\fR string\fR Print specified string into its binary, octal, decimal and hexadecimal representations. \fBstrbuffer:\fR buffer_size\fR Return a string describing a size for the specified buffer size. \fBstr2hex:\fR "string"\fR Convert specified string argument into a sequence of hexadecimal values (returned as a string). See also: \fIhex2str\fR. \fBExample:\fR [#1] hex=${"str2hex \"Hello my friends\""} echo $hex\fR [gmic]-0./ Start G'MIC interpreter. [gmic]-0./ 48656c6c6f206d7920667269656e6473 [gmic]-0./ End G'MIC interpreter.\fR \fBstrcapitalize:\fR string\fR Capitalize specified string. \fBstrcontains:\fR string1,string2\fR Return 1 if the first string contains the second one. \fBstrclut:\fR "string"\fR Return simplified version of the specified string that can be used as a CLUT name. \fBstrlen:\fR string1\fR Return the length of specified string argument. \fBstrlowercase:\fR string\fR Return a lower-case version of the specified string. \fBstrreplace:\fR string,search,replace\fR Search and replace substrings in an input string. \fBstruppercase:\fR string\fR Return an upper-case version of the specified string. \fBstrvar:\fR "string"\fR Return a simplified version of the specified string, that can be used as a variable name. (version that creates a lowercase result, no longer than 128 chars). \fBstrcasevar:\fR "string"\fR Return a simplified version of the specified string, that can be used as a variable name. (version that keeps original case of specified string, no longer than 128 chars). \fBstrver:\fR _version,_prerelease\fR Return the specified version number of the G'MIC\fR interpreter, as a string. \fBDefault value\fR: '\fBversion=$_version\fR' and '\fBprerelease=\fR'. \fBtic:\fR Initialize tic-toc timer. Use it in conjunction with '\fBtoc\fR'. \fBtime:\fR Return current time as a string '\fBhh:mm:ss\fR'. \fBtoc:\fR Display elapsed time of the tic-toc timer since the last call to '\fBtic\fR'. This command returns the elapsed time in the status value. Use it in conjunction with '\fBtic\fR'. \fBuint82base64:\fR _encoding={ 0:Base64 | 1:Base64url }\fR Encode the values of the latest of the selected images as a base64-encoded string. The string can be decoded using command '\fBbase642uint8\fR'. Selected images must have values that are integers in [0,255]. \fBDefault values\fR: '\fBencoding=0\fR'. \fB\fB11.22. Other Interactive Commands\fR \fB --------------------------\fR \fBdemos:\fR _run_in_parallel={ 0:No | 1:Yes | 2:Auto }\fR Show a menu to select and view all G'MIC\fR interactive demos. \fBx_2048:\fR Launch the 2048 game. \fBx_blobs:\fR Launch the blobs editor. \fI../img/x_blobs.jpg\fR \fB[image: 'x_blobs']\fR \fBx_bouncing:\fR Launch the bouncing balls demo. \fBx_color_curves:\fR _colorspace={ rgb | cmy | cmyk | hsi | hsl | hsv | lab | lch | ycbcr | last }\fR Apply color curves on selected RGB[A] images, using an interactive window. Set '\fBcolorspace\fR' to '\fBlast\fR' to apply last defined color curves without opening interactive windows. \fBDefault value\fR: '\fBcolorspace=rgb\fR'. \fBx_colorize:\fR _is_lineart={ 0:No | 1:Yes },_max_resolution={ 0 | >=128 },_multichannels_output={ 0:No | 1:Yes },_[palette1],_[palette2],_[grabber1]\fR Colorized selected B&W images, using an interactive window. When >0, argument '\fBmax_resolution\fR' defines the maximal image resolution used in the interactive window. \fBDefault values\fR: '\fBis_lineart=1\fR', '\fBmax_resolution=1024\fR' and '\fBmultichannels_output=0\fR'. \fBx_connect4:\fR Launch the Connect Four game. \fBxz:\fR Shortcut for command '\fBx_crop\fR'. \fBx_crop:\fR Crop selected images interactively. If multiple input images are selected, the same crop is applied to all images. (equivalent to shortcut command '\fBxz\fR'). \fBx_cut:\fR Clip value ranges of selected images interactively. \fBx_fire:\fR Launch the fire effect demo. \fBx_fireworks:\fR Launch the fireworks demo. \fBx_fisheye:\fR Launch the fish-eye effect demo. \fBx_fourier:\fR Launch the fourier filtering demo. \fBx_grab_color:\fR _variable_name\fR Open a color grabber widget from the first selected image. Argument '\fBvariable_name\fR' specifies the variable that contains the selected color values at any time. Assigning '\fB-1\fR' to it forces the interactive window to close. \fBDefault values\fR: '\fBvariable_name=xgc_variable\fR'. \fBx_hanoi:\fR Launch the Tower of Hanoi game. \fBx_histogram:\fR Launch the histogram demo. \fBx_hough:\fR Launch the hough transform demo. \fBx_jawbreaker:\fR 0<_width<20,0<_height<20,0<_nb_colors<=8\fR Launch the Jawbreaker game. \fBDefault values\fR: '\fBwidth=12\fR', '\fBheight=13\fR' and '\fBnb_colors=5\fR'. \fBx_landscape:\fR Launch the virtual landscape demo. \fBx_life:\fR Launch the game of life. \fBx_light:\fR Launch the light effect demo. \fBx_mandelbrot:\fR _is_julia={ 0:No | 1:Yes },_c0r,_c0i\fR Launch Mandelbrot/Julia explorer. \fBx_mask_color:\fR _colorspace={ all | rgb | lrgb | ycbcr | lab | lch | hsv | hsi | hsl | cmy | cmyk | yiq },_spatial_tolerance>=0,_color_tolerance>=0\fR Interactively select a color, and add an alpha channel containing the corresponding color mask. Argument '\fBcolorspace\fR' refers to the color metric used to compute color similarities, and can be basically one of \fB{ rgb | lrgb | ycbcr | lab | lch | hsv | hsi | hsl | cmy | cmyk | yiq }\fR. You can also select one particular channel of this color space, by setting '\fBcolorspace\fR' as '\fBcolorspace_channel\fR' (e.g. '\fBhsv_h\fR' for the hue). \fBDefault values\fR: '\fBcolorspace=all\fR', '\fBspatial_tolerance=5\fR' and '\fBcolor_tolerance=5\fR'. \fBx_metaballs3d:\fR Launch the 3D metaballs demo. \fBx_minesweeper:\fR 8<=_width<=20,8<=_height<=20\fR Launch the Minesweeper game. \fBx_minimal_path:\fR Launch the minimal path demo. \fBx_morph:\fR _nb_frames>=2,_preview_fidelity={ 0:Coarsest | 1:Coarse | 2:Normal | 3:Fine | 4:Finest }\fR Launch the interactive image morpher. \fBDefault values\fR: '\fBnb_frames=16\fR' and '\fBpreview_fidelity=3\fR'. \fBx_pacman:\fR Launch pacman game. \fBx_paint:\fR Launch the interactive painter. \fBx_plasma:\fR Launch the plasma effect demo. \fBx_quantize_rgb:\fR _nbcolors>=2\fR Launch the RGB color quantization demo. \fBx_reflection3d:\fR Launch the 3D reflection demo. \fBx_rubber3d:\fR Launch the 3D rubber object demo. \fBx_segment:\fR _max_resolution={ 0:Auto | >=128 }\fR Segment foreground from background in selected opaque RGB images, interactively. Return RGBA images with binary alpha-channels. \fBDefault value\fR: '\fBmax_resolution=1024\fR'. \fBx_select_color:\fR _variable_name\fR Display an RGB or RGBA color selector. Argument '\fBvariable_name\fR' specifies the variable that contains the selected color values (as R,G,B,[A]) at any time. Its value specifies the initial selected color. Assigning '\fB-1\fR' to it forces the interactive window to close. \fBDefault value\fR: '\fBvariable_name=xsc_variable\fR'. \fBx_select_function1d:\fR _variable_name,_background_curve_R,_background_curve_G,_background_curve_B\fR Open an interactive window, where the user can define their own 1D function. If an image is selected, it is used to display additional information : - The first row defines the values of a background curve displayed on the window (e.g. an histogram). - The 2nd, 3rd and 4th rows define the R,G,B color components displayed beside the X and Y axes. Argument '\fBvariable_name\fR' specifies the variable that contains the selected function keypoints at any time. Assigning '\fB-1\fR' to it forces the interactive window to close. \fBDefault values\fR: '\fBvariable_name=xsf_variable\fR', '\fBbackground_curve_R=220\fR', '\fBbackground_curve_G=background_curve_B=background_curve_ T\fR'. \fBx_select_palette:\fR _variable_name,_number_of_columns={ 0:Auto | >0 }\fR Open a RGB or RGBA color selector widget from a palette. The palette is given as a selected image. Argument '\fBvariable_name\fR' specifies the variable that contains the selected color values (as R,G,B,[A]) at any time. Assigning '\fB-1\fR' to it forces the interactive window to close. \fBDefault values\fR: '\fBvariable_name=xsp_variable\fR' and '\fBnumber_of_columns=2\fR'. \fBx_shadebobs:\fR Launch the shade bobs demo. \fBx_spline:\fR Launch spline curve editor. \fBx_starfield3d:\fR Launch the 3D starfield demo. \fBx_tetris:\fR Launch tetris game. \fBx_threshold:\fR Threshold selected images interactively. \fBx_tictactoe:\fR Launch tic-tac-toe game. \fBx_tixy:\fR "expression"\fR Animate specified mathematical expression with a 16x16 grid of circles, using the rules described at \fIhttps://tixy.land\fR. \fBx_warp:\fR _nb_keypoints_xgrid>=2,_nb_keypoints_ygrid>=2,_nb_keypoints_contours>=0,_preview_fidelity={ 0:Coarsest | 1:Coarse | 2:Normal | 3:Fine | 4:Finest }, _[background_image],0<=_background_opacity<=1\fR Launch the interactive image warper. \fBDefault values\fR: '\fBnb_keypoints_xgrid=nb_keypoints_ygrid=2\fR', '\fBnb_keypoints_contours=0\fR' and '\fBpreview_fidelity=1\fR'. \fBx_waves:\fR Launch the image waves demo. \fBx_whirl:\fR _opacity>=0\fR Launch the fractal whirls demo. \fBDefault values\fR: '\fBopacity=0.2\fR'. \fB12. Examples of Use\fR \fB ---------------\fR 'gmic\fR' is a generic image processing tool which can be used in a wide variety of situations. The examples below illustrate possible uses of this tool: \fB### View a list of images:\fR $ gmic file1.bmp file2.jpeg\fR \fB### Convert an image file:\fR $ gmic input.bmp output output.jpg\fR \fB### Create a volumetric image from a movie sequence:\fR $ gmic input.mpg append z output output.hdr\fR \fB### Compute the image gradient norm:\fR $ gmic input.bmp gradient_norm\fR \fB### Denoise a color image:\fR $ gmic image.jpg denoise 30,10 output denoised.jpg\fR \fB### Compose two images using overlay layer blending:\fR $ gmic image1.jpg image2.jpg blend overlay output blended.jpg\fR \fB### Evaluate a mathematical expression:\fR $ gmic echo "cos(pi/4)^2+sin(pi/4)^2={cos(pi/4)^2+sin(pi/4)^2}"\fR \fB### Plot a 2D function:\fR $ gmic 1000,1,1,2 fill "X=3*(x-500)/500;X^2*sin(3*X^2)+(!c?u(0,-1):cos(X*10))" plot\fR \fI../img/example_plot.png\fR \fB[image: '2D Plot']\fR \fB### Plot a 3D elevated function in random colors:\fR $ gmic 128,128,1,3,"u(0,255)" plasma 10,3 blur 4 sharpen 10000 n 0,255 elevation3d[-1] "'X=(x-64)/6;Y=(y-64)/6;100*exp(-(X^2+Y^2)/30)*abs(cos(X)*si n(Y))'"\fR \fI../img/example_elevation3d.png\fR \fB[image: '3D Elevation']\fR \fB### Plot the isosurface of a 3D volume:\fR $ gmic mode3d 5 moded3d 5 isosurface3d "'x^2+y^2+abs(z)^abs(4*cos(x*y*z*3))'",3\fR \fI../img/example_isosurface3d.png\fR \fB[image: '3D Isosurface']\fR \fB### Render a \fBG'MIC\fR 3D logo:\fR $ gmic 0 text G\'MIC,0,0,53,1,1,1,1 expand xy,10 blur 1 normalize 0,100 +plasma 0.4 add blur 1 elevation3d -0.1 moded3d 4\fR \fI../img/example_logo.png\fR \fB[image: '3D G'MIC Logo']\fR \fB### Generate a 3D ring of torii:\fR $ gmic repeat 20 torus3d 15,2 color3d[-1] "{u(60,255)},{u(60,255)},{u(60,255)}" *3d[-1] 0.5,1 if "{$>%2}" rotate3d[-1] 0,1,0,90 fi add3d[-1] 70 add3d rotate3d 0,0,1,18 done moded3d 3 mode3d 5\fR \fI../img/example_torii.png\fR \fB[image: '3D Ring']\fR \fB### Create a vase from a 3D isosurface:\fR $ gmic moded3d 4 isosurface3d "'x^2+2*abs(y/2)*sin(2*y)^2+z^2-3',0" sphere3d 1.5 sub3d[-1] 0,5 plane3d 15,15 rotate3d[-1] 1,0,0,90 center3d[-1] add3d[-1] 0,3.2 color3d[-1] 180,150,255 color3d[-2] 128,255,0 color3d[-3] 255,128,0 add3d\fR \fI../img/example_vase.png\fR \fB[image: '3D Vase']\fR \fB### Launch a set of interactive demos:\fR $ gmic demos\fR \fB** G'MIC comes with ABSOLUTELY NO WARRANTY; for details visit: https://gmic.eu **\fR