G'MIC(1)

๐Ÿ’– G'MIC(1) โ€” gmic ๐Ÿ’–

From the General Commands Manual, bestie โ€” this is the gmic page, and it's giving main-character Unix energy. ๐Ÿซถ

๐ŸŒธ NAME ๐ŸŒธ

gmic - Perform image processing operations using the G'MIC framework. โœจ

โœจ HELP โœจ

Here's the built-in help banner, served fresh and exactly as it appears:

gmic: GREYC's Magic for Image Computing: Command-Line Interface
      Version 4.0.7
      (https://gmic.eu)

      Copyright (c) 2008-2026, David Tschumperlรฉ / GREYC / CNRS.
      (https://www.greyc.fr)

1. Usage ๐Ÿ’ป

First, the synopsis โ€” yes, it's a mouthful, but it's iconic:

gmic [command_1 [arg_1_1,arg_1_2,..]] .. [command_N [arg_N_1,arg_N_2,..]]

gmic is the open-source interpreter of the G'MIC 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 framework, in its current version 4.0.7. Periodt.

For a gentler introduction, see the tutorial: https://gmic.eu/tutorial/ ๐ŸŒธ

2. Overall Context ๐ŸŒ€

  • At any given time, G'MIC 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 0 and is denoted by [0]. The second image in the list is denoted by [1], the third by [2] and so on. โœจ
  • Negative indices are handled periodically: [-1] refers to the last image in the list, [-2] to the penultimate one, etc. Thus, if the list has 4 images, [1] and [-3] both designate the second image in the list. ๐Ÿ”
  • A named image can also be designated by [name], if name uses the character set [a-zA-Z0-9_] and does not start with a number. Image names can be set or reassigned at any time during the processing pipeline (see command name for this purpose). ๐Ÿท๏ธ
  • G'MIC 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 command (stored in a user command file), which can then be reused as a regular command within a larger pipeline. ๐Ÿงฉ

3. Image Definition and Terminology ๐Ÿ–ผ๏ธ

  • In G'MIC, 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:
    • width, the number of image columns (size along the x-axis).
    • height, the number of image rows (size along the y-axis).
    • depth, the number of image slices (size along the z-axis). The depth is equal to 1 for typical color or grayscale 2D images.
    • spectrum, the number of image channels (size along the c-axis). The spectrum is equal to 3 and 4 for standard RGB and RGBA 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 width, height and depth of an image are considered as spatial dimensions, while the spectrum represents the spectral dimension. Thus, a 4D image in G'MIC should be most often regarded as a 3D dataset of multi-spectral voxels. Most G'MIC commands adhere to this convention (e.g. by default, command blur blurs 4D images only along the three spatial xyz-axes). ๐ŸŒˆ
  • G'MIC stores all the image data as buffers of float values (32 bits, value range [-3.4E38,+3.4E38]). 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 bool, char, int, etc.). This is possible by specifying it as a file option when using I/O commands (see section Input/Output Properties to learn more about file options). ๐Ÿ“ฅ๐Ÿ“ค

4. Items of a Processing Pipeline ๐Ÿงฑ

  • In G'MIC, an image processing pipeline is described as a sequence of items separated by the space character. Such items are parsed and executed from left to right. For instance, the expression:
filename.jpg blur 3,0 sharpen 10 resize 200%,200% output file_out.jpg

is a valid pipeline composed of nine G'MIC items. Count them if you want, bestie โ€” nine. ๐Ÿ’…

  • Each G'MIC item is either a command, a list of command arguments, a filename or a special input string. ๐Ÿงพ
  • Escape characters and double quotes (") can be used to define items containing spaces or other special characters. For instance, the two strings 'single item' and '"single item"' both define the same single item, with a space in it. ๐Ÿช„

5. Input Data ๐Ÿ“ฅ

  • If a G'MIC 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 input filename). ๐Ÿ“‚
  • Special filenames - and -.ext stand for the standard input/output (stdin/stdout) streams, optionally forced to be in a specific ext file format (e.g. -.jpg or -.png). ๐Ÿšฐ
  • The following special input strings may be used as G'MIC items to create and insert new images with prescribed values, at the end of the image list:
    • [selection] or [selection]xN: Insert 1 or N copies of already existing images. selection may represent one or several images (see section Command Items and Selections to learn more about selections). ๐Ÿ–จ๏ธ
    • width[%],_height[%],_depth[%],_spectrum[%],_values[xN]: Insert one or N new images with specified size and values (adding % to a dimension means "percentage of the size along the same axis", taken from the last image [-1]). Any specified dimension can be also written as [image], and is then set to the size (along the same axis) of the existing image [image]. values can be either a sequence of numbers separated by commas ,, or a mathematical expression, as e.g. in input item 256,256,1,3,[x,y,128] which creates a 256x256 RGB color image with a spatial shading on the red and green channels. (see section Mathematical Expressions to learn more about mathematical expressions). ๐ŸŽจ
    • (v1,v2,..[:delimiter | axis_order])[xN]: Insert one or N new images from explicit values. Value separator inside parentheses can be , (column separator), ; (row separator), / (slice separator) or ^ (channel separator). For instance, expression (1,2,3;4,5,6;7,8,9) creates a 3x3 matrix (scalar image), with values running from 1 to 9. ๐Ÿ”ข
    • ('string'[:delimiter])[xN]: Insert one or N new images from the given string, by filling the images with the character codes composing the string. When specified, delimiter defines the main orientation of the image. Delimiter can be x (equivalent to , which is the default), y (eq. to ;), z (eq. to /) or c (eq. to ^). When specified delimiter is ,, ;, / or ^, the expression is actually equivalent to ({'string'[:delimiter]})[xN] (see section Substitution Rules for more information on the syntax). ๐Ÿ”ค
    • 0[xN]: Insert one or N new "empty" images, containing no pixel data. Empty images are used only in rare occasions. ๐Ÿซฅ
  • Input item name=value declares a new variable name, or assigns a new string value to an existing variable. Variable names must use the character set [a-zA-Z0-9_] and cannot start with a number. ๐Ÿท๏ธ
  • A variable definition is always local to the current command except:
    • When it starts with an underscore _. 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 command, a variable also becomes accessible in the calling (parent) command. A shared variable command is a command whose name starts with __ (e.g. __foo). ๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘ง
  • If a variable name starts with two underscores __, the global variable is also shared among different threads and can be read/set by commands running in parallel (see command parallel for this purpose). Otherwise, it remains local to the thread that defined it. ๐Ÿงต
  • Numerical variables can be updated using these special operators: += (addition), -= (subtraction), *= (multiplication), /= (division), %= (modulo), &= (bitwise and), |= (bitwise or), ^= (power), <<= and >>= (bitwise left and right shifts). For instance, foo=1 foo+=3. โž•
  • Input item name.=string appends string at the end of variable name. โžก๏ธ
  • Input item name..=string prepends string at the beginning of variable name. โฌ…๏ธ
  • Multiple variable assignments and updates are allowed, with expressions: name1,name2,...,nameN=value or name1,name2,...,nameN=value1,value2,...,valueN where assignment operator = can be replaced by one of the allowed operators (e.g. +=). ๐Ÿ“
  • Variables usually store numbers or strings. Use command store to assign variables from image data (and syntax input $variable to bring them back on the image list afterwards). ๐Ÿ’พ

6. Command Items and Selections ๐ŸŽฏ

  • A G'MIC item that isn't a filename and isn't a special input string is, usually, a 'command' ๐Ÿ’…. Like, generally speaking, commands do image-processing operations on one or several of the images chilling in your list.
  • Popular commands come with two equivalent names โ€” a 'regular' one and a 'short' one ๐ŸŽ€. For instance, resize and r are literally the same image-resizing action, iykyk.
  • A G'MIC command can have mandatory or optional arguments, and those arguments have to be specified in the next item on the command line, no cap. Commas , separate multiple arguments of a single command, when that's required.
  • You can restrict a G'MIC command so it only runs on a subset of the image list โ€” just append [selection] to the command name โœจ. Valid syntaxes for selection:
    • command[-2]: applies the command only to the penultimate image [-2] in the list.
    • command[0,1,3]: applies only to images [0], [1] and [3].
    • command[3-6]: applies only to images [3] through [6] (so [3], [4], [5] and [6]).
    • command[50%-100%]: applies only to the second half of the image list.
    • command[0,-4--1]: applies only to the first image and the last four images.
    • command[0-9:3]: applies only to images [0] through [9], with a step of 3 (so images [0], [3], [6] and [9]).
    • command[0--1:2]: applies only to images in the list with even indices.
    • command[0,2-4,50%--1]: applies to images [0], [2], [3], [4] and also the second half of the image list.
    • command[^0,1]: applies to all images except the first two.
    • command[name1,name2]: applies to the named images name1 and name2.
  • Indices in selections are always sorted in increasing order, and duplicate indices get yeeted ๐Ÿ—‘๏ธ. For example, selections [3-1,1-3] and [1,1,1,3,2] are both equivalent to [1-3]. If you actually want to repeat a single command multiple times on an image, use a repeat..done loop instead, bestie. And if you want to invert the order of images for a command? You do that by explicitly inverting the order of the images in the list, with the command reverse[selection].
  • Selections [-1], [-2] and [-3] are used so often that they got their own shortcuts: ., .. and ... ๐Ÿ‘‘. So blur.. is equivalent to blur[-2]. These shortcuts also work when you're specifying command arguments โ€” iconic.
  • G'MIC commands invoked with no [selection] get applied to all images in the list, i.e. the default selection is [0--1] (except for the command input, whose default selection is [-1]). Slay.
  • Prepending a single hyphen - to a G'MIC command is allowed โœ…. This is handy for spotting command items more easily in a one-liner pipeline (typically invoked from a shell).
  • A G'MIC command prepended with a plus sign + does not act in-place โ€” instead it inserts its result as one or several new images at the end of the image list ๐Ÿฆ‹.
  • There are two different types of commands the G'MIC interpreter can run:
    • Built-in commands are the hard-coded functionalities in the interpreter core. They're 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, blur 1,,1 is invalid but blur 1 is correct.
    • Custom commands are defined as G'MIC pipelines of built-in or other custom commands. They're parsed by the G'MIC interpreter, and thus run a bit slower than built-in commands ๐Ÿข. Omitting arguments when invoking a custom command is permitted. For instance, the expressions flower ,,,100,,2 or flower , are correct.
  • Most of the existing commands in G'MIC are actually defined as custom commands, ngl.
  • Users can easily add their own custom commands to the G'MIC interpreter (see section Adding Custom Commands for the deets). New built-in commands can't be added, though โ€” unless you go modify the G'MIC interpreter source code and recompile it ๐Ÿ˜ญ.

โœจ 7. Input/Output Properties โœจ

  • G'MIC can read/write most of the classical image file formats, including:
    • 2D grayscale/color files: .png, .jpeg, .gif, .pnm, .tif, .bmp, ...
    • 3D volumetric files: .dcm, .hdr, .nii, .cube, .pan, .inr, .pnk, ...
    • Video files: .mpeg, .avi, .mp4, .mov, .ogg, .flv, ...
    • Generic text or binary data files: .gmz, .cimg, .cimgz, flo, ggr, gpl, .dlm, .asc, .pfm, .raw, .txt, .h.
    • 3D mesh files: .off, .obj.
  • Bestie, real talk: when we're messing with color images, G'MIC is out here living that sRGB life โ€” that's the standard color space it reads, writes, and displays in. Periodt. ๐Ÿ’…
  • Okay so when you load a .png or .tiff file, the bit-depth of the input image(s) gets stored in the status. Iconic little detail, ngl. โœจ
  • G'MIC is literally able to manage 3D mesh objects โ€” yeah, you heard me โ€” that can be read from files or generated by G'MIC commands. A 3D object is stored as a one-column scalar image containing the object data, in this exact order: { magic_number; sizes; vertices; primitives; colors; opacities }. These 3D representations can then be processed as regular images (see command split3d for accessing each of these 3D object data separately). No cap, you can treat 3D like any other image. ๐Ÿฆ‹
  • Be aware, bestie โ€” standard file formats may sometimes not be suitable for storing all the available image data, since G'MIC uses floating-point image buffers. So like, if you save an image that was initially loaded with 16 bits per channel as a .jpg file, you'll get a loss of information. ๐Ÿ˜ญ Use the G'MIC-specific file extension .gmz to ensure that all data precision is preserved when saving images. That's the safe route, fr fr.
  • Sometimes, file options may or must be set for specific file formats. Buckle up, because here comes the whole menu: ๐ŸŽ€
    • Video files: Only sub-frames of an image sequence may be loaded, using the input expression filename.ext,[first_frame[,last_frame[,step]]]. Set last_frame==-1 to tell it must be the last frame of the video. Set step to 0 to force an opened video file to be opened/closed. Output framerate and codec can also be set by using the output expression filename.avi,_fps,_codec,_keep_open where keep_open can be { 0:No (default) | 1:Yes }. codec is a 4-char string (see http://www.fourcc.org/codecs.php ) or 0 for the default codec. keep_open indicates whether the output video file must be kept open for appending new frames afterwards. ๐ŸŽฅ
    • .cimg[z] files: Only crops and sub-images of .cimg files can be loaded, using the input expressions filename.cimg,N0,N1, filename.cimg,N0,N1,x0,x1, filename.cimg,N0,N1,x0,y0,x1,y1, filename.cimg,N0,N1,x0,y0,z0,x1,y1,z1 or filename.cimg,N0,N1,x0,y0,z0,c0,x1,y1,z1,c1. Specifying -1 for one coordinates stands for the maximum possible value. Output expression filename.cimg[z][,datatype] can be used to force the output pixel type. datatype can be { auto | bool | uint8 | int8 | uint16 | int16 | uint32 | int32 | uint64 | int64 | float32 | float64 }. So many types, I know โ€” but you got this. ๐Ÿ’œ
    • .raw binary files: Image dimensions and input pixel type may be specified when loading .raw files with input expression filename.raw[,datatype][,width][,height[,depth[,dim[,offset]]]]]. 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 filename.raw[,datatype]. datatype can be the same as for .cimg[z] files. ๐Ÿงš
    • .yuv files: Image dimensions must be specified when loading, and only sub-frames of an image sequence may be loaded, using the input expression filename.yuv,width,height[,chroma_subsampling[,first_frame[,last_frame[,step]]]. chroma_subsampling can be { 420 | 422 | 444 }. When saving, chroma subsampling mode can be specified with output expression filename.yuv[,chroma_subsampling]. ๐ŸŒˆ
    • .tiff files: Only sub-images of multi-pages tiff files can be loaded, using the input expression filename.tif,_first_frame,_last_frame,_step. Output expression filename.tiff,_datatype,_compression,_force_multipage,_use_bigtiff can be used to specify the output pixel type, as well as the compression method. datatype can be the same as for .cimg[z] files. compression can be { 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 }. force_multipage can be { 0:No (default) | 1:Yes }. use_bigtiff can be { 0:No | 1:Yes (default) }. That's a whole lot of compression options and honestly? Slay. ๐Ÿ”ฅ
    • .pdf files: When loading a file, the rendering resolution can be specified using the input expression filename.pdf,resolution, where resolution is an unsigned integer value. ๐ŸŽ€
    • .gif files: Animated gif files can be saved, using the input expression filename.gif,fps>0,nb_loops. Specify nb_loops=0 to get an infinite number of animation loops (this is the default behavior). Loops forever, just like my love for Unix. ๐Ÿ’–
    • .jpeg and .webp files: The output quality may be specified (in %), using the output expression filename.jpg,30 (here, to get a 30% quality output). 100 is the default. โญ
    • .png files: The bit depth can be specified (8 or 16), using the output expression filename.png,16 (here, to get a 16 bit depth output file). By default, G'MIC guesses the best bit depth automatically. It just knows, iykyk. ๐Ÿฆ‹
    • .mnc files: The output header can be set from another file, using the output expression filename.mnc,header_template.mnc. ๐ŸŽ€
    • .pan, .cpp, .hpp, .c and .h files: The output datatype can be selected with output expression filename[,datatype]. datatype can be the same as for .cimg[z] files. โœจ
    • .gmic files: These filenames are assumed to be G'MIC 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 filename.gmic[,add_debug_info] where debug_info can be { 0:False | 1:True }. ๐Ÿ’œ
    • Prepending ext: to a filename (e.g. jpg:filename) forces G'MIC to read/write the file as if it had the given extension .ext. Lowkey a hack but a good one. ๐Ÿ’…
  • 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 software. Just a heads up so you're not left confused, bestie. ๐Ÿ™ˆ

8. Substitution Rules โœจ

  • G'MIC items containing $ or {} are substituted before being interpreted. Use these substituting expressions to access various data from the interpreter environment. It's giving variable magic and I'm obsessed. ๐Ÿช„
  • $name and ${name} are both substituted by the value of the named variable (set previously by the item name=value). If this variable has not already been set, the expression is substituted by the highest positive index of the named image [name]. 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). Fallback game is strong, fr fr. ๐Ÿซถ
  • The following reserved variables are predefined by the G'MIC interpreter. These are the VIPs, the main characters, the ones you need to know: ๐Ÿ‘‘
    • $!: The current number of images in the list. ๐Ÿ’…
    • $> and $<: The increasing/decreasing index of the latest (currently running) loop. $> goes from 0 (first loop iteration) to nb_iterations - 1 (last iteration). $< does the opposite (except for for and while loops, where $< is nan as the number of iterations is unknown). Loop drama, honestly. ๐Ÿ˜ญ
    • $%: A value that linearly goes from 0 (first iteration) to 1 (last iteration) in a running loop (equivalent to $>/($>+$<)). It's giving math but make it cute. โœจ
    • $/: The current call stack. Stack items are separated by slashes /. ๐ŸŽ€
    • $|: The current value (expressed in seconds) of a millisecond precision timer. Precise queen. โฑ๏ธ
    • $^: The current verbosity level. ๐Ÿฆ‹
    • $_cpus: The number of CPU cores available on your machine. Know your power. ๐Ÿ”ฅ
    • $_flags: The list of enabled flags when G'MIC interpreter has been compiled. ๐ŸŒธ
    • $_host: A string telling about the host running the G'MIC interpreter (e.g. cli or gimp). ๐ŸŒˆ
    • $_os: A string describing the running operating system. โญ
    • $_path_rc: The path to the G'MIC folder used to store configuration files (its value is OS-dependent). ๐Ÿ’œ
    • $_path_user: The path to the G'MIC user file .gmic or user.gmic (its value is OS-dependent). ๐Ÿซถ
    • $_path_commands: A list of all imported command files (stored as an image list). ๐ŸŽ€
    • $_pid: The current process identifier, as an integer. ๐Ÿ’…
    • $_pixeltype: The type of image pixels (default: float32). โœจ
    • $_prerelease: For pre-releases, the date of the pre-release as yymmdd. For stable releases, this variable is set to 0. ๐Ÿฆ‹
    • $_user_agent: A string telling the user-agent G'MIC uses when accessing network files (default: gmic). ๐ŸŒธ
    • $_version: A 3-digit number indicating the current version of the G'MIC interpreter (e.g. 407). ๐ŸŒˆ
    • $_vt100: Set to 1 if colored text output is allowed on the console. Otherwise, set to 0. Colors on or off, that's the vibe check. ๐Ÿ’–
  • $$name and $${name} โ€” both get swapped out for the G'MIC script code of the custom command called name, or for an empty string if no custom command with that name exists. No cap. ๐Ÿ’…
  • ${"-pipeline"} โ€” gets replaced by the status value after the G'MIC pipeline runs (see command status). So ${} is literally the current status value. periodt. โœจ
  • {:string} โ€” becomes a double-quoted version of string. ๐ŸŽ€
  • {/string} โ€” becomes the escaped version of string. ๐Ÿฆ‹
  • {'string'[:delimiter]} (the string sits between single quotes) โ€” becomes the sequence of character codes that composes the string, separated by the delimiter you picked. Possible delimiters are , (default), ;, /, ^ or (space). For instance, item {'foo'} is substituted by 102,111,111, and {'foo':;} by 102;111;111. This is lowkey giving character-code realness. ๐Ÿ“
  • {image,feature[:delimiter]} โ€” becomes a specific feature of the image [image]. The image can be an image number or an image name, and it can also be omitted โ€” in that case the last image [-1] in the list is considered for the requested feature. The specified feature can be one of:
    • b: the image basename (filename without the folder path or extension).
    • f: the image folder name.
    • n: the image name or filename (if the image has been read from a file).
    • t: the text string from the image values regarded as character codes.
    • x: the image extension (the characters after the last . in the image name).
    • ^: the sequence of all image values, separated by commas ,.
    • @subset: the sequence of image values corresponding to the specified subset, separated by commas ,.
    • Any other feature is considered as a mathematical expression associated to the image [image] and is substituted by its evaluated result (floating-point value). For instance, expression {0,w+h} is substituted by the sum of the width and height of the first image (see section Mathematical Expressions for more details). If a mathematical expression starts with an underscore _, the resulting value is truncated to a readable format. For instance, item {_pi} is substituted by 3.14159 (while {pi} is substituted by 3.141592653589793). ๐Ÿ˜ญ
    • A feature 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 {`[102,111,111]`} is substituted by foo, and item {`vector8(65)`} by AAAAAAAA. ๐Ÿ”ฅ
  • {*} โ€” becomes the visibility state of the instant display window #0 (can be { 0:Closed | 1:Visible }). ๐Ÿ‘€
  • {*[index],feature1,...,featureN[:delimiter]} โ€” becomes a specific set of features of the instant display window #0 (or #index, if specified). Requested features can be:
    • u: screen width (actually independent on the window size).
    • v: screen height (actually independent on the window size).
    • uv: screen width*screen height.
    • d: window width (width of the window widget).
    • e: window height (height of the window widget).
    • de: window width*window height.
    • w: display width (width of the display area managed by the window).
    • h: display height (height of the display area managed by the window).
    • wh: display width*display height.
    • i: X-coordinate of the display window.
    • j: Y-coordinate of the display window.
    • f: current fullscreen state of the instant display.
    • n: current normalization type of the instant display.
    • t: window title of the instant display.
    • x: X-coordinate of the mouse position (or -1, if outside the display area).
    • y: Y-coordinate of the mouse position (or -1, if outside the display area).
    • b: state of the mouse buttons { 1:left-but. | 2:right-but. | 4:middle-but. }.
    • o: state of the mouse wheel.
    • k: decimal code of the pressed key if any, 0 otherwise.
    • c: boolean (0 or 1) telling if the instant display has been closed recently.
    • r: boolean telling if the instant display has been resized recently.
    • m: boolean telling if the instant display has been moved recently.
    • Any other feature stands for a keycode name (in capital letters), and is substituted by a boolean describing the current key state { 0:Pressed | 1:Released }.
    • You can also prepend a hyphen - to a feature (that supports it) to flush the corresponding event immediately after reading its state (works for keys, mouse and window events). ๐Ÿ’…
  • Item substitution is never 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 {, } or $ characters, as in 3+4 doesn't evaluate. ๐Ÿ™ˆ

9. Mathematical Expressions โœจ๐Ÿงฎ

  • G'MIC has an embedded mathematical parser, used to evaluate (possibly complex) mathematical expressions specified inside braces {}, or formulas in commands that may take one as an argument (e.g. fill or eval). ๐Ÿ”ฅ
  • When the context allows it, a formula is evaluated for each pixel of the selected images (e.g. fill or eval). โœจ
  • A mathematical expression may return, or take as arguments, either a scalar or a fixed-size vector.

The mathematical parser supports the following operators, functions and variables:

Common mathematical operators: ๐Ÿงฎ

|| (logical or), && (logical and), | (bitwise or), & (bitwise and), !=, ==, <=, >=, <, >, << (left bitwise shift), >> (right bitwise shift), -, +, *, /, % (modulo), ^ (power), ! (logical not), ~ (bitwise not), ++, --, +=, -=, *=, /=, %=, &=, |=, ^=, >>, <<= (in-place operators).

Common mathematical functions: ๐Ÿ’–

abs(), acos(), acosh(), arg0(), arg1(), argkth(), argmax(), argmaxabs(), argmin(), argminabs(), asin(), asinh(), atan(), atan2(), atanh(), avg(), bool(), cbrt(), ceil(), cos(), cosh(), cut(), deg2rad(), erf(), erfinv(), exp(), fact(), fibo(), floor(), frac(), gamma(), gauss(), gcd(), hypot(), int(), isconst(), isfinite(), isnan(), isnum(), isinf(), isint(), isbool(), isexpr(), isfile(), isdir(), isin(), kth(), lcm(), log(), log2(), log10(), logit(), max(), maxabs(), med(), min(), minabs(), narg(), prod(), rad2deg(), rol() (left bit rotation), ror() (right bit rotation), round(), sign(), sigmoid(), sin(), sinc(), sinh(), sqrt(), std(), srand(_seed), sum(), tan(), tanh(), var(), xor().

  • cov(A,B,_avgA,_avgB) โ€” gives you the covariance between vectors A and B. And yes bestie, you can pass in the estimated averages of those vectors as extra args if you already know them ๐Ÿ’…
  • mse(A,B) โ€” the mean-squared error between vectors A and B. classic.
  • atan2(y,x) โ€” it's the two-argument glow-up of atan(), taking y and x, exactly like in C/C++. iconic behavior fr.
  • perm(k,n,_with_order) โ€” counts the permutations of k objects pulled from a set of n objects. math girlies stay winning โœจ
  • gauss(x,_sigma,_is_normalized) โ€” returns exp(-x^2/(2*s^2))/(is_normalized?sqrt(2*pi*sigma^2):1). that's the whole formula, no cap, copy it exactly ๐ŸŽ€
  • cut(x,min,_max) โ€” hands back x if it's chilling inside the range [min, max], otherwise it clamps to min or max. gatekeeping your values, respectfully ๐Ÿšง
  • abscut(x,min,_max,_offset) โ€” returns cut(abs(x) + offset,min, max)*sign(x). same clamp energy but folded through the absolute value first, then sign-corrected ๐Ÿฆ‹
  • narg(a_1,...,a_N) โ€” tells you how many arguments you actually handed over (here, that's N). nosey but useful ๐Ÿ‘€
  • arg0(i,a_0,..,a_N) โ€” gives you the i-th argument a_i, where index i runs from 0 to N.
  • arg1(i,a_1,..,a_N) โ€” literally the same thing but the index i runs from 1 to N instead. one-based besties rise ๐Ÿ™Œ
  • indexof(ref,a_0,..,a_N) โ€” finds the index i of ref inside the list a_k, or returns -1 if ref isn't in the list at all (rude). index i starts from 0.
  • isnum(), isnan(), isinf(), isint(), isbool() โ€” these test the type of the number or expression you give them, and they return 0 (false) or 1 (true). vibe check for numbers ๐Ÿ’…
  • isfile('path') / isdir('path') โ€” returns 0 (false) or 1 (true) depending on whether that string argument is a path to an existing file (or, for isdir, a directory) ๐Ÿ—‚๏ธ
  • ispercentage(arg) โ€” returns 1 (true) if arg ends with a %, and 0 (false) otherwise. percent-coded โœจ
  • isvarname('str') โ€” returns 0 (false) or 1 (true) depending on whether that string is a valid variable name. name-checking, literally.
  • isvar(varname) โ€” returns 0 (false) or 1 (true) depending on whether varname is already a defined variable. is she already in the group chat or not ๐Ÿซถ
  • isin(v,a_1,...,a_n) โ€” returns 0 (false) or 1 (true) depending on whether the first argument v shows up in the set of other arguments a_i. basically "are you on the list" ๐ŸŽŸ๏ธ
  • isint(x,_xmin,_xmax) โ€” returns 1 (true) if x is an integer sitting in the range [xmin,xmax], otherwise 0 (false). whole-number only, no decimals allowed ๐Ÿ™…
  • inrange(value,m,M,include_m,include_M) โ€” returns 0 (false) or 1 (true) depending on whether the value lies in range [m, M]. the include_m and includeM args tell it how the boundaries m and M get treated (in or out, bestie, your call) ๐Ÿ”
  • argkth(), argmin(), argmax(), argminabs(), argmaxabs(), avg(), kth(), min(), max(), minabs(), maxabs(), med(), prod(), std(), sum() and var() โ€” all of these can be called with an arbitrary number of scalar/vector arguments. feed them as many as you want, they eat ๐Ÿฝ๏ธ
  • vargkth(), vargmin(), vargmax(), vargminabs(), vargmaxabs(), vavg(), vkth(), vmin(), vmax(), vminabs(), vmaxabs(), vmed(), vprod(), vstd(), vsum() and vvar() โ€” these are the vector versions of the functions right above. same energy, vector arguments ๐Ÿ’œ
  • wave(x,type) โ€” defines a periodic function with period 1 and values in [-1,1]. type picks the waveform, and it can be { 0:Square | 1:Triangle | 2:Ascending sawtooth | 3:Descending sawtooth | 4:Sine }. literally your own little oscillator ๐ŸŒ€
  • round(value,rounding_value,direction) โ€” returns a rounded value. direction can be { -1:To-lowest | 0:To-nearest | 1:To-highest }. pick your fighter โœจ
  • softmax(V,_temperature) and softmin(V,_temperature) โ€” return the softmax and softmin of vector V respectively. the default value for temperature is 1. soft girl summer but make it vector math ๐ŸŒธ
  • softargmax(V,_temperature) and softargmin(V,_temperature) โ€” return the softargmax and softargmin of vector V respectively. default for temperature is 1. yeah, they really made both flavors ๐Ÿ˜ญ
  • lerp(a,b,t) โ€” returns a*(1-t)+b*t. the interpolation girlie of all time, obsessed ๐ŸŽ€
  • swap(a,b) โ€” swaps the values of the two arguments you give it. and there's a second form: swap(#ind, offset0,offset1,_is_vector) swaps the pixels of image [ind] located at offsets offset0 and offset1. trading places, cinematic ๐Ÿ”

๐Ÿท๏ธ Predefined variable names:

The variable names below are already predefined for you bestie. that said, they can be overridden if you really want to ๐Ÿ˜Œ

  • l โ€” length of the current list of images.
  • k โ€” index of the current image, in [0,l-1].
  • w โ€” width of the current image, if there is one (0 otherwise).
  • h โ€” height of the current image, if any (0 otherwise).
  • d โ€” depth of the current image, if any (0 otherwise).
  • s โ€” spectrum of the current image, if any (0 otherwise).
  • r โ€” shared state of the current image, if any (0 otherwise).
  • wh โ€” shortcut for width*height.
  • whd โ€” shortcut for width*height*depth.
  • whds โ€” shortcut for width*height*depth*spectrum (which is literally the number of image values).
  • ia, ic, id, im, iM, in, ip, is, iv โ€” respectively the average, median, standard deviation, minimum, maximum, L2-norm, product, sum and variance of the current image, if any (0 otherwise). that's a whole squad right there ๐Ÿ‘‘
  • xm, ym, zm, cm โ€” the pixel coordinates of the minimum value in the current image, if any (0 otherwise).
  • xM, yM, zM, cM โ€” the pixel coordinates of the maximum value in the current image, if any (0 otherwise).
Real talk: all these variables get treated as constant values by the math parser (for optimization purposes), and honestly that's true most of the time. BUT it might not hold if the function resize(#ind,..) gets used inside the math expression. if that happens, it's safer to call l(), w(_#ind), h(_#ind), ... s(_#ind) and in(_#ind) instead of the matching named variables. play it safe bestie ๐Ÿซถ
  • i โ€” the currently processed pixel value (aka the value at (x,y,z, c)) in the current image, if any (0 otherwise).
  • iN โ€” the N-th channel value of the currently processed pixel (aka the value at (x,y,z,N) in the current image), if any (0 otherwise). N must be an integer in range [0,9]. don't push it ๐Ÿ’…
  • R, G, B and A โ€” equivalent to i0, i1, i2 and i3 respectively. rgb girlies, this is your moment ๐ŸŒˆ
  • I โ€” the currently processed vector pixel in the current image, if any (0 otherwise). the number of vector components equals the number of image channels (so for an RGB image, I = [ R,G,B ]). slay ๐Ÿ’–
  • _0 and _1 โ€” vectors whose dimension equals the number of channels of the current image, and whose values are all 0 or all 1 respectively.
  • You can add #ind to any of the variable names above to grab that info for any numbered image [ind] in the list (when it makes sense). for example, ia#0 denotes the average value of the first image in the list. iykyk ๐Ÿ”ฅ
  • x โ€” the currently processed column of the image, if any (0 otherwise).
  • y โ€” the currently processed row of the image, if any (0 otherwise).
  • z โ€” the currently processed slice of the image, if any (0 otherwise).
  • c โ€” the currently processed channel of the image, if any (0 otherwise).
  • t โ€” the thread id when an expression is evaluated with multiple threads (0 means the master thread).
  • n โ€” the maximum number of threads when the expression is evaluated in parallel (so t runs from 0 to n-1). threading era ๐Ÿงต
  • e โ€” the value of e, i.e. 2.71828....
  • pi โ€” the value of pi, i.e. 3.1415926....
  • eps โ€” the value of machine epsilon, aka the difference between 1.0 and the next value representable by a double.
  • u โ€” a random value between [0,1], following a uniform distribution.
  • v โ€” a random integer that's either 0 or 1, following a uniform distribution.
  • g โ€” a random value following a gaussian distribution of variance 1 (roughly inside [-6,6]). chaotic but make it statistics ๐ŸŒช๏ธ
  • interpolation โ€” the value of the default interpolation mode used when reading pixel values with the pixel access operators (i.e. when the interpolation argument isn't explicitly given โ€” more on pixel access operators below). its initial default value is 0.
  • boundary โ€” the value of the default boundary conditions used when reading pixel values with the pixel access operators (i.e. when the boundary condition argument isn't explicitly given โ€” again, more below on pixel access operators). its initial default value is 0.
  • The last image in the list is always the one associated with evaluations of expressions. for example, this G'MIC sequence:
256,128 fill {w}

will create a 256x128 image filled with value 256. cute right? ๐ŸŒŸ

Note on assignment: the predefined variables i, I, R, G, B, etc. act as read-only values. so writing I = [255,0,0] or i = 128 will create (or overwrite) a new local variable i or I inside the scope of the mathematical parser โ€” and it will not modify the actual image buffer. to actually do that, use the pixel access operator explicitly instead, e.g. I(x,y) = [ 255,0,0 ] or i(x,y,z) = 128. don't get got by this one ๐Ÿ™ˆ

๐Ÿงฎ Vector functions and operators:

okay so the math evaluator can absolutely work with vector elements. a math function applied to a vector argument usually returns a vector with the same dimension, where each element of the input vector got passed through the specified function (so like, abs([-1,2,-3]) returns [1,2,3]). it's giving element-wise excellence ๐Ÿ’…โœจ

okay so there are literally dedicated functions and operators for defining and computing vector elements โ€” here's the full rundown, bestie, no skips:

  • [a0,a1,...,aN-1] โ€” boom, that's how you define a N-dimensional vector with scalar coefficients ak. iconic.
  • vectorN(a0,a1,,...,aN-1) โ€” does the exact same thing, except the ak get repeated periodically if you only specify a few of them. lowkey convenient.
  • vector(#N,a0,a1,,...,aN-1) โ€” also the same deal, and this one can be used for any constant expression N.
  • In all of the expressions above, the ak can themselves be vectors, and they get concatenated into one single vector. nesting, slay.
  • You grab the scalar element ak of a vector X with X[k].
  • You grab the sub-vector [X[p],X[p+s]...X[p+s*(q-1)]] (of size q) of a vector X with X[p,q,s].
  • Equality/inequality comparisons between two vectors are done with the operators == and !=. periodt.
  • Some vector-specific functions can be used on vector values: cross(X,Y) (cross product), dot(X,Y) (dot product), size(X) (vector dimension), sort(X,_is_increasing,_starting_index,_nb_elts,_size_elt,_sort_index) (sorted values), reverse(A) (reverse order of components), map(X,P,_nb_channelsX,_nb_channelsP,_boundary_conditions), shift(A,_length,_boundary_conditions) and same(A,B,_nb_vals,_is_case_sensitive) (vector equality test).
  • Function normP(u1,...,un) computes the LP-norm of the specified vector โ€” P being a constant or inf, as in e.g. norm1().
  • Function normp(V,_p) computes the Lp-norm of the vector V. Here p can be variable, and the default value for p is 2.
  • Function unitnorm(V,_p) returns a normalized version V/normp(V) of vector V. Default value for p is 2.
  • Function resize(A,size,_interpolation,_boundary_conditions) returns a resized version of a vector A with the given interpolation mode. interpolation can be { -1:None (memory content) | 0:None | 1:Nearest | 2:Average | 3:Linear | 4:Grid | 5:Bicubic | 6:Lanczos }, and boundary_conditions can be { 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }.
  • Function find(A,B,_starting_index,_search_step,_max_iterations) returns the index where sub-vector B appears in vector A โ€” or -1 if B is not contained in A ๐Ÿ˜ญ. Argument A can also be replaced by an image index #ind.

big mood warning ๐Ÿšจ if you specify a vector-valued math expression as an argument of a command that operates on image values (e.g. fill), it modifies the whole spectrum range of the processed image(s), for each spatial coordinates (x,y,z). The command does not loop over the c-axis in this case. iykyk.

๐Ÿ’œ Complex-valued functions ๐Ÿ’œ

A 2-dimensional vector may be interpreted as a complex number and used in these particular functions/operators:

  • ** โ€” complex multiplication
  • // โ€” complex division
  • ^^ โ€” complex exponentiation
  • **= โ€” complex self-multiplication
  • //= โ€” complex self-division
  • ^^= โ€” complex self-exponentiation
  • cabs() โ€” complex modulus
  • carg() โ€” complex argument
  • cconj() โ€” complex conjugate
  • cexp() โ€” complex exponential
  • clog() โ€” complex logarithm
  • ccos() โ€” complex cosine
  • csin() โ€” complex sine
  • csqr() โ€” complex square
  • csqrt() โ€” complex square root
  • ctan() โ€” complex tangent
  • ccosh() โ€” complex hyperbolic cosine
  • csinh() โ€” complex hyperbolic sine
  • ctanh() โ€” complex hyperbolic tangent

the whole c-family ate, honestly ๐Ÿซถ

๐Ÿ‘‘ Matrix-valued functions ๐Ÿ‘‘

A MN-dimensional vector may be interpreted as a M x N matrix and used in these particular functions/operators:

  • * โ€” matrix-vector multiplication
  • det(A) โ€” determinant
  • diag(V) โ€” diagonal matrix from a vector
  • eig(A) โ€” eigenvalues/eigenvectors
  • eye(n) โ€” n x n identity matrix
  • invert(A,_nb_colsA) โ€” matrix inverse
  • mul(A,B,_nb_colsB) โ€” matrix-matrix multiplication
  • qr(A, _nb_colsA,_is_reduced_form)
  • rot(u,v,w,angle) โ€” 3D rotation matrix
  • rot(angle) โ€” 2D rotation matrix
  • solve(A,B,_nb_colsB) โ€” solver of linear system A.X = B
  • svd(A,_nb_colsA) โ€” singular value decomposition
  • trace(A) โ€” matrix trace
  • transpose(A, nb_colsA) โ€” matrix transpose
ngl tiny little detail that saves your life: argument nb_colsB may be omitted if it is equal to 1. โœจ

๐Ÿฆ‹ Image-valued functions ๐Ÿฆ‹

Some functions take vector-valued arguments that represent image data, and honestly? obsessed:

  • Function expr(formula,_w,_h,_d,_s,_A) outputs a vector of size w*h*d*s with values generated from the given formula, as if one were filling an image with dimensions (w,h,d,s). If A is specified, it must be a vector of size w*h*d*N (N can be different from s). It is then passed as a reference image (of size w x h x d x N) for the given expression.
  • Function resize(A,wA,hA,dA,sA,nwA,_nhA,_ndA,_nsA,_interpolation,_boundary_conditions,_ax,_ay,_az,_ac) is the extended version of the resize() function. It lets you resize the vector A, treated as an image of size (ow,oh,od,os), as a new image of size (nw,nh,nd,ns), with the resizing options you specify.
  • Function warp(A,wA,hA,dA,sA,B,wB,hB,dB,sB,_mode,_interpolation,_boundary_conditions) returns the warped version of the image A (of size (wA,hA,dA,sA), treated as a vector of size (wA*hA*dA*sA)) by the warping field B (of size (wB,hB,dB,sB)). The resulting image has size (wB,hB,dB,sA). This is the math evaluator equivalent of command warp.
  • Function index(A,P,nb_channelsP,_dithering,_map_colors) returns the indexed version of the image A by the colormap P. This is the math evaluator equivalent of command index.
  • Function permute(A,wA,hA,dA,sA,permutation) returns a permuted version of the image A (of size (wA,hA,dA,sA), treated as a vector of size wA*hA*dA*sA). This is the math evaluator equivalent of command permute.
  • Function mirror(A,wA,hA,dA,sA,axes_string) returns a mirrored version of the image A (of size (wA,hA,dA,sA), treated as a vector of size wA*hA*dA*sA). This is the math evaluator equivalent of command mirror.
  • Function cumulate(A,wA,hA,dA,sA,_axes_string) returns a cumulated version of the image A (of size (wA,hA,dA,sA), treated as a vector of size wA*hA*dA*sA). This is the math evaluator equivalent of command cumulate.
  • Function histogram(A,nb_levels,_min_value,_max_value) returns the histogram of the vector A. This is the math evaluator equivalent of command histogram.
  • Function equalize(A,nb_levels,_min_value,_max_value) returns the equalized version of the vector A. This is the math evaluator equivalent of command equalize.
  • Function normalize(A,_min_value,_max_value) returns the normalized version of the vector A. This is the math evaluator equivalent of command normalize.
  • Function mproj(S,nb_colsS,D,nb_colsD,method,max_iter,max_residual) projects a matrix S onto a dictionary (matrix) D. This is the math evaluator equivalent of command mproj.
  • Functions fft(R,I,w,h,d,s,_'axis') computes the Fast Fourier Transform of the complex pair [R,I], treated as images of size (w,h,d,s). Inverse fft is computed with the similar function ifft(). These functions replace the content of R and I in-place. This is the math evaluator equivalent of commands fft and ifft.
  • Function shift(A,wA,hA,dA,sA,_dx,_dy,_dz,_dc,_boundary_conditions) returns a shifted version of the vector A, treated as an image of size (wA,hA,dA,sA). This is the math evaluator equivalent of command shift.
  • Function noise(A,amplitude,_noise_type) returns the noisy version of the vector A. This is the math evaluator equivalent of command noise.
  • Function rand(#size,_min_value,_max_value,_pdf,_precision) returns a vector of size random values. This is the math evaluator equivalent of command rand.

๐ŸŽ€ String manipulation ๐ŸŽ€

Character strings are defined as vector objects, so they can totally be managed as such. Dedicated functions and initializers to manage strings exist:

  • ['string'] and ''string'' define a vector whose values are the character codes of the given character string (e.g. ''foo'' is equal to [ 102,111,111 ]).
  • _'character' returns the ASCII code of the given character (e.g. _'A' is equal to 65).
  • A special case happens for empty strings: values of both expressions [''] and '''' are 0. ๐Ÿ’€ yes really.
  • Functions lowercase() and uppercase() return a string with all string characters lowercased or uppercased.
  • Function s2v(str,_starting_index,_is_strict) parses string str and returns the value contained in it.
  • Function v2s(expr,_nb_digits,_siz) returns a vector of size siz which contains the character representation of values described by expression expr. nb_digits can be { <-1:0-Padding of integers | -1:Auto-reduced | 0:All | >0:Max number of digits }.
  • Function echo(str1,str2,...,strN) prints the concatenation of the given string arguments on the console.
  • Function string(_#siz,str1,str2,...,strN) generates a vector corresponding to the concatenation of the given string/number arguments.

๐ŸŒˆ Dynamic arrays ๐ŸŒˆ

A dynamic array is defined as a one-column (or empty) image [ind] in the image list. It lets elements be added or removed, each element having the same dimension (which is actually the number of channels of image [ind]). Dynamic arrays adapt their size to the number of elements they contain. main character energy fr fr โœจ

A dynamic array can be manipulated in a math expression, and the function lineup is genuinely stacked, bestie:

  • da_size(_#ind) โ€” returns the number of elements in dynamic array [ind]. Literally the headcount.
  • da_back(_#ind) โ€” returns the last element of dynamic array [ind]. The final girlie.
  • da_insert(_#ind,pos,elt_1,_elt_2,...,_elt_N) โ€” inserts N new elements elt_k starting from index pos in dynamic array [ind].
  • da_push(_#ind,elt1,_elt2,...,_eltN) โ€” inserts N new elements elt_k at the end of dynamic array [ind].
  • da_pop(_#ind) โ€” same as da_back() but also removes the last element from dynamic array [ind].
  • da_push_heap(_#ind,elt1,_elt2,...,_eltN) and da_pop_heap(_#ind) โ€” same energy, but for a dynamic array seen as a min-heap structure.
  • da_insert_n(_#ind,n,pos,elt_1,_elt_2,...,_elt_N), da_push_n(_#ind,n,elt1,_elt2,...,_eltN) and da_push_heap_n(_#ind,n,elt1,_elt2,...,_eltN) โ€” variants that insert the given elements consecutively, n times. If no elements are given, they insert n empty elements. No notes.
  • da_remove(_#ind,_start,_end) โ€” removes elements located between indices start and end (included) in dynamic array [ind].
  • da_freeze(_#ind) โ€” converts a dynamic array into a 1-column image with height da_size(#ind). Glow-up into image form.
  • The value of the k-th element of dynamic array [ind] is retrieved with i[_#ind,k] (if the element is a scalar value), or I[_#ind,k] (if the element is a vector).

In the functions above, argument #ind may be omitted, in which case it is assumed to be #-1. Convenient? Iconic.


โœจ Special operators โœจ

  • ; โ€” expression separator. The returned value is always the last encountered expression. For instance expression 1;2;pi is evaluated as pi. Last one standing wins.
  • = โ€” variable assignment. Variables in the mathematical parser can only refer to numerical values (vectors or scalars). Variable names are case-sensitive. Use this operator in conjunction with ; to define more complex evaluable expressions, such as:
t = cos(x); 3*t^2 + 2*t + 1

These variables remain local to the mathematical parser and cannot be accessed outside the evaluated expression. Very private, very mysterious.

  • Variables defined in the math parser may have a constant property, by specifying keyword const before the variable name (e.g. const foo = pi/4;). The value assigned to such a variable must be a constant scalar. Constant variables allow certain types of optimizations in the math JIT compiler. Optimization slay.

๐Ÿงš Specific functions ๐Ÿงš

  • addr(expr) โ€” returns the pointer address to the given expression expr.
  • o2c(_#ind,offset,_boundary_conditions) and c2o(_#ind,x,_y,_z,_c,_boundary_conditions) โ€” convert image offset to image coordinates and vice-versa. Argument boundary_conditions can be { 0:None | 1:Return -1 if out-of-range }.
  • fill(target,expr) or fill(target,index_name,expr) โ€” fills the vector variable target, using the given expression, e.g. V = vector16(); fill(V,k,k^2 + k + 1);. This is basically equivalent to: for (index_name = 0, index_name<size(target), ++index_name, target[index_name] = expr);.
  • fill(target,w,h,d,s,'expr') โ€” fills the vector variable target, treated as an image of size (w,h,d,s), using the given expression.
  • u(max) or u(min,max,_include_min,_include_max) โ€” returns a random value in range 0...max or min...max, following a uniform distribution. Each range extremum can be included (default) in the distribution or not.
  • v(max) or v(min,max,_include_min,_include_max) โ€” does the same but returns an integer in the specified range. Integer behavior, no crumbs.
  • f2ui(value) and ui2f(value) โ€” convert a large unsigned integer as a negative floating-point value (and vice-versa), so that 32-bit floats can be used to store large integers while keeping a unitary precision.
  • i(_a,_b,_c,_d,_interpolation_type,_boundary_conditions) โ€” returns the value of the pixel located at position (a,b,c,d) in the current image, if any (0 otherwise). interpolation_type can be { 0:Nearest neighbor | 1:Linear | 2:Cubic }. boundary_conditions can be { 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }. Omitted coordinates are replaced by their default values, which are respectively x, y, z, c, interpolation and boundary. For instance, command:
fill 0.5*(i(x+1)-i(x-1))

will estimate the X-derivative of an image with a classical finite difference scheme. Math but make it cute.

  • j(_dx,_dy,_dz,_dc,_interpolation_type,_boundary_conditions) โ€” does the same for the pixel located at position (x+dx,y+dy,z+dz,c+dc) (pixel access relative to the current coordinates).
  • i[offset,_boundary_conditions] โ€” returns the value of the pixel located at offset in the associated image buffer (or 0 if offset is out-of-bounds).
  • j[offset,_boundary_conditions] โ€” does the same for an offset relative to the current pixel coordinates (x,y,z,c).
  • i(#ind,_x,_y,_z,_c,_interpolation,_boundary_conditions), j(#ind,_dx,_dy,_dz,_dc,_interpolation,_boundary_conditions), i[#ind,offset,_boundary_conditions] and i[offset,_boundary_conditions] โ€” similar expressions used to access pixel values for any numbered image [ind] in the list.
  • I/J[_#ind,offset,_boundary_conditions] and I/J(_#ind,_x,_y,_z,_interpolation,_boundary_conditions) โ€” do the same as i/j[_#ind,offset,_boundary_conditions] and i/j(_#ind,_x,_y,_z,_c,_interpolation,_boundary_conditions) but return a vector instead of a scalar (e.g. a vector [ R,G,B ] for a pixel at (a,b,c) in a color image). Vector realness.
  • crop(_#ind,_x,_y,_z,_c,_dx,_dy,_dz,_dc,_boundary_conditions) โ€” returns a vector whose values come from the cropped region of image [ind] (or from the default image selected if ind is not specified). The cropped region starts from point (x,y,z,c) and has a size of (dx,dy,dz,dc). Arguments for coordinates and sizes can be omitted if they are not ambiguous (e.g. crop(#ind,x,y,dx,dy) is a valid invocation of this function).
  • crop(S,w,h,d,s,_x,_y,_z,_c,_dx,_dy,_dz,_dc,_boundary_conditions) โ€” does the same but extracts the cropped data from a vector S, treated as an image of size (w,h,d,s).
  • draw(_#ind,S,_x,_y,_z,_c,_dx,_dy,_dz,_dc,_opacity,_opacity_mask,_max_opacity_mask) โ€” draws a sprite S in image [ind] (or in the default image selected if ind is not specified) at coordinates (x,y,z,c).
  • draw(D,w,h,s,d,S,_x,_y,_z,_c,_dx,_dy,_dz,_dc,_opacity,_M,_max_M) โ€” does the same but draws the sprite S in the vector D, treated as an image of size (w,h,d,s).
  • polygon(_#ind,nb_vertices,coords,_opacity,_color) โ€” draws a filled polygon in image [ind] (or in the default image selected if ind is not specified) at given coordinates. It draws a single line if nb_vertices is set to 2.
  • polygon(_#ind,-nb_vertices,coords,_opacity,_pattern,_color) โ€” draws an outlined polygon in image [ind] (or in the default image selected if ind is not specified) at given coordinates and with line pattern. It draws a single line if nb_vertices is set to 2. Outline era.
  • ellipse(_#ind,xc,yc,radius1,_radius2,_angle,_opacity,_color) โ€” draws a filled ellipse in image [ind] (or in the default image selected if ind is not specified) with given coordinates.
  • ellipse(_#ind,xc,yc,-radius1,-_radius2,_angle,_opacity,_pattern,_color) โ€” draws an outlined ellipse in image [ind] (or in the default image selected if ind is not specified).
  • flood(_#ind,_x,_y,_z,_tolerance,_is_high_connectivity,_opacity,_color) โ€” performs a flood fill in image [ind] (or in the default image selected if ind is not specified) with given coordinates. This is the math evaluator equivalent of command flood.
  • resize(#ind,w,_h,_d,_s,_interp,_boundary_conditions,_cx,_cy,_cz,_cc) โ€” resizes an image of the associated list with given dimension and interpolation method. When using this function, you should consider retrieving the (non-constant) image dimensions using the dynamic functions w(_#ind), h(_#ind), d(_#ind), s(_#ind), wh(_#ind), whd(_#ind) and whds(_#ind) instead of the corresponding constant variables.
  • if(condition,expr_then,_expr_else) โ€” returns value of expr_then or expr_else, depending on the value of condition { 0:False | other:True }. expr_else can be omitted, in which case 0 is returned if the condition does not hold. Using the ternary operator condition?expr_then[:expr_else] gives an equivalent expression. For instance, G'MIC commands:
fill if(!(x%10),255,i)

and:

fill x%10?i:255

both draw blank vertical lines on every 10th column of an image. Conditional queen behavior.

  • do(expression,_condition) โ€” repeats the evaluation of expression until condition vanishes (or until a break() instruction is encountered if no condition is specified). For instance, the expression:
if(N<2,N,n=N-1;F0=0;F1=1;do(F2=F0+F1;F0=F1;F1=F2,n=n-1))

returns the N-th value of the Fibonacci sequence, for N>=0 (e.g., 46368 for N=24). do(expression,condition) always evaluates the expression at least once, then checks for the loop condition. When done, it returns the last value of expression.

  • for(init,condition,_procedure,body) โ€” first evaluates the expression init, then iteratively evaluates body (followed by procedure if specified) while condition holds (i.e. not zero). It may happen that no iterations are done, in which case the function returns nan. Otherwise, it returns the last value of body. For instance, the expression:
if(N<2,N,for(n=N;F0=0;F1=1,n=n-1,F2=F0+F1;F0=F1;F1=F2))

โ€ฆreturns the N-th value of the Fibonacci sequence, for N>=0 (e.g. 46368 for N=24). ๐ŸŒ€

  • while(condition,expression) โ€” exactly the same as for(init,condition,expression) but with no initializing expression specified, periodt. ๐Ÿ’…
  • repeat(nb_iters,expr) or fill(nb_iters,iter_name,expr) โ€” runs nb_iters iterations of the given expression expr, like V = vector16(); repeat(16,k,V[k] = k^2 + k + 1);. Basically equivalent to: for (iter_name = 0, iter_name<nb_iters, ++iter_name, expr); ๐ŸŽ€
  • break() and continue() โ€” respectively terminate or continue execution of the current loop or block. know the difference bestie โœจ
  • fsize('filename') โ€” returns the size of the given filename (or -1 if the file does not exist). ๐Ÿ“
  • date(attr,'path') โ€” returns the date attribute for the given path (file or directory), with attr being { 0:Year | 1:Month | 2:Day | 3:Day of week | 4:Hour | 5:Minute | 6:Second }, or a vector of those values. ๐Ÿ—“๏ธ
  • date(_attr) โ€” returns the given attribute for the current (locale) date (attributes being { 0...6:Same meaning as above | 7:Milliseconds }). โฐ
  • epoch(_year,_month,_day,_hour,_minute,_second) โ€” converts a date into Epoch. If no arguments are specified, the current Epoch is returned. ๐Ÿ•ฐ๏ธ
  • print(expr1,expr2,...) or print(#ind) โ€” prints the value of the given expressions (or image information) on the console, and returns the value of the last expression (or nan in case of an image). Function prints(expr) also prints the string composed of the character codes defined by the vector-valued expression (e.g. prints('Hello')). ๐Ÿ–จ๏ธ
  • debug(expression) โ€” prints detailed debug info about the sequence of operations done by the math parser to evaluate the expression (and returns its value). detective mode activated ๐Ÿ”
  • display(_X,_w,_h,_d,_s) or display(#ind) โ€” displays the contents of the vector X (or given image) and waits for user events. If no arguments are given, a memory snapshot of the math parser environment is displayed instead. ๐Ÿ‘€
  • begin(expression) and end(expression) โ€” evaluate the given expressions only once, respectively at the beginning and end of the evaluation procedure, even when multiple evaluations are required (e.g. in fill ">begin(foo = 0); ++foo"). ๐Ÿ”
  • copy(dest,src,_nb_elts,_inc_d,_inc_s,_opacity) โ€” copies an entire memory block of nb_elts elements starting from a source value src to a specified destination dest, with increments defined by inc_d and inc_s respectively for the destination and source pointers. ๐Ÿ“ฆ
  • stats(_#ind) โ€” returns the statistics vector of the running image [ind], i.e the vector [ im,iM,ia,iv,xm,ym,zm,cm,xM,yM,zM,cM,is,ip, in ] (15 values). ๐Ÿ“Š
  • stats(X,w,h,d,s) โ€” returns the statistics vector of the vector X, treated as an image of size (w,h,d,s). ๐Ÿงฎ
  • ref(expr,a) โ€” references the given expression expr as variable name a. ๐Ÿชข
  • unref(a,b,...) โ€” destroys references to the named variable given as arguments. โœ‚๏ธ
  • breakpoint() โ€” inserts a possible computation breakpoint (useless with the cli interface). ๐Ÿ›‘
  • _(comment) expr โ€” just returns expression expr (useful for inserting inline comments in math expressions). ๐Ÿ’ฌ
  • run('pipeline') โ€” executes the G'MIC pipeline as if it was called outside the currently evaluated expression. ๐Ÿƒโ€โ™€๏ธ
  • set('variable_name',A) โ€” sets the G'MIC variable $variable_name with the value of expression A. If A is a vector variable, it is assumed to encode a string. ๐Ÿช„
  • store('variable_name',A,_w,_h,_d,_s,_is_compressed) โ€” transfers the data of vector A as a (w,h,d,s) image to the G'MIC variable $variable_name. Thus, the data becomes available outside the math expression (that is equivalent to using the regular command store, but directly in the math expression). ๐Ÿ—ƒ๏ธ
  • get('variable_name',_size,_return_as_string) โ€” returns the value of the variable, as a vector of size values, or as a scalar (if size is zero or not specified). ๐ŸŽฃ
  • name(_#ind,size) โ€” returns a vector of size size, whose values are the character codes of the name of image [ind] (or default image selected if ind is not specified). ๐Ÿท๏ธ
  • correlate(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) โ€” returns the correlation, unrolled as a vector, of the (wI,hI,dI,sI)-sized image I with the (wK,hK,dK,sK)-sized kernel K (the meaning of the other arguments is the same as in command correlate). Similar function convolve(...) is also defined for computing the convolution between I and K. ๐Ÿง 

๐Ÿฆ‹ User-defined macros: ๐Ÿฆ‹

  • Custom macro functions can be defined in a math expression, using the assignment operator =, e.g.
foo(x,y) = cos(x + y); result = foo(1,2) + foo(2,3)
  • Trying to override a built-in function (e.g. abs()) 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 macros by the mathematical evaluator. You should avoid invoking them with arguments that are themselves results of assignments or self-operations. For instance,
foo(x) = x + x; z = 0; foo(++z)

returns 4 rather than the expected value 2. plot twist ๐Ÿ˜ญ

  • When substituted, macro arguments are placed inside parentheses, except if a number sign # is located just before or after the argument name. For instance, expression
foo(x,y) = x*y; foo(1+2,3)

returns 9 (being substituted as (1+2)*(3)), while expression

foo(x,y) = x#*y#; foo(1+2,3)

returns 7 (being substituted as 1+2*3). ๐Ÿคฏ

  • Number signs # appearing between macro arguments actually act as empty separators. They may be used to force the substitution of macro arguments in unusual places, e.g. as in
str(N) = ['I like N#'];
  • Macros with variadic arguments can be defined, by specifying a single argument name followed by .... For instance,
foo(args...) = sum([ args ]^2);

defines a macro that returns the sum of its squared arguments, so foo(1,2,3) returns 14 and foo(4,5) returns 41. ๐ŸŒˆ

๐ŸŒˆ Multi-threaded and in-place evaluation: ๐ŸŒˆ

  • If your images are large enough and you have several CPU cores available, it is possible that the math expression passed to fill, eval or input commands can be evaluated in parallel, using multiple computation threads. โšก
  • G'MIC tries to auto-detect if an expression can be parallelized, and if it can be evaluated in-place (otherwise, a temporary copy of the image is allocated). However, this auto-detection can be overridden, by starting the mathematical expression for the fill or eval commands with a single character, that can be:
    • * โ€” evaluate expression in parallel, possibly using a temporary image copy. ๐Ÿ’ซ
    • : โ€” evaluate expression in parallel, but in-place. ๐ŸŽฏ
    • + โ€” evaluate expression in a single thread, possibly using a temporary image copy (in scanline order). ๐Ÿงต
    • > โ€” evaluate expression in a single thread, but in-place (in scanline order). โžก๏ธ
    • < โ€” evaluate expression in a single thread, but in-place (in reverse scanline 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). noted, bestie โš ๏ธ
  • For parallel evaluations, function critical(expr) serializes execution of the given sub-expression expr in a single thread at a time. ๐Ÿ”’
  • begin_t(expr) and end_t(expr) โ€” evaluate the given expression once for each running thread (so possibly several times) at the beginning and the end of the evaluation procedure. ๐Ÿงš
  • merge(variable,operator) โ€” specifies that the local thread values requests merging, with the given operator, when all threads have finished computing. ๐Ÿงฉ
  • Expressions i(_#ind,x,_y,_z,_c)=value, j(_#ind,x,_y,_z,_c)=value, i[_#ind,offset]=value and j[_#ind,offset]=value set a pixel value at a location other than the current one in the image [ind] (or in the current image if argument #ind is omitted), either with global coordinates/offsets (with i(...) and i[...]), or relatively to the current position (x,y,z,c) (with j(...) and j[...]). These expressions always return value. ๐ŸŽจ

10. Adding Custom Commands ๐Ÿ‘‘

  • New custom commands can be added by the user, through the use of G'MIC custom commands files. ๐Ÿ› ๏ธ
  • A command file is a simple text file, where each line starts either with
command_name: command_definition

or

command_definition (continuation)
  • At startup, G'MIC automatically pulls in the user's command file $HOME/.gmic (on Unix) or %USERPROFILE%ser.gmic (on Windows). The CLI tool gmic automatically runs the command cli_start if it's defined. ๐Ÿซถ
    • Custom command names have to use the character set [a-zA-Z0-9_] and cannot start with a number.
    • Any # comment expression you leave in a custom commands file gets yeeted by the G'MIC parser, no matter where it sits on the line. ๐Ÿ’€
    • In a custom command, these $-expressions are recognized and substituted:
      • $* gets swapped for a verbatim copy of the given string of arguments (do not include arguments set to default values).
      • $"*" gets swapped for the sequence of given arguments, separated by commas ,, each one double-quoted (this one does include arguments set to default values). โœจ
      • $# gets swapped for the maximum index of known arguments (either specified by the user or set to a default value in the custom command).
      • $[] gets swapped for the list of selected image indices that were specified in the command invocation.
      • $? gets swapped for a printable version of $[], meant to be used in command descriptions.
      • $i and ${i} both get swapped for the i-th argument. Negative indices like ${-j} are allowed and refer to the j-th latest argument. And $0 gets swapped for the custom command name. ๐ŸŽ€
      • ${i=default} gets swapped for the value of $i (if it's defined) or for its new value set to default otherwise (default can be a $-expression too).
      • ${subset} gets swapped for the argument values (separated by commas ,) of an argument subset. So for example, the expression ${2--2} gets swapped for all command arguments except the first and the last one. Expression ${^0} then gets swapped for all arguments of the invoked command (equivalent to $* if all arguments really were specified). ๐ŸŒธ
      • $=var gets swapped for the set of instructions that will assign each argument $i to the named variable var$i (for i in [0...$#]). This is super handy when a custom command wants to manage a variable number of arguments. Variable names must use the character set [a-zA-Z0-9_] and cannot start with a number.
    • These particular $-expressions for custom commands are always substituted โ€” even inside double-quoted items, or when the dollar sign $ is escaped with a backslash $. To dodge the substitution, just place an empty double-quoted string right after the $ (like in $""1). ๐Ÿ™ˆ
    • You can skip specifying arguments when you invoke a custom command, by replacing them with commas , like in this expression:
flower ,,3

Omitted arguments get set to their default values, which therefore have to be explicitly defined in the code of the matching custom command (using default argument expressions like ${1=default}).

  • If a required numbered argument of a custom command is missing a value, the G'MIC interpreter throws an error.
  • You can specialize the invocation of a +command by defining it like this:
+command_name: command_definition
  • A +-specialization takes priority over the regular command definition when the command is invoked with a prepended +. ๐Ÿ‘‘
  • When only a +-specialization of a command is defined, invoking command is actually equivalent to +command.

๐ŸŒˆ 11. List of Commands ๐ŸŒˆ

All the available G'MIC commands are listed below by category, bestie. An argument wrapped in square brackets [] or starting with _ is optional โ€” except when it stands for an existing image [image], where image can be either an index number or an image name. In that case, the [] characters are mandatory when you write the item. Also note: all images that serve as illustrations in this reference documentation get normalized in range [0, 255] before being displayed. You may need to do that explicitly (command normalize 0,255) if you want to save and view images with the same appearance as the ones illustrated in the example codes. ๐Ÿ–ผ๏ธ

The examples that come with this List of Commands show off the G'MIC language and are written as they'd appear in a custom command. While some examples may work if you type them directly at a shell prompt, there's no guarantee โ€” and no attempt has been made to escape special characters in these examples, which many shells reserve. ๐Ÿ˜ญ

โœจ 11.1. Global Options โœจ

debug (+)

Enable debug mode. When it's on, the G'MIC interpreter gets so much more verbose and prints extra messages about its internal state to the standard output (stdout). This option is mainly for developers and for reporting potential interpreter bugs. ๐Ÿ›

h

Shortcut for command help.

help

command | (no arg)

Display help for all commands, or for a specified command, then exit. (equivalent to shortcut command h). ๐Ÿ’–

version

Display the current version number on stdout.

๐Ÿฆ‹ 11.2. Input / Output ๐Ÿฆ‹

camera (+)

_camera_index>=0,_nb_frames>0,_skip_frames>=0,_capture_width>=0,_capture_height>=0

Insert one or several frames from the specified camera. When nb_frames==0, the camera stream is released instead of capturing new images. Heads up: this command requires features from the OpenCV library (not enabled in G'MIC by default). ๐ŸŽฅ

Default values: camera_index=0 (default camera), nb_frames=1, skip_frames=0 and capture_width=capture_height=0 (default size).

m (+)

Shortcut for command command.

command (+)

_add_debug_info={ 0:No | 1:Yes },{ filename | http[s]://URL | "string" }

Import G'MIC custom commands from a specified file, URL or string. (equivalent to shortcut command m). ๐Ÿ’…

Imported commands are available directly after the command invocation. The specified filename is not allowed to contain colons :.

Default value: add_debug_info=1 (except for a "string" argument, in which case add_debug_info=0).

Example:

[#1] image.jpg command "foo : mirror y deform $""1" +foo[0] 5 +foo[0] 15

compress_to_keypoints

_method,_max_keypoints>=0,_err_avg[%]>=0,_err_max[%]>=0,_"err_command"

Compress each of the selected images into a set of keypoints that can later be decompressed using command decompress_from_keypoints. โš ๏ธ Beware: this type of compression is effective only for images with very smooth content. method can be { 0:PDE | 1:RBF }. Add 2 to method to skip the point removal step.

  • max_keypoints is the maximal number of keypoints generated by the compression method. If max_keypoints<0, the removal step is not done when the number of maximal keypoints has been reached. max_keypoints=0 means no limits. ๐Ÿ”ฅ
  • err_avg is the desired average compression error.
  • err_max is the desired pointwise max compression error.
  • err_command is the code of a command that inputs the two images [reference] and [compressed] and computes a single error map as a last image.

Default values: method=3, max_keypoints=0, err_avg=1%, err_max=5% and err_command=-. [0] norm.

createdir (+)

force_overwrite={ 0:No | 1:Yes },directory_path_1,_directory_path_2,...

Create one or several new directories directory_path_k on the filesystem. If a specified directory path contains several subdirectories itself, they all get created if necessary. ๐Ÿ“

Default value: force_overwrite=1.

cursor (+)

_mode = { 0:hide | 1:show }

Show or hide the mouse cursor for the selected instant display windows. Command selection (if any) stands for instant display window indices instead of image indices. ๐Ÿ–ฑ๏ธ

Default value: mode=1.

delete (+)

filename1[,filename2,...]

Delete the specified files or directories on disk. Multiple filenames must be separated by commas. ๐Ÿ—‘๏ธ

d

Shortcut for command display.

display

Display selected images in an interactive window. (equivalent to shortcut command d). ๐Ÿ’–

When invoked with a + prefix (i.e. +display), the command outputs its log messages on stdout rather than on stderr. Display window #0 is used as the default window for the display, if it's already opened.

Available controls are shown below (where LMB = Left mouse button, RMB = Right mouse button, MMB = Middle mouse button and MW = Mouse wheel).

  • Thumbnail navigation bar:
    • TAB: Show/hide thumbnails
    • LMB: Select thumbnail or shift thumbnail bar
    • 0-9, ARROWS (optionally +SHIFT), B, BACKSPACE, C, E, END, H, HOME, SPACE: Navigate and select thumbnails (add CTRL if the mouse pointer is outside the thumbnail bar).
  • Image view:
    • LMB or MMB: Image pan
    • RMB or MW: Image zoom
    • ARROWS (optionally +SHIFT), HOME, END: Shift view
    • A: Switch alpha rendering
    • C: Center view
    • E: Go to lower-right corner
    • RETURN: Reset view
    • G: Toggle grid
    • H: Go to upper-left corner
    • K: Switch background
    • M: Toggle 3D view
    • N: Switch normalization
    • P: Print info about current image pixel on stdout
    • PAGEUP or PAGEDOWN: Raise/lower base channel
    • R: Rotate image
    • T: Plot as a 1D curve
    • V: Crop image
    • Z: Switch zoom factor
    • 0-9: Set zoom factor. ๐Ÿ”
  • 3D mesh view:
    • LMB: Mesh rotation
    • CTRL+LMB or MMB: Mesh pan
    • RMB: Mesh zoom
    • A: Toggle axes
    • D: Switch face side mode
    • F: Change focal length
    • J: Start/stop animation
    • K: Switch background
    • O: Switch outline mode
    • P: Print 3D pose matrix on stdout
    • R: Switch rendering mode
    • T: Switch motion rendering mode
    • X: Show/hide bounding-box
    • U: Switch animation mode
    • Z: Toggle z-buffer. ๐ŸงŠ
  • 2D images specific:
    • CTRL+LMB: Rectangular selection.
  • 3D volumetric images specific:
    • CTRL+MW: Pan along orthogonal axis
    • X: Reset area layout. ๐ŸŽ€
  • Ctrl+C โ€” shrink the window ๐Ÿ’…
  • Ctrl+D โ€” grow the window โœจ
  • Ctrl+F โ€” toggle fullscreen, main character energy ๐ŸŽ€
  • Ctrl+I โ€” toggle the info label
  • Ctrl+O โ€” save a copy of the image as a .gmz file
  • Ctrl+L โ€” save a copy of the image list as a .gmz file ๐Ÿฆ‹
  • Ctrl+S โ€” save a screenshot as a .png file ๐Ÿ“ธ
  • Ctrl+W โ€” start/stop window recording
  • Ctrl+X โ€” toggle the cursor

๐ŸŽ€ Configuration variables ๐ŸŽ€

okay so you can literally tune the viewer by assigning these variables, no cap. like, just set them and the vibe check passes:

  • _display_selected โ€” an integer or an image name telling which image is selected by default.
  • _display_alpha โ€” can be { 0:Off | 1:On | 2:Over black | 3:Over gray | 4:Over white } (default value: 0).
  • _display_background โ€” an integer in range [ 0,9 ] (default value: 3).
  • _display_cursor โ€” can be { 0:Off | 1:On (2D only) | 2:On (+3D volumetric images) } (default value: 1).
  • _display_is_grid โ€” can be { 0:Off | 1:On } (default value: 1).
  • _display_is_info โ€” can be { 0:Off | 1:On } (default value: 1).
  • _display_normalization โ€” can be { -1:Auto | 0:Off | 1:Cut | 2:Stretch channelwise | 3:Stretch global | 4: stretch (global-once) } (default value: -1).
  • _display_print_images โ€” can be { 0:Off | N>0 } (default value: 5). it sets the max number N of images whose information is initially printed on stderr or stdout.
  • _display_3d_is_rendered โ€” can be { 0:Off | 1:On } (default value: 1).
  • _display_3d_rendering_mode โ€” can be { 0:Dots | 1:Wireframe | 2:Flat | 3:Flat-shaded | 4:Gouraud-shaded | 5=Phong-shaded } (default value: 4).
  • _display_3d_outline_mode โ€” can be { 0:No-outline | 1:Black-outline | 2:Gray-outline | 3:Red-outline | 4:Green-outline | 5:Blue-outline | 6:White-outline } (default value: 0).
  • _display_3d_motion_rendering_mode โ€” can be { -1:Bounding-box | 0:Dots | 1:Wireframe | 2:Flat | 3:Flat-shaded | 4:Gouraud-shaded | 5=Phong-shaded } (default value: 3).
  • _display_3d_motion_time_limit โ€” specified in ms. above this time, motion rendering toggle to bounding-box mode (default value: 300).
  • _display_3d_side_mode โ€” can be { 0:Single-sided | 1:Double-sided | 2:Single-sided (flipped) } (default value: 0).
  • _display_3d_is_zbuffer โ€” can be { 0:Off | 1:On } (default value: 1).
  • _display_3d_focal โ€” can be { <0:Perspective projection w/o sprite zooming, 0:Parallel projection | >0:Perspective projection } (default value: 1.5).
  • _display_3d_is_axes โ€” can be { 0:Off | 1:On } (default value: 1).
  • _display_3d_is_bounding_box โ€” can be { 0:Off | 1:On } (default value: 0).
  • _display_3d_background โ€” an unsigned integer in range [0,11] (default value: 11).
  • _display_3d_pose โ€” a sequence of 12 values that defines the current 3D pose matrix (read/write).
  • _display_3d_animation โ€” can be { 0:Off | 1:Forward | 2:Backward } (default value: 0).
  • _display_3d_animation_mode โ€” can be { 0-3:X-axis | 4-7:Y-axis | 8-11:Z-axis | 12-15:XYZ-axes } (default value: 4).

โœจ d0 / display0 โœจ

d0 is literally just a shortcut for the command display0. slay.

display0 โ€” shows your selected images in an interactive window, but with no normalization and alpha mode enabled. that's the whole vibe ๐Ÿ’ซ


๐ŸŒธ da / display_array ๐ŸŒธ

da = shortcut for display_array. iconic.

display_array: _width>0,_height>0

it displays images in interactive windows where you can actually go explore pixel neighborhoods ๐Ÿ” bestie it's giving microscope energy.

default values: width=13 and height=width.


๐Ÿฆ‹ dc / display_camera ๐Ÿฆ‹

dc = shortcut for display_camera.

display_camera opens the camera viewer ๐Ÿ“ท

heads up: this command requires features from the OpenCV library, and those are not enabled in G'MIC by default. so like, don't be shocked if it doesn't go ๐Ÿ’€

๐ŸŽ€ dclut / display_clut ๐ŸŽ€

dclut = shortcut for display_clut.

display_clut: _image_resolution>0,_clut_resolution>0

displays selected 3D color LUTs ๐ŸŒˆ obsessed honestly.

default values: image_resolution=320 and clut_resolution=33.

example:

[#1] clut tealorange clut summer clut 60s display_clut 400

โญ dfft / display_fft โญ

dfft = shortcut for display_fft.

display_fft displays the fourier transform of selected images, with centered log-module and argument โœจ (equivalent to shortcut command dfft).

example:

[#1] image.jpg +display_fft

๐Ÿ’œ dg / display_graph ๐Ÿ’œ

dg = shortcut for display_graph.

display_graph: _width>=0,_height>=0,_plot_type,_vertex_type,_xmin,_xmax,_ymin,_ymax,_xlabel,_ylabel,_frame_size>=0

renders a graph plot from the selected image data ๐Ÿ“Š

  • plot_type can be { 0:None | 1:Lines | 2:Splines | 3:Bar }.
  • vertex_type can be { 0:None | 1:Points | 2,3:Crosses | 4,5:Circles | 6,7:Squares }.
  • xmin, xmax, ymin, ymax set the coordinates of the displayed xy-axes.
  • if the specified width or height is 0, then the image size is set to half the screen size ๐Ÿ–ฅ๏ธ

default values: width=0, height=0, plot_type=1, vertex_type=1, xmin=xmax=ymin=ymax=0 (auto), xlabel="x-axis", ylabel="y-axis" and frame_size=32.

example:

[#1] 128,1,1,1,'cos(x/10+u)' +display_graph 400,300,3

๐Ÿ”ฅ dh / display_histogram ๐Ÿ”ฅ

dh = shortcut for display_histogram.

display_histogram: _width>=0,_height>=0,_clusters>0,_min_value[%],_max_value[%],_show_axes={ 0:No | 1:Yes },_expression.

renders a channel-by-channel histogram ๐Ÿ“ˆ if your selected images have several slices, the rendering is performed for all input slices, fr fr.

expression is a mathematical expression used to transform the histogram data for visualization purposes. (equivalent to shortcut command dh).

if the specified width or height is 0, then the image size is set to half the screen size.

default values: width=0, height=0, clusters=256, min_value=0%, max_value=100%, show_axes=1 and expression=i.

example:

[#1] image.jpg +display_histogram 512,300

๐ŸŒˆ display_parametric ๐ŸŒˆ

display_parametric: _width>0,_height>0,_outline_opacity,_vertex_radius>=0,_is_antialiased={ 0:No | 1:Yes },_is_decorated={ 0:No | 1:Yes },_xlabel,_ylabel

renders 2D or 3D parametric curves or point clouds from your 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, those additional channels define the (R,G,B) color for each vertex ๐ŸŽจ

if outline_opacity>1, the outline is colored according to the specified vertex colors, and outline_opacity-1 is used as the actual drawing opacity.

default values: width=512, height=width, outline_opacity=3, vertex_radius=0, is_antialiased=1, is_decorated=1, xlabel="x-axis" and ylabel="y-axis".

examples:

[#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
[#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

๐Ÿงš display_polar ๐Ÿงš

display_polar: _width>32,_height>32,_outline_type,_fill_R,_fill_G,_fill_B,_theta_start,_theta_end,_xlabel,_ylabel

renders a polar curve from the selected image data ๐Ÿ’ซ

  • outline_type can be { r<0:Dots with radius -r | 0:No outline | r>0:Lines+dots with radius r }.
  • fill_color can be { -1:No fill | R,G,B:Fill with specified color }.

default values: width=500, height=width, outline_type=1, fill_R=fill_G=fill_B=200, theta_start=0, theta_end=360, xlabel="x-axis" and ylabel="y-axis".

examples:

[#1] 300,1,1,1,'0.3+abs(cos(10*pi*x/w))+u(0.4)' display_polar 512,512,4,200,255,200
[#2] 3000,1,1,1,'x^3/1e10' display_polar 400,400,1,-1,,,0,{15*360}

๐Ÿ“ dq / display_quiver ๐Ÿ“

dq = shortcut for display_quiver.

display_quiver: _size_factor>0,_arrow_size>=0,_color_mode={ 0:Monochrome | 1:Grayscale | 2:Color }

renders selected images of 2D vectors as a field of 2D arrows ๐Ÿน (equivalent to shortcut command dq).

default values: size_factor=16, arrow_size=1.5 and color_mode=1.

example:

[#1] image.jpg +luminance gradient[-1] xy rv[-2,-1] *[-2] -1 a[-2,-1] c crop 60,10,90,30 +display_quiver[1] ,

๐Ÿ’… drgba / display_rgba ๐Ÿ’…

drgba = shortcut for display_rgba.

display_rgba: _background_RGB_color

renders selected RGBA images over a checkerboard or a colored background ๐Ÿ (equivalent to shortcut command drgba).

default values: background_RGB_color=undefined (checkerboard).

example:

[#1] image.jpg +norm threshold[-1] 40% blur[-1] 3 normalize[-1] 0,255 append c display_rgba

๐Ÿซถ dt / display_tensors ๐Ÿซถ

dt = shortcut for display_tensors.

display_tensors: _size_factor>0,_ellipse_size>=0,_color_mode={ 0:Monochrome | 1:Grayscale | 2:Color },_outline>=0

renders selected images of tensors as a field of 2D ellipses ๐Ÿฅšโœจ (equivalent to shortcut command dt).

default values: size_factor=16, ellipse_size=1.5, color_mode=2 and outline=2.

example:

[#1] image.jpg +diffusiontensors 0.1,0.9 rescale2d. 64 +display_tensors. 16,2

tutorial: https://gmic.eu/oldtutorial/_display_tensors


๐Ÿ‘‘ dv3d / display_voxels3d ๐Ÿ‘‘

dv3d = shortcut for display_voxels3d.

display_voxels3d displays selected images as a set of 3D voxels ๐ŸงŠ๐ŸงŠ๐ŸงŠ (equivalent to shortcut command dv3d).


๐ŸŽ€ dw / display_warp ๐ŸŽ€

dw = shortcut for display_warp.

display_warp: _cell_size>0

renders selected 2D warping fields ใ€ฐ๏ธ (equivalent to shortcut command dw).

default value: cell_size=15.

example:

[#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

๐Ÿ’– e (+) / echo (+) ๐Ÿ’–

e = shortcut for echo.

echo (+): message

outputs the specified message on the error output ๐Ÿ“ข (equivalent to shortcut command e).

command selection (if any) stands for a displayed call stack subset instead of image indices ๐Ÿ‘€

when invoked with a + prefix (i.e. +echo), the command outputs its message on stdout rather than stderr. yes bestie, it really does swap streams ๐Ÿซก


๐ŸŒธ echo_file ๐ŸŒธ

echo_file: filename,message

outputs the specified message, appending it to the specified output file ๐Ÿ“ (similar to echo for a specified output file stream).


โญ font โญ

font: { 'Font_name' | font_number | font.gmz },_font_height[%]>0,_is_bold={ 0:No | 1:Yes }

โ€ฆso yeah bestie, this one hands you back the font identifier (that's a variable name, iykyk) which you can then literally reuse in the text command as a custom font. ๐Ÿ’…

'Font name' can be any of these iconic ones:

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

And if you pass a filename like font.gmz, no cap it has to be a file that was converted with the font2gmz command. ๐ŸŽ€

Default values, fr fr: font_height=64 and is_bold=0.

Example (yes she's giving):

[#1] 400,300,1,3 text "Hello World!",0.5~,0.5~,${"font

font2gmz

_font_name,_font_size>0,_font_qualifier

Converts whatever font you throw at it into G'MIC format so it can be used as a custom font for the text command. โœจ

'font_name' can be either a filename like font.ttf, or a Google Font Name.

Heads up bestie: this command needs the command line tool cutycapt installed on your system. No cutycapt, no font conversion, periodt. ๐Ÿ˜ญ
Also beware: 'font_size' is the size of font used for the rendering โ€” it does not correspond to the font height. The way that trips everyone up, I swear.

Default values: font_name=Sofia, font_size=24 and font_qualifier="".


function1d

0<=smoothness<=1,x0>=0,y0,x1>=0,y1,...,xn>=0,yn

Inserts a continuous 1D spline function built from the list of keypoints (xk,yk) you feed it, in the range [0,max(xk)] (and yes, the xk are positive integers, keep it cute and legal ๐Ÿ’–).

Example:

[#1] function1d 1,0,0,10,30,40,20,70,30,80,0 +display_graph 400,300

identity

_width>=0,_height>=0,_depth>=0

Drops an identity map of the size you asked for at the end of the image list. Slay. ๐ŸŒธ

Default values: height=width and depth=1.

Example:

[#1] identity 5,1 identity 8,8

i (+)

Shortcut for command input. That's it, that's the whole vibe. ๐Ÿฆ‹


input (+)

[type:]filename |
[type:]http://URL |
[selection]x_nb_copies>0 |
{ width[%]>0 | [image_w] },{ _height[%]>0 | [image_h] },{ _depth[%]>0 | [image_d] },{ _spectrum[%]>0 | [image_s] },_{ value1,_value2,... | 'formula' } |
(value1{,|;|/|^}value2{,|;|/|^}...[:{x|y|z|c|,|;|/|^}]) |
0

Inserts a brand-new image ๐ŸŽ€ โ€” either plucked from a filename, or a copy of an existing image [index], or a fresh one with the dimensions and values you specify. Single quotes may be omitted in 'formula', and passing arg 0 inserts an 'empty' image.

Equivalent to shortcut command i, obviously.

Default values: nb_copies=1, height=depth=spectrum=1 and value1=0.

Examples (iconic behaviour only):

[#1] input image.jpg
[#2] input (1,2,3;4,5,6;7,8,9^9,8,7;6,5,4;3,2,1)
[#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'

Tutorial (go read it bestie): https://gmic.eu/tutorial/input


input_565

filename,width>0,height>0,reverse_endianness={ 0:No | 1:Yes }

Inserts image data from a raw RGB-565 file, right at the end of the list. ๐Ÿ”ฅ

Default value: reverse_endianness=0.


ib

Shortcut for command input_bytes. Lowkey a whole mood. ๐Ÿ’œ


input_bytes

filename

Takes the filename you gave it and inputs it as a 1D array of bytes. Equivalent to shortcut command ib.


input_csv

"filename",_delimiter,_read_data_as={ 0:Numbers | 1:Strings }

Inserts an array of strings or numbers read from the .csv file you specified. A WxH image gets inserted at the end of the list, and each vector-valued pixel I(x,y) encodes the content (number or string) of each cell. Spreadsheet girlies, this one's for you. ๐Ÿ“

Default values: delimiter=, and read_data_as=1.


input_cube

"filename",_convert_1d_cluts_to_3d={ 0:No | 1:Yes }.

Inserts CLUT data from a .cube filename (that's the Adobe CLUT file format, fancy). โœจ

Default value: convert_1d_cluts_to_3d=0.


input_flo

"filename"

Inserts optical flow data from a .flo filename (vision.middlebury.edu file format, if you were wondering). ๐Ÿงš


ig

Shortcut for command input_glob. Short king. ๐Ÿ‘‘


input_glob

pattern

Inserts new images from all the several filenames that match the glob pattern you gave. Equivalent to shortcut command ig.


input_gpl

filename

Inputs the specified filename as a .gpl palette data file. ๐ŸŒˆ


input_cached

"basename.ext",_downloading_from_gmic_server

Inputs the specified filename, which is assumed to be stored in one of the G'MIC resource folders. If the file isn't found and try_downloading=1, it gets downloaded from the G'MIC server and stashed in the ${-path_cache} folder.

This command returns the full path to the corresponding file โ€” cute and useful. ๐Ÿ’…

downloading_from_gmic_server can be { 0:No | 1:Yes, if file not found | 2:Yes, if file not in regular cache folder }.

Default value: try_downloading_from_gmic_server=1.


in

Shortcut for command input_normalized. ๐ŸŽ€


input_normalized

filename

Inputs the specified filename and constrains its value range to be inside [0,255]. Equivalent to shortcut command in.


input_obj

filename

Inputs the specified 3D mesh from a .obj Wavefront file. 3D girlies rise. ๐Ÿฆ‹


it

Shortcut for command input_text. Simple as that, bestie. ๐ŸŒธ


input_text

filename

Inputs the specified text-data filename as a new image. Equivalent to shortcut command it.


lorem

_width>0,_height>0

Inputs a random image of the specified size, retrieved straight from the Internet. Main character energy, honestly. ๐Ÿ˜ญ

Default values: width=height=800.


network (+)

mode={ -1=Disabled | 0:Enabled w/o timeout | >0:Enabled w/ specified timeout in seconds }

Enables or disables load-from-network and sets the matching timeout. (Default mode is enabled w/o timeout.)


o (+)

Shortcut for command output. Periodt. โญ


output (+)

[type:]filename,_format_options

Outputs the selected images as one or several numbered file(s). Equivalent to shortcut command o.

Default value: format_options=(undefined).


output_565

"filename",reverse_endianness={ 0:No | 1:Yes }

Outputs the selected images as raw RGB-565 files. ๐Ÿ”ฅ

Default value: reverse_endianness=0.


output_csv

"filename",_delimiter,_write_data_as={ 0:Numbers | 1:Strings }

Outputs the selected ascii-encoded arrays as .csv files. Spreadsheet slay. ๐Ÿ“

Default values: delimiter=, and write_data_as=1.


output_cube

"filename"

Outputs the selected CLUTs as .cube files (Adobe CLUT format, again, fancy).


output_flo

"filename"

Outputs the selected optical flow as a .flo file (vision.middlebury.edu file format). ๐Ÿงš


output_ggr

filename,_gradient_name

Outputs the selected images as .ggr gradient files (that's GIMP's thing ๐Ÿ’œ). If you don't specify a gradient name, it just gets deduced from the filename. Convenient!


output_gmz

filename,_datatype

Outputs the selected images as .gmz files (the G'MIC native file format, home turf ๐ŸŽ€).

datatype can be { bool | uint8 | int8 | uint16 | int16 | uint32 | int32 | uint64 | int64 | float32 | float64 }.


output_obj

filename,_save_materials={ 0:No | 1:Yes }

Outputs the selected 3D meshes as Wavefront 3D object files. Set save_materials to 1 to produce a corresponding material file (.mtl) and possibly texture files. โœจ

Beware bestie: exporting to .obj files may be quite slow for large 3D objects. Like, quite slow. Don't come for me. ๐Ÿ˜ญ

Default value: save_materials=1.


ot

Shortcut for command output_text. ๐ŸŒธ


output_text

filename

Outputs the selected images as text-data filenames. Equivalent to shortcut command ot.


on

Shortcut for command outputn. ๐Ÿฆ‹


outputn

filename,_index

Outputs the selected images as automatically numbered filenames, inside repeat...done loops. Equivalent to shortcut command on.


op

Shortcut for command outputp. ๐Ÿ’œ


outputp

prefix

Outputs the selected images as prefixed versions of their original filenames. Equivalent to shortcut command op.

Default value: prefix=_.


ow

Shortcut for command outputw. โญ


outputw

Outputs the selected images by overwriting their original location.

Bestie this one straight up overwrites your files. Equivalent to shortcut command ow. You've been warned ๐Ÿ’€

ox

Shortcut for command outputx. ๐ŸŒˆ


outputx

extension1,_extension2,_...,_extensionN,_output_at_same_location={ 0:No | 1:Yes }

Outputs the selected images with the same base filenames but for N different extensions. Equivalent to shortcut command ox.

Default value: output_at_same_location=0.


parse_cli

_output_mode,_{ * | command_name }

Parses the definition of @cli-documented commands and outputs info about them in the specified output mode. ๐ŸŽ€

output_mode can be { ascii | bashcompletion | html | images | print }.

Default values: output_mode=print and command_name=*.


parse_gmd

Parses and tokenizes the selected images, viewed as text strings formatted with the G'MIC markdown syntax. Feeling fancy? This is the fancy one. ๐Ÿ’…


gmd2html

_include_default_header_footer={ 0:None | 1:Reference | 2:Tutorial | 3:News } |
(no arg)

Converts the selected gmd-formatted text images to html format. She's going on the web, bestie. ๐Ÿ”ฅ

Default values: include_default_header_footer=1.


gmd2ascii

_max_line_length>0,_indent_forced_newlines>=0 |
(no arg)

Converts the selected gmd-formatted text images to ascii format. Terminal girlies stay winning. ๐ŸŒธ

Default values: max_line_length=80 and indent_forced_newline=0.


parse_gui

_outputmode,_{ * | filter_name}

(no extra tea given, this is literally the whole line, don't @ me ๐Ÿ’€)

So like, the parser goes through all the filter definitions you picked and spits out info about them in whichever output mode you chose. โœจ

outputmode can be { gmicol | images | json | list | print | strings | update | zart }.

And bestie, you can absolutely roll your own output mode โ€” just implement these commands (outputmode gets swapped out for the name of your custom user output mode, iykyk):

  • parse_gui_outputmode โ€” a command that outputs the parsing info in your own custom format. This one's mandatory.
  • parse_gui_parseparams_outputmode (optional) โ€” a simple command that returns 0 or 1. It tells the parser whether the parameters of matching filters need to be analyzed (which is slower, fair warning ๐Ÿ˜ญ).
  • parse_gui_trigger_outputmode (optional) โ€” a command the parser calls right before it parses the set of each matching filter.

Here's the list of global variables the parser sets, all accessible inside parse_gui_outputmode:

  • $_nb_filters โ€” number of matching filters.
  • $_nongui (stored as an image) โ€” all the merged lines in the file that are not #@gui lines.

For each filter ๐ŸŒธ:

  • $_fF_name โ€” filter name.
  • $_fF_path โ€” full path.
  • $_fF_locale โ€” filter locale (empty if not specified).
  • $_fF_command โ€” filter command.
  • $_fF_command_preview โ€” filter preview command (empty if not specified).
  • $_fF_zoom_factor โ€” default zoom factor (empty if not specified).
  • $_fF_preview_accuracy โ€” preview accuracy (can be { 0:Does not support zoom in/out | 1:Support zoom in/out | 2:Pixel-perfect }).
  • $_fF_input_mode โ€” default preferred input mode (empty if not specified).
  • $_fF_hide โ€” path of the filter hidden by the current filter (for localized filters; empty if not specified).
  • $_fF_nb_params โ€” number of parameters.

For each parameter ๐ŸŽ€:

  • $_fF_pP_name โ€” parameter name.
  • $_fF_pP_type โ€” parameter type.
  • $_fF_pP_responsivity โ€” parameter responsivity (can be { 0:No | 1:Yes }).
  • $_fF_pP_randomizable โ€” randomizable property of the parameter (can be { 0:No | 1:Yes }).
  • $_fF_pP_visibility โ€” parameter visibility.
  • $_fF_pP_propagation โ€” propagation of the parameter visibility.
  • $_fF_pP_nb_args โ€” number of parameter arguments.

For each argument ๐Ÿฆ‹:

  • $_fF_pP_aA โ€” argument value.

Default parameters: filter_name=* and output_format=print.


pass (+)

_shared_state={ -1:Status only | 0:Non-shared (copy) | 1:Shared | 2:Adaptive }

Insert images from the parent context of a custom command or a local environment. Iconic behaviour, honestly. ๐Ÿ’…

Command selection (if there is one) stands for a selection of images in that parent context.

By default โ€” that's the adaptive shared state โ€” the selected images get inserted in a shared state if they also don't belong to the context (selection) of the current custom command or local environment. Yep, that sentence is a whole mood, read it twice. ๐Ÿ™ˆ

Typical use of pass? Designing custom commands that take images as arguments. It's giving "I need my images back." ๐Ÿ˜ญ

This command returns the list of corresponding indices in the status.

Default value: shared_state=2.

Example:

[#1] command "average : pass$""1 add[^-1] [-1] remove[-1] div 2" sample ? +mirror y +average[0] [1]

plot

_plot_type,_vertex_type,_xmin,_xmax,_ymin,_ymax,_exit_on_anykey={ 0:No | 1:Yes }

Display selected images or formula in an interactive viewer (it uses the instant display window [0] if that's open, no cap โœจ).

  • plot_type can be { 0:None | 1:Lines | 2:Splines | 3:Bar }.
  • vertex_type can be { 0:None | 1:Points | 2,3:Crosses | 4,5:Circles | 6,7:Squares }.
  • xmin, xmax, ymin, ymax set the coordinates of the displayed xy-axes.

Default values: plot_type=1, vertex_type=1, xmin=xmax=ymin=ymax=0 (auto) and exit_on_anykey=0.

poincare_disk

_size>=0,_p>2,_q>2,_angle,_tiling={ 0:Triangular | 1:Polygonal },_nb_max_iter>=0,_xmin,_ymin,_xmax,_ymax

Returns a 3-channel image of a poincare disk. The output channels are [x,y,it]. Geometry girlies rise ๐Ÿงš

Default values: size=1024, p=5, q=3, angle=0, tiling=0, nb_max_iter=20, xmin=ymin=-1 and xmax=ymax=1.

Example:

[#1] repeat 4 { poincare_disk 1024,{3+$>} channels[-1] 2 mod[-1] 3 neq[-1] 2 } rescale2d 50%

portrait

_size>0

Inputs a random portrait image of the specified size, retrieved from the Internet. Yes, literally fetched from the Internet, she's online ๐Ÿ’–

Default values: size=800.

p

Shortcut for command print.

print

Print information on selected images, on the standard error (stderr). (Equivalent to shortcut command p, bestie.)

When you invoke it with a + prefix (so like +print), the command outputs on stdout instead of on stderr. Little glow-up, same command. ๐ŸŒŸ

random_patches

_nb_patches>0,_patch_size>0

Generates a set of square color patches stuffed with random geometric shapes, returned as a volumetric image. It's giving arts-and-crafts but make it 3D ๐ŸŽจ

Default values: nb_patches=16 and patch_size=64.

Example:

[#1] random_patches 16,64 split z append_tiles ,

random_pattern

_width>0,_height>0,_min_detail_level>=0

Inserts a brand new RGB image of the specified size at the end of the image list, rendered with a random pattern. Surprise! ๐ŸŒˆ

Default values: width=height=512 and min_detail_level=2.

Example:

[#1] repeat 6 { random_pattern 256 }

screen (+)

_x0[%],_y0[%],_x1[%],_y1[%]

Takes a screenshot โ€” optionally grabbed with the coordinates you specify โ€” and inserts it at the end of the image list. Main character behaviour fr ๐Ÿ“ธ

select

feature_type,_X[%]>=0,_Y[%]>=0,_Z[%]>=0,_exit_on_anykey={ 0:No | 1:Yes },_is_multiaxes_selection={ 0:No | 1:Yes }

Interactively select a feature from the selected images (it uses the instant display window [0] if that's open).

  • feature_type can be { 0:Point | 1:Segment | 2:Rectangle | 3:Ellipse }.
  • The arguments X, Y, Z determine the initial selection view, for 3D volumetric images.

The retrieved feature comes back as a 3D vector (if feature_type==0) or as a 6d vector (if feature_type!=0) containing the feature coordinates. ๐Ÿ’…

Default values: feature_type=2, X=Y=Z=50%, exit_on_anykey=0 and is_multiaxes_selection=1.

serialize (+)

_datatype,_is_compressed={ 0:No | 1:Yes },_store_names={ 0:No | 1:Yes }

Serializes the selected list of images into a single image, optionally in a compressed form. Packing it all up ๐ŸŽ

  • datatype can be { auto | uint8 | int8 | uint16 | int16 | uint32 | int32 | uint64 | int64 | float32 | float64 }.
  • Specify datatype if all selected images have a range of values constrained to a particular datatype, so you can minimize the memory footprint. Look at you being efficient ๐Ÿ’œ
  • The resulting image has only integer 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 store_names is set to 1, serialization uses the .gmz format to store data in memory (otherwise it uses the .cimg[z] format).

Default values: datatype=auto, is_compressed=1 and store_names=1.

Example:

[#1] image.jpg +serialize uint8 +unserialize[-1]

shape_circle

_size>=0

Inputs a 2D circle binary shape with the specified size. Simple, clean, iconic โญ•

Default value: size=512.

Example:

[#1] shape_circle ,

shape_cupid

_size>=0

Inputs a 2D cupid binary shape with the specified size. Cupid?! In my image list?? ๐Ÿน๐Ÿ’˜

Default value: size=512.

Example:

[#1] shape_cupid ,

shape_diamond

_size>=0

Inputs a 2D diamond binary shape with the specified size. Shine bright ๐Ÿ’Ž

Default value: size=512.

Example:

[#1] shape_diamond ,

shape_dragon

_size>=0,_recursion_level>=0,_angle

Inputs a 2D Dragon curve with the specified size. Not me getting emotionally attached to a fractal ๐Ÿ˜ญ

Default value: size=512, recursion_level=18 and angle=0.

Example:

[#1] shape_dragon ,

shape_fern

_size>=0,_density[%]>=0,_angle,0<=_opacity<=1,_type={ 0:Asplenium adiantum-nigrum | 1:Thelypteridaceae }

Inputs a 2D Barnsley fern with the specified size. Botanists, this one's for you ๐ŸŒฟ

Default value: size=512, density=50%, angle=30, opacity=0.3 and type=0.

Example:

[#1] shape_fern ,

shape_gear

_size>=0,_nb_teeth>0,0<=_height_teeth<=100,0<=_offset_teeth<=100,0<=_inner_radius<=100

Inputs a 2D gear binary shape with the specified size. Mechanical slay โš™๏ธ

Default value: size=512, nb_teeth=12, height_teeth=20, offset_teeth=0 and inner_radius=40.

Example:

[#1] shape_gear ,

shape_heart

_size>=0

Inputs a 2D heart binary shape with the specified size. ๐Ÿซถ

Default value: size=512.

Example:

[#1] shape_heart ,

shape_hilbert

_size>=0,_nb_recursions>=0

Inputs a 2D image of the Hilbert curve. Space-filling and gorgeous ๐Ÿ’ซ

Default values: size=512 and nb_recursions=5.

Example:

[#1] shape_hilbert ,

shape_menger

_nb_iterations>=0

Inputs a 3D voxelized representation of the Menger sponge. Sponge but make it math ๐Ÿงฝ

Default value: nb_iterations=3.

Example:

[#1] shape_menger 4 surfels3d , color3d 200 m3d 3

shape_mosely

_nb_iterations>=0

Inputs a 3D voxelized representation of the Mosely snowflake. โ„๏ธโœจ

Default value: nb_iterations=3.

Example:

[#1] shape_mosely 4 surfels3d , color3d 200 m3d 3

shape_peano

_size>=0,_nb_recursions>=0

Inputs a 2D image of the Peano curve. Another space-filler queen ๐Ÿ‘‘

Default values: size=512 and nb_recursions=3.

Example:

[#1] shape_peano ,

shape_polygon

_size>=0,_nb_vertices>=3,_angle

Inputs a 2D polygonal binary shape with the specified geometry. Customize your polygon, go off ๐Ÿ”ท

Default value: size=512, nb_vertices=5 and angle=0.

Example:

[#1] repeat 6 { shape_polygon 256,{3+$>} }

shape_rays

_size>=0,_xcenter[%],_ycenter[%],_branches>0,_angle[%],_twist,0<=_perspective<=1,_is_antialias={ 0:No | 1:Yes }

Inputs a 3D binary spiral with the specified size and attributes. Spiral season ๐ŸŒช๏ธ

Default values: size=512, xcenter=50%, ycenter=50%, branches=7, angle=50%, twist=0, perspective=0.35 and is_antialias=0.

Example:

[#1] shape_rays 400,50%,50%,7 shape_rays 400,50%,50%,3,0,3

shape_snowflake

size>=0,0<=_nb_recursions<=6

Inputs a 2D snowflake binary shape with the specified size. (Heads up bestie: size here has no underscore in the original, that's just how it is, don't come for me ๐Ÿ˜…)

Default values: size=512 and nb_recursions=5.

Example:

[#1] repeat 6 { shape_snowflake 256,$> }

shape_star

_size>=0,_nb_branches>0,0<=_thickness<=1

Inputs a 2D star binary shape with the specified size. โญ Literally a star, she ate.

Default vibes for this one, bestie: size=512, nb_branches=5 and thickness=0.38. ๐Ÿ“

Example:

[#1] repeat 9 { shape_star 256,{$>+2} }

sh (+):

Ok so this one is literally just a shortcut for the command shared. No cap. โœจ

shared (+):

x0[%],x1[%],y[%],z[%],c[%] |
y0[%],y1[%],z[%],c[%] |
z0[%],z1[%],c[%] |
c0[%],c1[%] |
c0[%] |
(no arg)

So this inserts shared buffers from your selected images โ€” and optionally from specific points / rows / planes / channels of them, which is giving "surgical precision" energy ๐Ÿ’….

Big caveat bestie: shared buffers cannot be returned by a command, and they can't come back from a local environment either. Like, they stay put. Periodt.

(equivalent to shortcut command sh).

Example:

[#1] image.jpg shared 1 blur[-1] 3 remove[-1]
[#2] image.jpg repeat s { shared 25%,75%,0,$> mirror[-1] x remove[-1] }

Tutorial: https://gmic.eu/oldtutorial/_shared

sp:

Shortcut for the command sample. That's it, that's the whole thing ๐Ÿซถ

sample:

_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) } |
(no arg)

Inputs a brand new sample RGB image โ€” and you can optionally say what size you want it ๐ŸŒธ. Every classic test image is in here, the whole iconic lineup: 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. Like, the whole squad is here ๐Ÿ˜ญ๐Ÿ’–

(equivalent to shortcut command sp).

The argument name can also be swapped for an integer, which acts as a sample index. Fancy ๐Ÿ”ฅ

Example:

[#1] repeat 6 { sample }

srand (+):

value |
(no arg)

Sets the random generator seed ๐ŸŽฒ. If you pass no argument at all, a random value gets used as the seed โ€” chaotic, but make it fashion ๐Ÿ’….

store (+):

_is_compressed={ 0:No | 1:Yes },variable_name1,_variable_name2,...

Stores your selected images into one or several named variables ๐Ÿ“ฆ. Heads up: the selected images get transferred to the variables, which means they are so removed from the image list. Gone. Moved out. (Unless you use the prepended variant '+store[selection]', which keeps them around ๐Ÿซถ).

If you give just a single variable name, all images in the selection get assigned to that one named variable. Otherwise there must be exactly as many variable names as there are images in the selection, and each selected image gets assigned to each specified named variable โ€” one for one, no leftovers.

Want them back? Use input $variable_name to bring the stored images back into the list. Iconic round trip โœจ

Default value: is_compressed=0.

Example:

[#1] sample eagle,earth store img1,img2 input $img2 $img1

Tutorial: https://gmic.eu/tutorial/store

testimage2d:

_width>0,_height>0,_spectrum>0

Inputs a 2D synthetic image. Very demure, very testable ๐ŸŽ€

Default values: width=512, height=width and spectrum=3.

Example:

[#1] testimage2d 512

um:

Shortcut for the command uncommand. Yep, that's the whole entry ๐Ÿ’€

uncommand (+):

command_name[,_command_name2,...] |
*

Discards the definition of the specified custom commands ๐Ÿ—‘๏ธ. Set the argument to * and you're discarding all existing custom commands โ€” nuclear option, use with care bestie.

(equivalent to shortcut command um).

uniform_distribution:

nb_levels>=1,spectrum>=1

Inputs a set of uniformly distributed spectrum-d points in [0,1]^spectrum ๐ŸŽฏ. Very even, very fair, very "spread the love across the cube".

Example:

[#1] uniform_distribution 64,3 * 255 +distribution3d circles3d[-1] 10

unserialize (+):

Recreates lists of images from serialized image buffers โ€” the ones you got with the command serialize. It's giving "unzip my soul" energy ๐Ÿฆ‹

up:

Shortcut for the command update. Short king ๐Ÿ‘‘

update:

Updates commands from the latest definition file on the G'MIC server ๐ŸŒˆ. Fresh off the server, still warm.

(equivalent to shortcut command up).

v (+):

Shortcut for the command verbose ๐Ÿ“ข

verbose (+):

level |
{ + | - }

Sets, or increments / decrements, the verbosity level. Default level is 0. (equivalent to shortcut command v).

When level>0, G'MIC log messages get displayed on the standard error (stderr) โ€” so it's chatty, but it's chatty in the right channel, iykyk ๐Ÿ’ฌ

Default value: level=1.

wait (+):

delay |
(no arg)

Waits for a given delay (in ms), optionally measured since the last call to wait โณ โ€” or waits for a user event to happen on the selected instant display windows.

delay can be { <0:Delay+flush events | 0:Event | >0:Delay }.

Command selection (if there is one) stands for instant display window indices instead of image indices. Sneaky but correct ๐Ÿ’…

If no window indices are specified and if delay is positive, the command results in a hard sleep during the specified delay. Like, actually asleep. Snoring. ๐Ÿ˜ด

Default value: delay=0.

warn (+):

_force_visible={ 0:No | 1:Yes },_message

Prints the specified warning message on the standard error (stderr) โš ๏ธ. A little "hey bestie, heads up" for your terminal.

Command selection (if any) stands for a displayed call stack subset instead of image indices.

w (+):

Shortcut for the command window ๐ŸชŸ

window (+):

_width[%]>=-1,_height[%]>=-1,_normalization,_fullscreen,_pos_x[%],_pos_y[%],_title

Displays selected images in an instant display window with the specified size, normalization type, fullscreen mode and title ๐Ÿ–ผ๏ธโœจ

(equivalent to shortcut command w).

If width or height is set to -1, the corresponding dimension gets adjusted to the window or image size. Only specify the pos_x and pos_y arguments if the window actually has to be moved to those coordinates โ€” otherwise you can just leave them out, no pressure ๐Ÿซถ

width=0 or height=0 closes the instant display window (goodbye window, you served us well ๐Ÿ˜ญ).

normalization can be { -1:Keep same | 0:None | 1:Always | 2:1st-time | 3:Auto }.

fullscreen can be { -1:Keep same | 0:No | 1:Yes }.

You can manage up to 10 different instant display windows using the numbered variants w0 (default, eq. to w), w1, ..., w9 of the command w. Ten windows. Ten vibes. ๐ŸŒˆ

Invoke window with no selection to make the window visible again, if the user closed it on you. Window restoration era ๐Ÿ’…

Default values: width=height=normalization=fullscreen=-1 and title=(undefined).


โœจ 11.3. List Manipulation โœจ

k (+):

Shortcut for the command keep. Keep it ๐Ÿ’–

keep (+):

Keep only the selected images. Everything else? Not invited to the party ๐ŸŽ‰ (equivalent to shortcut command k).

Example:

[#1] image.jpg split x keep[0-50%:2] append x
[#2] image.jpg split x keep[^30%-70%] append x

kn:

Shortcut for the command keep_named.

keep_named:

"name1","name2",...

Keeps all images with the specified names from the list of images โœ…. And if no images with those names exist? Then it removes all images. Yes, all of them. Empty list era ๐Ÿ’€ (equivalent to shortcut command kn).

mv (+):

Shortcut for the command move. Scoot ๐Ÿ›ด

move (+):

position[%]

Moves the selected images to the specified position ๐Ÿ“. The images actually get inserted between the current positions position-1 and position.

Careful bestie: the specified position may not correspond to the new position of the image after the move command โ€” typically if the moved image(s) are located before the specified position. Positions shift, that's just how it is ๐ŸŒ€

(equivalent to shortcut command mv).

Example:

[#1] image.jpg split x,3 move[1] 0
[#2] image.jpg split x move[50%--1:2] 0 append x

nm (+):

Shortcut for the command name.

=> (+):

Also a shortcut for the command name. Two shortcuts, one command, main character energy ๐Ÿ‘‘.

name (+):

"name1","name2",...,"nameN"

Sets the names of the selected images ๐Ÿท๏ธโœจ

  • If no explicit image selection is given, image selection is assumed to be [-N--1], where N is the number of specified arguments.
  • If N is higher than the number of images in the selection, an error is thrown. Rude, but fair.
  • If N is lower than the number of images in the selection, image names get assigned in a periodic way, i.e. name(selection[k]) = arg[k%N]. Repeating names, wheel keeps turning ๐ŸŽก

(equivalent to shortcut command =>).

Example:

[#1] image.jpg name image blur[image] 2

Tutorial: https://gmic.eu/tutorial/name

rm (+):

Shortcut for the command remove. Say bye ๐Ÿ‘‹

remove (+):

Removes the selected images. Poof. Gone. Not in the list anymore ๐Ÿ—‘๏ธ๐Ÿ’จ (equivalent to shortcut command rm).

Example:

[#1] image.jpg split x remove[30%-70%] append x
[#2] image.jpg split x remove[0-50%:2] append x

remove_duplicates:

Removes duplicate images in the selected images list ๐Ÿงนโœจ. Clones get cancelled, no cap.

Example:

[#1] (1,2,3,4,2,4,3,1,3,4,2,1) split x remove_duplicates append x

remove_empty:

Removes empty images in the selected image list ๐Ÿ•ณ๏ธ๐Ÿšซ. Nothing to see here, literally.

rmn:

Shortcut for the command remove_named.

remove_named:

"name1","name2",...

Removes all images with the specified names from the list of images ๐Ÿ—‘๏ธ. If no images with those names exist, it does nothing at all โ€” no drama, no error, just vibes ๐Ÿซถ (equivalent to shortcut command rmn).

rv (+):

Shortcut for the command reverse. Flip it ๐Ÿ”„

reverse (+):

Reverses the positions of the selected images ๐Ÿ™ƒ. Backwards but make it fashion. (equivalent to shortcut command rv).

Example:

[#1] image.jpg split x,3 reverse[-2,-1]
[#2] image.jpg split x,-16 reverse[50%-100%] append x

sort_list:

_ordering={ +:Increasing | -:Decreasing },_criterion

Sorts the list of selected images according to the specified image criterion ๐Ÿ“Š โ€” increasing or decreasing, your call bestie.

Default values: ordering=+, criterion=i.

Example:

[#1] (1;4;7;3;9;2;4;7;6;3;9;1;0;3;3;2) split y sort_list +,i append y

๐ŸŒธ 11.4. Mathematical Operators ๐ŸŒธ

abs (+):

Computes the pointwise absolute values of selected images โž•โœจ. Every negative gets flipped to positive, everyone's happy.

Example:

[#1] image.jpg +sub {ia} abs[-1]
[#2] 300,1,1,1,'cos(20*x/w)' +abs display_graph 400,300

abscut (+):

min,_max,_offset

Cuts the absolute values of pixel values in selected images, with the specified range โœ‚๏ธ. For each value i of the selected images, it computes cut(abs(i) + offset,min,max)*sign(i).

So basically it only clamps / shifts the absolute value of each pixel value while keeping its sign unchanged ๐ŸŽฏ โ€” the sign stays, the magnitude gets handled. Very "fix the volume, keep the attitude" of it.

Default values: max=inf and offset=0.

Example:

[#1] 300,1,1,1,'cos(20*x/w)' +abscut 0,0.5 append c display_graph 400,300

acos (+):

Computes the pointwise arccosine of selected images ๐Ÿ“๐ŸŒ™. Inverse trig girlies, this one's for you.

Example:

[#1] image.jpg +normalize -1,1 acos[-1]
[#2] 300,1,1,1,'cut(x/w+0.1*u,0,1)' +acos display_graph 400,300

Tutorial: https://gmic.eu/oldtutorial/trigonometric-and-inverse-trigonometric-commands

acosh (+):

The hyperbolic arccosine one โ€” and we're picking that up right at the top of the next part, so don't go anywhere bestie ๐Ÿฆ‹๐Ÿ’œ

Compute the pointwise hyperbolic arccosine of selected images. ๐Ÿ’œ


+ (+) ๐ŸŽ€

Shortcut for command add.


add (+) ๐ŸŒธ

value[%] |
[image] |
'formula' |
(no arg)

Add a specified value, image or mathematical expression to the selected images, or compute the pointwise sum of the selected images. Bestie this is just plus, but make it fashion. (equivalent to shortcut command +). ๐Ÿ’…

Examples โ€” the whole buffet:

[#1] image.jpg +add 30% cut 0,255
[#2] image.jpg +blur 5 normalize 0,255 add[1] [0]
[#3] image.jpg add '80*cos(80*(x/w-0.5)*(y/w-0.5)+c)' cut 0,255
[#4] image.jpg repeat 9 { +rotate[0] {$>*36},1,0,50%,50% } add div 10

& (+) ๐Ÿฆ‹

Shortcut for command and.


and (+) โœจ

value[%] |
[image] |
'formula' |
(no arg)

Compute the bitwise AND of the selected images with a specified value, image or mathematical expression โ€” or, if you give it nothing, compute the pointwise sequential bitwise AND of the selected images. (equivalent to shortcut command &). lowkey my fave little bit-twiddler ๐Ÿซถ

Examples:

[#1] image.jpg and {128+64}
[#2] image.jpg +mirror x and

argmax ๐Ÿ‘‘

Compute the argmax of the selected images. It hands back a single image where each pixel value is the index of the input image that had the maximal value at that spot. main character pixel wins, everyone else is supporting cast ๐Ÿ’…

Example:

[#1] image.jpg sample lena,lion,square +argmax

argmaxabs ๐Ÿ”ฅ

Compute the argmaxabs of the selected images. Returns a single image where each pixel value is the index of the input image carrying the maxabs value.


argmin ๐Ÿฅบ

Compute the argmin of the selected images. Returns a single image where each pixel value is the index of the input image with the minimal value. shyest pixel, you're up.

Example:

[#1] image.jpg sample lena,lion,square +argmin

argminabs ๐Ÿ“

Compute the argminabs of the selected images. Returns a single image where each pixel value is the index of the input image with the minabs value.


asin (+) ๐ŸŒˆ

Compute the pointwise arcsine of the selected images.

Examples:

[#1] image.jpg +normalize -1,1 asin[-1]
[#2] 300,1,1,1,'cut(x/w+0.1*u,0,1)' +asin display_graph 400,300

Tutorial: https://gmic.eu/oldtutorial/trigonometric-and-inverse-trigonometric-commands


asinh (+) ๐Ÿงš

Compute the pointwise hyperbolic arcsine of the selected images.


atan (+) โญ

Compute the pointwise arctangent of the selected images.

Examples:

[#1] image.jpg +normalize 0,8 atan[-1]
[#2] 300,1,1,1,'4*x/w+u' +atan display_graph 400,300

Tutorial: https://gmic.eu/oldtutorial/trigonometric-and-inverse-trigonometric-commands


atan2 (+) ๐Ÿ’ซ

[x_argument]

Compute the pointwise oriented arctangent of the selected images. Here's the tea: each selected image is treated as the y-argument of the arctangent function, and the image you specify supplies the matching x-argument. two inputs, one vibe. ๐Ÿซถ

Example:

[#1] (-1,1) (-1;1) resize 400,400,1,1,3 atan2[1] [0] keep[1] mod {pi/8}

Tutorial: https://gmic.eu/oldtutorial/trigonometric-and-inverse-trigonometric-commands


atanh (+) ๐Ÿ’œ

Compute the pointwise hyperbolic arctangent of the selected images.


<< (+) ๐ŸŽ€

Shortcut for command bsl.


bsl (+) ๐ŸŒธ

value[%] |
[image] |
'formula' |
(no arg)

Compute the bitwise left shift of the selected images with a specified value, image or mathematical expression โ€” or, with no arg, compute the pointwise sequential bitwise left shift of the selected images. (equivalent to shortcut command <<). shifting left like it's a group chat you're leaving on read ๐Ÿ’€

Example:

[#1] image.jpg bsl 'round(3*x/w,0)' cut 0,255

>> (+) ๐Ÿฆ‹

Shortcut for command bsr.


bsr (+) โœจ

value[%] |
[image] |
'formula' |
(no arg)

Compute the bitwise right shift of the selected images with a specified value, image or mathematical expression โ€” or, with no arg, compute the pointwise sequential bitwise right shift of the selected images. (equivalent to shortcut command >>). the opposite direction, equally iconic ๐Ÿ‘‘

Example:

[#1] image.jpg bsr 'round(3*x/w,0)' cut 0,255

cos (+) ๐ŸŒˆ

Compute the pointwise cosine of the selected images.

Examples:

[#1] image.jpg +normalize 0,{2*pi} cos[-1]
[#2] 300,1,1,1,'20*x/w+u' +cos display_graph 400,300

Tutorial: https://gmic.eu/oldtutorial/trigonometric-and-inverse-trigonometric-commands


cosh (+) ๐Ÿงš

Compute the pointwise hyperbolic cosine of the selected images.

Examples:

[#1] image.jpg +normalize -3,3 cosh[-1]
[#2] 300,1,1,1,'4*x/w+u' +cosh display_graph 400,300

c (+) โญ

Shortcut for command cut.


cut (+) ๐Ÿ“

{ value0[%] | [image0] },{ value1[%] | [image1] } |
[image]

Cut the values of the selected images into a specified range. Clamp it, bestie, nobody needs values escaping the vibe check. (equivalent to shortcut command c). ๐Ÿ’…

Examples:

[#1] image.jpg +add 30% cut[-1] 0,255
[#2] image.jpg +cut 25%,75%

deg2rad ๐Ÿฆ‹

Convert the pointwise angle values of the selected images from degrees to radians (it applies i*pi/180). basically a unit glow-up โœจ


/ (+) ๐ŸŒธ

Shortcut for command div.


div (+) ๐Ÿ’œ

value[%] |
[image] |
'formula' |
(no arg)

Divide the selected images by a specified value, image or mathematical expression, or compute the pointwise quotient of the selected images. (equivalent to shortcut command /). sharing is caring, dividing is... also caring? ๐Ÿซถ

Examples:

[#1] image.jpg div '1+abs(cos(x/10)*sin(y/10))'
[#2] image.jpg +norm add[-1] 1 +div

== (+) ๐ŸŽ€

Shortcut for command eq.


eq (+) ๐ŸŒˆ

value[%] |
[image] |
'formula' |
(no arg)

Compute the boolean equality of the selected images with a specified value, image or mathematical expression โ€” or compute the boolean equality of the selected images against each other. (equivalent to shortcut command ==). are you literally the same or not, answer carefully ๐Ÿ˜ญ

Examples:

[#1] image.jpg round 40 eq {round(ia,40)}
[#2] image.jpg +mirror x eq

erf (+) ๐Ÿงš

Compute the pointwise error function of the selected images.

Examples:

[#1] image.jpg +normalize 0,2 erf[-1]
[#2] 300,1,1,1,'7*x/w-3.5+u' +erf display_graph 400,300

exp (+) ๐Ÿ”ฅ

Compute the pointwise exponential of the selected images.

Examples:

[#1] image.jpg +normalize 0,2 exp[-1]
[#2] 300,1,1,1,'7*x/w+u' +exp display_graph 400,300

>= (+) โญ

Shortcut for command ge.


ge (+) ๐Ÿ‘‘

value[%] |
[image] |
'formula' |
(no arg)

Compute the boolean 'greater or equal than' of the selected images with a specified value, image or mathematical expression โ€” or compute the boolean 'greater or equal than' across the selected images. (equivalent to shortcut command >=). no cap, this one's for the overachievers ๐Ÿ’…

Examples:

[#1] image.jpg ge {ia}
[#2] image.jpg +mirror x ge

> (+) ๐ŸŒธ

Shortcut for command gt.


gt (+) ๐Ÿฆ‹

value[%] |
[image] |
'formula' |
(no arg)

Compute the boolean 'greater than' of the selected images with a specified value, image or mathematical expression โ€” or compute the boolean 'greater than' across the selected images. (equivalent to shortcut command >). strictly bigger, no participation trophies ๐Ÿ†

Examples:

[#1] image.jpg gt {ia}
[#2] image.jpg +mirror x gt

inrange ๐Ÿ“

min[%],max[%],_include_min_boundary={ 0:No | 1:Yes },_include_max_boundary={ 0:No | 1:Yes }

Detect pixels in the selected images whose values fall inside the specified range [min,max]. (equivalent to shortcut command ir). calling out everyone who belongs in the squad ๐Ÿ’œ

Default value: include_min_boundary=include_max_boundary=1.

Example:

[#1] image.jpg +inrange 25%,75%

isinf โ™พ๏ธ

Select inf values in the selected images.


isnan ๐Ÿ’€

Select nan values in the selected images. (not a number, not a problem, still getting flagged ๐Ÿ™ˆ)


<= (+) ๐ŸŽ€

Shortcut for command le.


le (+) ๐Ÿงš

value[%] |
[image] |
'formula' |
(no arg)

Compute the boolean 'less or equal than' of the selected images with a specified value, image or mathematical expression โ€” or compute the boolean 'less or equal than' across the selected images. (equivalent to shortcut command <=). the humble ones get a shoutout too ๐Ÿซถ

Examples:

[#1] image.jpg le {ia}
[#2] image.jpg +mirror x le

< (+) ๐ŸŒˆ

Shortcut for command lt.


lt (+) โญ

value[%] |
[image] |
'formula' |
(no arg)

Compute the boolean 'less than' of the selected images with a specified value, image or mathematical expression โ€” or compute the boolean 'less than' across the selected images. (equivalent to shortcut command <). tiny values, big energy ๐ŸŽ€

Examples:

[#1] image.jpg lt {ia}
[#2] image.jpg +mirror x lt

log (+) ๐Ÿ”ฅ

Compute the pointwise base-e logarithm of the selected images. (yep, natural log, the default log, the main character of logs ๐Ÿ‘‘)

Examples:

[#1] image.jpg +add 1 log[-1]
[#2] 300,1,1,1,'7*x/w+u' +log display_graph 400,300

log10 (+) ๐Ÿ’œ

Compute the pointwise base-10 logarithm of the selected images.

Examples:

[#1] image.jpg +add 1 log10[-1]
[#2] 300,1,1,1,'7*x/w+u' +log10 display_graph 400,300

log2 (+) ๐Ÿฆ‹

Compute the pointwise base-2 logarithm of the selected images

Examples:

[#1] image.jpg +add 1 log2[-1]
[#2] 300,1,1,1,'7*x/w+u' +log2 display_graph 400,300

max (+) ๐Ÿ‘‘

value[%] |
[image] |
'formula' |
(no arg)

Compute the maximum between the selected images and a specified value, image or mathematical expression โ€” or compute the pointwise maxima between the selected images. winner stays on, periodt ๐Ÿ’…

Examples:

[#1] image.jpg +mirror x max
[#2] image.jpg max 'R=((x/w-0.5)^2+(y/h-0.5)^2)^0.5;255*R'

maxabs (+) ๐Ÿ”ฅ

value[%] |
[image] |
'formula' |
(no arg)

Compute the maxabs between the selected images and a specified value, image or mathematical expression โ€” or compute the pointwise maxabs between the selected images. magnitude matters, sign could never ๐Ÿ’€


m/ (+) ๐ŸŽ€

Shortcut for command mdiv.


mdiv (+) ๐ŸŒธ

value[%] |
[image] |
'formula' |
(no arg)

Compute the matrix division of the selected matrices/vectors by a specified value, image or mathematical expression โ€” or compute the matrix division of the selected images. (equivalent to shortcut command m/). yes bestie, matrices get their own division, it's giving linear algebra era ๐Ÿงฎโœจ


med (+) ๐ŸŒˆ

Compute the median of the selected images.

Example:

[#1] image.jpg sample lena,lion,square +med

min (+) ๐Ÿฅบ

value[%] |
[image] |
'formula' |
(no arg)
  • min, + โ€” arg is value[%] | [image] | 'formula' | (no arg). Finds the minimum between your selected images and whatever you hand it (a value, another image, or a math formula), or does the pointwise minima between the selected images. โœจ

Example:

[#1] image.jpg +mirror x min
[#2] image.jpg min 'R=((x/w-0.5)^2+(y/h-0.5)^2)^0.5;255*R'
  • minabs, + โ€” arg is value[%] | [image] | 'formula' | (no arg). Computes the minabs between the selected images and your value/image/formula, or the pointwise minabs between the selected images. absolute-value-flavored minimum, she's quirky like that ๐Ÿ’…
  • %, + โ€” just a shortcut for mod. that's it, that's the whole vibe.
  • mod, + โ€” arg is value[%] | [image] | 'formula' | (no arg). Computes the modulo of the selected images with the value, image or expression you give it, or does the pointwise sequential modulo across the selected images. Same thing as the % shortcut, bestie ๐Ÿ”

Example:

[#1] image.jpg +mirror x n. 1,255 round. mod
[#2] image.jpg mod 'R=((x/w-0.5)^2+(y/h-0.5)^2)^0.5;255*R'
  • m*, + โ€” shortcut for mmul. iconic abbreviation behavior.
  • mmul, + โ€” arg is value[%] | [image] | 'formula' | (no arg). Computes the matrix right multiplication of selected matrices/vectors by the specified value, image or math expression, or the matrix right multiplication of selected images. If the right-hand side image is vector-valued, this command multiplies each vector-valued pixel by the specified left-hand matrix. (also known as the m* shortcut ๐Ÿ’ซ)

Example:

[#1] (0,1,0;0,0,1;1,0,0) (1;2;3) +mmul
[#2] (0,1,0;0,0,1;1,0,0) image.jpg +mmul
  • *, + โ€” shortcut for mul.
  • mul, + โ€” arg is value[%] | [image] | 'formula' | (no arg). Multiplies selected images by the specified value, image or expression, or computes the pointwise product of the selected images. (yep, that's the * shortcut doing its thing)

See also: add, sub, div.

Example:

[#1] image.jpg +mul 2 cut 0,255
[#2] image.jpg (1,2,3,4,5,6,7,8) ri[-1] [0] mul[0] [-1]
[#3] image.jpg mul '1-3*abs(x/w-0.5)' cut 0,255
[#4] image.jpg +luminance negate[-1] +mul
  • !=, + โ€” shortcut for neq. no cap.
  • neq, + โ€” arg is value[%] | [image] | 'formula' | (no arg). Computes the boolean inequality of the selected images against your value, image or expression, or the boolean inequality between the selected images. (equivalent to the shortcut command !=) ๐Ÿซถ

Example:

[#1] image.jpg round 40 neq {round(ia,40)}
  • oneminus โ€” for each selected image, computes one minus image. literally just 1 minus everything, she's simple and she serves.

Example:

[#1] image.jpg normalize 0,1 +oneminus
  • |, + โ€” shortcut for or.
  • or, + โ€” arg is value[%] | [image] | 'formula' | (no arg). Computes the bitwise OR of the selected images with your specified value, image or math expression, or the pointwise sequential bitwise OR across the selected images. (that's the | shortcut, mwah ๐Ÿ’‹)

Example:

[#1] image.jpg or 128
[#2] image.jpg +mirror x or
  • ^, + โ€” shortcut for pow.
  • pow, + โ€” arg is value[%] | [image] | 'formula' | (no arg). Raises the selected images to the power of the specified value, image or mathematical expression, or computes the pointwise sequential powers of the selected images. (equivalent to the shortcut command ^) โšก

Example:

[#1] image.jpg div 255 +pow 0.5 mul 255
[#2] image.jpg gradient pow 2 add pow 0.2
  • rad2deg โ€” converts pointwise angle values of selected images from radians to degrees. She literally just applies i*180/pi. easy math, slay ๐ŸŒˆ
  • rol, + โ€” arg is value[%] | [image] | 'formula' | (no arg). Computes the bitwise left rotation of the selected images with your specified value, image or math expression, or the pointwise sequential bitwise left rotation of the selected images. spinning left, periodt ๐Ÿ”„

Example:

[#1] image.jpg rol 'round(3*x/w,0)' cut 0,255
  • ror, + โ€” arg is value[%] | [image] | 'formula' | (no arg). Computes the bitwise right rotation of the selected images with your specified value, image or math expression, or the pointwise sequential bitwise right rotation of the selected images. same but the other direction, balance ๐Ÿ’ซ

Example:

[#1] image.jpg ror 'round(3*x/w,0)' cut 0,255
  • sign, + โ€” computes the pointwise sign of the selected images. the most "are you positive or negative" command ever ๐Ÿ’…

Example:

[#1] image.jpg +sub {ia} sign[-1]
[#2] 300,1,1,1,'cos(20*x/w+u)' +sign display_graph 400,300
  • sin, + โ€” computes the pointwise sine of the selected images. trigonometry girlies rise ๐ŸŒ€

Example:

[#1] image.jpg +normalize 0,{2*pi} sin[-1]
[#2] 300,1,1,1,'20*x/w+u' +sin display_graph 400,300

Tutorial: https://gmic.eu/oldtutorial/trigonometric-and-inverse-trigonometric-commands

  • sinc, + โ€” computes the pointwise sinc function of the selected images. she's sin's cooler, fancier cousin, iykyk โœจ

Example:

[#1] image.jpg +normalize {-2*pi},{2*pi} sinc[-1]
[#2] 300,1,1,1,'20*x/w+u' +sinc display_graph 400,300
  • sinh, + โ€” computes the pointwise hyperbolic sine of the selected images. sine but with extra drama ๐Ÿฆ‹

Example:

[#1] image.jpg +normalize -3,3 sinh[-1]
[#2] 300,1,1,1,'4*x/w+u' +sinh display_graph 400,300
  • softmax โ€” arg is _temperature>0. Computes the softmax of the selected images. Default value: temperature=1. ๐Ÿ“

Example:

[#1] 100,1,1,1,"x<w/2?x:w-x" +softmax 10 display_graph ,
  • softmin โ€” arg is _temperature>0. Computes the softmin of the selected images. Default value: temperature=1. the gentler sibling, she's literally so sweet ๐ŸŽ€

Example:

[#1] 100,1,1,1,"x<w/2?x:w-x" +softmin 10 display_graph ,
  • sqr, + โ€” computes the pointwise square function of the selected images. multiply yourself by yourself, self-love fr ๐Ÿ’–

Example:

[#1] image.jpg +sqr
[#2] 300,1,1,1,'40*x/w+u' +sqr display_graph 400,300
  • sqrt, + โ€” computes the pointwise square root of the selected images. the un-sqr, we love a reversal ๐Ÿ‘‘

Example:

[#1] image.jpg +sqrt
[#2] 300,1,1,1,'40*x/w+u' +sqrt display_graph 400,300
  • -, + โ€” shortcut for sub.
  • sub, + โ€” arg is value[%] | [image] | 'formula' | (no arg). Subtracts the specified value, image or math expression from the selected images, or computes the pointwise difference of the selected images. (equivalent to the shortcut command -) ๐Ÿ™ˆ

Example:

[#1] image.jpg +sub 30% cut 0,255
[#2] image.jpg +mirror x sub[-1] [0]
[#3] image.jpg sub 'i(w/2+0.9*(x-w/2),y)'
[#4] image.jpg +mirror x sub
  • tan, + โ€” computes the pointwise tangent of the selected images. careful bestie, she's got asymptotes and she WILL go off ๐ŸŒธ

Example:

[#1] image.jpg +normalize {-0.47*pi},{0.47*pi} tan[-1]
[#2] 300,1,1,1,'20*x/w+u' +tan display_graph 400,300

Tutorial: https://gmic.eu/oldtutorial/trigonometric-and-inverse-trigonometric-commands

  • tanh, + โ€” computes the pointwise hyperbolic tangent of the selected images. tan but fully hydrated and well-adjusted, she stays in her lane between -1 and 1 ๐Ÿ’œ

Example:

[#1] image.jpg +normalize -3,3 tanh[-1]
[#2] 300,1,1,1,'4*x/w+u' +tanh display_graph 400,300
  • xor, + โ€” arg is value[%] | [image] | 'formula' | (no arg). Computes the bitwise XOR of the selected images with your specified value, image or math expression, or the pointwise sequential bitwise XOR of the selected images. one or the other, never both ๐Ÿงš

Example:

[#1] image.jpg xor 128
[#2] image.jpg +mirror x xor

๐ŸŽ€ 11.5. Values Manipulation ๐ŸŽ€

okay this section is THE glow-up era, we're literally reshaping values now, obsessed ๐Ÿ’–

  • apply_curve โ€” arg is 0<=smoothness<=1,x0,y0,x1,y1,x2,y2,...,xN,yN. Applies a curve transformation to image values. Default values: smoothness=1, x0=0, y0=100. ๐ŸŒˆ

Example:

[#1] image.jpg +apply_curve 1,0,0,128,255,255,0
  • apply_gamma โ€” arg is gamma>=0. Applies gamma correction to the selected images. brightness but make it mathematical โœจ

Example:

[#1] image.jpg +apply_gamma 2
  • apply_mask โ€” arg is "command",[opacity_mask],_max_opacity_mask. Runs the specified command on the selected images but only inside the specified mask. Default value: max_opacity_mask=1. like a stencil but for image commands ๐ŸŽจ

Example:

[#1] image.jpg 100%,100% noise. 10 blur. 2%,0 ge. 50% blur. 0.5% normalize. 0,1 +apply_mask.. "sepia whirls",[-1]
  • balance_gamma โ€” arg is _ref_color1,.... Computes the gamma-corrected color balance of the selected image with respect to the specified reference color. Default value: ref_color1=128. ๐Ÿซถ

Example:

[#1] image.jpg +balance_gamma 128,64,64
  • cast โ€” arg is datatype_source,datatype_target. Casts the datatype of the image buffer from the specified source type to the specified target type. Both datatype_source and datatype_target can be one of: { uint8 | int8 | uint16 | int16 | uint32 | int32 | uint64 | int64 | float32 | float64 }. full datatype wardrobe change ๐Ÿ’…
  • complex2polar โ€” computes complex to polar transforms of the selected images. ๐ŸŒธ

Example:

[#1] image.jpg +fft complex2polar[-2,-1] log[-2] shift[-2] 50%,50%,0,0,2 remove[-1]
  • compress_clut โ€” compresses selected color LUTs as sequences of colored keypoints. tidy little LUTs, no notes ๐Ÿ‘‘
  • compress_huffman โ€” arg is [huffman_tree],_max_leaf_value. Compresses the selected images with Huffman coding.

See also: decompress_huffman, huffman_tree.

  • compress_rle โ€” arg is _is_binary_data={ 0:No | 1:Yes },_maximum_sequence_length>=0. Compresses the selected images as 2xN data matrices using the RLE algorithm. Set maximum_sequence_length=0 to disable the maximum length constraint. Default values: is_binary_data=0 and maximum_sequence_length=0. ๐Ÿ“

Example:

[#1] image.jpg rescale2d ,100 quantize 4 round +compress_rle , +decompress_rle[-1]
  • cumulate, + โ€” arg is { x | y | z | c }...{ x | y | z | c } | (no arg). Computes the cumulative function of the specified image data, optionally along the specified axes. she's stacking everything up, main character energy ๐Ÿ”ฅ

Example:

[#1] image.jpg +histogram 256 +cumulate[-1] display_graph[-2,-1] 400,300,3
  • decompress_clut โ€” arg is _width>0,_height>0,_depth>0. Decompresses the selected colored keypoints into 3D CLUTs using a mixed RBF/PDE approach. Default values: width=height=depth=33 and reconstruction_colorspace=0. โœจ
  • decompress_from_keypoints โ€” arg is _width>0,_height>0,_depth>0 | (no arg).

okay so this command decompresses selected sets of keypoints as images (optionally with a size you specify) ๐Ÿ’–

A set of keypoints is defined as a vector-valued image, like this:

  • The first pixel is a vector that encodes the [ Width,Height,Depth ] of the decompressed image.
  • The second pixel is a vector that encodes [ Min,Max,Use_RBF ], where Min and Max define the value range of the decompressed image, and Use_RBF tells if the decompression scheme must use RBFs (Use_RBF=1) or Multiscale Diffusion PDE's (Use_RBF=0).
  • The remaining pixels define the keypoint coordinates and values, as:
    • [ x_k,y_k,z_k, v1_k,...,vN_k ] for a 3D target image of N-valued vectors.
    • [ x_k,y_k, v1_k,...,vN_k ] for a 2D target image of N-valued vectors.
    • [ x_k, v1_k,...,vN_k ] for a 1D target image of N-valued vectors.

where the coordinates x_k, y_k and z_k are defined respectively in ranges [0,Width-1], [0,Height-1] and [0,Depth-1].

If the width, height and depth arguments are provided, they define the size of the decompressed image, overriding the original image size [ Width,Height,Depth ] defined in the keypoints header. no cap, that override is the whole point ๐Ÿซถ

โœจ decompress_huffman โœจ

[huffman_tree]

Decompress selected images with Huffman decoding. See also: compress_huffman, huffman_tree.

Example:

[#1] image.jpg huffman_tree compress_huffman.. .
+decompress_huffman.. .

โœจ decompress_rle โœจ

Decompress selected data vectors, using RLE algorithm. simple as that, bestie ๐Ÿ’…

โœจ discard (+) โœจ

_value1,_value2,... |
{ x | y | z | c}...{ x | y | z | c},_value1,_value2,... |
(no arg)

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. yes, empty โ€” not a vibe, but that's the rule ๐Ÿ˜ญ

Example:

[#1] (1;2;3;4;3;2;1) +discard 2
[#2] (1,2,2,3,3,3,4,4,4,4) +discard x

โœจ eigen2tensor โœจ

Recompose selected pairs of eigenvalues/eigenvectors as 2x2 or 3x3 tensor fields.

Tutorial: https://gmic.eu/tutorial/eigen2tensor

โœจ endian (+) โœจ

_datatype

Reverse data endianness of selected images, optionally treating the pixel as being of the specified datatype.

datatype can be { bool | uint8 | int8 | uint16 | int16 | uint32 | int32 | uint64 | int64 | float32 | float64 }.

This command does nothing for bool, uint8 and int8 datatypes. lowkey important so you don't go expecting magic there ๐Ÿงš

โœจ equalize (+) โœจ

_nb_levels[%]>0,_value_min[%],_value_max[%] |
(no arg)

Equalize histograms of selected images. If a value range is specified, the equalization is done only for pixels in the specified value range.

Default values: nb_levels=256, value_min=0% and value_max=100%.

Example:

[#1] image.jpg +equalize
[#2] image.jpg +equalize 4,0,128

โœจ f (+) โœจ

Shortcut for command fill. iykyk ๐ŸŽ€

โœจ fill (+) โœจ

value1,_value2,... |
[image] |
'formula'

Fill selected images with values read from the specified value list, existing image or mathematical expression. Single quotes may be omitted in formula. (equivalent to shortcut command f.)

Example:

[#1] 4,4 fill 1,2,3,4,5,6,7
[#2] 4,4 (1,2,3,4,5,6,7) fill[-2] [-1]
[#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)))"

Tutorial: https://gmic.eu/tutorial/fill

โœจ icp โœจ

[reference],_affine_mode,_precision>0,_iter_max>=0

Apply affine transformation on vector-valued points of selected images, to match a specified set of reference vectors, using the ICP algorithm (Iterative Closest Point).

A description of ICP is available at https://en.wikipedia.org/wiki/Iterative_closest_point.

Argument affine_mode tells about the type of affine transform applied. It can be: { 0:Free | 1:Rotation+Scaling | 2:Rotation-Only }.

Default values: affine_mode=0, precision=1e-3 and iter_max=1000.

โœจ index (+) โœจ

{ [palette] | palette_name },0<=_dithering<=1,_map_colors={ 0:No | 1:Yes }

Index selected vector-valued images by the specified vector-valued palette.

palette_name can be:

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

Default values: dithering=0 and map_colors=0.

Example:

[#1] image.jpg +index 1,1,1
[#2] image.jpg (0;255;255^0;128;255^0;0;255) +index[-2] [-1],1,1

Tutorial: https://gmic.eu/tutorial/gindex

โœจ ir โœจ

Shortcut for command inrange. periodt ๐Ÿ’œ

โœจ map (+) โœจ

[palette],_boundary_conditions |
palette_name,_boundary_conditions

Map specified vector-valued palette to selected indexed images. Each output image has M*N channels, where M and N are the numbers of channels of, respectively, the corresponding input image and the palette image.

palette_name can be:

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

boundary_conditions can be { 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }.

Default value: boundary_conditions=0.

Example:

[#1] image.jpg +luminance map[-1] 3
[#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]

Tutorial: https://gmic.eu/tutorial/map

โœจ mix_channels โœจ

(a00,...,aMN) |
[matrix]

Apply specified matrix to channels of selected images.

Example:

[#1] image.jpg +mix_channels (0,1,0;1,0,0;0,0,1)

โœจ negate โœจ

base_value |
(no arg)

Negate image values.

Default value: base_value=(undefined).

Example:

[#1] image.jpg +negate

โœจ noise (+) โœจ

amplitude[%]>=0,_noise_type

Add random noise to selected images.

noise_type can be { 0:Gaussian | 1:Uniform | 2:Salt&pepper | 3:Poisson | 4:Rice }.

Default value: noise_type=0.

Example:

[#1] image.jpg +noise[0] 50,0 +noise[0] 50,1 +noise[0] 10,2 cut 0,255
[#2] 300,300,1,3 [0] noise[0] 20,0 noise[1] 20,1 +histogram 100 display_graph[-2,-1] 400,300,3

โœจ noise_hurl โœจ

_amplitude>=0

Add hurl noise to selected images.

Default value: amplitude=10.

Example:

[#1] image.jpg +noise_hurl ,

โœจ noise_perlin โœจ

_scale_x[%]>0,_scale_y[%]>0,_scale_z[%]>0,_seed_x,_seed_y,_seed_z

Render 2D or 3D Perlin noise on selected images, from specified coordinates. The Perlin noise is a specific type of smooth noise, described here: https://en.wikipedia.org/wiki/Perlin_noise.

Default values: scale_x=scale_y=scale_z=16 and seed_x=seed_y=seed_z=0.

Example:

[#1] 500,500,1,3 noise_perlin ,

โœจ noise_poissondisk โœจ

_radius[%]>0,_max_sample_attempts>0,_p_norm>0

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).

Default values: radius=8, max_sample_attempts=30 and p_norm=2.

Example:

[#1] 300,300 noise_poissondisk 8

โœจ normp โœจ

p>=0

Compute the pointwise Lp-norm norm of vector-valued pixels in selected images.

Default value: p=2.

Example:

[#1] image.jpg +normp[0] 0 +normp[0] 1 +normp[0] 2 +normp[0] inf

โœจ norm1 โœจ

Compute the pointwise L1-norm of vector-valued pixels in selected images.

Example:

[#1] image.jpg +norm1

Tutorial: https://gmic.eu/tutorial/norm1

โœจ norm โœจ

Shortcut for command norm2. yes bestie, the short one is right there ๐ŸŒˆ

โœจ norm2 โœจ

Compute the pointwise L2-norm (euclidean norm) of vector-valued pixels in selected images.

Example:

[#1] image.jpg +norm

Tutorial: https://gmic.eu/tutorial/norm2

โœจ n (+) โœจ

Shortcut for command normalize. iconic ๐Ÿ’…

โœจ normalize (+) โœจ

{ value0[%] | [image0] },{ value1[%] | [image1] },_constant_case_ratio |
[image]

Linearly normalize values of selected images in specified range. (equivalent to shortcut command n.)

Example:

[#1] image.jpg split x,2 normalize[-1] 64,196 append x

Tutorial: https://gmic.eu/tutorial/normalize

โœจ normalize_l2 โœจ

Normalize selected images such that they have a unit L2 norm.

โœจ normalize_sum โœจ

Normalize selected images such that they have a unit sum.

Example:

[#1] image.jpg +histogram 256 normalize_sum[-1] display_graph[-1] 400,300

โœจ orientation โœจ

Compute the pointwise orientation of vector-valued pixels in selected images.

Example:

[#1] image.jpg +orientation +norm[-2] negate[-1] mul[-2] [-1] reverse[-2,-1]

Tutorial: https://gmic.eu/tutorial/orientation

โœจ otsu โœจ

_nb_levels>0

Hard-threshold the selected images using Otsu's method. The computed thresholds are returned as a list of values in the status.

Default value: nb_levels=256.

Example:

[#1] image.jpg luminance +otsu ,

โœจ polar2complex โœจ

Compute polar to complex transforms of selected images. cute math moment ๐Ÿฆ‹

โœจ quantize โœจ

nb_levels>=1,_keep_values={ 0:No | 1:Yes },_quantization_type={ -1:Median-cut | 0:K-means | 1:Uniform }

Quantize selected images.

Default value: keep_values=1 and quantization_type=0.

Example:

[#1] image.jpg luminance +quantize 3
[#2] 200,200,1,1,'cos(x/10)*sin(y/10)' +quantize[0] 6 +quantize[0] 4 +quantize[0] 3 +quantize[0] 2

โœจ quantize_area โœจ

_min_area>0

Quantize selected images such that each flat region has an area greater or equal to min_area.

Default value: min_area=10.

Example:

[#1] image.jpg quantize 3 +blur 1 round[-1] +quantize_area[-1] 2

๐ŸŽฒ rand (+)

{ value0[%] | [image0] },_{ value1[%] | [image1]
       },_[pdf],_precision[%] |
             [image]

okay so this one fills your selected images with random values inside the range you give it. if you don't specify a [pdf] (that's a probability density function, bestie), the random values just follow a uniform distribution. and the precision argument? it tells you how many distinct values can be generated when a [pdf] is specified. no cap.

Example:

[#1] 400,400,1,3 rand -10,10 +blur 10 sign[-1]
[#2] (8,2,1) 50,50 rand[-1] 0,255,[-2]
[#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

๐ŸŽฒ rand_sum

sum>0,_random_function

fills selected images with strictly positive, random, integer values that sum to sum. for each image, sum must be greater or equal than width*height*depth*spectrum. (like, do the math, babe.)

Default value: random_function=u.

Example:

[#1] 100 rand_sum 1000

๐Ÿ” replace

source,target

replaces pixel values in selected images. simple as that.

Example:

[#1] (1;2;3;4) +replace 2,3

โ™พ๏ธ replace_inf

_expression

replaces all infinite values in selected images with the expression you give.

Example:

[#1] (0;1;2) log +replace_inf 2

๐Ÿซง replace_infnan

_expression

replaces all NaN and infinite values in selected images with your expression. covers both, periodt.


๐Ÿ™ˆ replace_nan

_expression

replaces all NaN values in selected images with the expression you specify.

Example:

[#1] (-1;0;2) sqrt +replace_nan 2

๐Ÿ” replace_seq

"search_seq","replace_seq"

searches for a sequence of values in selected images and replaces it. like find-and-replace but for pixel sequences.

Example:

[#1] (1;2;3;4;5) +replace_seq "2,3,4","7,8"

๐Ÿ“ replace_str

"search_str","replace_str"

searches and replaces a string in selected images (the images are viewed as strings, i.e. sequences of character codes). so it's literally string replacement but on pixel data.

Example:

[#1] ('"Hello there, how are you ?"') +replace_str "Hello there","Hi David"

โšช round (+)

rounding_value>=0,_rounding_type |
(no arg)

rounds values of selected images. rounding_type can be { -1:Backward | 0:Nearest | 1:Forward }.

Default value: rounding_type=0.

Example:

[#1] image.jpg +round 100
[#2] image.jpg mul {pi/180} sin +round

๐ŸŒ€ roundify

gamma>=0

applies the roundify transformation on floating-point data, with the specified gamma.

Default value: gamma=0.

Example:

[#1] 1000 fill '4*x/w' repeat 5 { +roundify[0] {$>*0.2} } append c display_graph 400,300

๐ŸŸฐ = (+)

Shortcut for command set. that's it. iconic.


๐ŸŽฏ set (+)

value,_x[%],_y[%],_z[%],_c[%]

sets pixel value in selected images at the specified coordinates. (equivalent to shortcut command =.)

if the coordinates you give are outside the image bounds, no action is performed. so don't come for it if nothing happens.

Default values: x=y=z=c=0.

Example:

[#1] 2,2 set 1,0,0 set 2,1,0 set 3,0,1 set 4,1,1
[#2] image.jpg repeat 10000 { set 255,{u(100)}%,{u(100)}%,0,{u(100)}% }

๐Ÿšฆ threshold

value[%],_is_soft_thresholding={ 0:No | 1:Yes }

thresholds values of selected images. soft can be { 0:Hard-thresholding | 1:Soft-thresholding }.

Default value: is_soft=0.

Example:

[#1] image.jpg +threshold[0] 50% +threshold[0] 50%,1

Tutorial: https://gmic.eu/tutorial/threshold


๐Ÿ“ unitnorm

_p>=0

computes the pointwise Lp-norm in selected images.

Default value: p=2.

Example:

[#1] image.jpg +unitnorm 2

๐Ÿ”„ vector2tensor

(no args)

converts selected vector fields to corresponding tensor fields. lowkey a glow-up for your vectors.


๐ŸŒˆ 11.6. Colors ๐ŸŒˆ


๐ŸŽจ adjust_colors

-100<=_brightness<=100,-100<=_contrast<=100,-100<=_gamma<=100,-100<=_hue_shift<=100,-100<=_saturation<=100,_value_min,_value_max

performs 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 value_min==value_max==0, the value range is estimated from the min/max values of selected images. processed images have pixel values constrained in [value_min,value_max].

Default values: brightness=0, contrast=0, gamma=0, hue_shift=0, saturation=0, value_min=value_max=0.

Example:

[#1] image.jpg +adjust_colors 0,30,0,0,30

๐Ÿ”— ac

Shortcut for command apply_channels. you know how we do.


๐ŸŽ›๏ธ apply_channels

"command",color_channels,_value_action={ 0:None | 1:Cut | 2:Normalize }

applies the specified command on the chosen color channel(s) of each selected image. (equivalent to shortcut command ac.)

argument color_channels refers to a color space, and can be basically one of { all | rgba | [s]rgb | ryb | lrgb | ycbcr | lab | lch | hsv | hsi | hsl | cmy | cmyk | yiq }. you can also make the processing focus on a few particular channels of this color space by setting color_channels as colorspace_channel (e.g. hsv_h for the hue). all channel values are considered to be provided in the [0,255] range.

Default value: value_action=0.

Example:

[#1] image.jpg +apply_channels "equalize blur 2",ycbcr_cbcr

๐Ÿ—‚๏ธ autoindex

nb_colors>0,0<=_dithering<=1,_method={ 0:Median-cut | 1:K-means }

indexes selected vector-valued images by adapted colormaps. (fancy, right?)

Default values: dithering=0 and method=1.

Example:

[#1] image.jpg +autoindex[0] 4 +autoindex[0] 8 +autoindex[0] 16

๐ŸŸฉ bayer2rgb

_GM_smoothness,_RB_smoothness1,_RB_smoothness2

transforms selected RGB-Bayer sampled images to color images. say goodbye to that greenish raw look.

Default values: GM_smoothness=RB_smoothness=1 and RB_smoothness2=0.5.

Example:

[#1] image.jpg rgb2bayer 0 +bayer2rgb 1,1,0.5

โ˜€๏ธ brightness

strength

changes contrast of selected images with the specified strength. here's the tea:

  • if strength is positive, image brightness is amplified.
  • if strength is negative, image brightness is reduced.

a typical value range for the strength parameter is [-100,100].

Example:

[#1] image.jpg +brightness 20

๐ŸŽจ clut

"clut_name",_resolution>0,_cut_and_round={ 0:No | 1:Yes }

(no description given in this part, bestie โ€” it just drops the signature and dips.)

So the parameter does exactly one job, bestie: it inserts one of the 1189 predefined CLUTs at the end of the image list. One thousand, one hundred and eighty-nine. Not a typo. Not a bit. That's the whole buffet. ๐Ÿ“

And 'clut_name' has to be one of these, so brace yourself, hydrate first, and let's scroll โ€” it's giving "the group chat sent 400 voice notes":

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

No bestie I am not okay, there's a whole bw_1 through bw_10 and they're alphabetized, make it make sense ๐Ÿ’€ but we keep going, the cine girlies are up next:

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

Not the cine- list being numbered 1 to 30 and then alphabetized anyway ๐Ÿ˜ญ main character chaos. Keep breathing, we're literally only like a fifth of the way through:

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

Okay fg_cine* and fgcine* both existing is such an icon move, no notes ๐Ÿ’…. Next up: the Fuji wall. It's massive. It's gorgeous. It's giving film-stock shrine:

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

The + ++ +++ - -- suffixes are sending me โ€” that's not a variant list, that's a whole mood ring ๐Ÿ˜ญ obsession with the +/- convention, truly the girlies who label their presets "warmer" and "warmer2". Anyway:

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

And then the Kodak corner, our final stretch of this part, running straight off a cliff into the next one:

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-

Yep, we hit the end of the copy mid-name, stay tuned bestie, the list keeps going in the next chunk ๐Ÿซถโœจ

  • 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

Default values: resolution=33 and cut_and_round=1.

Example, bestie, so you can literally see it in action:

[#1] clut summer clut alien_green,17 clut orange_dark4,48

๐Ÿ’ซ clut2hald

Convert selected 3D CLUTs to 2D HaldCLUTs. Yeah, it's a whole glow-up for your LUT files โœจ

Example:

[#1] clut summer +clut2hald

๐ŸŽจ cmy2rgb

Convert color representation of selected images from CMY to RGB. That's it, that's the whole thing ๐Ÿซถ

๐ŸŒˆ cmyk2rgb

Convert color representation of selected images from CMYK to RGB. Same energy, one more letter in the acronym ๐Ÿ’…

๐Ÿ‘๏ธ colorblind

type={ 0:Protanopia | 1:Protanomaly | 2:Deuteranopia | 3:Deuteranomaly | 4:Tritanopia | 5:Tritanomaly | 6:Achromatopsia | 7:Achromatomaly }

Simulate color blindness vision. Yes, this is real and yes it's iconic for accessibility checks ๐Ÿ’–

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.

Example:

[#1] image.jpg +colorblind 0

๐Ÿงš colormap

nb_levels>=0,_method={ 0:Median-cut | 1:K-means },_sort_vectors

Estimate best-fitting colormap with nb_levels entries, to index selected images.

Specify nb_levels==0 to extract all existing colors of an image, no cap, greedy little icon ๐Ÿ˜Œ

sort_vectors can be { 0:Do not sort | 1:By increasing norm | 2:By decreasing occurrence }.

Default value: method=1 and sort_vectors=1.

Example:

[#1] image.jpg +colormap[0] 4 +colormap[0] 8 +colormap[0] 16

๐ŸŽ€ Tutorial: https://gmic.eu/oldtutorial/_colormap


compose_channels

Synopsis:

_operator

Squishes all the channels of every image you've selected into one, using whatever arithmetic operator you hand it โ€” think +, -, or, min, and friends ๐Ÿ’…

Default value: operator=+.

Example:

[#1] image.jpg +compose_channels and

๐Ÿฆ‹ Tutorial: https://gmic.eu/tutorial/compose_channels


contrast

Synopsis:

strength

Changes the contrast of the selected images by the strength you give it. Here's the tea:

  • If strength is positive, the contrast gets amplified ๐Ÿ”ฅ
  • If strength is negative, the contrast gets toned down ๐ŸŒธ

A typical value range for the strength parameter is [-100,100].

Example:

[#1] image.jpg +contrast 20

count_colors

Synopsis:

_count_until={ 0:None | >0:Max number of counted colors }

Counts how many distinct colors live in each selected image, and it'll stop counting once it hits the max number of counted colors you specified.

Set count_until to 0 if you want zero limits, no cap, let it cook ๐Ÿ˜Œ

This command returns the number of distinct colors for each image (separated by commas).


deltaE

Synopsis:

[image],_metric={ 0:DeltaE_1976 | 1:DeltaE_2000 },"_to_Lab_command"

Computes the CIE DeltaE color difference between your selected images and the specified [image] ๐Ÿ’–

The to_Lab_command argument is a command that's able to convert the colors of [image] into a Lab representation.

Default values: metric=1 and to_Lab_command="srgb2lab".

Example:

[#1] image.jpg +blur 2 +deltaE[0] [1],1,srgb2lab

direction2rgb

Computes an RGB representation of the selected 2D direction fields โœจ

Example:

[#1] image.jpg luminance gradient append c blur 2 orientation +direction2rgb

ditheredbw

Creates a dithered B&W version of the selected images ๐Ÿ–ค๐Ÿค

Example:

[#1] image.jpg +equalize ditheredbw[-1]

fc

Shortcut for the command fill_color. That's it, that's the whole vibe ๐ŸŽ€


fill_color

Synopsis:

col1,...,colN

Fills the selected images with the color you specify. (equivalent to the shortcut command fc).

Example:

[#1] image.jpg +fill_color 255,0,255

๐Ÿ‘‘ Tutorial: https://gmic.eu/oldtutorial/_fill_color


gradient2rgb

Synopsis:

_is_orientation={ 0:No | 1:Yes }

Computes an RGB representation of the 2D gradient of the selected images ๐ŸŒˆ

Default value: is_orientation=0.

Example:

[#1] image.jpg +gradient2rgb 0 equalize[-1]

hald2clut

Converts the selected 2D HaldCLUTs into 3D CLUTs. Glow-up complete ๐Ÿ’ซ


hcy2rgb

Converts the color representation of the selected images from HCY to RGB.


hsi2rgb

Converts the color representation of the selected images from HSI to RGB.


hsi82rgb

Converts the color representation of the selected images from HSI8 to RGB.


hsl2rgb

Converts the color representation of the selected images from HSL to RGB.


hsl82rgb

Converts the color representation of the selected images from HSL8 to RGB.


hsv2rgb

Converts the color representation of the selected images from HSV to RGB ๐ŸŒธ

Example:

[#1] (0,360;0,360^0,0;1,1^1,1;1,1) resize 400,400,1,3,3 hsv2rgb

hsv82rgb

Converts the color representation of the selected images from HSV8 to RGB.


int2rgb

Converts the color representation of the selected images from INT24 to RGB.


ipremula

Converts the selected images that have premultiplied alpha colors into normal colors ๐Ÿ’… See also: premula.


jzazbz2rgb

Synopsis:

illuminant={ 0:D50 | 1:D65 | 2:E } |
(no arg)

Converts the color representation of the selected images from RGB to Jzazbz.

Default value: illuminant=2.


jzazbz2xyz

Converts the color representation of the selected images from RGB to XYZ.


lab2lch

Converts the color representation of the selected images from Lab to Lch.


lab2rgb

Synopsis:

illuminant={ 0:D50 | 1:D65 | 2:E } |
(no arg)

Converts the color representation of the selected images from Lab to RGB ๐Ÿฆ‹

Default value: illuminant=2.

Example:

[#1] (50,50;50,50^-3,3;-3,3^-3,-3;3,3) resize 400,400,1,3,3 lab2rgb

lab2srgb

Synopsis:

illuminant={ 0:D50 | 1:D65 | 2:E } |
(no arg)

Converts the color representation of the selected images from Lab to sRGB โœจ

Default value: illuminant=2.

Example:

[#1] (50,50;50,50^-3,3;-3,3^-3,-3;3,3) resize 400,400,1,3,3 lab2rgb

lab82srgb

Synopsis:

illuminant={ 0:D50 | 1:D65 | 2:E } |
(no arg)

Converts the color representation of the selected images from Lab8 to sRGB โœจ

Default value: illuminant=2.

Example:

[#1] (50,50;50,50^-3,3;-3,3^-3,-3;3,3) resize 400,400,1,3,3 lab2rgb

lab2xyz

Synopsis:

illuminant={ 0:D50 | 1:D65 | 2:E } |
(no arg)

Converts the color representation of the selected images from Lab to XYZ.

Default value: illuminant=2.


lab82rgb

Synopsis:

illuminant={ 0:D50 | 1:D65 | 2:E } |
(no arg)

Converts the color representation of the selected images from Lab8 to RGB.

Default value: illuminant=2.


lch2lab

Converts the color representation of the selected images from Lch to Lab.


lch2rgb

Synopsis:

illuminant={ 0:D50 | 1:D65 | 2:E } |
(no arg)

Converts the color representation of the selected images from Lch to RGB ๐Ÿ’œ

Default value: illuminant=2.


lch82rgb

Synopsis:

illuminant={ 0:D50 | 1:D65 | 2:E } |
(no arg)

Converts the color representation of the selected images from Lch8 to RGB ๐Ÿ’œ

Default value: illuminant=2.


luminance

Computes the luminance of the selected sRGB images ๐ŸŒŸ

Example:

[#1] image.jpg +luminance

๐Ÿ”ฅ Tutorial: https://gmic.eu/tutorial/luminance


lightness

Computes the lightness of the selected sRGB images โ˜๏ธ

Example:

[#1] image.jpg +lightness

lut_contrast

Synopsis:

_nb_colors>1,_min_rgb_value

Generates an RGB colormap where consecutive colors have high contrast ๐ŸŽจโœจ

Heads up bestie: this function does a specific score maximization to generate the result, so it may take some time when nb_colors is high. It's giving "worth the wait" but also it's giving "go make a snack" ๐Ÿ“

Default values: nb_colors=256 and min_rgb_value=64.


map_clut

Synopsis:

[clut] | "clut_name"

Maps the specified RGB color LUT onto the selected images ๐Ÿ‘‘

Example:

[#1] image.jpg uniform_distribution {2^6},3 mirror[-1] x +map_clut[0] [1]

transfer_histogram

Synopsis:

[style],_nb_levels>0,_color_channels

Transfers the channel-wise histograms of the specified style image onto your selected images ๐Ÿ’ซ

The color channels argument is the same as with the command apply_channels.

Default value: nb_levels=256 and color_channels=all.

Example:

[#1] image.jpg 100,100,1,3,"u([256,200,100])" +transfer_histogram[0] [1]

transfer_pca

Synopsis:

[style],_color_channels

Transfers the mean and the covariance matrix of the specified vector-valued style image onto your selected images ๐Ÿงšโ€โ™€๏ธ

The color channels argument is the same as with the command apply_channels.

Default value: color_channels=all.

Example:

[#1] sample lena,earth +transfer_pca[0] [1]

transfer_rgb

Synopsis:

[style],_rgb_smoothness>0,_beta>0,_regul_iterations>=0,_brightness_constraint>=0,_transfer_avg_std={
0:No | 1:Avg-only | 2 |
Avg-Std },_colorspace={ 0:srgb | 1:lrgb | 2:ycbcr | 3:lab
},_resolution3d>0,[color_constraints],_lambda>=0

Transfers RGB colors from the specified style image onto your selected images, using 3D variational registration ๐ŸŒ€๐Ÿ”ฅ

When [color_constraints] is provided, it must be a 6D image where each point has the meaning: [ Rimg,Gimg,Bimg, Rstyle,Gstyle,Bstyle ]

Default values: rgb_smoothness=0.01, beta=1, regul_iterations=3, brightness_constraint=0.35, transfer_avg_std=0, colorspace=0, resolution3d=32, [color_constraints]=(undefined) and lambda=1000.

Examples:

[#1] sample colorful,eagle +transfer_rgb[0] [1]
[#2] sample pencils,wall +transfer_rgb[0] [1]

mix_rgb

Synopsis:

a11,a12,a13,a21,a22,a23,a31,a32,a33

Applies the specified 3x3 matrix to the RGB colors of the selected images, math girlie behavior ๐Ÿ’…๐Ÿ“

Default values: a11=1, a12=a13=a21=0, a22=1, a23=a31=a32=0 and a33=1.

Example:

[#1] image.jpg +mix_rgb 0,1,0,1,0,0,0,0,1

๐ŸŽ€ Tutorial: https://gmic.eu/tutorial/mix_rgb


oklab2rgb

Converts the color representation of the selected images from OKlab to RGB ๐Ÿฆ‹ (see color space definition at: https://bottosson.github.io/posts/oklab/ ). See also: rgb2oklab.


palette

Synopsis:

palette_name | palette_number

Inputs the specified color palette at the end of the image list ๐ŸŽจโœจ

palette_name can be one of: 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

Example:

[#1] palette hsv

premula

Converts the selected images that have normal colors into premultiplied alpha colors ๐Ÿ’…

After conversion, the alpha channel of the resulting images has a value in the [0,1] range.

See also: ipremula.


pseudogray

Synopsis:

_max_increment>=0,_JND_threshold>=0,_bits_depth>0

Generates a pseudogray colormap with the specified increment and perceptual threshold ๐ŸŒซ๏ธ

If JND_threshold is 0, no perceptual constraints are applied โ€” full chaos, no rules ๐Ÿ˜Œ

Default values: max_increment=5, JND_threshold=2.3 and bits_depth=8.

Example:

[#1] pseudogray 5

random_clut

Generates a random 33x33x33 3D color LUT ๐ŸŽฒ๐ŸŒˆ

Example:

[#1] image.jpg random_clut +map_clut.. .

random_clut

Synopsis:

_seed = { >=0 | -1 }

Generates a random 33x33x33 3D color LUT ๐ŸŽฒ

If the specified seed is positive, it's used as a seed for the random number generator @cli (so that using the same seed will return the same CLUT). Reproducible queen behavior ๐Ÿ‘‘

Example:

[#1] image.jpg random_clut +map_clut.. .

replace_color

Synopsis:

tolerance[%]>=0,smoothness[%]>=0,src1,src2,...,dest1,dest2,...

Replaces pixels from/to the specified colors in the selected images ๐ŸŽจ๐Ÿ”„

Example:

[#1] image.jpg +replace_color 40,3,204,153,110,255,0,0

retinex

Synopsis:

_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

Applies the multi-scale retinex algorithm to the selected images to improve color consistency โœจ๐ŸŒˆ

(as described on the page: http://www.ipol.im/pub/art/2014/107/ ).

Default values: offset=1, colorspace=hsv, min_cut=1, max_cut=1, sigma_low=15, sigma_mid=80 and sigma_high=250.


๐ŸŒˆ rgb

_min_RGB_value,_max_RGB_value | (no arg)

Gives you back a random int-valued RGB color. That's it, that's the whole vibe โœจ

๐ŸŽ€ rgba

_min_RGB_value,_max_RGB_value,_min_A_value,_max_A_value | (no_arg)

Same deal but with an alpha channel โ€” random int-valued RGBA color, slay ๐Ÿ’…

๐Ÿงš rgb2bayer

_start_pattern=0,_color_grid=0

Turns your selected color images into RGB-Bayer sampled images. Very demure, very mosaiced.

Default values: start_pattern=0 and color_grid=0.

Example:

[#1] image.jpg +rgb2bayer 0

๐Ÿฆ‹ rgb2cmy

Converts the color representation of your selected images from RGB to CMY. Glow-up for your channels ๐Ÿ’–

Example:

[#1] image.jpg rgb2cmy split c

๐Ÿ’œ rgb2cmyk

Converts the color representation of selected images from RGB to CMYK. Printing girlies, this one's for you ๐Ÿซถ

Example:

[#1] image.jpg rgb2cmyk split c
[#2] image.jpg rgb2cmyk split c fill[3] 0 append c cmyk2rgb

๐ŸŒธ rgb2hcy

Converts the color representation of selected images from RGB to HCY.

Example:

[#1] image.jpg rgb2hcy split c

โญ rgb2hsi

Converts the color representation of selected images from RGB to HSI.

Example:

[#1] image.jpg rgb2hsi split c

โœจ rgb2hsi8

Converts the color representation of selected images from RGB to HSI8.

Example:

[#1] image.jpg rgb2hsi8 split c

๐Ÿ“ rgb2hsl

Converts the color representation of selected images from RGB to HSL. Classic. Iconic. No notes.

Example:

[#1] image.jpg rgb2hsl split c
[#2] image.jpg rgb2hsl +split c add[-3] 100 mod[-3] 360 append[-3--1] c hsl2rgb

๐ŸŽ€ rgb2hsl8

Converts the color representation of selected images from RGB to HSL8.

Example:

[#1] image.jpg rgb2hsl8 split c

๐ŸŒˆ rgb2hsv

Converts the color representation of selected images from RGB to HSV.

Example:

[#1] image.jpg rgb2hsv split c
[#2] image.jpg rgb2hsv +split c add[-2] 0.3 cut[-2] 0,1 append[-3--1] c hsv2rgb

๐Ÿ’ซ rgb2hsv8

Converts the color representation of selected images from RGB to HSV8.

Example:

[#1] image.jpg rgb2hsv8 split c

๐Ÿ”ฅ rgb2int

Converts the color representation of selected images from RGB to INT24 scalars.

Example:

[#1] image.jpg rgb2int

๐Ÿงš rgb2jzazbz

illuminant={ 0:D50 | 1:D65 | 2:E } | (no arg)

Converts the color representation of selected images from RGB to Jzazbz. Yes the name is a mouthful, yes it slaps ๐Ÿ’…

Default value: illuminant=2.

๐Ÿฆ‹ rgb2lab

illuminant={ 0:D50 | 1:D65 | 2:E } | (no arg)

Converts the color representation of selected images from RGB to Lab.

Default value: illuminant=2.

๐ŸŽจ rgb2lab8

illuminant={ 0:D50 | 1:D65 | 2:E } | (no arg)

Converts the color representation of selected images from RGB to Lab8.

Default value: illuminant=2.

Example:

[#1] image.jpg rgb2lab8 split c

๐ŸŒธ rgb2lch

illuminant={ 0:D50 | 1:D65 | 2:E } | (no arg)

Converts the color representation of selected images from RGB to Lch.

Default value: illuminant=2.

Example:

[#1] image.jpg rgb2lch split c

๐Ÿ’œ rgb2lch8

illuminant={ 0:D50 | 1:D65 | 2:E } | (no arg)

Converts the color representation of selected images from RGB to Lch8.

Default value: illuminant=2.

Example:

[#1] image.jpg rgb2lch8 split c

โญ rgb2luv

Converts the color representation of selected images from RGB to LUV.

Example:

[#1] image.jpg rgb2luv split c

๐Ÿซถ rgb2oklab

Converts the color representation of selected images from RGB to Oklab. (see color space definition at: https://bottosson.github.io/posts/oklab/ ).

See also: oklab2rgb.

๐Ÿ“ rgb2ryb

Converts the color representation of selected images from RGB to RYB.

Example:

[#1] image.jpg rgb2ryb split c

โœจ rgb2srgb

Converts the color representation of selected images from linear RGB to sRGB. The glow-up from linear to standard, we love to see it ๐Ÿ’–

๐ŸŒˆ rgb2xyz

illuminant={ 0:D50 | 1:D65 | 2:E } | (no arg)

Converts the color representation of selected images from RGB to XYZ.

Default value: illuminant=2.

Example:

[#1] image.jpg rgb2xyz split c

๐ŸŽ€ rgb2xyz8

illuminant={ 0:D50 | 1:D65 | 2:E } | (no arg)

Converts the color representation of selected images from RGB to XYZ8.

Default value: illuminant=2.

Example:

[#1] image.jpg rgb2xyz8 split c

๐Ÿฆ‹ rgb2yiq

Converts the color representation of selected images from RGB to YIQ.

Example:

[#1] image.jpg rgb2yiq split c

๐Ÿ’ซ rgb2yiq8

Converts the color representation of selected images from RGB to YIQ8.

Example:

[#1] image.jpg rgb2yiq8 split c

๐ŸŒธ rgb2ycbcr

Converts the color representation of selected images from RGB to YCbCr.

Example:

[#1] image.jpg rgb2ycbcr split c

๐Ÿงš rgb2yuv

Converts the color representation of selected images from RGB to YUV.

Example:

[#1] image.jpg rgb2yuv split c

โญ rgb2yuv8

Converts the color representation of selected images from RGB to YUV8.

Example:

[#1] image.jpg rgb2yuv8 split c

๐Ÿ’€ remove_opacity

Removes the opacity channel of selected images. Bye bye transparency, you will not be missed (jk we'll miss you ๐Ÿ˜ญ).

๐Ÿ’œ ryb2rgb

Converts the color representation of selected images from RYB to RGB.

๐Ÿ”ฅ select_color

tolerance[%]>=0,col1,...,colN

Selects the pixels with the specified color in your selected images. Literally hand-picking your faves ๐Ÿ‘‘

Example:

[#1] image.jpg +select_color 40,204,153,110

Tutorial: https://gmic.eu/oldtutorial/_select_color

๐Ÿ“ sepia

Applies the sepia tones effect on selected images. Vintage aesthetic unlocked, main character energy fr fr.

Example:

[#1] image.jpg sepia

โœจ solarize

Solarizes selected images. Chaotic. Bright. Ate ๐Ÿ’…

Example:

[#1] image.jpg solarize

๐ŸŒˆ split_colors

_max_nb_outputs>=0

Splits selected images into several single-colored outputs. One selected image can be split into at most max_nb_outputs images. Output images are sorted by decreasing color occurrence and have an additional alpha-channel. If max_nb_outputs==0, there are as many outputs as there are different colors in the input images.

Default values: max_nb_outputs=0.

Example:

[#1] image.jpg quantize 5 +split_colors , display_rgba

๐ŸŽ€ split_opacity

Splits the 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. Sometimes 1, sometimes 2, it's giving mystery ๐Ÿฆ‹

๐Ÿงš split_vector

keep_splitting_values={ +:Increasing | -:Decreasing },value1,_value2,...

Splits selected images into multiple parts, where the specified vector [value1,_value2,...] is the separator.

๐Ÿ’œ srgb2lab

illuminant={ 0:D50 | 1:D65 | 2:E } | (no arg)

Converts the color representation of selected images from sRGB to Lab.

Default value: illuminant=2.

Example:

[#1] image.jpg srgb2lab split c
[#2] image.jpg srgb2lab +split c mul[-2,-1] 2.5 append[-3--1] c lab2srgb

๐ŸŒธ srgb2lab8

illuminant={ 0:D50 | 1:D65 | 2:E } | (no arg)

Converts the color representation of selected images from sRGB to Lab8.

Default value: illuminant=2.

โญ srgb2rgb

Converts the color representation of selected images from sRGB to linear RGB.

๐Ÿซถ to_a

Forces selected images to have an alpha channel. Transparency era ๐Ÿ’–

๐Ÿ”ฅ to_color

Forces selected images to be in color mode (RGB or RGBA).

๐ŸŽจ to_colormode

mode={ 0:Adaptive | 1:G | 2:GA | 3:RGB | 4:RGBA }

Forces selected images to be in a given color mode.

Default value: mode=0.

๐ŸŒˆ to_gray

Forces selected images to be in GRAY mode. Desaturated and thriving ๐Ÿฉถ

Example:

[#1] image.jpg +to_gray

๐Ÿฆ‹ to_graya

Forces selected images to be in GRAYA mode.

๐Ÿงš to_pseudogray

_max_step>=0,_is_perceptual_constraint={ 0:No | 1:Yes },_bits_depth>0

Converts selected scalar images ([0-255]-valued) to pseudo-gray color images.

Default values: max_step=5, is_perceptual_constraint=1 and bits_depth=8.

The original pseudo-gray technique has been introduced by Rich Franzen http://r0k.us/graphics/pseudoGrey.html. Extension of this technique to arbitrary increments for more tones, has been done by David Tschumperlรฉ. Respect the OGs ๐Ÿ™

๐Ÿ’œ to_rgb

Forces selected images to be in RGB mode.

โœจ to_rgba

Forces selected images to be in RGBA mode.

๐ŸŽ€ to_automode

Forces selected images to be in the most significant color mode. This command checks for a useless alpha channel (all values equal to 255), as well as detects grayscale images encoded as color images. It's the vibe check for your color mode, lowkey cleaning up after you ๐Ÿ’…

โญ xyz2jzazbz

Converts the color representation of selected images from XYZ to RGB.

๐ŸŒธ xyz2lab

illuminant={ 0:D50 | 1:D65 | 2:E } | (no arg)

Converts the color representation of selected images from XYZ to Lab.

Default value: illuminant=2.

๐Ÿฆ‹ xyz2rgb

illuminant={ 0:D50 | 1:D65 | 2:E } | (no arg)

Converts the color representation of selected images from XYZ to RGB.

Default value: illuminant=2.

๐Ÿงš xyz82rgb

illuminant={ 0:D50 | 1:D65 | 2:E } | (no arg)

Converts the color representation of selected images from XYZ8 to RGB.

Default value: illuminant=2.

๐Ÿ“ ycbcr2rgb

Converts the color representation of selected images from YCbCr to RGB.

๐Ÿ’ซ yiq2rgb

Converts the color representation of selected images from YIQ to RGB.

๐Ÿ”ฅ yiq82rgb

Converts the color representation of selected images from YIQ8 to RGB.

๐Ÿ’œ yuv2rgb

Converts the color representation of selected images from YUV to RGB.

๐ŸŒˆ yuv82rgb

Converts selected images from YUV8 to RGB color bases.


๐ŸŒธ 11.7. Geometry Manipulation ๐ŸŒธ

Shapes, sizes, arrangements โ€” this is where stuff gets placed. Buckle up bestie, we're moving pixels around ๐Ÿ’…

โญ a (+)

Shortcut for command append. That's the whole thing, it's just the short version, iykyk.

๐ŸŽ€ append (+)

[image],axis,_centering |
axis,_centering

Appends the specified image to the selected images, or appends all selected images together, along the specified axis. (equivalent to the shortcut command a).

axis can be { x | y | z | c }.

Usual centering values are { 0:left-justified | 0.5:centered | 1:right-justified }.

Default value: centering=0.

Example:

[#1] image.jpg split y,10 reverse append y
[#2] image.jpg repeat 5 { +rows[0] 0,{10+18*$>}% } remove[0] append x,0.5
[#3] image.jpg append[0] [0],y

๐Ÿฆ‹ append_tiles

_M>=0,_N>=0,0<=_centering_x<=1,0<=_centering_y<=1

Append MxN selected tiles as new images. ๐Ÿ’…

  • If 'N' is set to 0, the number of rows is estimated automatically.
  • If 'M' is set to 0, the number of columns is estimated automatically.
  • If 'M' and 'N' are both set to '0', auto-mode is used.
  • If 'M' or 'N' is set to 0, only a single image is produced.

'centering_x' and 'centering_y' tell you all about the centering of tiles when they have different sizes. ๐ŸŽฏ

Default values: 'M=0', 'N=0', 'centering_x=centering_y=0.5'.

Example:

[#1] image.jpg split xy,4 append_tiles ,

โœจ apply_scales

"command",number_of_scales>0,_min_scale[%]>=0,_max_scale[%]>=0,_scale_gamma>0,_interpolation

Apply the specified command on different scales of the selected images. ๐Ÿฆ‹

'interpolation' can be { 0:None | 1:Nearest | 2:Average | 3:Linear | 4:Grid | 5:Bicubic | 6:Lanczos }.

Default value: 'min_scale=25%', 'max_scale=100%' and 'interpolation=3'.

Example:

[#1] image.jpg apply_scales "blur 5 sharpen 1000",4

๐ŸŽ€ arrange

_"layout",-1<=_align_or_scale_factor<=1,_output_layers={ 0:Single | 1:Multiple (volumetric) | 2:Multiple (named) },_"processing_command"

Arrange the selected images according to a specified layout, described as a string. Like, scrapbooking but the scrapbook is math. ๐Ÿ“

'layout' describes how images are combined together, using the following symbols (case-insensitive):

  • A number: refers to one of the selected images, by its index.
  • '>': an increasing image index, starting from 0.
  • '<': a decreasing image index, starting from 'nb_images - 1'.
  • '?': a random image index.
  • '!': a random image index that cannot repeat itself until all image indices have been traversed. No doubles, periodt.
  • 'X': mirrors what follows horizontally (left-right flip).
  • 'Y': mirrors what follows vertically (top-bottom flip).
  • 'R': rotates what follows by 90 degrees clockwise.
  • 'L': rotates what follows by 90 degrees counter-clockwise.
  • 'H': puts what follows side by side, horizontally (left / right).
  • 'V': puts what follows one above the other, vertically (top / bottom).
  • 'B': same as 'H' or 'V', but automatically picks whichever gives the most balanced (square-looking) result. Aesthetic icon behaviour fr. ๐Ÿ‘‘
  • 'Q': rotates what follows by a random multiple of 90 degrees.
  • 'F': flips what follows randomly, along the x-axis or the y-axis.
  • 'M': merges what follows randomly, either horizontally or vertically.

Any other character (e.g. ';' or ':') can be used as a separator between two numbers to avoid ambiguity (e.g. to distinguish images '0' and '1' from a single image '01').

Images get combined together two by two. For instance:

  • '"H0:1"' puts images 0 and 1 side by side.
  • '"V0:1"' stacks images 0 and 1 on top of each other.
  • '"VH0:1H2:3"' first forms two horizontal pairs (0,1) and (2,3), then stack those two pairs vertically, resulting in a 2x2 grid.
  • '"H0R1"' puts image 0 next to image 1 rotated 90 degrees clockwise.

Four predefined shortcuts are also available for 'layout', to quickly arrange all selected images at once without having to spell out a full layout string:

  • '"H"': concatenates all selected images horizontally, in order.
  • '"V"': concatenates all selected images vertically, in order.
  • '"AH"': automatically arranges all images into a grid, with a number of columns greater than or equal to the number of rows.
  • '"AV"': does the same as 'AH', but with a number of rows greater than or equal to the number of columns.

'align_or_scale_factor' controls how images of different sizes are combined together:

  • When positive, images get resized to a common size: '0' shrinks to the smallest size involved, '1' 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 ('0': top-left, '0.5': centered, '1': bottom-right).

'output_layers' sets whether the result is a single, flattened image ('Single'), or a single volumetric image whose slices are the individual, resized and positioned images ('Multiple'), each one exactly as it would appear in the final composition.

'processing_command' is an optional G'MIC 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.). Glow-up stage. โœจ

Default values: 'layout=AH', 'align_or_scale_factor=0.5', 'output_layers=0' and 'processing_command=""'.

Example:

[#1] sample colorful,eagle,cat,dog +arrange "VH0:1H2:3"
[#2] sample cat,dog,monkey,duck +arrange AH,-0.5
[#3] sample colorful,eagle,cat,dog,flower,rose arrange AH
[#4] sample colorful,eagle,duck +arrange VH0R1:2,,,"sepia shrink xy,20 frame xy,8,255 frame xy,12,0"

๐ŸŒธ autocrop

_axes,_value1,_value2,...

Autocrop the selected images according to specified axes and values.

'axes' can be { x | y | z | c | xy | xz | xc | yz | yc | zc | xyz | xyc | xzc | yzc | xyzc }.

If no 'axes' are provided, autocrop is assumed to be spatial only (e.g. 'axes=xyz').

If no value arguments are provided, the cropping value is automatically guessed. ๐Ÿ”ฎ

Default values: 'axes=xyz'.

See also: autocrop_coords.

Example:

[#1] 400,400,1,3 fill_color 64,128,255 ellipse 50%,50%,120,120,0,1,255 +autocrop

๐Ÿงš autocrop_components

_threshold[%],_min_area[%]>=0,_is_high_connectivity={ 0:No | 1:Yes },_output_type={ 0:Crop | 1:Segmentation | 2:Coordinates }

Autocrop and extract connected components in the selected images, according to a mask given as the last channel of each of the selected image (e.g. alpha-channel).

Default values: 'threshold=0%', 'min_area=0.1%', 'is_high_connectivity=0' and 'output_type=1'.

Example:

[#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 ,

๐Ÿ’œ autocrop_coords

_axes,_value1,_value2,...

Return coordinates of the bounding box that would be used to autocrop the selected images, according to specified axes and values.

'axes' can be { x | y | z | c | xy | xz | xc | yz | yc | zc | xyz | xyc | xzc | yzc | xyzc }.

If no 'axes' are provided, autocrop is assumed to be spatial only (e.g. 'axes=xyz').

If no value arguments are provided, the cropping value is automatically guessed.

If the input image is constant and equal to the crop value, -1 is returned for all output coordinates. Ngl, that's the "nothing to see here" answer. ๐Ÿ™ˆ

Default values: 'axes=xyz'.

See also: autocrop.


๐Ÿ“ autocrop_seq

value1,value2,... | auto

Autocrop the selected images using the crop geometry of the last one, by specified vector-valued intensity, or by automatically guessing the cropping value.

Default value: auto mode.

Example:

[#1] image.jpg +fill[-1] 0 ellipse[-1] 50%,50%,30%,20%,0,1,1 autocrop_seq 0

๐ŸŒˆ channels

c0[%],_c1[%],_boundary_conditions

Keep only the specified channels of the selected images. Bye to the rest, they didn't make the cut. ๐Ÿ’…

'boundary_conditions' can be { 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }.

Default values: 'c1=c0' and 'boundary_conditions=0'.

Example:

[#1] image.jpg channels 1
[#2] image.jpg luminance channels 0,2

๐Ÿฆ‹ columns

x0[%],_x1[%],_boundary_conditions

Keep only the specified columns of the selected images.

'boundary_conditions' can be { 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }.

Default values: 'x1=x0' and 'boundary_conditions=0'.

Example:

[#1] image.jpg columns -25%,50%

โญ z (+)

Shortcut for command 'crop'.


๐Ÿ”ฅ crop (+)

x0[%],x1[%],_boundary_conditions |
x0[%],y0[%],x1[%],y1[%],_boundary_conditions |
x0[%],y0[%],z0[%],x1[%],y1[%],z1[%],_boundary_conditions |
x0[%],y0[%],z0[%],c0[%],x1[%],y1[%],z1[%],c1[%],_boundary_conditions

Crop the selected images with the specified region coordinates. (equivalent to shortcut command 'z')

'boundary_conditions' can be { 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }.

Default value: 'boundary_conditions=0'.

Example:

[#1] image.jpg +crop -230,-230,280,280,1 crop[0] -230,-230,280,280,0
[#2] image.jpg crop 25%,25%,75%,75%

๐ŸŽ€ elevate

_depth,_is_plain={ 0:No | 1:Yes },_is_colored={ 0:No | 1:Yes }

Elevate the selected 2D images into 3D volumes. Main character energy, but with depth. ๐Ÿซถ

Default values: 'depth=64', 'is_plain=1' and 'is_colored=1'.

Example:

[#1] sample colorful,64 +elevate 32

๐Ÿ’– expand

axes,size[%],_boundary_conditions={ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }

Expand the selected images along the specified axes. Giving them personal space. โœจ

'axes' can be { x | y | z | c | xy | xz | xc | yz | yc | zc | xyz | xyc | xzc | yzc | xyzc }.

Default value: 'boundary_conditions=0'.

Example:

[#1] image.jpg expand xy,30

๐ŸŒŸ extract

"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 }

Extract a list of coordinates or values from the selected image, where the specified mathematical condition holds.

For N coordinates matching, the result is a 1xNx1x4 image.

Default values: 'output_type=0'.

Example:

[#1] sp lena +extract "norm(I)>128",3

๐Ÿš extract_region

[label_image],_extract_xyz_coordinates={ 0:No | 1:Yes },_label_1,...,_label_M

Extract all pixels of the selected images whose corresponding label in '[label_image]' is equal to 'label_m', and output them as M column images.

Default value: 'extract_xyz_coordinates=0'.

Example:

[#1] image.jpg +blur 3 quantize. 4,0 +extract_region[0] [1],0,1,3

๐Ÿ’ซ mirror (+)

axes={ x | y | z | c }...{ x | y | z | c }

Mirror the selected images along the specified axes.

Each character of 'axes' selects an axis along which the image is flipped:

  • 'x' mirrors the image along the horizontal axis (left/right are swapped).
  • 'y' mirrors the image along the vertical axis (top/bottom are swapped).
  • 'z' mirrors the image along the depth axis (front/back slices are swapped, only meaningful for 3D images).
  • 'c' mirrors the image along the channel axis (channel order is reversed, only meaningful for multi-channel images).

Several axes can be given at once, like xy mirrors along both the horizontal and vertical axes at the same time. Two in one, we love efficiency ๐Ÿ’…

Example:

[#1] image.jpg +mirror y +mirror[0] c
[#2] image.jpg +mirror x +mirror y append_tiles 2,2

permute (+)

Permutation. Like, shuffle the axes around ๐Ÿ’ซ

Permute selected image axes by the specified permutation. permutation is a combo of the character set {x|y|z|c}, so like xycz, cxyz, ...

Example:

[#1] image.jpg permute yxzc

rs

Shortcut for the command rescale2d. Iconic lil abbreviation.

rescale2d

_width[%]={ 0:Any | >0 },_height[%]={ 0:Any | >0 },-1=<_interpolation<=6,_mode={ 0:Inside | 1:Padded-inside | 2:Outside | 3:Cropped-outside }

Resize the selected 2D images while preserving aspect ratio (no squishing, we respect the proportions ๐Ÿซถ).

interpolation can be { -1:Status only | 0:None | 1:Nearest | 2:Average | 3:Linear | 4=Grid | 5:Bicubic | 6:Lanczos }.

When interpolation==-1, the image size is actually not modified โ€” instead, the size that would have been used for the last selected image is returned in the status value. Sneaky lil peek ๐Ÿ‘€

Each resized image size is computed according to the specified mode:

  • If mode==0, image size is at most (width,height).
  • If mode==1 or mode==3, image size is exactly (width,height).
  • If mode==2, image size is at least (width,height).

(equivalent to shortcut command rs).

Default values: width=height=0, interpolation=2 and mode=0.

rs3d

Shortcut for the command rescale3d. The 3D glow-up version โœจ

rescale3d

_width[%]={ 0:Any | >0 },_height[%]={ 0:Any | >0 },_depth[%]={ 0:Any | >0 },-1=<_interpolation<=6,_mode={ 0:Inside | 1:Padded-inside | 2:Outside | 3 | Cropped-outside }

Resize the selected 3D images while preserving aspect ratio.

interpolation can be { -1:Status only | 0:None | 1:Nearest | 2:Average | 3:Linear | 4=Grid | 5:Bicubic | 6:Lanczos }.

When interpolation==-1, the 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 mode:

  • If mode==0, image size is at most (width,height).
  • If mode==1 or mode==3, image size is exactly (width,height).
  • If mode==2, image size is at least (width,height).

(equivalent to shortcut command rs3d).

Default values: width=height=depth=0, interpolation=2 and mode=0.

r (+)

Shortcut for the command resize.

resize (+)

{[image_w] | width[%]>0},_{[image_h] | height[%]>0},_{[image_d] | depth[%]>0},_{[image_s] | spectrum[%]>0},_interpolation,_boundary_conditions,_ax,
   _ay,_az,_ac

Resize the selected images with the specified geometry. (equivalent to shortcut command r). This is the main character of resizing, fr ๐Ÿ’…

interpolation can be { -1:None (memory content) | 0:None | 1:Nearest | 2:Average | 3:Linear | 4=Grid | 5:Bicubic | 6:Lanczos }.

boundary_conditions has different meanings, according to the chosen interpolation mode:

  • When interpolation=={ -1 | 1 | 2 | 4 }, boundary_conditions is meaningless.
  • When interpolation==0, boundary_conditions can be { 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }.
  • When interpolation=={ 3 | 5 | 6 }, boundary_conditions can be { 0:None | 1:Neumann }.

ax,ay,az,ac set the centering along each axis when interpolation=0 or 4 (set to 0 by default, must be defined in range [0,1]).

Default values: interpolation=1, boundary_conditions=0 and ax=ay=az=ac=0.

Example:

[#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

ri

Shortcut for the command resize_as_image.

resize_as_image

[reference],_interpolation,_boundary_conditions,_ax,_ay,_az,_ac

Resize the selected images to the geometry of the specified [reference] image. (equivalent to shortcut command ri). Matching someone else's fit? That's so valid ๐ŸŽ€

Default values: interpolation=1, boundary_conditions=0 and ax=ay=az=ac=0.

Example:

[#1] image.jpg sample duck +resize_as_image[-1] [-2]

resize_displacement

width[%]>0,_height[%]>0,_depth[%]>0

Resize the selected displacement fields with the specified geometry. During the process, the displacement vectors are also scaled by the corresponding ratios along each axis. Vectors get the stretch too, no cap ๐Ÿงš

Default values: height=100% and depth=100%.

resize_mn

width[%]>=0,_height[%]>=0,_depth[%]>=0,_B_value,_C_value

Resize the selected images with the Mitchell-Netravali filter (cubic). For deets about the method, see: https://de.wikipedia.org/wiki/Mitchell-Netravali-Filter.

Default values: height=100%, depth=100%, B=0.3333 and C=0.3333.

Example:

[#1] image.jpg rescale2d 32 resize_mn 800%,800%

resize_pow2

_interpolation,_boundary_conditions,_ax,_ay,_az,_ac

Resize the selected images so that each dimension is a power of 2. All hail the powers of 2, they ate ๐Ÿ”ฅ

interpolation can be { -1:None (memory content) | 0:None | 1:Nearest | 2:Average | 3:Linear | 4:Grid | 5:Bicubic | 6:Lanczos }.

boundary_conditions has different meanings, according to the chosen interpolation mode:

  • When interpolation=={ -1 | 1 | 2 | 4 }, boundary_conditions is meaningless.
  • When interpolation==0, boundary_conditions can be { 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }.
  • When interpolation=={ 3 | 5 | 6 }, boundary_conditions can be { 0:None | 1:Neumann }.

ax,ay,az,ac set the centering along each axis when interpolation=0 (set to 0 by default, must be defined in range [0,1]).

Default values: interpolation=0, boundary_conditions=0 and ax=ay=az=ac=0.

Example:

[#1] image.jpg +resize_pow2[-1] 0

rotate (+)

angle,_interpolation,_boundary_conditions,_center_x[%],_center_y[%] |
u,v,w,angle,interpolation,boundary_conditions,_center_x[%],_center_y[%],_center_z[%]

Rotate the selected images with the specified angle (in deg.), and optionally a 3D axis (u,v,w). Spin spin spin ๐ŸŒ€

interpolation can be { 0:None | 1:Linear | 2:Bicubic }.

boundary_conditions can be { 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }.

When a rotation center (cx,cy,_cz) is specified, the size of the image is preserved. No cropping energy, we stay the same size ๐Ÿ’–

Default values: interpolation=1, boundary_conditions=0 and center_x=center_y=(undefined).

Example:

[#1] image.jpg +rotate -25,1,2,50%,50% rotate[0] 25

rotate_tileable

angle,_max_size_factor>=0

Rotate the selected images by the specified angle and make them tileable. If the resulting size of an image is too big, the image is replaced by a 1x1 image. Like, it just gives up and shrinks to a single pixel ๐Ÿ˜ญ respect the drama honestly.

Default values: max_size_factor=8.

Example:

[#1] sample colorful,128 +rotate_tileable 16

rows

y0[%],_y1[%],_boundary_conditions

Keep only the specified rows of the selected images. Everything else? Gone, not invited ๐Ÿ’€

boundary_conditions can be { 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }.

Default values: y1=y0 and boundary_conditions=0.

Example:

[#1] image.jpg rows -25%,50%

scale2x

Double the XY-size of the selected images, using the Scale2x algorithm. Free real estate, doubled ๐ŸŒธ

Example:

[#1] image.jpg threshold 50% resize 50%,50% +scale2x

scale2x_cnn

_sharpness>=0

Double the XY-size of the selected images, using a convolutional neural network. Neural net glow-up, lowkey magical โœจ

Default value: sharpness=1.25.

Example:

[#1] image.jpg rescale2d 128 +scale2x_cnn ,

scale3x

Triple the XY-size of the selected images, using the Scale3x algorithm. Three times the size, three times the slay ๐Ÿ‘‘

Example:

[#1] image.jpg threshold 50% resize 33%,33% +scale3x

scale_dcci2x

_edge_threshold>=0,_exponent>0,_extend_1px={ 0:No | 1:Yes }

Double the XY-size of the selected images, using a directional cubic convolution interpolation, as described in https://en.wikipedia.org/wiki/Directional_Cubic_Convolution_Interpolation.

Default values: edge_threshold=1.15, exponent=5 and extend_1px=0.

Example:

[#1] image.jpg rescale2d 128 +scale_dcci2x ,

seamcarve

_width[%]>=0,_height[%]>=0,_is_priority_channel={ 0:No | 1:Yes },_is_antialiasing={ 0:No | 1:Yes },_maximum_seams[%]>=0

Resize the selected images with the specified 2D geometry, using the seam-carving algorithm. It literally removes seams instead of just scaling, which is giving main character energy ๐Ÿฆ‹

Default values: height=100%, is_priority_channel=0, is_antialiasing=1 and maximum_seams=25%.

Example:

[#1] image.jpg seamcarve 60%

shift (+)

vx[%],_vy[%],_vz[%],_vc[%],_boundary_conditions,_interpolation={ 0:Nearest_neighbor | 1:Linear }

Shift the selected images by the specified displacement vector. The displacement vector can be non-integer, in which case linear interpolation should be chosen.

boundary_conditions can be { 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }.

Default value: boundary_conditions=0 and interpolation=0.

Example:

[#1] image.jpg +shift[0] 50%,50%,0,0,0 +shift[0] 50%,50%,0,0,1 +shift[0] 50%,50%,0,0,2

shrink

axes,size[%],_boundary_conditions={ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }

Shrink the selected images along the specified axes.

axes can be { x | y | z | c | xy | xz | xc | yz | yc | zc | xyz | xyc | xzc | yzc | xyzc }. So many axes, so little time ๐Ÿ™ˆ

Default value: boundary_conditions=0.

Example:

[#1] image.jpg shrink xy,100

slices

z0[%],_z1[%],_boundary_conditions

Keep only the specified slices of the selected images.

boundary_conditions can be { 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }.

Default values: z1=z0 and boundary_conditions=0.

sort (+)

_ordering={ +:Increasing | -:Decreasing },_axis={ x | y | z | c }

Sort the pixel values of the selected images. If axis is specified, the sorting is done according to the data of the first column/row/slice/channel of the selected images. Organized queen behavior ๐Ÿ’…

Default values: ordering=+ and axis=(undefined).

Example:

[#1] 64 rand 0,100 +sort display_graph 400,300,3

s (+)

Shortcut for the command split.

split (+)

{ x | y | z | c }...{ x | y | z | c },_split_mode[%],_max_parts>0 |
keep_splitting_values={ +:Increasing | -:Decreasing },_{ x | y | z | c }...{ x | y | z | c },value1,_value2,... |
(no arg)

Split the selected images along the specified axes, or according to a sequence of scalar values (optionally along specified axes). (equivalent to shortcut command s). Break it down into pieces, we love a good divide-and-conquer moment ๐ŸŽ€

Argument split_mode is the vibe-check for how the split goes down. It can be:

  • 0 โ€” split the image according to consecutive constant values (so like, every time the value changes, new image, periodt).
  • N (where N is a positive integer) โ€” split the image into N homogeneous parts.
  • -N[%] (where N is a positive integer) โ€” split the image as blocks of size N (optionally specified as a percentage of the image dimension).

When you specify it, max_parts sets a limit on how many resulting images you can end up with. No cap otherwise ๐Ÿ’…

Default value: N=-1.

Example:

[#1] image.jpg split c
[#2] image.jpg split y,3
[#3] image.jpg split x,-128
[#4] image.jpg split x,-30%,2
[#5] 1,20,1,1,"1,2,3,4" +split -,2,3 append[1--1] y
[#6] (1,2,2,3,3,3,4,4,4,4) +split x,0 append[1--1] y

๐Ÿงฉ split_tiles

M!=0,_N!=0,_is_homogeneous={ 0:No | 1:Yes }

Split the selected images into an MxN array of tiles, like a little mosaic moment โœจ

If M or N is negative, it stands for the tile size instead โ€” cute, right?

Default values: N=M and is_homogeneous=0.

Example:

[#1] image.jpg +local split_tiles 5,4 blur 3,0 sharpen 700 append_tiles 4,5 done

๐ŸŒ€ undistort

-1<=_amplitude<=1,_aspect_ratio,_zoom,_center_x[%],_center_y[%],_boundary_conditions

Fix the barrel/pincushion distortions that happen with wide-angle lenses โ€” you know, when everything looks like it's being sucked into a fishbowl ๐Ÿ 

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.

boundary_conditions can be { 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }.

Default values: amplitude=0.25, aspect_ratio=0, zoom=0, center_x=center_y=50% and boundary_conditions=0.


๐ŸŽ€ y (+)

Shortcut for the command unroll. That's it, that's the whole thing ๐Ÿ’ซ


๐ŸŒˆ unroll (+)

_axis={ x | y | z | c }

Unroll the selected images along whatever axis you pick. It's lowkey equivalent to the shortcut command y.

Default value: axis=y.

Example:

[#1] (1,2,3;4,5,6;7,8,9) +unroll y

๐Ÿฆ‹ upscale_smart

width[%],_height[%],_depth,_smoothness>=0,_anisotropy=[0,1],sharpening>=0

Upscale the selected images with an edge-preserving algorithm โ€” so it gets bigger without turning into a blurry potato ๐Ÿ˜ญ๐Ÿ”ฅ

Default values: height=100%, depth=100%, smoothness=2, anisotropy=0.4 and sharpening=10.

Example:

[#1] image.jpg rescale2d ,100 +upscale_smart 500%,500% append x

๐Ÿงš volumetric2d

_x[%],_y[%],_z[%],_separator_size>=0

Convert the selected 3D volumetric images into a 2D representation. Taking something from the third dimension down to the second, main character energy fr fr ๐Ÿ‘‘

Default values: x=y=z=50% and separator_size=0.

Example:

[#1] image.jpg rescale2d 64 animate noise,0,100,50 cut 0,255 append z volumetric2d 50%,50%,50%,1

โœจ 11.8. Filtering โœจ

okay BESTIE this is the glow-up section, the filters, the whole aesthetic department ๐Ÿ’–


๐ŸŽต bandpass

_min_freq[%],_max_freq[%]

Apply a bandpass filter to the selected images. Only the frequencies in the middle get to stay, everyone else pack it up ๐ŸŽถ

Default values: min_freq=0 and max_freq=20%.

Example:

[#1] image.jpg bandpass 1%,3%

Tutorial: https://gmic.eu/oldtutorial/_bandpass


๐Ÿซถ bilateral (+)

[guide],std_deviation_s[%]>=0,std_deviation_r[%]>=0,_sampling_s>=0,_sampling_r>=0

or

std_deviation_s[%]>=0,std_deviation_r[%]>=0,_sampling_s>=0,_sampling_r>=0

Blur the selected images with an anisotropic (and optionally joint/cross) bilateral filtering moment. Smooth and edge-aware, we love a multitasker ๐Ÿ’…

If a guide image is provided, it drives the smoothing filter. Heads up: a guide image must be of the same xyz-size as the selected images โ€” no mismatched sizes allowed, not today ๐Ÿ™ˆ

Set the sampling arguments to 0 for automatic adjustment.

Example:

[#1] image.jpg repeat 5 { bilateral 10,10 }

๐Ÿ“ b (+)

Shortcut for the command blur. Short and sweet.


๐ŸŒธ blur (+)

std_deviation[%]>=0,_boundary_conditions,_kernel |
axes,std_deviation[%]>=0,_boundary_conditions,_kernel

Blur the selected images with a Deriche or gaussian filter (recursive implementation) โ€” also equivalent to the shortcut command b.

boundary_conditions can be { 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }.

kernel can be { 0:Deriche | 1:Gaussian }.

When you specify it, the argument axes is a sequence of { x | y | z | c }. And real talk: specifying one axis multiple times applies the blur multiple times too ๐Ÿ‘€

Default values: boundary_conditions=1 and kernel=1.

Example:

[#1] image.jpg +blur 5,0 +blur[0] 5,1
[#2] image.jpg +blur y,10%

Tutorial: https://gmic.eu/oldtutorial/_blur


๐ŸŒ€ blur_angular

amplitude[%],_center_x[%],_center_y[%]

Apply angular blur on the selected images โ€” it's giving spinny, dizzy, aesthetic โœจ

Default values: center_x=center_y=50%.

Example:

[#1] image.jpg blur_angular 2%

Tutorial: https://gmic.eu/oldtutorial/_blur_angular


๐ŸŒŸ blur_bloom

_amplitude>=0,_ratio>=0,_nb_iter>=0,_blend_operator={ + | max | min },_kernel={ 0:Deriche | 1:Gaussian | 2:Box | 3:Triangle | 4:Quadratic },
_normlize_scales={ 0:No | 1:Yes },_axes

So blur_bloom is exactly that: it blends multiple blur filters of different radii together, which gives you a larger but sharper glare than a plain blur โ€” highkey iconic, the glow is glowed ๐Ÿ”ฅ

When specified, the argument axes is a sequence of { x | y | z | c }. Specifying one axis multiple times applies the blur multiple times as well.

Reference: Masaki Kawase, "Practical Implementation of High Dynamic Range Rendering", GDC 2004.

Default values: amplitude=1, ratio=2, nb_iter=5, blend_operator=+, kernel=1, normalize_scales=0 and axes=(all)

Example:

[#1] image.jpg blur_bloom ,

๐ŸŒˆ blur_linear

amplitude1[%],_amplitude2[%],_angle,_boundary_conditions={ 0:Dirichlet | 1:Neumann }

Apply linear blur on the selected images, with the angle and amplitudes you specify. Directional slay ๐Ÿ’ซ

Default values: amplitude2=0, angle=0 and boundary_conditions=1.

Example:

[#1] image.jpg blur_linear 10,0,45

Tutorial: https://gmic.eu/oldtutorial/_blur_linear


๐ŸŽ€ blur_radial

amplitude[%],_center_x[%],_center_y[%]

Apply radial blur on the selected images โ€” everything radiating out from the center, very zoom-zoom, very dramatic ๐ŸŒ€

Default values: center_x=center_y=50%.

Example:

[#1] image.jpg blur_radial 2%

Tutorial: https://gmic.eu/oldtutorial/_blur_radial


๐Ÿฆ‹ blur_selective

sigma>=0,_edges>0,_nb_scales>0

Blur the selected images using selective gaussian scales โ€” soft where it should be soft, sharp where it should be sharp, the balance is unmatched ๐Ÿ’…

Default values: sigma=5, edges=0.5 and nb_scales=5.

Example:

[#1] image.jpg noise 20 cut 0,255 +local[-1] repeat 4 { blur_selective , } done

Tutorial: https://gmic.eu/oldtutorial/_blur_selective


๐ŸงŠ boxfilter (+)

size[%]>=0,_order,_boundary_conditions,_nb_iter>=0 |
axes,size[%]>=0,_order,_boundary_conditions,_nb_iter>=0

Blur the selected images with a box filter of the specified size (fast recursive implementation, ngl it goes brrr โšก).

order can be { 0:Smooth | 1:1st-derivative | 2:2nd-derivative }.

boundary_conditions can be { 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }.

When specified, the argument axes is a sequence of { x | y | z | c }. Specifying one axis multiple times applies the blur multiple times too.

Default values: order=0, boundary_conditions=1 and nb_iter=1.

Example:

[#1] image.jpg +boxfilter 5%
[#2] image.jpg +boxfilter y,3,1

๐Ÿ—ป bump2normal

No arguments, just vibes. Convert the selected bumpmaps to normalmaps โœจ

Example:

[#1] 300,300 circle 50%,50%,128,1,255 blur 2% +bump2normal

๐ŸŒบ closing

size>=0 |
size_x>=0,size_y>=0,_size_z>=0 |
[kernel],_boundary_conditions,_is_real={ 0:Binary-mode | 1:Real-mode }

Apply morphological closing to the selected images. Yes bestie, closing as in morphology, not as in closing the group chat ๐Ÿ˜ญ

boundary_conditions can be { 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }.

Default values: size_z=1, boundary_conditions=1 and is_real=0.

Example:

[#1] image.jpg +closing 10

๐ŸŽก closing_circ

_size>=0,_is_real={ 0:No | 1:Yes }

Apply circular dilation of the selected images by the specified size. Circle-coded behavior fr fr โญ•

Default values: boundary_conditions=1 and is_real=0.

Example:

[#1] image.jpg +closing_circ 7

๐Ÿง  convolve (+)

[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

Convolve the selected images by the specified mask โ€” the classic, the blueprint, the moment ๐Ÿ‘‘

boundary_conditions can be { 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }.

channel_mode can be { 0:All | 1:One-for-one | 2:Partial sum | 3:Full sum }.

Note: For each of the parameter groups center (xcenter, ycenter, zcenter), stride (xstride, ystride, zstride), dilation (xdilation, ydilation, zdilation), offset (xoffset, yoffset, zoffset) and size (xsize, ysize, zsize), 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 xoffset without also specifying yoffset and zoffset is invalid). Like, it's all of us or none of us, no partial commits ๐Ÿ™ˆ

Default values: boundary_conditions=1, is_normalized=0, channel_mode=1, xcenter=ycenter=zcenter=(undefined), xstride=ystride=zstride=1, xdilation=ydilation=zdilation=1, xoffset=yoffset=zoffset=0 and xsize=ysize=zsize=ceil(input_size/stride).

Example:

[#1] image.jpg (0,1,0;1,-4,1;0,1,0) convolve[-2] [-1] keep[-2]
[#2] image.jpg (0,1,0) resize[-1] 130,1,1,1,3 +convolve[0] [1]

Tutorial: https://gmic.eu/oldtutorial/_convolve


๐ŸŒŒ convolve_fft

[mask],_boundary_conditions

Convolve the selected images with the specified mask, but in the fourier domain โ€” same energy, different dimension, iykyk ๐ŸŒ 

boundary_conditions can be { 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }.

Example:

[#1] image.jpg 100%,100% gaussian[-1] 20,1,45 +convolve_fft[0] [1]

๐Ÿ’ซ correlate (+)

[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

Correlate the selected images by the specified mask โ€” convolution's slightly different sibling, still iconic ๐Ÿซถ

boundary_conditions can be { 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }.

channel_mode can be { 0:All | 1:One-for-one | 2:Partial sum | 3:Full sum }.

Note, bestie: for each of the parameter groups center (xcenter,ycenter,zcenter), stride (xstride,ystride,zstride), dilation (xdilation,ydilation,zdilation), offset (xoffset,yoffset,zoffset) and size (xsize,ysize,zsize), 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 xoffset without also specifying yoffset and zoffset is invalid).

Default values: boundary_conditions=1, is_normalized=0, channel_mode=1, xcenter=ycenter=zcenter=-1, xstride=ystride=zstride=1, xdilation=ydilation=zdilation=1,xoffset=yoffset=zoffset=0 and xsize=ysize=zsize=ceil(input_size/stride).

Example:

[#1] image.jpg (0,1,0;1,-4,1;0,1,0) correlate[-2] [-1] keep[-2]
[#2] image.jpg +crop 40%,40%,60%,60% +correlate[0] [-1],0,1

cross_correlation ๐Ÿซถ

Signature:

[mask]

This computes cross-correlation of selected images with the specified mask. Matching energy, no cap.

Example:

[#1] image.jpg +shift -30,-20 +cross_correlation[0] [1]

curvature โœจ

This computes isophote curvatures on selected images. Very contour-core, honestly.

Example:

[#1] image.jpg blur 10 curvature

dct ๐Ÿฆ‹

Signature:

_{ x | y | z }...{ x | y | z } |
(no arg)

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. Heads up, bestie.

Default values: (no arg).

See also: idct.

Example:

[#1] image.jpg +dct +idct[-1] abs[-2] +[-2] 1 log[-2]

Tutorial: https://gmic.eu/oldtutorial/_dct-and-idct

deblur ๐Ÿ’…

Signature:

amplitude[%]>=0,_nb_iter>=0,_dt>=0,_regul>=0,_regul_type={ 0:Tikhonov | 1:Meancurv. | 2:TV }

Deblur image using a regularized Jansson-Van Cittert algorithm. Yes, that is the whole name, and yes it ate.

Default values: nb_iter=10, dt=20, regul=0.7 and regul_type=1.

Example:

[#1] image.jpg blur 3 +deblur 3,40,20,0.01

deblur_goldmeinel ๐ŸŒธ

Signature:

sigma>=0,_nb_iter>=0,_acceleration>=0,_kernel_type={ 0:Deriche | 1:Gaussian }.

Deblur selected images using Gold-Meinel algorithm.

Default values: nb_iter=8, acceleration=1 and kernel_type=1.

Example:

[#1] image.jpg +blur 1 +deblur_goldmeinel[-1] 1

deblur_richardsonlucy โญ

Signature:

sigma>=0, nb_iter>=0, _kernel_type={ 0:Deriche | 1:Gaussian }.

Deblur selected images using Richardson-Lucy algorithm.

Default values: nb_iter=50 and kernel_type=1.

Example:

[#1] image.jpg +blur 1 +deblur_richardsonlucy[-1] 1

deconvolve_fft ๐ŸŽ€

Signature:

[kernel],_regularization>=0

Deconvolve selected images by specified mask in the fourier space.

Default value: regularization>=0.

Example:

[#1] image.jpg +gaussian 5 +convolve_fft[0] [1] +deconvolve_fft[-1] [1]

deinterlace ๐ŸŒˆ

Signature:

_method

Deinterlace selected images (method can be { 0:Standard | 1:Motion-compensated }).

Default value: method=0.

Example:

[#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

denoise (+) ๐Ÿ’–

Signature:

[guide],std_deviation_s[%]>=0,std_deviation_r[%]>=0,_patch_size>0,_lookup_size>0,_smoothness,_fast_approx={ 0:No | 1:Yes } |
std_deviation_s[%]>=0,std_deviation_r[%]>=0,_patch_size>0,_lookup_size>0,_smoothness,_fast_approx={ 0:No | 1:Yes }

Denoise selected images by non-local patch averaging. The guide variant is right there if you need it, iykyk.

Default values: patch_size=5, lookup_size=6 and smoothness=1.

Example:

[#1] image.jpg noise 20 cut 0,255 +denoise 8,8,7

denoise_haar ๐Ÿงš

Signature:

_threshold>=0,_nb_scales>=0,_cycle_spinning>0

Denoise selected images using haar-wavelet thresholding with cycle spinning. Set nb_scales==0 to automatically determine the optimal number of scales.

Default values: threshold=1.4, nb_scale=0 and cycle_spinning=10.

Example:

[#1] image.jpg noise 20 cut 0,255 +denoise_haar[-1] 0.8

denoise_cnn ๐Ÿ”ฅ

Signature:

_noise_level>=0,_patch_size>0

Denoise selected images using a convolutional neural network (CNN). Input value range should be [0,255]. Output value range is [0,255]. If std_noise==0, the noise level is automatically estimated for each selected image.

Default value: noise_level=0 (auto) and patch_size=64.

Example:

[#1] image.jpg noise 20 cut 0,255 +denoise_cnn 0

denoise_patchpca ๐Ÿฆ‹

Signature:

_strength>=0,_patch_size>0,_lookup_size>0,_spatial_sampling>0

Denoise selected images using the patch-pca algorithm.

Default values: patch_size=7, lookup_size=11, details=1.8 and spatial_sampling=5.

Example:

[#1] image.jpg +noise 20 cut[-1] 0,255 +denoise_patchpca[-1] ,

deriche (+) ๐Ÿ’œ

Signature:

std_deviation[%]>=0,order={ 0 | 1 | 2 },axis={ x | y | z | c },_boundary_conditions

Apply Deriche recursive filter on selected images, along specified axis and with specified standard deviation, order and boundary conditions. boundary_conditions can be { 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }.

Default value: boundary_conditions=1.

Example:

[#1] image.jpg deriche 3,1,x
[#2] image.jpg +deriche 30,0,x deriche[-2] 30,0,y add

Tutorial: https://gmic.eu/oldtutorial/_deriche

dilate (+) ๐Ÿซถ

Signature:

size[%]>=0 |
size_x[%]>=0,size_y[%]>=0,size_z[%]>=0 |
[kernel],_boundary_conditions,_is_real={ 0:Binary-mode | 1:Real-mode }

Dilate selected images by a rectangular or the specified structuring element. boundary_conditions can be { 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }.

Default values: size_z=1, boundary_conditions=1 and is_real=0.

Example:

[#1] image.jpg +dilate 10

dilate_circ ๐ŸŽ€

Signature:

_size[%]>=0,_boundary_conditions,_is_real={ 0:No | 1:Yes }

Apply circular dilation of selected images by specified size. boundary_conditions can be { 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }.

Default values: boundary_conditions=1 and is_real=0.

Example:

[#1] image.jpg +dilate_circ 7

dilate_oct ๐ŸŒธ

Signature:

_size[%]>=0,_boundary_conditions,_is_real={ 0:No | 1:Yes }

Apply octagonal dilation of selected images by specified size.

Default values: boundary_conditions=1 and is_real=0.

Example:

[#1] image.jpg +dilate_oct 7

dilate_threshold โญ

Signature:

size_x>=1,size_y>=1,size_z>=1,_threshold>=0,_boundary_conditions

Dilate selected images in the (X,Y,Z,I) space. boundary_conditions can be { 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }.

Default values: size_y=size_x, size_z=1, threshold=255 and boundary_conditions=1.

divergence ๐ŸŒˆ

Compute divergence of selected vector fields.

Example:

[#1] image.jpg luminance +gradient append[-2,-1] c divergence[-1]

dog ๐Ÿถ

Signature:

_sigma1[%]>=0,_sigma2[%]>=0

Compute difference of gaussian on selected images.

Default values: sigma1=2% and sigma2=3%.

Example:

[#1] image.jpg dog 2,3

diffusiontensors ๐Ÿงš

Signature:

_sharpness>=0,0<=_anisotropy<=1,_alpha[%],_sigma[%],is_sqrt={ 0:No | 1:Yes }

Compute the diffusion tensors of selected images for edge-preserving smoothing algorithms.

Default values: sharpness=0.7, anisotropy=0.3, alpha=0.6, sigma=1.1 and is_sqrt=0.

Example:

[#1] image.jpg diffusiontensors 0.8 abs pow 0.2

Tutorial: https://gmic.eu/oldtutorial/_diffusiontensors

erode (+) ๐Ÿ’…

Signature:

size[%]>=0 |
size_x[%]>=0,size_y[%]>=0,_size_z[%]>=0 |
[kernel],_boundary_conditions,_is_real={ 0:Binary-mode | 1:Real-mode }

Erode selected images by a rectangular or the specified structuring element. boundary_conditions can be { 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }.

Default values: size_z=1, boundary_conditions=1 and is_real=0.

Example:

[#1] image.jpg +erode 10

erode_circ ๐Ÿฆ‹

Signature:

_size[%]>=0,_boundary_conditions,_is_real={ 0:No | 1:Yes }

Apply circular erosion of selected images by specified size. boundary_conditions can be { 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }.

Default values: boundary_conditions=1 and is_real=0.

Example:

[#1] image.jpg +erode_circ 7

erode_oct ๐ŸŒธ

Signature:

_size[%]>=0,_boundary_conditions,_is_real={ 0:No | 1:Yes }

Apply octagonal erosion of selected images by specified size.

Default values: boundary_conditions=1 and is_real=0.

Example:

[#1] image.jpg +erode_oct 7

erode_threshold โญ

Signature:

size_x>=1,size_y>=1,size_z>=1,_threshold>=0,_boundary_conditions

Erode selected images in the (X,Y,Z,I) space. boundary_conditions can be { 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }.

Default values: size_y=size_x, size_z=1, threshold=255 and boundary_conditions=1.

fft (+) ๐Ÿ”ฅ

Signature:

_{ x | y | z }...{ x | y | z }

Compute the direct fourier transform (real and imaginary parts) of selected images, optionally along the specified axes only.

See also: ifft.

Example:

[#1] image.jpg luminance +fft append[-2,-1] c norm[-1] log[-1] shift[-1] 50%,50%,0,0,2
[#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]

Tutorial: https://gmic.eu/oldtutorial/_fft

g (+) ๐Ÿซถ

Shortcut for command gradient.

gradient ๐Ÿ’œ

Signature:

{ x | y | z | c }...{ x | y | z | c },_scheme,_boundary_conditions |
(no arg)

Compute the gradient components (first derivatives) of selected images, along specified axes. (equivalent to shortcut command g).

scheme can be:

{ -1:Backward | 0:Centered | 1:Forward | 2:Sobel | 3:Rotation-invariant (default) | 4:Deriche | 5:Vanvliet | 6:FB-Maxabs }

boundary_conditions can be { 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }.

(no arg) compute all significant components.

Default values: scheme=0 and boundary_conditions=1.

Example:

[#1] image.jpg gradient

Tutorial: https://gmic.eu/oldtutorial/_gradient

gradient_norm ๐Ÿฆ‹

Signature:

_scheme,_boundary_conditions |
(no arg)

so like, this one computes the gradient norm of whatever images you've got selected โœจ and you get to pick your fave flavour with scheme:

  • -1 โ†’ Backward
  • 0 โ†’ Centered
  • 1 โ†’ Forward
  • 2 โ†’ Sobel
  • 3 โ†’ Rotation-invariant (this one's the default, bestie ๐Ÿ‘‘)
  • 4 โ†’ Deriche
  • 5 โ†’ Vanvliet
  • 6 โ†’ FB-Maxabs

And boundary_conditions is giving four options only:

  • 0 โ†’ Dirichlet
  • 1 โ†’ Neumann
  • 2 โ†’ Periodic
  • 3 โ†’ Mirror

Default values, literally as written: scheme=0 and boundary_conditions=1. ๐Ÿ‘€ (yes the list above says 3 is the default and this line says 0 โ€” that's exactly what the page says, i'm just the messenger ๐Ÿ’€)

Example, copy it exactly:

[#1] image.jpg gradient_norm equalize

Tutorial if u wanna go deeper: https://gmic.eu/oldtutorial/_gradient_norm


๐ŸŒˆ gradient_orientation

_dimension={ 1 | 2 | 3 }

Computes the N-d gradient orientation of the selected images.

Default value: dimension=3.

Example:

[#1] image.jpg +gradient_orientation 2

๐Ÿฆ‹ guided (+)

[guide],radius[%]>=0,regularization[%]>=0 |
radius[%]>=0,regularization[%]>=0

Blurs your selected images using guided image filtering ๐Ÿ’… If you hand it a guide image, that guide drives the whole smoothing situation. Heads up tho: a guide image must be the same xyz-size as the selected images, no cap.

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

Example:

[#1] image.jpg +guided 5,400

๐ŸŽ€ haar

scale>0

Computes the direct haar multiscale wavelet transform of the selected images ๐ŸŒ€

See also: ihaar.

Tutorial: https://gmic.eu/oldtutorial/_haar


๐Ÿ”ฅ heat_flow

_nb_iter>=0,_dt,_keep_sequence={ 0:No | 1:Yes }

Applies iterations of the heat flow on the selected images.

Default values: nb_iter=10, dt=30 and keep_sequence=0.

Example:

[#1] image.jpg +heat_flow 20

๐Ÿ’œ hessian

{ xx | xy | xz | yy | yz | zz }...{ xx | xy | xz | yy | yz | zz },_boundary_conditions |
(no arg)

Computes the hessian components (aka second derivatives, the little overachievers) of the selected images along whichever axes you specify.

boundary_conditions can be { 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }.

(no arg) computes all significant components โ€” the whole set, no picking favourites.

Default value: boundary_conditions=1.

Example:

[#1] image.jpg hessian

๐ŸŒธ idct

_{ x | y | z }...{ x | y | z } |
(no arg)

Computes the inverse discrete cosine transform of the selected images, optionally along the specified axes only โœจ

Output images are always evenly sized, so this command may actually change the size of your selected images โ€” not a bug, just how she works.

(dct images obtained with the dct command are evenly sized anyway, so like, no drama there.)

Default values: (no arg)

See also: dct.

Tutorial: https://gmic.eu/oldtutorial/_dct-and-idct


โญ iee

No args, she just goes ๐Ÿ’ซ

Computes the gradient-orthogonal-directed 2nd derivative of the image(s).

Example:

[#1] image.jpg iee

๐Ÿงš ifft (+)

_{ x | y | z }...{ x | y | z }

Computes the inverse fourier transform (real and imaginary parts) of the selected images, optionally along the specified axes only.

See also: fft.

Tutorial: https://gmic.eu/oldtutorial/_fft


๐Ÿ“ ihaar

scale>0

Computes the inverse haar multiscale wavelet transform of the selected images โ€” the un-haar-ing, if u will ๐Ÿ™ˆ

See also: haar.

Tutorial: https://gmic.eu/oldtutorial/_haar


๐Ÿ‘‘ ilaplacian

{ nb_iterations>0 | 0 },_[initial_estimate]

Inverts the selected Laplacian images.

If nb_iterations is 0, the inversion happens in Fourier space (single iteration). Otherwise it happens by applying nb_iterations of a Laplacian-inversion PDE flow.

Real talk bestie: the resulting inversions are just estimations of possible/approximated solutions. So like, she's doing her best, not performing miracles ๐Ÿ˜ญ

Default values: nb_iterations=0, axes=(undefined) and [initial_estimated]=(undefined).

Example:

[#1] image.jpg +laplacian +ilaplacian[-1] 0

๐ŸŒˆ inn

No args needed ๐Ÿ’–

Computes the gradient-directed 2nd derivative of the image(s).

Example:

[#1] image.jpg inn

๐Ÿซถ inpaint (+)

[mask] |
[mask],0,_fast_method |
[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 }

Inpaints the selected images using the specified mask โœจ

If no patch size is given (or it's 0), the inpainting runs with a fast average or median algorithm โ€” quick lil glow-up. Otherwise it uses a patch-based reconstruction method, which can be very time consuming. like, go make a snack, it's gonna be a minute ๐Ÿ˜ญ

fast_method can be { 0:Low-connectivity average | 1:High-connectivity average | 2:Low-connectivity median | 3:High-connectivity median }.

Default values: patch_size=0, fast_method=1, lookup_size=22, lookup_factor=0.5, lookup_increment=1, blend_size=0, blend_threshold=0, blend_decay=0.05, blend_scales=10 and is_blend_outer=1.

Example:

[#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]
[#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]

๐Ÿ’ซ inpaint_pde

[mask],_nb_scales[%],_diffusion_type={ 0:Isotropic | 1:Delaunay-guided | 2:Edge-guided | 3:Mask-guided },_diffusion_iter>=0

Inpaints the selected images using the specified mask, via a multiscale transport-diffusion algorithm ๐ŸŒ€

The nb_scales argument sets how many scales get used in the multiscale resolution scheme. The deets:

  • When the % qualifier is used for nb_scales, the number of used scales is relative to nb_scales_max = ceil(log2(max(w,h,d))).
  • When nb_scales<0, it determines the minimum image size encountered at the lowest scale.

If diffusion_type==3, non-zero values of the mask (e.g. a distance function) are used to guide the diffusion process ๐Ÿ‘€

Default values: nb_scales=-9, diffusion_type=1 and diffusion_iter=20.

Example:

[#1] image.jpg 100%,100% ellipse[-1] 30%,30%,40,30,0,1,255 +inpaint_pde[0] [1]

๐Ÿฆ‹ inpaint_flow

[mask],_nb_global_iter>=0,_nb_local_iter>=0,_dt>0,_alpha>=0,_sigma>=0

Applies an iteration of the inpainting flow on the selected images.

Default values: nb_global_iter=10, nb_local_iter=100, dt=5, alpha=1 and sigma=3.

Example:

[#1] image.jpg 100%,100% ellipse[-1] 30%,30%,40,30,0,1,255 inpaint_flow[0] [1]

๐ŸŽ€ inpaint_holes

maximal_area[%]>=0,_tolerance>=0,_is_high_connectivity={ 0:No | 1:Yes }

Inpaints all connected regions whose area is less than the specified value โ€” little holes, begone ๐Ÿ’…

Default values: maximal_area=4, tolerance=0 and is_high_connectivity=0.

Example:

[#1] image.jpg noise 5%,2 +inpaint_holes 8,40

๐ŸŒธ inpaint_morpho

[mask]

Inpaints the selected images using the specified mask, with morphological operators โœจ

Example:

[#1] image.jpg 100%,100% ellipse[-1] 30%,30%,40,30,0,1,255 +inpaint_morpho[0] [1]

๐Ÿ”ฅ inpaint_matchpatch

[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 }

Inpaints the selected images using the specified binary mask, with a multiscale matchpatch algorithm ๐Ÿงฉ

Default values: nb_scales=0, patch_size=9, nb_iterations_per_scale=10, blend_size=5, allow_outer_blending=1 and is_already_initialized=0.

Example:

[#1] image.jpg 100%,100% ellipse[-1] 30%,30%,40,30,0,1,255 +inpaint_matchpatch[0] [1]

โญ kuwahara

size>0

Applies the Kuwahara filter of the specified size on the selected images โ€” the classic painterly vibe check ๐ŸŽจ

Example:

[#1] image.jpg kuwahara 9

๐Ÿ’œ laplacian

No args, just vibes โœจ

Computes the Laplacian of the selected images.

Example:

[#1] image.jpg laplacian

๐ŸŒˆ lic

_amplitude>0,_channels>0

Renders the LIC representation of the selected vector fields ๐ŸŒช๏ธ

Default values: amplitude=30 and channels=1.

Example:

[#1] 400,400,1,2,'[x,y]-[w,h]/2' +lic 200,3 quiver[-2] [-2],10,1,1,1,255

๐Ÿ“ map_tones

_threshold>=0,_gamma>=0,_smoothness>=0,nb_iter>=0

Applies a tone mapping operator on the selected images, based on the Poisson equation ๐Ÿ”†

Default values: threshold=0.1, gamma=0.8, smoothness=0.5 and nb_iter=30.

Example:

[#1] image.jpg +map_tones ,

๐Ÿงš map_tones_fast

_radius[%]>=0,_power>=0

Applies a fast tone mapping operator on the selected images โ€” same vibe, less waiting โšก

Default values: radius=3% and power=0.3.

Example:

[#1] image.jpg +map_tones_fast ,

๐Ÿซถ meancurvature_flow

_nb_iter>=0,_dt,_keep_sequence={ 0:No | 1:Yes }

Applies iterations of the mean curvature flow on the selected images.

Default values: nb_iter=10, dt=30 and keep_sequence=0.

Example:

[#1] image.jpg +meancurvature_flow 20

๐Ÿ’ซ median (+)

size>=0,_threshold>0

Applies an (optionally thresholded) median filter on the selected images, with a structuring element of size size x size ๐ŸŽ€

Example:

[#1] image.jpg +median 5

๐Ÿ‘‘ merge_alpha

No args ๐Ÿ’–

Merges the selected alpha detail scales into a single image. Those alpha detail scales? You got them with the command split_alpha.


๐Ÿฆ‹ nlmeans

[guide],_patch_radius>0,_spatial_bandwidth>0,_tonal_bandwidth>0,_patch_measure_command |
_patch_radius>0,_spatial_bandwidth>0,_tonal_bandwidth>0,_patch_measure_command

Applies non-local-means denoising by Buades et al. (2005) on the selected images โœจ

Here's the anatomy, bestie:

  • The patch is a gaussian function of std_patch_radius.
  • The spatial kernel is a rectangle of radius spatial_bandwidth.
  • The tonal kernel is exponential (exp(-d^2/_tonal_bandwidth^2)) with d the euclidean distance between image patches.

Default values: patch_radius=4, spatial_bandwidth=4, tonal_bandwidth=10 and patch_measure_command=-norm.

Example:

[#1] image.jpg +noise 10 nlmeans[-1] 4,4,{0.6*${-std_noise}}

๐ŸŒธ nlmeans_core

_reference_image,_scaling_map,_patch_radius>0,_spatial_bandwidth>0

Applies non-local-means denoising using an image for weighting and a map for scaling ๐Ÿ’…


โญ normalize_local

_amplitude>=0,_radius>0,_n_smooth[%]>=0,_a_smooth[%]>=0,_is_cut={ 0:No | 1:Yes },_min=0,_max=255

Normalizes the selected images locally ๐ŸŒˆ

Default values: amplitude=3, radius=16, n_smooth=4%, a_smooth=2%, is_cut=1, min=0 and max=255.

Example:

[#1] image.jpg normalize_local 8,10

๐ŸŽ€ normalized_cross_correlation

[mask]

Computes the normalized cross-correlation of the selected images with the specified mask ๐Ÿซถ

Example:

[#1] image.jpg +shift -30,-20 +normalized_cross_correlation[0] [1]

opening:

size>=0 |
size_x>=0,size_y>=0,_size_z>=0 |
[kernel],_boundary_conditions,_is_real={ 0:Binary-mode | 1:Real-mode }

Apply morphological opening to selected images, bestie. boundary_conditions can be { 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }.

Default values: size_z=1, boundary_conditions=1 and is_real=0.

Example:

[#1] image.jpg +opening 10

opening_circ:

_size>=0,_is_real={ 0:No | 1:Yes }

Apply circular opening of selected images by specified size. Slay.

Default values: boundary_conditions=1 and is_real=0.

Example:

[#1] image.jpg +opening_circ 7

percentile:

[mask],0<=_min_percentile[%]<=100,0<=_max_percentile[%]<=100.

Apply the percentile averaging filter to selected images. Literally so useful.

Default values: min_percentile=0 and max_percentile=100.

Example:

[#1] image.jpg shape_circle 11,11 +percentile[0] [1],25,75

peronamalik_flow:

K_factor>0,_nb_iter>=0,_dt,_keep_sequence={ 0:No | 1:Yes }

Apply iterations of the Perona-Malik flow on selected images.

Default values: K_factor=20, nb_iter=5, dt=5 and keep_sequence=0.

Example:

[#1] image.jpg +heat_flow 20

phase_correlation:

[destination]

Estimate translation vector between selected source images and specified destination. Iconic.

Example:

[#1] image.jpg +shift -30,-20 +phase_correlation[0] [1] unroll[-1] y

pde_flow:

_nb_iter>=0,_dt,_velocity_command,_keep_sequence={ 0:No | 1:Yes }

Apply iterations of a generic PDE flow on selected images.

Default values: nb_iter=10, dt=30, velocity_command=laplacian and keep_sequence=0.

Example:

[#1] image.jpg +pde_flow 20

periodize_poisson:

Periodize selected images using a Poisson solver in Fourier space. Main character energy fr fr.

Example:

[#1] image.jpg +periodize_poisson array 2,2,2

rbf:

dx,_x0,_x1,_phi(r),_is_affine_term={ 0:No | 1:Yes } |
dx,dy,_x0,_y0,_x1,_y1,_phi(r),_is_affine_term |
dx,dy,dz,x0,y0,z0,x1,y1,z1,phi(r)_is_affine_term

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 x_k, y_k and z_k are the spatial coordinates of keypoint k.

Values f1(),..,fN() are the N components of the vector value of keypoint k.

The command reconstructs an image with specified size dxxdyxdz, with N channels.

If affine_term==1, the reconstruction function includes an affine term.

Default values: x0=y0=z0=0, x1=dx-1, y1=dy-1, z1=dz-1, phi(r)=r*log(1+r) and affine_term=0.

Example:

[#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
[#2] 32,1,1,5,u([400,400,255,255,255]) rbf 400,400 c 0,255

red_eye:

0<=_threshold<=100,_smoothness>=0,0<=attenuation<=1

Attenuate red-eye effect in selected images. Obsessed with this one ngl.

Default values: threshold=75, smoothness=3.5 and attenuation=0.1.

Example:

[#1] image.jpg +red_eye ,

remove_hotpixels:

_mask_size>0, _threshold[%]>0

Remove hot pixels in selected images.

Default values: mask_size=3 and threshold=10%.

Example:

[#1] image.jpg noise 10,2 +remove_hotpixels ,

remove_pixels:

number_of_pixels[%]>=0

Remove specified number of pixels (i.e. set them to 0) from the set of non-zero pixels in selected images. Periodt.

Example:

[#1] image.jpg +remove_pixels 50%

rolling_guidance:

std_deviation_s[%]>=0,std_deviation_r[%]>=0,_precision>=0

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.

Default values: std_deviation_s=4, std_deviation_r=10 and precision=0.5.

Example:

[#1] image.jpg +rolling_guidance , +-

sharpen:

amplitude>=0 |
amplitude>=0,edge>=0,_alpha[%],_sigma[%]

Sharpen selected images by inverse diffusion or shock filters methods. edge must be specified to enable shock-filter method.

Default values: edge=0, alpha=0 and sigma=0.

Examples:

[#1] image.jpg sharpen 300
[#2] image.jpg blur 5 sharpen 300,1

sharpen_alpha:

_amplitude[%]>=0,_nb_scales>0,0<=_anisotropy<=1,0<=_minimize_alpha<=1

Sharpen selected images using a multi-scale and alpha boosting algorithm. Cute little multi-scale moment.

Default values: amplitude=1, nb_scales=5, anisotropy=0 and minimize_alpha=1.

smooth (+)

amplitude[%]>=0,_sharpness>=0,0<=_anisotropy<=1,_alpha[%],_sigma[%],_dl>0,_da>0,_precision>0,_interpolation,_fast_approx={ 0:No | 1:Yes } |
nb_iterations>=0,_sharpness>=0,_anisotropy,_alpha,_sigma,_dt>0,0 |
[tensor_field],_amplitude>=0,_dl>0,_da>0,_precision>0,_interpolation,_fast_approx={ 0:No | 1:Yes } |
[tensor_field],_nb_iters>=0,_dt>0,0

Smooth selected images anisotropically using diffusion PDE's, with specified field of diffusion tensors. interpolation can be { 0:Nearest | 1:Linear | 2:Runge-kutta }.

Default values: sharpness=0.7, anisotropy=0.3, alpha=0.6, sigma=1.1, dl=0.8, da=30, precision=2, interpolation=0 and fast_approx=1.

Examples:

[#1] image.jpg repeat 3 smooth 40,0,1,1,2 done
[#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

Tutorial: https://gmic.eu/oldtutorial/_smooth

split_freq:

smoothness[%]>0

Split selected images into low and high frequency parts. The way this divides things is giving split energy ๐Ÿ’…

Example:

[#1] image.jpg split_freq 2%

solve_poisson:

"laplacian_command",_nb_iterations>=0,_time_step>0,_nb_scales>=0

Solve Poisson equation so that applying laplacian[n] is close to the result of laplacian_command[n]. Solving is performed using a multi-scale gradient descent algorithm. If nb_scales=0, the number of scales is automatically determined.

Default values: nb_iterations=60, dt=5 and nb_scales=0.

Example:

[#1] image.jpg command "foo : gradient x" +solve_poisson foo +foo[0] +laplacian[1]

split_alpha:

_nb_scales[%]={ 0:Auto | -S<0 | N>0 },_subsample={ 0:No | 1:Yes },0<=_anisotropy<=1,0<=_minimize_alpha<=1

Split selected images into alpha detail scales. If nb_scales==-S, the lowest scale has a size of at least SxS. Parameter anisotropy is only considered when subsample=0. Image reconstruction is done with command merge_alpha.

Default values: nb_scales=0, subsample=0, anisotropy=0 and minimize_alpha=1.

split_details:

_nb_scales[%]={ 0:Auto | -S<0 | N>0 },_base_scale[%]>=0,_detail_scale[%]>=0

Split selected images into nb_scales detail scales. If base_scale = detail_scale = 0, the image decomposition is done with a trous wavelets. Otherwise, it uses laplacian pyramids with linear standard deviations.

Default values: nb_scales=0, base_scale=0 and detail_scale=0.

Example:

[#1] image.jpg split_details ,

structuretensors:

_scheme={ 0:Centered | 1:Forward/backward }

Compute the structure tensor field of selected images. So math-core ๐Ÿ”ฅ

Default value: scheme=0.

Example:

[#1] image.jpg structuretensors abs pow 0.2

Tutorial: https://gmic.eu/oldtutorial/_structuretensors

solidify:

_nb_diffusion_iterations>=0,_opacity_threshold[%]

Solidify selected transparent images, using a multi-scale propagation/diffusion algorithm. Last image channel of each selected image is assumed to represent the opacity mask. Each output image has one channel less than each input image.

Default values: nb_diffusion_iterations=10 and opacity_threshold=50%.

Example:

image.jpg 100%,100% circle[-1] 50%,50%,25%,1,255 append c +solidify
, display_rgba

syntexturize:

_width[%]>0,_height[%]>0

Resynthesize widthxheight versions of selected micro-textures by phase randomization. The texture synthesis algorithm is a straightforward implementation of the method described in : http://www.ipol.im/pub/art/2011/ggm_rpn/.

Default values: width=height=100%.

Example:

[#1] image.jpg crop 2,282,50,328 +syntexturize 320,320

syntexturize_matchpatch:

_width[%]>0,_height[%]>0,_nb_scales>=0,_patch_size>0,_blending_size>=0,_precision>=0

Resynthesize widthxheight versions of selected micro-textures using a patch-matching algorithm. If nbscales==0, the number of scales used is estimated from the image size.

Default values: width=height=100%, nb_scales=0, patch_size=7, blending_size=5 and precision=1.

Example:

[#1] image.jpg crop 25%,25%,75%,75% syntexturize_matchpatch 512,512

tv_flow:

_nb_iter>=0,_dt,_keep_sequence={ 0:No | 1:Yes }

Apply iterations of the total variation flow on selected images. Lowkey mesmerizing.

Default values: nb_iter=10, dt=30 and keep_sequence=0.

Example:

[#1] image.jpg +tv_flow 40

unsharp:

radius[%]>=0,_amount>=0,_threshold[%]>=0

Apply an unsharp mask on selected images. Classic glow-up behavior.

Default values: amount=2 and threshold=0.

Example:

[#1] image.jpg blur 3 +unsharp 1.5,15 cut 0,255

unsharp_octave:

_nb_scales>0,_radius[%]>=0,_amount>=0,threshold[%]>=0

Apply octave sharpening on selected images.

Default values: nb_scales=4, radius=1, amount=2 and threshold=0.

Example:

[#1] image.jpg blur 3 +unsharp_octave 4,5,15 cut 0,255

vanvliet (+)

std_deviation[%]>=0,order={ 0 | 1 | 2 | 3 },axis={ x | y | z | c },_boundary_conditions

so like, vanvliet will apply the Vanvliet recursive filter on the selected images ๐Ÿ’ซ along whichever axis you specify, with the standard deviation, order, and boundary conditions you give it. 'boundary_conditions' can be { 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }.

Default value: 'boundary_conditions=1'.

Example:

[#1] image.jpg +vanvliet 3,1,x
[#2] image.jpg +vanvliet 30,0,x vanvliet[-2] 30,0,y add

voronoi

Compute the discrete Voronoi diagram of non-zero pixels in selected images โœจ

Example:

[#1] 400,400,1,3 eval "repeat(50,I(v([w,w]-1)) = v([255,255,255]))" +voronoi +gradient_norm. eq. 0 *[-2,-1]

watermark_fourier

text,_size>0

Add a textual watermark in the frequency domain of selected images ๐ŸŽ€

Default value: 'size=33'.

Example:

[#1] image.jpg +watermark_fourier "Watermarked!" +display_fft remove[-3,-1] normalize 0,255 append[-4,-2] y append[-2,-1] y

watershed (+)

[priority_image],_is_high_connectivity={ 0:No | 1:Yes }

Compute the watershed transform of selected images ๐Ÿ’ง

Default value: 'is_high_connectivity=1'.

Example:

[#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

11.9. Features Extraction ๐ŸŒธ

area

tolerance>=0,is_high_connectivity={ 0:No | 1:Yes }

Compute area of connected components in selected images ๐Ÿซถ

Default values: 'is_high_connectivity=0'.

Example:

[#1] image.jpg luminance stencil[-1] 1 +area 0

Tutorial: https://gmic.eu/oldtutorial/_area

area_fg

tolerance>=0,is_high_connectivity={ 0:No | 1:Yes }

Compute area of connected components for non-zero values in selected images. Similar to 'area' except that 0-valued pixels are not considered ๐Ÿ‘‘ Default values: 'is_high_connectivity=0'.

Example:

[#1] image.jpg luminance stencil[-1] 1 +area_fg 0

at_curve

x0[%],y0[%],z0[%],...,xN[%],yn[%],zn[%]

Retrieve pixels of the selected images belonging to the specified cubic spline curve that passes across the specified points ๐Ÿฆ‹

Example:

[#1] image.jpg +at_curve 0,0,0,80%,50%,0,100%,100%,0

at_quadrangle

x0[%],y0[%],x1[%],y1[%],x2[%],y2[%],x3[%],y3[%],_interpolation,_boundary_conditions |
x0[%],y0[%],z0[%],x1[%],y1[%],z1[%],x2[%],y2[%],z2[%],x3[%],y3[%],z3[%],_interpolation,_boundary_conditions

Retrieve pixels of the selected images belonging to the specified 2D or 3D quadrangle โœจ 'interpolation' can be { 0:Nearest-neighbor | 1:Linear | 2:Cubic }. 'boundary_conditions' can be { 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }.

Example:

[#1] image.jpg params=5%,5%,95%,5%,60%,95%,40%,95% +at_quadrangle $params polygon.. 4,$params,0.5,255

barycenter

Compute the barycenter vector of pixel values ๐Ÿ’…

Example:

[#1] 256,256 ellipse 50%,50%,20%,20%,0,1,1 deform 20 +barycenter +ellipse[-2] {@0,1},5,5,0,10

betti

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 'https://en.wikipedia.org/wiki/Betti_number' for details about Betti numbers).

canny

_sigma[%]>=0,_low_threshold>=0,_high_threshold>=0

Locate image edges using Canny edge detector ๐Ÿ”ฅ

Default values: 'sigma=1', 'low_threshold=0.05', 'high_threshold=0.15'.

Example:

[#1] image.jpg canny 1

delaunay

_output_type={ 0:Image | 1:Coordinates/triangles }

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 'ABC' where 'a','b','c' are the labels of the pixels 'A','B','C'.

Example:

[#1] 400,400 rand 32,255 100%,100% noise. 0.4,2 eq. 1 mul +delaunay
[#2] image.jpg 100%,100% noise. 2,2 eq. 1 delaunay. +blend shapeaverage0

detect_skin

0<=tolerance<=1,_skin_x,_skin_y,_skin_radius>=0

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 'skin_x', 'skin_y' and 'skin_radius' are provided, skin pixels are learnt from the sample pixels inside the circle located at ('skin_x','skin_y') with radius 'skin_radius'.

Default value: 'tolerance=0.5' and 'skin_x=skin_y=radius=-1'.

displacement (+)

[reference],_smoothness,_precision>=0,_nb_scales>=0,_iteration_max>=0,mode={ 0:Backward | 1:Forward },_[guide]

Estimate displacement field from specified reference image (source) to selected images (targets) ๐ŸŒˆ If 'smoothness>=0', regularization type is set to Tikhonov, else to TV (Total Variation). If 'nbscales==0', the number of scales used is estimated from the image size.

Default values: 'smoothness=0.1', 'precision=7', 'nb_scales=0', 'iteration_max=1000', 'mode=0', and '[guide]=(unused)'.

Example:

[#1] image.jpg +rotate 3,1,0,50%,50% +displacement[-1] [-2] quiver[-1] [-1],15,1,1,1,{1.5*iM}

distance (+)

isovalue[%],_metric |
isovalue[%],[metric],_method

Compute the unsigned distance function to specified isovalue, optionally according to a custom metric ๐Ÿ’ซ 'metric' can be { 0:Chebyshev | 1:Manhattan | 2:Euclidean | 3:Squared-euclidean }. 'method' can be { 0:Fast-marching | 1:Low-connectivity dijkstra | 2:High-connectivity dijkstra | 3:1+Return path | 4:2+Return path }.

Default value: 'metric=2' and 'method=0'.

Example:

[#1] image.jpg threshold 20% distance 0 pow 0.3
[#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

Tutorial: https://gmic.eu/oldtutorial/_distance

edgels

x0,y0,_n0,_is_high_connectivity={ 0:No | 1:Yes }

Extract one or several lists of edgels (and their normals) that defines a 2D binary silhouette ๐ŸŒธ When specified (i.e. '!=-1'), arguments 'x0,y0,n0' are the coordinates of the starting edgel, which must be located on an edge of the binary silhouette.

  • If 'x0,y0' and 'n0' are specified, only a single list of edgels is returned.
  • If only 'x0,y0' are specified (meaning 'n0=-1'), up to 4 lists of edgels can be returned, all starting from the same point (x0,y0).
  • If no arguments are specified (meaning 'x0=y0=n0=-1'), all possible lists of edgels are returned.

A list of edgels is returned as an image with 3 channels '[x,y,n]' where 'x' and 'y' are the 2D coordinates of the edgel pixel, and 'n' is the orientation of its associated canonical normal (which can be { 0:[1,0] | 1:[0,1] | 2:[-1,0] | 3:[0,-1] }.

Default values: 'x0=y0=n0=-1' and 'is_high_connectivity=1'.

edges

_threshold[%]>=0

Estimate contours of selected images โœจ

Default value: 'edges=15%'

Example:

[#1] image.jpg +edges 15%

fftpolar

Compute fourier transform of selected images, as centered magnitude/phase images ๐Ÿฆ‹

Example:

[#1] image.jpg fftpolar ellipse 50%,50%,10,10,0,1,0 ifftpolar

histogram (+)

nb_levels[%]>0,_min_value[%],_max_value[%]

Compute the histogram of selected images ๐Ÿ’œ If value range is set, the histogram is estimated only for pixels in the specified value range. Argument 'max_value' must be specified if 'min_value' is set.

Default values: 'min_value=0%' and 'max_value=100%'.

Example:

[#1] image.jpg +histogram 64 display_graph[-1] 400,300,3

histogram_masked

[mask],nb_levels[%]>0,_min_value[%],_max_value[%]

Compute the masked histogram of selected images ๐ŸŽ€

Default values: 'min_value=0%' and 'max_value=100%'.

histogram_nd

nb_levels[%]>0,_value0[%],_value1[%]

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.

Default values: 'value0=0%' and 'value1=100%'.

Example:

[#1] image.jpg channels 0,1 +histogram_nd 256

histogram_cumul

_nb_levels>0,_is_normalized={ 0:No | 1:Yes },_val0[%],_val1[%]

Compute cumulative histogram of selected images โญ

Default values: 'nb_levels=256', 'is_normalized=0', 'val0=0%' and 'val1=100%'.

Example:

[#1] image.jpg +histogram_cumul 256 histogram[0] 256 display_graph 400,300,3

histogram_pointwise

nb_levels[%]>0,_value0[%],_value1[%]

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.

Default values: 'value0=0%' and 'value1=100%'.

hough

_width>0,_height>0,gradient_norm_voting={ 0:No | 1:Yes }

Compute hough transform (theta,rho) of selected images ๐Ÿ”ฅ

Default values: 'width=512', 'height=width' and 'gradient_norm_voting=1'.

Example:

[#1] image.jpg +blur 1.5 hough[-1] 400,400 blur[-1] 0.5 add[-1] 1 log[-1]

huffman_tree

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 'N' vector-valued leafs/nodes of the tree, encoded as '[ value,parent,child0,child1 ]'. 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: compress_huffman, decompress_huffman.

ifftpolar

Compute inverse fourier transform of selected images, from centered magnitude/phase images ๐ŸŒธ

img2patches

patch_size>0,_overlap[%]>0,_boundary_conditions

Decompose selected 2D images into (possibly overlapping) patches and stack them along the z-axis ๐Ÿงฉ 'overlap' must be in range '[0,patch_size-1]'. 'boundary_conditions' can be { 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }.

Default values: 'overlap=0' and 'boundary_conditions=0'. See also: patches2img.

Example:

[#1] image.jpg img2patches 64

isophotes

_nb_levels>0

Render isophotes of selected images on a transparent background ๐Ÿ’…

...still on isophotes ๐ŸŒธ โ€” Default value: nb_levels=64.

Example:

[#1] image.jpg blur 2 isophotes 6 dilate_circ 5 display_rgba

  • label (+) โ€” signature: _tolerance>=0,is_high_connectivity={ 0:No | 1:Yes },_is_L2_norm={ 0:No | 1:Yes }

Labels the connected components in your selected images, bestie ๐Ÿซถ. If is_L2_norm=1, the tolerances get compared against the L2-norm โ€” otherwise it's L1-norm doing the work.

Default values: tolerance=0, is_high_connectivity=0 and is_L2_norm=1.

Examples:

[#1] image.jpg luminance threshold 60% label normalize 0,255 map 0
[#2] 400,400 set 1,50%,50% distance 1 mod 16 threshold 8 label mod 255 map 2

Tutorial: https://gmic.eu/oldtutorial/_label

  • label_fg โ€” signature: tolerance>=0,is_high_connectivity={ 0:No | 1:Yes },_is_L2_norm={ 0:No | 1:Yes }

Labels connected components for the non-zero values (aka the foreground โœจ) in your selected images. It's literally label's sibling, except the 0-valued pixels don't get labeled at all. If is_L2_norm=1, tolerances are compared against L2-norm, otherwise L1-norm gets the job.

Default value: is_high_connectivity=0 and is_L2_norm=1.

  • laar โ€” Pulls out the largest axis-aligned rectangle living inside the non-zero areas of your selected images ๐Ÿ‘‘. The rectangle coordinates come back in the status, as a sequence of numbers x0,y0,x1,y1. Slay.

Example:

[#1] shape_cupid 256 coords=${-laar} normalize 0,255 to_rgb rectangle $coords,0.5,0,128,0
  • max_patch โ€” signature: _patch_size>=1

Returns the locations of the maximal values in a local patch-based neighborhood of the given size, for your selected images ๐Ÿ”ฅ.

Default value: patch_size=16.

Example:

[#1] image.jpg norm +max_patch 16
  • min_patch โ€” signature: _patch_size>=1

Same energy as max_patch but flipped ๐Ÿซถ โ€” returns the locations of the minimal values in a local patch-based neighborhood of the given size for your selected images.

Default value: patch_size=16.

Example:

[#1] image.jpg norm +min_patch 16
  • minimal_path โ€” signature: x0[%]>=0,y0[%]>=0,z0[%]>=0,x1[%]>=0,y1[%]>=0,z1[%]>=0,_is_high_connectivity={ 0:No | 1:Yes }

Computes the minimal path between two points on your selected potential maps ๐ŸŒˆ.

Default value: is_high_connectivity=0.

Example:

[#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
  • mse โ€” signature: [reference]

Returns the MSE (Mean-Squared Error) between your selected images and the reference image you specify ๐Ÿ’…. Important: this command does not modify the images. It returns a value (or a whole list of values) in the status.

  • mse_matrix โ€” Computes the MSE (Mean-Squared Error) matrix between your selected images, no args needed, it's giving self-care ๐ŸŽ€.

Example:

[#1] image.jpg +noise 30 +noise[0] 35 +noise[0] 38 cut. 0,255 +mse_matrix
  • patches2img โ€” signature: width>0,height>0,_overlap[%]>0,_overlap_std[%]

Recomposes 2D images from their selected patch representations ๐Ÿงš. Heads up: overlap must be in range [0,patch_size-1], where patch_size is the width/height of the selected image. overlap_std is the standard deviation of the gaussian weights used for reconstructing those overlapping patches. And if you set overlap_std to -1, you get uniform weights instead of gaussian โ€” iconic little switch.

Default value: overlap=0 and overlap_std=-1. See also: img2patches.

Example:

[#1] image.jpg +img2patches 32,0,3 mirror[-1] xy patches2img[-1] {0,[w,h]}
  • patches โ€” signature: patch_width>0,patch_height>0,patch_depth>0,x0,y0,z0,_x1,_y1,_z1,...,_xN,_yN,_zN

Extracts N+1 patches from your selected images, each one centered at the locations you specify ๐ŸŒธ.

Example:

[#1] image.jpg +patches 64,64,1,153,124,0,184,240,0,217,126,0,275,38,0
  • pca โ€” signature: _output_mode,_target_dim[%]>0,_normalization_mode={ 0:None | 1:Center | 2:Center+scale }

Performs PCA (Principal Component Analysis) on your selected images, viewed as sets of vector-valued samples Xk ๐Ÿ”ฅ.

The bits of output_mode select which output data get returned on the image stack:

  • 1: Output image of vector-valued samples Yk = Mt*(Xk - avg)/std, which are the projections of the Xk in a vector sub-space of (lower) dimension target_dim. avg is the average vector of all the Xk (or the zero vector if normalization_mode==0). std is the standard deviation vector of all the Xk (or the all-ones vector if normalization_mode<2). Mt is the transpose of M, the matrix of the target_dim first eigenvectors (arranged by columns) of the covariance matrix of the Xk.
  • 2: Output vector avg: the average of the Xk.
  • 4: Output vector std: the standard deviations of the Xk.
  • 8: Output matrix M: the projection matrix (orthonormal).

Knowing avg, std and M makes it possible to (approximately) retro-project the Yk back into the initial vector space, by computing Xk = avg + std*M*Yk for each image pixel ๐Ÿ‘‘.

Default values: output_mode=15, target_dim=100% and normalization_mode=1.

Example:

[#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]
  • matchpatch (+) โ€” signature: [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]

Estimates a correspondence map between your selected images and the patch image you specify, 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 output_score=1, the third channel also gives the corresponding matching score for each patch too. And the spicy part: if patch_penalization is >=0, SSD gets penalized with patch occurrences; if patch_penalization is <0, SSD is inf-penalized when the distance between patches is less than -patch_penalization.

Default values: patch_height=patch_width, patch_depth=1, nb_iterations=5, nb_randoms=5, occurence_penalization=0, output_score=0 and guide=(undefined).

Example:

[#1] image.jpg sample colorful +matchpatch[0] [1],3 +warp[-2] [-1],0
  • matchpatch_alt โ€” signature: [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]

This is the matchpatch command implemented as an alternative custom command ๐Ÿ’… โ€” and yeah, it's slower, ngl.

Default values: patch_height=patch_width, patch_depth=1, nb_iterations=5, nb_randoms=5, occurrence_penalization=0, output_score=0 and guide=(undefined).

Example:

[#1] image.jpg sample colorful +matchpatch_alt[0] [1],3 +warp[-2] [-1],0
  • plot2value โ€” Retrieves values from your selected 2D graph plots ๐ŸŽ€. Magic trick energy, honestly.

Example:

[#1] 400,300,1,1,'y>300*abs(cos(x/10+2*u))' +plot2value +display_graph[-1] 400,300
  • pointcloud โ€” signature: _type = { -X:-X-opacity | 0:Binary | 1:Cumulative | 2:Label | 3:Retrieve coordinates },_width,_height>0,_depth>0

Renders a set of point coordinates as a point cloud in a 1D/2D or 3D binary image โ€” or does the reverse, retrieving the coordinates of the non-zero points from a rendered point cloud ๐Ÿ”ฅ.

Your input point coordinates can be a NxMx1x1, Nx1x1xM or 1xNx1xM image, where N is the number of points and M the point coordinates. If M>3, the 3-to-M components set the (M-3)-dimensional color at each point ๐ŸŒˆ.

The width, height and depth parameters are related to the size of the final image, like so:

  • 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 (width, height, depth) just don't get plotted ๐Ÿ™ˆ.

Default values: type=0 and max_width=max_height=max_depth=0.

Examples:

[#1] 3000,2 rand 0,400 +pointcloud 0 dilate[-1] 3
[#2] 3000,2 rand 0,400 {w} {w},3 rand[-1] 0,255 append y +pointcloud 0 dilate[-1] 3
  • psnr โ€” signature: [reference],_max_value>0

Returns the PSNR (Peak Signal-to-Noise Ratio) between your selected images and the reference image you specify โœจ. Just like mse, this does not modify the images โ€” it returns a value (or a list of values) in the status.

Default value: max_value=255.

  • psnr_matrix โ€” signature: _max_value>0

Computes the PSNR (Peak Signal-to-Noise Ratio) matrix between your selected images ๐Ÿ’œ.

Default value: max_value=255.

Example:

[#1] image.jpg +noise 30 +noise[0] 35 +noise[0] 38 cut. 0,255 +psnr_matrix
  • segment_watershed โ€” signature: _threshold>=0

Applies watershed segmentation to your selected images ๐ŸŒŠโœจ.

Default values: threshold=2.

Example:

[#1] image.jpg segment_watershed 2
  • shape2bump โ€” signature: _resolution>=0,0<=_weight_std_max_avg<=1,_dilation,_smoothness>=0

Estimates a bumpmap from the binary shape in your selected images ๐Ÿซถ.

Default value: resolution=256, weight_std_max=0.75, dilation=0 and smoothness=100.

  • skeleton โ€” signature: _boundary_conditions={ 0:Dirichlet | 1:Neumann }

Computes the skeleton of binary shapes using a distance transform and constrained thinning ๐Ÿฆดโœจ.

Default value: boundary_conditions=1.

Example:

[#1] shape_cupid 320 +skeleton 0
  • slic โ€” signature: size>0,_regularity>=0,_nb_iterations>0

Segments your selected 2D images into superpixels using the SLIC algorithm (Simple Linear Iterative Clustering) ๐ŸŒธ. You get scalar images of increasingly labeled pixels back. Reference paper: Achanta, R., Shaji, A., Smith, K., Lucchi, A., Fua, P., & Susstrunk, S. (2010). SLIC Superpixels (No. EPFL-REPORT-149300).

Default values: size=16, regularity=10 and nb_iterations=10.

Example:

[#1] image.jpg +srgb2lab slic[-1] 16 +blend shapeaverage f[-2] "j(1,0)==i && j(0,1)==i" *[-1] [-2]
  • ssd_patch โ€” signature: [patch],_use_fourier={ 0:No | 1:Yes },_boundary_conditions

Computes fields of SSD between your selected images and the patch you specify ๐Ÿ”ฅ. Note that the boundary_conditions argument is only valid when use_fourier=0. boundary_conditions can be { 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }.

Default value: use_fourier=0 and boundary_conditions=0.

Example:

[#1] image.jpg +crop 20%,20%,35%,35% +ssd_patch[0] [1],0,0
  • ssim โ€” signature: [reference],_patch_size>0,_max_value>0
  • ssim โ€” spot the difference, but like, mathematically โœจ โ€” compute the Structural Similarity Index Measure (SSIM) between your selected images and a reference image you pass in.

This command does not touch the images โ€” ngl it's a read-only queen ๐Ÿ‘‘. It just returns a value, or a whole list of values, in the status.

When downsampling_factor is given with a % on the end, its value equals 1+(patch_size-1)*spatial_factor%.

SSIM comes from this paper, and yes we're citing it properly because academia said so ๐ŸŽ“:

Wang, Zhou, et al., "Image quality assessment: from error visibility to structural similarity." in IEEE transactions on image processing 13.4 (2004): 600-612.

The implementation here is a direct translation of the reference code (in Matlab), which lives at:

https://ece.uwaterloo.ca/~z70wang/research/ssim/

Default values, bestie: patch_size=11, and max_value=255.

โœจ ssim_matrix โœจ

_patch_size>0,_max_value>0

Compute the SSIM (Structural Similarity Index Measure) matrix between the selected images. Yeah, the whole matrix. She's thorough ๐Ÿ’…

Default values: patch_size=11, and max_value=255.

Example โ€” because seeing it hits different:

[#1] image.jpg +noise 30 +noise[0] 35 +noise[0] 38 cut. 0,255 +ssim_matrix

๐Ÿฆ‹ thinning ๐Ÿฆ‹

_boundary_conditions={ 0:Dirichlet | 1:Neumann }

Compute the skeleton of binary shapes using morphological thinning. Heads up though โ€” beware, this is a quite slow iterative process ๐Ÿ˜ญ she takes her time, okay? Let her cook.

Default value: boundary_conditions=1.

Example:

[#1] shape_cupid 320 +thinning

๐ŸŒธ tones ๐ŸŒธ

N>0

Get N tones masks out of your selected images. Manifesting those gradients โœจ

Example:

[#1] image.jpg +tones 3

๐ŸŽ€ topographic_map ๐ŸŽ€

_nb_levels>0,_smoothness

Render selected images as topographic maps โ€” contour-line realness, it's giving geography class ๐Ÿ—บ๏ธ

Default values: nb_levels=16 and smoothness=2.

Example:

[#1] image.jpg topographic_map 10

๐Ÿงš tsp ๐Ÿงš

_precision>=0

Try to solve the 'travelling salesman' problem, using a combination of greedy search and 2-opt algorithms. He's been travelling for so long, someone free him ๐Ÿ˜ญ

Selected images must have dimensions Nx1x1xC to represent N cities, each with C-dimensional coordinates.

This command re-orders the selected data along the x-axis so that the point sequence becomes a shortest path. Iconic shortest-path behaviour, no cap.

Default values: precision=256.

Example:

[#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]

๐Ÿ’œ variance_patch ๐Ÿ’œ

_patch_size>=1

Compute the variance of each image's patch centered at (x,y), across the selected images. Little squares of statistical chaos, love that for us ๐Ÿซถ

Default value: patch_size=16

Example:

[#1] image.jpg +variance_patch

๐ŸŽจ 11.10. Image Drawing ๐ŸŽจ

Okay bestie, this is the artsy section โ€” grab a brush, we're drawing on images ๐Ÿ’…๐Ÿ–Œ๏ธ

โญ arrow โญ

x0[%],y0[%],x1[%],y1[%],_thickness[%]>=0,_head_length[%]>=0,_head_thickness[%]>=0,_opacity,_pattern,_color1,...

Draw the specified arrow on the selected images. Point at the thing! ๐Ÿ‘‰โœจ

pattern is an hexadecimal number starting with 0x, and you can literally omit the 0x โ€” even if a color is specified. If a pattern is specified, the arrow gets drawn outlined instead of filled.

Default values: thickness=1%, head_length=10%, head_thickness=3%, opacity=1, pattern=(undefined) and color1=0.

Example โ€” 100 random arrows, absolute chaos, ate:

[#1] 400,400,1,3 repeat 100 arrow 50%,50%,{u(100)}%,{u(100)}%,3,20,10,0.3,${-rgb} done

๐ŸŒˆ axes ๐ŸŒˆ

x0,x1,y0,y1,_font_height>=0,_opacity,_pattern,_color1,...

Draw xy-axes on the selected images. Coordinate-system main character energy ๐Ÿ“

pattern is an hexadecimal number starting with 0x which can be omitted even if a color is specified.

Wanna draw only one x-axis at row Y? Set both y0 and y1 to Y. Wanna draw only one y-axis at column X? Set both x0 and x1 to X. Slay, specific.

Default values: font_height=14, opacity=1, pattern=(undefined) and color1=0.

Example:

[#1] 400,400,1,3,255 axes -1,1,1,-1

๐Ÿ”ฎ ball ๐Ÿ”ฎ

_size>0,_R,_G,_B,_ambient>=0,_diffuse>=0,_specular>=0,_shininess>=0,_light_x,_light_y,_light_z

Input a 2D RGBA colored ball sprite, rendered using the Phong illumination model. Shiny sphere moment ๐Ÿ”ฅ

Default values: size=64, R=200, G=R, B=R, ambient=0.25, diffuse=1, specular=1, shininess=20, light_x=1.5, light_y=-1.5 and light_z=1.

Example โ€” a whole grid of ascending balls, obsessed:

[#1] repeat 9 { ball {int(1.5^($>+4))},${-rgb} } append_tiles 3,3

๐Ÿ“ chessboard ๐Ÿ“

size1>0,_size2>0,_offset1,_offset2,_angle,_opacity,_color1,...,_color2,...

Draw a chessboard on the selected images. Checkmate bestie โ™Ÿ๏ธ

Default values: size2=size1, offset1=offset2=0, angle=0, opacity=1, color1=0 and color2=255.

Example:

[#1] image.jpg chessboard 32,32,0,0,25,0.3,255,128,0,0,128,255

๐Ÿฆ„ cie1931 ๐Ÿฆ„

Draw a CIE-1931 chromaticity diagram on the selected images. Colour-science horse-shoe, literally iconic ๐ŸŒˆ

Example:

[#1] 500,400,1,3 cie1931

๐Ÿ’– circle ๐Ÿ’–

x[%],y[%],R[%],_opacity,_pattern,_color1,...

Draw the specified colored circle on the selected images. Round and perfect, just like her ๐Ÿ’…

A radius of 100% stands for sqrt(width^2+height^2).

pattern is an hexadecimal number starting with 0x which can be omitted even if a color is specified. If a pattern is specified, the circle is drawn outlined instead of filled.

Default values: opacity=1, pattern=(undefined) and color1=0.

Example:

[#1] image.jpg repeat 300 circle {u(100)}%,{u(100)}%,{u(30)},0.3,${-rgb} done circle 50%,50%,100,0.7,255

๐ŸŒ™ close_binary ๐ŸŒ™

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 }

Automatically close open shapes in binary images (defining white strokes on black background). She's finishing what you started, no drama โœจ

Default values: endpoint_rate=75, endpoint_connectivity=2, spline_distmax=80, segment_distmax=20, spline_anglemax=90, spline_roundness=1, area_min=100, allow_self_intersection=1.

๐ŸŽข curve ๐ŸŽข

[xy_coordinates],_thickness>0,_tilt,_tilt_strength[%],_is_closed={ 0:No | 1:Yes },_opacity,_color1,...

Draw the specified parameterized curve on the selected images. Curveball but make it fashion ๐ŸŒ€

Arguments are:

  • [xy_coordinates] is the set of XY-coordinates of the curve, specified as a 2-channels image.
  • thickness is the thickness of the drawing, specified in pixels.
  • tilt is an angle, specified in degrees.
  • tilt_strength must be a floating-point in [0,1] (or in [0,100] if specified as a percentage).
  • is_closed is a boolean which indicates whether the curve is closed.

Default values: thickness=0, tilt=45

Example โ€” full art-project pipeline, she contains multitudes:

[#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

๐Ÿซง ellipse (+) ๐Ÿซง

x[%],y[%],R[%],r[%],_angle,_opacity,_pattern,_color1,...

Draw the specified colored ellipse on the selected images. Circle but she's stretching her potential โœจ

A radius of 100% stands for sqrt(width^2+height^2).

pattern is an hexadecimal number starting with 0x which can be omitted even if a color is specified. If a pattern is specified, the ellipse is drawn outlined instead of filled.

Default values: opacity=1, pattern=(undefined) and color1=0.

Example:

[#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

๐Ÿ’ง flood (+) ๐Ÿ’ง

x[%],_y[%],_z[%],_tolerance>=0,_is_high_connectivity={ 0:No | 1:Yes },_opacity,_color1,...

Flood-fill the selected images using the specified value and tolerance. The paint bucket era of everyone's life ๐Ÿชฃ

Default values: y=z=0, tolerance=0, is_high_connectivity=0, opacity=1 and color1=0.

Example:

[#1] image.jpg repeat 1000 flood {u(100)}%,{u(100)}%,0,20,0,1,${-rgb} done

๐ŸŒธ gaussian ๐ŸŒธ

_sigma1[%],_sigma2[%],_angle

Draw a centered gaussian on the selected images, with the specified standard deviations and orientation. Bell curve baddie ๐Ÿ””โœจ

Default values: sigma1=3, sigma2=sigma1 and angle=0.

Example:

[#1] 400,400 gaussian 100,30,45

Tutorial: https://gmic.eu/oldtutorial/_gaussian

๐Ÿ“ˆ graph ๐Ÿ“ˆ

[function_image],_plot_type,_vertex_type,_ytop,_ybottom,_opacity,_pattern,_color1,...

Draw the specified function graph on the selected images. Data visualization but make it cute ๐Ÿ“Š๐Ÿ’–

plot_type can be { 0:None | 1:Lines | 2:Splines | 3:Bar }.

vertex_type can be { 0:None | 1:Points | 2,3:Crosses | 4,5:Circles | 6,7:Squares }.

pattern is an hexadecimal number starting with 0x which can be omitted even if a color is specified.

Default values: plot_type=1, vertex_type=1, ytop=ybottom=0 (auto), opacity=1, pattern=(undefined) and color1=0.

Example โ€” three graphs, three colors, one slay:

[#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]

๐Ÿ•ธ๏ธ grid ๐Ÿ•ธ๏ธ

size_x[%]>=0,size_y[%]>=0,_offset_x[%],_offset_y[%],_opacity,_pattern,_color1,...

Draw an xy-grid on the selected images. Structure, but make it aesthetic ๐Ÿงš

pattern is an hexadecimal number starting with 0x which can be omitted even if a color is specified.

Default values: offset_x=offset_y=0, opacity=1, pattern=(undefined) and color1=0.

Examples:

[#1] image.jpg grid 10%,10%,0,0,0.5,255
[#2] 400,400,1,3,255 grid 10%,10%,0,0,0.3,0xCCCCCCCC,128,32,16

๐Ÿ‘‘ j (+) ๐Ÿ‘‘

Shortcut for command image. Short king behaviour, love that ๐Ÿ’…

๐Ÿ–ผ๏ธ image (+) ๐Ÿ–ผ๏ธ

[sprite],_x[%|~],_y[%|~],_z[%|~],_c[%|~],_opacity,_[opacity_mask],_max_opacity_mask

Draw the specified sprite on the selected images. (equivalent to shortcut command j). Paste her in, she belongs there ๐Ÿซถ

If one of the x,y,z or c argument ends with a ~, its value is expected to be a centering ratio (in [0,1]) rather than a position. Usual centering ratios are { 0:left-justified | 0.5:centered | 1:right-justified }.

Default values: x=y=z=c=0, opacity=1, opacity_mask=(undefined) and max_opacity_mask=1.

Example โ€” crop, resize, frame, then paste it back in at 30%,30%, chef's kiss:

[#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]

๐Ÿฆ‹ ja ๐Ÿฆ‹

Shortcut for command imagealpha. Another shortcut, another icon โœจ

๐Ÿ’ซ imagealpha ๐Ÿ’ซ

[sprite],_x[%|~],_y[%|~],_z[%|~],_c[%|~],_opacity

Draw the specified sprite on the selected images, considering that the sprite's last channel is the drawing's alpha. Transparency realness ๐Ÿซง (equivalent to shortcut command ja).

If one of the x,y,z or c argument ends with a ~, its value is expected to be a centering ratio (in [0,1]) rather than a position. Usual centering ratios are { 0:left-justified | 0.5:centered | 1:right-justified }.

Default values: x=y=z=c=0 and opacity=1.

โœ๏ธ line (+) โœ๏ธ

x0[%],y0[%],x1[%],y1[%],_opacity,_pattern,_color1,...

Okay so for line, the rest of the tea is: it draws the colored line you specified on the selected images. 'pattern' is an hexadecimal number starting with 0x, and yes, you can omit the 0x even if a color is specified. Defaults are 'opacity=1', 'pattern=(undefined)', and 'color1=0'. Example, bestie:

[#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

line_aa

x0[%],y0[%],x1[%],y1[%],_opacity,_color1,...

Draws the specified antialiased colored line on the selected images. Defaults: 'opacity=1' and 'color1=0'. Example:

[#1] 512,512,1,3 repeat 100 line_aa {v([w,h,w,h])-1},1,${-rgb} done

spline

x0[%],y0[%],u0[%],v0[%],x1[%],y1[%],u1[%],v1[%],_opacity,_color1,...

Draws the specified colored spline curve on selected images (cubic hermite spline). Defaults: 'opacity=1' and 'color1=0'. Example:

[#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}
}

thickcircle

x[%],y[%],R[%],_thickness>=0,_opacity,_color1,...

Draws the specified colored thick outlined circle on selected images. Defaults: 'thickness=3', 'opacity=1' and 'color1=0'. Example:

[#1] 400,400 repeat 15 { R:=lerp(10,190,$%) thickcircle 200,200,$R,2,1,$R } n 0,255 map 7

thickellipse

x[%],y[%],R[%],r[%],_angle,_thickness>=0,_opacity,_color1,...

Draws the specified colored thick outlined ellipse on selected images. Defaults: 'thickness=3', 'opacity=1' and 'color1=0'. Example:

[#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

thickline

x0[%],y0[%],x1[%],y1[%],_thickness,_opacity,_color1

Draws the specified colored thick line on selected images. Defaults: 'thickness=2', 'opacity=1' and 'color1=0'. Example:

[#1] 400,400,1,3 repeat 100 thickline {u([w,h,w,h,5])},0.5,${-rgb} done

thickpolygon

N>=1,x1[%],y1[%],...,xN[%],yN[%],_thickness>=0,_opacity,_color1,...
|
[coords],_thickness>=0,_opacity,_color1,...

Draws the specified colored thick outlined N-vertices polygon on selected images.

Heads up: if 'thickness<0', the command draws an open polygon rather than a closed polygon.

Defaults: 'thickness=3', 'opacity=1', and 'color1=0'. Example:

[#1] image.jpg thickpolygon 4,20%,20%,80%,30%,80%,70%,20%,80%,5,1,0,255,0
[#2] image.jpg 2,16,1,1,'u(x?h#0:w#0)' thickpolygon[-2] [-1],5,1,255,0,255 remove[-1]

thickspline

x0[%],y0[%],u0[%],v0[%],x1[%],y1[%],u1[%],v1[%],_thickness,_opacity,_color1,...

Draws the specified colored thick spline curve on selected images (cubic hermite spline). Defaults: 'thickness=3', 'opacity=1' and 'color1=0'. Example:

[#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} }

mandelbrot

z0r,z0i,z1r,z1i,_iteration_max>=0,_is_julia={ 0:No | 1:Yes },_c0r,_c0i,_opacity

Draws a mandelbrot/julia fractal on selected images. Defaults: 'iteration_max=100', 'is_julia=0', 'c0r=c0i=0' and 'opacity=1'. Example:

[#1] 400,400 mandelbrot -2.5,-2,2,2,1024 map 0 +blur 2 elevation3d[-1] -0.2

marble

_image_weight,_pattern_weight,_angle,_amplitude,_sharpness>=0,_anisotropy>=0,_alpha,_sigma,_cut_low>=0,_cut_high>=0

Renders a marble like pattern on selected images. Defaults: 'image_weight=0.2', 'pattern_weight=0.1', 'angle=45', 'amplitude=0', 'sharpness=0.4' and 'anisotropy=0.8', 'alpha=0.6', 'sigma=1.1' and 'cut_low=cut_high=0'. Example:

[#1] image.jpg +marble ,

maze

_width>0,_height>0,_cell_size>0

Inputs a maze with the specified size. Example:

[#1] maze 30,20 negate normalize 0,255

maze_mask

_cellsize>0

Inputs a maze according to the size and shape of selected mask images. Mask may contain disconnected shapes. Example:

[#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

newton_fractal

z0r,z0i,z1r,z1i,_angle,0<=_descent_method<=2,_iteration_max>=0,_convergence_precision>0,_expr_p(z),_expr_dp(z),_expr_d2p(z)

Draws a 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 ]. 'descent_method' can be { 0:Secant | 1:Newton | 2:Householder }.

Defaults: 'angle=0', 'descent_method=1', 'iteration_max=200', 'convergence_precision=0.01', 'expr_p(z)=z^^3-1', 'expr_dp(z)=3*z^^2' and 'expr_d2z(z)=6*z'. Example:

[#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

pack_sprites

[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

Tries to randomly pack as many sprites as possible onto the 'empty' areas of an image. Sprites may be optionally rotated and scaled during the packing process.

  • The 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.
  • '[sprite_set]' 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.
  • 'nb_scales' sets the number of decreasing scales considered for all specified sprites to be packed.
  • 'min_scale' (in %) sets the minimal size considered for packing (specified as a percentage of the original sprite size).
  • 'spacing' can be positive or negative.
  • 'max_attempts' defines the maximum number of attempts to pack a sprite for each scale.

Defaults: 'nb_scales=1', 'min_scale=25', 'allow_rotation=0', 'spacing=1' and 'max_attempts=512'. Example:

[#1] shape_heart 512 negate normalize 0,255 channels -3,0 repeat 2 { ball 48,${-rgb} } +pack_sprites[0] [^0],5,15

piechart

label_height>=0,label_R,label_G,label_B,"label1",value1,R1,G1,B1,...,"labelN",valueN,RN,GN,BN

Draws a pie chart on selected (RGB) images. Example:

[#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

plasma

_alpha,_beta,_scale>=0

Draws a random colored plasma fractal on selected images. This command implements the so-called 'Diamond-Square' algorithm. Defaults: 'alpha=1', 'beta=1' and 'scale=8'. Example:

[#1] 400,400,1,3 plasma 1

Tutorial: https://gmic.eu/oldtutorial/_plasma

point (+)

x[%],_y[%],_z[%],_opacity,_color1,...

Sets the specified colored pixel on selected images. Defaults: 'z=0', 'opacity=1' and 'color1=0'. Example:

[#1] image.jpg repeat 10000 point {u(100)}%,{u(100)}%,0,1,${-rgb} done

polka_dots

diameter>=0,_density,_offset1,_offset2,_angle,_aliasing,_shading,_opacity,_color,...

Draws a dots pattern on selected images. Defaults: 'density=20', 'offset1=offset2=50', 'angle=0', 'aliasing=10', 'shading=1', 'opacity=1' and 'color=255'. Example:

[#1] image.jpg polka_dots 10,15,0,0,20,10,1,0.5,0,128,255

polygon (+)

N>=1,x1[%],y1[%],...,xN[%],yN[%],_opacity,_pattern,_color1,... |
[coords],_opacity,_pattern,_color1,...

Draws the specified colored N-vertices polygon on selected images.

'pattern' is an hexadecimal number starting with 0x 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 '-' sign before 'pattern' makes the command draw an open polyline rather than a closed polygon.

Defaults: 'opacity=1', 'pattern=(undefined)' and 'color1=0'. Example:

[#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
[#2] image.jpg 2,16,1,1,'u(x?h#0:w#0)' polygon[-2] [-1],0.6,255,0,255 remove[-1]

quiver

[function_image],_sampling[%]>0,_factor>=0,_is_arrow={ 0:No | 1:Yes },_opacity,_color1,...

Draws the specified 2D vector/orientation field on selected images. Defaults: 'sampling=5%', 'factor=1', 'is_arrow=1', 'opacity=1', 'pattern=(undefined)' and 'color1=0'. Example:

[#1] 100,100,1,2,'!c?x-w/2:y-h/2' 500,500,1,3,255 quiver[-1] [-2],10
[#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

rectangle

x0[%],y0[%],x1[%],y1[%],_opacity,_pattern,_color1,...

Draws the specified colored rectangle on selected images.

'pattern' is an hexadecimal number starting with 0x which can be omitted even if a color is specified. If a pattern is specified, the rectangle is drawn outlined instead of filled.

Defaults: 'opacity=1', 'pattern=(undefined)' and 'color1=0'. Example:

[#1] image.jpg repeat 30 { rectangle {u(100)}%,{u(100)}%,{u(100)}%,{u(100)}%,0.3,${-rgb} }

rorschach

'smoothness[%]>=0','mirroring={ 0:None | 1:X | 2:Y | 3:XY }

Renders rorschach-like inkblots on selected images. Defaults: 'smoothness=5%' and 'mirroring=1'. Example:

[#1] 400,400 rorschach 3%

sierpinski

recursion_level>=0

Draws a Sierpinski triangle on selected images. Default value: 'recursion_level=7'. Example:

[#1] image.jpg sierpinski 7

spiralbw

width>0,_height>0,_is_2dcoords={ 0:No | 1:Yes }

Inputs a 2D rectangular spiral image with the specified size. Defaults: 'height=width' and 'is_2dcoords=0'. Example:

[#1] spiralbw 16
[#2] image.jpg spiralbw {[w,h]},1 +warp[0] [1],0,1,1 +warp[2] [1],2,1,1

tetraedron_shade

x0,y0,z0,x1,y1,z1,x2,y2,z2,x3,y3,z3,R0,G0,B0,...,R1,G1,B1,...,R2,G2,B2,...,R3,G3,B3,...

Draws a tetraedron with interpolated colors on selected (volumetric) images.

t (+)</p>

Shortcut for command text. that's it, that's the whole vibe ๐Ÿ’…

text (+)</p>

text,_x[%|~],_y[%|~],_{ font_height[%]>=0 | custom_font },_opacity,_color1,...

Draw a colored text string onto the selected images, bestie. (This is literally the same thing as the shortcut command t, no cap.) โœจ

  • If one of the x or y arguments ends with a ~, that value is a centering ratio (in [0,1]) instead of a straight-up position. Cute, right?
  • The usual centering ratios are { 0:left-justified | 0.5:centered | 1:right-justified }.
  • Font sizes 13 and 128 are special โ€” they're the binary fonts, so no anti-aliasing for those two. Every other font size gets rendered with anti-aliasing.
  • If you specify an empty target image, it gets resized to new dimensions so the image contains the entire text string. it grows for you, iconic ๐ŸŽ€
  • A custom font can be given either as a variable name that stores an image list of 256 or 512 items (512 = 256 character sprites + 256 associated opacities), or as an image selection that's a serialized version of such an image list.
Default values: x=y=0.01~, font_height=16, opacity=1 and color1=0.

Example ๐Ÿฆ‹

[#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*$>} }
[#2] 0 text "G'MIC",0,0,23,1,255

to:</p>

Shortcut for command text_outline. same energy, different fit ๐ŸŒธ

text_outline:</p>

text,_x[%|~],_y[%|~],{ _font_height[%]>0 | custom_font },_outline>=0,_opacity,_color1,...

Draw a colored and outlined text string onto the selected images โ€” it's giving main character energy, fr fr. ๐Ÿ”ฅ

  • If one of the x or y arguments ends in ~, that value is a centering ratio (in [0,1]) rather than a position.
  • The usual centering ratios are { 0:left-justified | 0.5:centered | 1:right-justified }.
Default values: x=y=0.01~, font_height=7.5%, outline=2, opacity=1, color1=color2=color3=255 and color4=255.

Example ๐Ÿ’–

[#1] image.jpg text_outline "Hi there!",10,10,63,3

triangle_shade:</p>

x0,y0,x1,y1,x2,y2,R0,G0,B0,...,R1,G1,B1,...,R2,G2,B2,...

Draw a triangle with interpolated colors on the selected images. gradients but make it geometry ๐Ÿงš

Example โœจ

[#1] image.jpg triangle_shade 20,20,400,100,120,200,255,0,0,0,255,0,0,0,255

truchet:</p>

_scale>0,_radius>=0,_pattern_type={ 0:Straight | 1:Curved }

Fill the selected images with random truchet patterns. hypnotic, honestly ๐Ÿ˜ญ๐ŸŒ€

Default values: scale=32, radius=5 and pattern_type=1.

Example

[#1] 400,300 truchet ,

turbulence:</p>

_radius>0,_octaves={ 1,2,3...,12 },_alpha>0,_difference={ -10,10 },_mode={ 0,1,2,3 }

Render fractal noise, aka turbulence, on the selected images. chaotic in the best way ๐Ÿ’€

Default values: radius=32, octaves=6, alpha=3, difference=0 and mode=0.

Example

[#1] 400,400,1,3 turbulence 16

Tutorial: https://gmic.eu/oldtutorial/_turbulence ๐Ÿ‘‘ go read it, it ate

yinyang:</p>

Draw a yin-yang symbol on the selected images. balance, bestie ๐ŸŽ€

Example

[#1] 400,400 yinyang

11.11. Matrix Computation

diagonal:

Transform the selected vectors as diagonal matrices. glow-up for numbers โœจ

Example

[#1] 1,10,1,1,'y' +diagonal

dijkstra:

starting_vertex>=0,_ending_vertex={ -1:None | >=0 }

Compute minimal distances and paths in the selected graphs, from the specified starting_vertex to all the other vertices (and optionally only until ending_vertex has been reached โ€” like leaving the party early ๐Ÿ™ˆ).

  • A graph of N vertices is specified as an NxN adjacency matrix giving the weights of every edge connecting vertices โ€” set it to inf when two vertices aren't connected, iykyk.
  • This command returns a 1xNx1x2 image holding the [distance,parent] info:
    • distance is the minimal distance from vertex #y to the starting_vertex (i.e. the sum of edge weights making up the minimal path between those two vertices).
    • parent is the index of the next vertex you have to follow to reach the starting_vertex through the minimal path.
Default value: ending_vertex=-1

eigen (+)

Compute the eigenvalues and eigenvectors of the selected symmetric matrices or matrix fields. ๐Ÿงฎโœจ

If one of the selected images has 3 or 6 channels, it's treated as a field of 2x2 or 3x3 symmetric matrices, and the eigen elements get computed at each point of that field. obsessed ngl

Example

[#1] (1,0,0;0,2,0;0,0,3) +eigen
[#2] image.jpg structuretensors blur 2 eigen split[0] c

Tutorial: https://gmic.eu/oldtutorial/_eigen ๐Ÿ’œ

eye:

_size>0

Insert an identity matrix of the given size at the end of the image list. yes it's just called eye, slay ๐Ÿ’…

Example

[#1] eye 3 eye 7 eye 10

fitsamples:

nb_samples>0,_relevant_dimension[%]>0,_average_vector_varname,_dilation_vector_varname,_orientation_matrix_varname

Generate nb_samples vectors that have the same multivariate gaussian distribution as the vectors of the selected images. ๐ŸŒˆ statistically identical, fr fr

  • Each input represents a set of M vectors of dimension N (with M>1), specified as an image with size MxNx1x1, Mx1xNx1, Mx1x1xN, 1xMxNx1, 1xMx1xN or 1x1xMxN.
  • The command returns a brand-new set of random vectors with similar geometry. ๐Ÿฆ‹
Default values: relevant_dimension=100%, and average_vector_varname=orientation_matrix_varname=dilation_matrix_varname=(undefined) fR.

invert:

Inverse the selected matrices โ€” or compute the Moore-Penrose pseudoinverse for the non-square ones. flips them right around ๐Ÿ”„

Example

[#1] (0,1,0;0,0,1;1,0,0) +invert

meigen:

m>=1

Compute an approximation of the m largest eigenvalues and eigenvectors of the selected symmetric matrices, using the Arnoldi iteration method (https://en.wikipedia.org/wiki/Arnoldi_iteration). ๐Ÿ“š

A larger m goes with better numerical precision. numbers really said "the more the merrier" ๐Ÿ˜ญ

Example

[#1] (1,0,0;0,2,0;0,0,3) +meigen 3

mproj (+)

[dictionary],_method,_max_iter={ 0:Auto | >0 },_max_residual>=0

Find the best matching projection of the selected matrices onto the span of an over-complete dictionary D, using either the orthogonal projection or the Matching Pursuit algorithm. ๐ŸŽฏ

  • The selected images are 2D matrices where each column represents a signal to project.
  • [dictionary] is a matrix where each column is an element of the dictionary D.
  • method says which projection algorithm to apply. 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 method-2 iterations.
  • max_iter sets the max number of iterations processed for each signal. If it's set to 0 (the default), max_iter equals the number of columns in D. (only meaningful for matching pursuit and its variants, jsyk)
  • max_residual gives a stopping criterion on the signal reconstruction accuracy. (also only meaningful for matching pursuit and its variants)
  • For each selected image, the result comes back as a matrix W whose columns correspond to the weights associated with each column of D, such that the matrix product D*W is an approximation of the input matrix. ๐Ÿ’ซ
Default values: method=0, max_iter=0 and max_residual=1e-6.

orthogonalize:

_mode = { 0:orthogonalize | 1:orthonormalize }

Orthogonalize or orthonormalize the selected matrices, using the Modified Gram-Schmidt process. getting them all perpendicular and proper โœจ

Default value: mode=0.

poweriteration:

_nb_eigenvectors>0,_epsilon>0,_max_iter>0

Compute the nb_eigenvectors largest eigenvectors of the selected symmetric matrices, using the power iteration algorithm. ๐Ÿ’ช iterating with power, literally

Default values: nb_eigenvectors=1, epsilon=1e-5 and max_iter=100.

qr (+)

_is_reduced_form={ 0:No | 1:Yes },_is_pivoting={ 0:No | 1:Yes }

Compute the QR decomposition of the 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 mร—m if is_reduced_form==0, or mร—min(m,n) otherwise.
  • R is an upper-trianguler matrix of size mร—n if is_reduced_form==0 or min(m,n)ร—n otherwise.
  • Q^T*Q = Id.
  • If n>m, only the first mร—m part of R is upper triangular.

If is_pivoting is enabled, an additional image of column permutations gets returned too. ๐ŸŒ€

Default values: is_reduced_form=1 and is_pivoting=0.

Example

[#1] 10,10,1,1,'v(100)' +qr +mmul[-2,-1]

solve (+)

[image]

Solve the linear system AX = B for the selected B-matrices and the specified A-matrix. ๐Ÿงฉ

If the system is under- or over-determined, the least squares or minimal norm solution is returned. it's flexible like that ๐Ÿ’…

Example

[#1] (0,1,0;1,0,0;0,0,1) (1;2;3) +solve[-1] [-2]

svd (+)

Compute the SVD decomposition of the selected matrices. singular value decomposition but make it cute ๐Ÿฆ‹

Example

[#1] 10,10,1,1,'x==y?x+u(-0.2,0.2):0' +svd

transpose:

Transpose the selected matrices. rows become columns, columns become rows, character development ๐ŸŒธ

Example

[#1] image.jpg +transpose

trisolve:

[image]

Solve the tridiagonal system AX = B for the selected B-vectors and the specified tridiagonal A-matrix. ๐Ÿ”บ

The tridiagonal matrix has to be stored as a 3 column vector, where the 2nd column contains the diagonal coefficients, while the 1st and 3rd columns contain the left and right coefficients. keep the order, bestie, it matters ๐Ÿ™ˆ

Example

[#1] (0,0,1;1,0,0;0,1,0) (1;2;3) +trisolve[-1] [-2]

11.12. 3D Meshes

+3d (+)

Shortcut for command add3d. the plus version, as a treat โญ

add3d (+)

tx,_ty,_tz |
[object3d] |
(no arg)

Shift the selected 3D objects with the specified displacement vector, or merge them with the specified 3D object, or merge all the selected 3D objects together. (This is equivalent to the shortcut command +3d.) assembling, moving, merging โ€” full 3D glow-up ๐Ÿ’…โœจ

Default values: ty=tz=0.

Example ๐Ÿ”ฅ

[#1] sphere3d 10 repeat 5 { +add3d[-1] 10,{u(-10,10)},0 color3d[-1] ${-rgb} } add3d
[#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 }

animate3d:

nb_frames>0,_step_angle_x,_step_angle_y,_step_angle_z,_zoom_factor,0<=_fake_shadow_level<=100,_[background]

Generate 3D animation frames of rotating 3D objects. ๐ŸŽฌโœจ

  • Frames are stacked along the z-axis (volumetric image).
  • The frame size is the same as the size of the [background] image (or 800x800 if no background is specified). ๐Ÿ–ผ๏ธ

Default values: 'step_angle_x=0', 'step_angle_y=5', 'step_angle_z=0', 'zoom_factor=1', 'fake_shadow_level=50' and 'background=(undefined)'.


apply_camera3d ๐ŸŽฅ

pos_x,pos_y,pos_z,target_x,target_y,target_z,up_x,up_y,up_z

Okay so this one slaps a full 3D camera matrix onto whatever 3D objects you've got selected. It's giving director-of-photography energy. ๐ŸŽฌ

Default values: 'target_x=0', 'target_y=0', 'target_z=0', 'up_x=0', 'up_y=-1' and 'up_z=0'.

apply_matrix3d ๐Ÿ”ข

a11,a12,a13,...,a31,a32,a33

Same vibe, but you hand it a literal 3D rotation matrix instead of a camera. Apply it to the selected 3D objects, done. ๐Ÿ’…

Example:

[#1] torus3d 10,1 +apply_matrix3d {mul(rot(1,0,1,-15ยฐ),[1,0,0,0,2,0,0,0,8],3)}

array3d ๐Ÿงฑ

size_x>=1,_size_y>=1,_size_z>=1,_offset_x[%],_offset_y[%],_offset_y[%]

Duplicate a 3D object along the X, Y and Z axes โ€” like a 3D copy-paste with spacing, no cap it's lowkey hypnotic. โœจ

Default values: 'size_y=1', 'size_z=1' and 'offset_x=offset_y=offset_z=100%'.

Example:

[#1] torus3d 10,1 +array3d 5,5,5,110%,110%,300%

arrow3d ๐Ÿน

x0,y0,z0,x1,y1,z1,_radius[%]>=0,_head_length[%]>=0,_head_radius[%]>=0

Drops a 3D arrow in, from a starting 3D point to an ending 3D point. Point A to point B, but make it fashion. ๐Ÿ’ซ

Default values: 'radius=5%', 'head_length=25%' and 'head_radius=15%'.

Example:

[#1] repeat 10 { a:=$>*2*pi/10 arrow3d 0,0,0,{cos($a)},{sin($a)},-0.5 } +3d

axes3d ๐Ÿ“

_size_x,_size_y,_size_z,_font_size>0,_label_x,_label_y,_label_z,_is_origin={ 0:No | 1:Yes }

Input 3D axes with the sizes you want along the x, y and z orientations. Yes it'll label them for you, she's thoughtful like that. ๐ŸŽ€

Default values: 'size_x=size_y=size_z=1', 'font_size=23', 'label_x=X', 'label_y=Y', 'label_z=Z' and 'is_origin=1'.

Example:

[#1] axes3d ,

boundingbox3d ๐Ÿ“ฆ

No args, she just knows what to do.

Replace the selected 3D objects by their 3D bounding boxes. It's giving "wrapping everything up in a neat little gift box". ๐ŸŽ

Example:

[#1] torus3d 100,30 +boundingbox3d +3d[-1] [-2]

box3d ๐ŸงŠ

_size_x,_size_y,_size_z

Inputs a 3D box sitting at (0,0,0) with whatever geometry you specified. Simple, iconic, does exactly what it says. ๐Ÿ’…

Default values: 'size_x=1' and 'size_z=size_y=size_x'.

Example:

[#1] box3d 100,40,30 +primitives3d 1 color3d[-2] ${-rgb}

c3d โœจ

Shortcut for the command 'center3d'. That's it. That's the whole entry, bestie. ๐Ÿ™ˆ

center3d ๐ŸŽฏ

No args needed.

Center the selected 3D objects at (0,0,0). It's the glow-up equivalent of "middle of the frame, please". (Equivalent to the shortcut command 'c3d'.) ๐Ÿซถ

Example:

[#1] repeat 100 { circle3d {u(100)},{u(100)},{u(100)},2 } add3d color3d[-1] 255,0,0 +center3d color3d[-1] 0,255,0 add3d

chainring3d โ›“๏ธ

_nb_links>=3,_x_scale>0,_y_scale>0,_z_scale>0

Inputs a 3D chain ring with the geometry you asked for. Heads up: 'nb_links' should preferably be even โ€” that's a real note from the page, not me being picky. ๐Ÿ˜Œ

Default values: 'nb_links=16', 'x_scale=0.5', 'y_scale=1' and 'z_scale=1'.

Example:

[#1] chainring3d

circle3d โญ•

_x0,_y0,_z0,_radius>=0

Inputs a 3D circle at the coordinates you gave it. Cute, round, mathematically pure. ๐ŸŒธ

Default values: 'x0=y0=z0=0' and 'radius=1'.

Example:

[#1] repeat 500 { a:=$>*pi/250 circle3d {cos(3*$a)},{sin(2*$a)},0,{$a/50} color3d[-1] ${-rgb},0.4 } add3d

circles3d ๐Ÿซง

_radius>=0,_is_outlined={ 0:No | 1:Yes }

Converts the selected 3D objects into sets of 3D circles with the radius you specify. Point-cloud-to-bubbles pipeline, we love to see it. โœจ

Default values: 'radius=1' and 'is_outlined=1'.

Example:

[#1] image.jpg luminance rescale2d ,40 threshold 50% * 255 pointcloud3d color3d[-1] 255,255,255 circles3d 0.7

col3d ๐ŸŽจ

Shortcut for the command 'color3d'. Same thing, shorter name, fewer keystrokes. iykyk. ๐Ÿ’…

color3d ๐ŸŒˆ

R,_G,_B,_opacity

Sets the color (and optionally the opacity, ooh) of the selected 3D objects. (Equivalent to the shortcut command 'col3d'.) This is the 3D equivalent of picking your fit for the day. ๐Ÿ‘‘

Default value: 'B=G=R' and 'opacity=(undefined)'.

Example:

[#1] torus3d 100,10 repeat 7 { +rotate3d[-1] 1,0,0,20 color3d[-1] ${-rgb} } add3d

colorcube3d ๐ŸŽฒ

_is_wireframe={ 0:No | 1:Yes }

Inputs a 3D color cube. Absolute main character energy for RGB visualizations. ๐ŸŒˆ

Default value: 'is_wireframe=0'.

Example:

[#1] colorcube3d mode3d 2 +primitives3d 1

colorize3d ๐Ÿ–Œ๏ธ

_color_function,_passed_images_for_color_function

Colorizes the primitives of the selected 3D objects according to a function you specify. Custom colors per triangle?? Obsessed. ๐Ÿ’–

  • 'color_function' returns a G, GA, RGB or RGBA vector, and it can depend on the variables 'x', 'y' and 'z', which are defined as the barycenter coordinates for each primitive.
  • 'passed_images_for_color_function' can be specified as a selection (e.g. '[0,2]') of images that will be inserted at the end of the image list while modifying 3D objects, so that the 'color_function' can have access to their content.

Default values: 'color_function=[x,y,z]' and 'passed_images_for_color_function='.

Example:

[#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]

cone3d ๐Ÿฆ

_radius,_height,_nb_subdivisions>0

Inputs a 3D cone at (0,0,0), geometry as specified. Pointy. Iconic. No notes. ๐Ÿ”บ

Default value: 'radius=1', 'height=1' and 'nb_subdivisions=24'.

Example:

[#1] cone3d 10,40 +primitives3d 1 color3d[-2] ${-rgb}

cubes3d ๐ŸงŠ

_size>=0

Converts the selected 3D objects into sets of 3D cubes of the size you picked. Minecraft-core, honestly. ๐Ÿ’€

Default value: 'size=1'.

Example:

[#1] image.jpg luminance rescale2d ,40 threshold 50% * 255 pointcloud3d color3d[-1] 255,255,255 cubes3d 1

cup3d โ˜•

_resolution>0

Inputs a 3D cup object. Yes, a whole cup. Hydration is important, bestie. ๐Ÿซถ

Default value: 'resolution=128'.

Example:

[#1] cup3d ,

curve3d ๐ŸŒ€

_"x(t)",_"y(t)",_"z(t)",_"r(t)",_resolution>1,_tmin,_tmax,_nb_sides>=0,_cap_style={ 0:Open | 1 | Capped | 2 | Closed }

Inputs a 3D curve with the parameterization you give it. You're basically writing the math and she renders it. โœจ

Heads up on the actual behavior: if 'r(t)==0' or 'nb_sides<3', the generated 3D object is composed of segments only.

Default values: 'x(t)=cos(2*pi*t)', 'y(t)=sin(2*pi*t)', 'z(t)=t', 'r(t)=0.025', 'resolution=128', 'tmin=0', 'tmax=1', 'nb_sides=16' and 'cap_style=1'.

Example:

[#1] curve3d ,

cylinder3d ๐Ÿฅซ

_radius,_height,_nb_subdivisions>0

Inputs a 3D cylinder at (0,0,0), geometry as specified. Reliable. Sturdy. A little bit of a can situation. ๐Ÿฅซ

Default value: 'radius=1', 'height=1' and 'nb_subdivisions=24'.

Example:

[#1] cylinder3d 10,40 +primitives3d 1 color3d[-2] ${-rgb}

delaunay3d ๐Ÿ”บ

No args โ€” she takes the selected images and runs with it.

Generates 3D Delaunay triangulations from the 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. Math girl summer. ๐Ÿงš

Example:

[#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]

depthmap3d ๐ŸŒ—

[object3d],_x[%],_y[%],_z_,is_double_sided={ 0:No | 1:Yes },_is_zbuffer={ 0:No | 1:Yes },_focal

Draws the depth map of the specified 3D object onto the selected images. It's giving shadow-selfie but mathematical. ๐Ÿ“ธ

Default values: 'x=y=50%', 'z=0' and 'is_zbuffer=1'. All other arguments take their default values from the 3D environment variables.

Example:

[#1] gmic3d center3d normalize3d rotate3d 0,1,0,45 mul3d 360 400,400 depthmap3d[-1] [-2] snapshot3d[-2] 400

distribution3d ๐Ÿ“Š

No args required.

Gets the 3D color distribution of the selected images. Basically a vibe check for your color palette. ๐ŸŒˆ

Example:

[#1] image.jpg distribution3d colorcube3d primitives3d[-1] 1 add3d

/3d โž—

Shortcut for the command 'div3d'. Division but make it 3D, and also shorter to type. ๐Ÿ’…

div3d โž—

factor |
factor_x,factor_y,_factor_z

Scales the selected 3D objects isotropically or anisotropically, using the inverse of the factors you specify. Yes, inverse โ€” read it twice, bestie, it's not a typo. (Equivalent to the shortcut command '/3d'.) ๐Ÿซถ

Default value: 'factor_z=1'.

Example:

[#1] torus3d 5,2 repeat 5 { +add3d[-1] 12,0,0 div3d[-1] 1.2 color3d[-1] ${-rgb} } add3d

db3d ๐Ÿชž

Shortcut for the command 'double3d'. Two letters, whole lot of double-sidedness. โœจ

double3d ๐Ÿชž

_is_double_sided={ 0:No | 1:Yes }

Enables or disables double-sided mode for 3D rendering. (Equivalent to the shortcut command 'db3d'.) Flip it on and suddenly both faces of your geometry are showing up to the party. ๐ŸŽ‰

Default value: 'is_double_sided=1'.

Example:

[#1] mode3d 1 repeat 2 { torus3d 100,30 rotate3d[-1] 1,1,0,60 double3d $> snapshot3d[-1] 400 }

elevation3d ๐Ÿ”๏ธ

{ z-factor | [elevation_map] | 'formula' },base_height={ -1 | >=0 } |
(no arg)

Generates a 3D elevation of the selected images, optionally with an elevation map you provide. Here's the deal: when invoked with (no arg) or 'z-factor', 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. Very "I made this terrain myself". ๐ŸŒ„

Example:

[#1] image.jpg +blur 5 elevation3d. 0.75
[#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))'

empty3d ๐Ÿซฅ

No args, obviously. It's empty.

Inputs an empty 3D object. Starting from nothing, very main character origin-story of it. ๐Ÿ’€

Example:

[#1] empty3d

extract_textures3d ๐Ÿงต

No args.

Extracts the texture data from the selected 3D objects. Unwrapping the whole fit, metaphorically. ๐ŸŽ€

Example:

[#1] image.jpg imagesphere3d 10,10 +extract_textures3d

extrude3d ๐Ÿงˆ

_depth>0,_resolution>0,_smoothness[%]>=0

Generates an extruded 3D object from the selected binary XY-profiles. Take a flat shape, give it depth, done. Glow-up complete. โœจ

Default values: 'depth=16', 'resolution=1024' and 'smoothness=0.5%'.

Example:

[#1] image.jpg threshold 50% extrude3d 16

f3d ๐Ÿ”ญ

Shortcut for the command 'focal3d'. Tiny name, big lens energy. ๐Ÿ“ท

focal3d ๐Ÿ”ญ

focal

Sets the 3D focal. (Equivalent to the shortcut command 'f3d'.) Now the important caveats, don't skip these:

  • Set 'focal' to 0 to enable parallel projection (instead of perspective).
  • Set negative 'focal' will disable 3D sprite zooming.

Default value: 'focal=700'.

Example:

[#1] repeat 5 { torus3d 100,30 rotate3d[-1] 1,1,0,60 focal3d {$<*90} snapshot3d[-1] 400 } remove[0]

fov3d ๐Ÿ‘€

fov_angle>=0,_image_resolution>0

Sets the 3D focal to match a specified field of vision angle (in degrees) for rendering a 3D object in an image with the resolution you give. Returns the corresponding value of the focal in the status. So yes, you get a little output treat. ๐Ÿ“

Default value: 'fov_angle=45' and 'image_size=max(w,h)' (max size of the latest image).

gaussians3d ๐Ÿซง

_size>0,0<=_opacity<=1

Converts the selected 3D objects into a set of 3D gaussian-shaped sprites. Soft, floaty, ethereal โ€” it's giving dream sequence. ๐Ÿ’œ

Example:

[#1] image.jpg rescale2d ,32 distribution3d gaussians3d 20 colorcube3d primitives3d[-1] 1 +3d

gmic3d ๐Ÿ‘‘

No args. It's the logo. She's famous.

Inputs a 3D G'MIC logo. Yes, the brand has its own 3D object, and honestly? Ate. ๐Ÿ”ฅ

Example:

[#1] gmic3d +primitives3d 1

gyroid3d ๐Ÿงฌ

_resolution>0,_zoom

Inputs a 3D gyroid at (0,0,0) with the resolution you specify. Infinitely repeating minimal-surface realness. ๐ŸŒ€

Default values: 'resolution=32' and 'zoom=5'.

Example:

[#1] gyroid3d 48 +primitives3d 1

histogram3d ๐Ÿ“ˆ

No args needed.

Gets the 3D color histogram of the selected images. Data but make it dimensional. ๐Ÿ’…

...and here's the rest of that example we were mid-way through:

[#1] image.jpg rescale2d 64 histogram3d circles3d 3 opacity3d.
       0.75 colorcube3d primitives3d[-1] 1 add3d

image6cube3d ๐ŸŽฒ

Generate 3D mapped cubes from 6-sets of selected images.

Example:

[#1] image.jpg animate flower,"30,0","30,5",6 image6cube3d

imageblocks3d ๐Ÿงฑ

Signature: _maximum_elevation,_smoothness[%]>=0

Generate 3D blocks from selected images. Transparency of selected images is taken into account.

Default values: maximum_elevation=10 and smoothness=0.

Example:

[#1] image.jpg rescale2d ,32 imageblocks3d -20 mode3d 3

imagecube3d ๐ŸงŠ

Generate 3D mapped cubes from selected images.

Example:

[#1] image.jpg imagecube3d

imageplane3d โœˆ๏ธ

Generate 3D mapped planes from selected images.

Example:

[#1] image.jpg imageplane3d

imagepyramid3d ๐Ÿ”บ

Generate 3D mapped pyramids from selected images.

Example:

[#1] image.jpg imagepyramid3d

imagerubik3d ๐ŸŽจ

Signature: _xy_tiles>=1,0<=xy_shift<=100,0<=z_shift<=100

Generate 3D mapped rubik's cubes from selected images.

Default values: xy_tiles=3, xy_shift=5 and z_shift=5.

Example:

[#1] image.jpg imagerubik3d ,

imagesphere3d ๐ŸŒ

Signature: _resolution1>=3,_resolution2>=3

Generate 3D mapped sphere from selected images.

Default values: resolution1=32 and resolutions2=16.

Example:

[#1] image.jpg imagesphere3d 32,16

isoline3d (+) ใ€ฐ๏ธ

Signature:

isovalue[%] |
'formula',value,_x0,_y0,_x1,_y1,_size_x[%]>0,_size_y[%]>0

Extract 3D isolines with specified value from selected images or from specified formula.

Default values: x0=y0=-3, x1=y1=3 and size_x=size_y=256.

Example:

[#1] image.jpg blur 1 isoline3d 50%
[#2] isoline3d 'X=x-w/2;Y=y-h/2;(X^2+Y^2)%20',10,-10,-10,10,10

isosurface3d (+) ๐Ÿซง

Signature:

isovalue[%] |
'formula',value,_x0,_y0,_z0,_x1,_y1,_z1,_size_x[%]>0,_size_y[%]>0,_size_z[%]>0

Extract 3D isosurfaces with specified value from selected images or from specified formula.

Default values: x0=y0=z0=-3, x1=y1=z1=3 and size_x=size_y=size_z=32.

Example:

[#1] image.jpg rescale2d ,128 luminance threshold 50% expand z,2 blur 1 isosurface3d 50% mul3d 1,1,30
[#2] isosurface3d 'x^2+y^2+abs(z)^abs(4*cos(x*y*z*3))',3

label3d ๐Ÿท๏ธ

Signature: "text",font_height>=0,_opacity,_color1,...

Generate 3D text label.

Default values: font_height=13, opacity=1 and color=255,255,255.

label_points3d ๐Ÿ”ข

Signature: _label_size>0,_opacity

Add a numbered label to all vertices of selected 3D objects.

Default values: label_size=13 and opacity=0.8.

Example:

[#1] torus3d 100,40,6,6 label_points3d 23,1 mode3d 1

lathe3d ๐Ÿช€

Signature: _resolution>0,_smoothness[%]>=0,_max_angle>=0

Generate 3D object from selected binary XY-profiles.

Default values: resolution=128, smoothness=0.5% and max_angle=361.

Example:

[#1] 300,300 rand -1,1 blur 40 sign normalize 0,255 lathe3d ,

l3d (+)

Shortcut for command light3d.

light3d (+) ๐Ÿ’ก

Signature:

position_x,position_y,position_z |
[texture] |
(no arg)

Set the light coordinates or the light texture for 3D rendering. (equivalent to shortcut command l3d).

(no arg) resets the 3D light to default.

Example:

[#1] torus3d 100,30 specs3d 1.2 repeat 5 { light3d {$>*100},0,-300 +snapshot3d[0] 400 } remove[0]

line3d ๐Ÿ“

Signature: x0,y0,z0,x1,y1,z1

Input 3D line at specified coordinates.

Example:

[#1] repeat 100 { a:=$>*pi/50 line3d 0,0,0,{cos(3*$a)},{sin(2*$a)},0 color3d. ${-rgb} } add3d

lines3d ๐Ÿงต

Signature: _length>=0

Convert specified 3D objects to sets of 3D horizontal segments with specified length.

Default values: length=1.

Example:

[#1] torus3d 100,40 +lines3d 20

lissajous3d ๐ŸŒ€

Signature: resolution>1,a,A,b,B,c,C

Input 3D lissajous curves x(t)=sin(a*t+A*2*pi), y(t)=sin(b*t+B*2*pi), z(t)=sin(c*t+C*2*pi).

Default values: resolution=1024, a=2, A=0, b=1, B=0, c=0 and C=0.

Example:

[#1] lissajous3d ,

m3d

Shortcut for command mode3d.

mode3d ๐Ÿ–ผ๏ธ

Signature: _mode

Set static 3D rendering mode. (equivalent to shortcut command m3d).

mode can be { -1:Bounding-box | 0:Dots | 1:Wireframe | 2:Flat | 3:Flat-shaded | 4:Gouraud-shaded | 5:Phong-shaded }.

heads up bestie: Bounding-box mode (mode==-1) is active only for the interactive 3D viewer.

Default value: mode=4.

Example:

[#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]

md3d

Shortcut for command moded3d.

moded3d ๐ŸŽฌ

Signature: _mode

Set dynamic 3D rendering mode for interactive 3D viewer. (equivalent to shortcut command md3d).

mode can be { -1:Bounding-box | 0:Dots | 1:Wireframe | 2:Flat | 3:Flat-shaded | 4:Gouraud-shaded | 5:Phong-shaded }.

Default value: mode=-1.

*3d (+)

Shortcut for command mul3d.

mul3d (+) ๐Ÿ“

Signature:

factor |
factor_x,factor_y,_factor_z

Scale selected 3D objects isotropically or anisotropically, with specified factors. (equivalent to shortcut command *3d).

Default value: factor_z=1.

Example:

[#1] torus3d 5,2 repeat 5 { +add3d[-1] 10,0,0 mul3d[-1] 1.2 color3d[-1] ${-rgb} } add3d

mt3d

Shortcut for command multithreaded3d.

multithreaded3d โšก

Signature: _is_multi_threaded_rendering={ 0:No | 1:Yes }

Enable/disable multi-threaded 3D rendering. (equivalent to shortcut command mt3d).

Default value: is_multithreaded_rendering=0.

n3d

Shortcut for command normalize3d.

normalize3d ๐Ÿ“ฆ

Normalize selected 3D objects to unit size. (equivalent to shortcut command n3d).

Example:

[#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

normalmap3d ๐Ÿ—บ๏ธ

Signature:

[object3d],_x[%],_y[%],_z_,is_double_sided={ 0:No | 1:Yes },_is_zbuffer={ 0:No | 1:Yes },_focal

Draw normal map of specified 3D object on selected images.

Default values: x=y=50%, z=0 and is_zbuffer=1. All other arguments take their default values from the 3D environment variables.

Example:

[#1] gmic3d center3d normalize3d rotate3d 0,1,0,45 mul3d 360 400,400,1,3 normalmap3d[-1] [-2] snapshot3d[-2] 400

normals3d ๐Ÿงญ

Signature: output_mode={ 0:vertices | 1:primitives | 2:vertices+primitives }.

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.

Default value: mode=2.

o3d

Shortcut for command opacity3d.

j3d (+)

Shortcut for command object3d.

object3d (+) ๐ŸŒŸ

Signature:

[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 }

Draw specified 3D object on selected images. (equivalent to shortcut command j3d).

rendering_mode can be { 0:Dots | 1:Wireframe | 2:Flat | 3:Flat-shaded | 4:Gouraud-shaded | 5:Phong-shaded }.

Default values: x=y=50%, z=0, opacity=1 and is_zbuffer=1. All other arguments take their default values from the 3D environment variables.

Example:

[#1] image.jpg torus3d 100,10 cone3d 30,-120 add3d[-2,-1] rotate3d. 1,1,0,60 object3d[0] [-1],50%,50% keep[0]

opacity3d ๐Ÿซฅ

Signature: opacity

Set opacity of selected 3D objects. (equivalent to shortcut command o3d).

Example:

[#1] torus3d 100,10 repeat 7 { +rotate3d[-1] 1,0,0,20 opacity3d[-1] {u} } add3d

parametric3d ๐ŸŒŠ

Signature:

_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

Input 3D object from specified parametric surface (a,b) โŸถ (x(a,b),y(a,b),z(a,b)).

Default values: x=(2+cos(b))*sin(a), y=(2+cos(b))*cos(a), c=sin(b), amin=-pi, amax=pi, bmin=-pi, bmax=pi, res_a=512, res_b=res_a, res_x=64, res_y=res_x, res_z=res_y, smoothness=2% and isovalue=10%.

Example:

[#1] parametric3d ,

pca_patch3d ๐Ÿงฉ

Signature:

_patch_size>0,_M>0,_N>0,_normalize_input={ 0:No | 1:Yes },_normalize_output={ 0:No | 1:Yes },_lambda_xy

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.

Default values: patch_size=7, M=1000, N=3000, normalize_input=1, normalize_output=0, and lambda_xy=0.

Example:

[#1] image.jpg pca_patch3d 7

plane3d ๐ŸŸฆ

Signature: _size_x,_size_y,_nb_subdivisions_x>0,_nb_subdisivions_y>0

Input 3D plane at (0,0,0), with specified geometry.

Default values: size_x=1, size_y=size_x and nb_subdivisions_x=nb_subdivisions_y=24.

Example:

[#1] plane3d 50,30 +primitives3d 1 color3d[-2] ${-rgb}

point3d ๐Ÿ“

Signature: x0,y0,z0

Input 3D point at specified coordinates.

Example:

[#1] repeat 1000 { a:=$>*pi/500 point3d {cos(3*$a)},{sin(2*$a)},0 color3d[-1] ${-rgb} } add3d

pointcloud3d โ˜๏ธ

Convert selected planar or volumetric images to 3D point clouds.

Example:

[#1] image.jpg luminance rescale2d ,100 threshold 50% mul 255 pointcloud3d color3d[-1] 255,255,255

pose3d ๐Ÿ•บ

Signature: p1,...,p12

Apply 3D pose matrix to selected 3D objects.

Example:

[#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

p3d

Shortcut for command primitives3d.

primitives3d ๐Ÿ”ท

Signature: mode

Convert primitives of selected 3D objects. (equivalent to shortcut command p3d).

mode can be { 0:Points | 1:Outlines | 2:Non-textured }.

Example:

[#1] sphere3d 30 primitives3d 1 torus3d 50,10 color3d[-1] ${-rgb} add3d

projections3d ๐Ÿ“Š

Signature:

_x[%],_y[%],_z[%],_is_bounding_box={ 0:No | 1:Yes },nb_subdivisions>0

(and the rest of this one is waiting for you in the next part ๐Ÿ’–)

โ€ฆso the command that got cut off in the last part wraps up like this: it generates the 3D xy, xz, yz projection planes from whichever volumetric images you've got selected. That's the whole vibe.

Default values are x=y=z=50%, is_bounding_box=1 and nb_subdividions=5 (yes, that spelling, don't @ me, copy it exactly).


pyramid3d

width,height

Drops a 3D pyramid at (0,0,0) with the geometry you asked for. Iconic.

[#1] pyramid3d 100,-100 +primitives3d 1 color3d[-2] ${-rgb}

quadrangle3d

x0,y0,z0,x1,y1,z1,x2,y2,z2,x3,y3,z3

Puts a 3D quadrangle at the coordinates you hand it. Four corners, one slay.

[#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

random3d

nb_points>=0

Generates a random 3D point cloud inside [0,1]^3 โ€” pure chaos, contained ๐Ÿ’…

[#1] random3d 100 circles3d 0.1 opacity3d 0.5

rv3d

Just a shortcut for the command reverse3d. That's it, that's the whole thing.

reverse3d

Flips the primitive orientations of the selected 3D objects (equivalent to the shortcut command rv3d). Inside-out is a look, honestly.

[#1] torus3d 100,40 +reverse3d

r3d (+)

Shortcut for command rotate3d. Nickname energy.

rotate3d (+)

u,v,w,angle

Rotates the selected 3D objects around the axis you specify, by the angle you specify โ€” angle is in deg. (equivalent to the shortcut command r3d).

[#1] torus3d 100,10 repeat 7 { +rotate3d[-1] 1,0,0,20 } add3d

rotation3d

u,v,w,angle

Feeds in a 3x3 rotation matrix built from the axis and angle you give it (angle in deg). Math girlies rise ๐Ÿซถ

[#1] rotation3d 1,0,0,0 rotation3d 1,0,0,90 rotation3d 1,0,0,180

sierpinski3d

_recursion_level>=0,_width,_height

Generates a 3D Sierpinski pyramid. Fractal icon behavior, no cap.

Default values: recursion_level=4, width=1 and height=1.

[#1] sierpinski3d 3,100,-100 +primitives3d 1 color3d[-2] ${-rgb}

size3d

Returns the bounding box size of the last selected 3D object. Just hands you the numbers.

skeleton3d

_metric,_frame_type={ 0:Squares | 1:Diamonds | 2:Circles | 3:Auto },_skeleton_opacity,_frame_opacity,_is_frame_wireframe={ 0:No | 1:Yes }

Builds a 3D skeletal structure object out of the 2d binary shapes sitting in the selected images. metric can be { 0:Chebyshev | 1:Manhattan | 2:Euclidean }.

Default values: metric=2, frame_type=3, skeleton_opacity=1 and frame_opacity=0.1.

[#1] shape_cupid 480 +skeleton3d ,

snapshot3d

_size>0,_zoom>=0,_backgroundR,_backgroundG,_backgroundB,_backgroundA,_fov_angle>=0 |
[background_image],zoom>=0,_fov_angle>=0

Takes 2D snapshots of the selected 3D objects. Set zoom to 0 if you want object auto-scaling off.

Default values: size=1024, zoom=1, [background_image]=(unused) and fov_angle=45.

[#1] torus3d 100,20 rotate3d 1,1,0,60 snapshot3d 400,1.2,128,64,32
[#2] torus3d 100,20 rotate3d 1,1,0,60 sample ? +snapshot3d[0] [1],1.2

sl3d

Shortcut for command specl3d. Two letters, maximum efficiency.

specl3d

value>=0

Sets the lightness of the 3D specular light (equivalent to the shortcut command sl3d).

Default value: value=0.25.

[#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]

ss3d

Shortcut for command specs3d.

specs3d

value>=0

Sets the shininess of the 3D specular light (equivalent to the shortcut command ss3d). Glow-up literally.

Default value: value=0.1.

[#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]

sphere3d

radius,_nb_recursions!=0 |
radius,_nb_phi>=3,_nb_theta>=3

Puts a 3D sphere at (0,0,0) with the geometry you specify. Here's the breakdown:

  • If you pass 2 arguments:
    • If nb_recursions>0, the sphere is built from recursive subdivisions of an icosahedron.
    • If nb_recursions<0, it's built from recursive subdividions of a cube.
  • If you pass 3 arguments, the sphere is built using spherical coordinates discretization.

Default value: nb_recursions=3.

[#1] sphere3d 100 +primitives3d 1 color3d[-2] ${-rgb}

spherical3d

"radius_function(phi,theta)",_nb_recursions!=0 |
"radius_function(phi,theta)",_nb_phi>=3,_nb_theta>=3

Puts a 3D spherical object at (0,0,0) with the geometry you specify. The second and third arguments work exactly like they do in sphere3d.

Default values: nb_recursions=5.

[#1] spherical3d "abs(1+0.5*cos(3*phi)*sin(4*theta))" +primitives3d 1

spline3d

x0[%],y0[%],z0[%],u0[%],v0[%],w0[%],x1[%],y1[%],z1[%],u1[%],v1[%],w1[%],_nb_vertices>=2

Puts a 3D spline in with the geometry you specify.

Default values: nb_vertices=128.

[#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

s3d

Shortcut for command split3d.

split3d

Splits the selected 3D objects into feature vectors: { header, sizes, vertices, primitives, colors, opacities } (equivalent to the shortcut command s3d).

Wanna put it back together? Append all the produced images along the y-axis, using the command append y.

[#1] box3d 100 +split3d

sprite3d

Converts the selected images into 3D sprites. Selected images that have alpha channels are handled (managed) properly, don't worry.

[#1] image.jpg sprite3d

sprites3d

[sprite],_sprite_has_alpha_channel={ 0:No | 1:Yes }

Converts the selected 3D objects into a sprite cloud. Set sprite_has_alpha_channel to 1 so the last channel of the selected sprite becomes a transparency mask.

Default value: mask_has_alpha_channel=0.

[#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]

star3d

_nb_branches>0,0<=_thickness<=1

Puts a 3D star at position (0,0,0) with the geometry you specify. Main character energy, obviously โœจ

Default values: nb_branches=5 and thickness=0.38.

[#1] star3d , +primitives3d 1 color3d[-2] ${-rgb}

streamline3d (+)

x[%],y[%],z[%],_L>=0,_dl>0,_interpolation,_is_backward={ 0:No | 1:Yes },_is_oriented={ 0:No | 1:Yes } |
'formula',x,y,z,_L>=0,_dl>0,_interpolation,_is_backward={ 0:No | 1:Yes },_is_oriented={ 0:No | 1:Yes }

Extracts 3D streamlines from the selected vector fields, or from the formula you give it. interpolation can be { 0:Nearest integer | 1:1st-order | 2:2nd-order | 3:4th-order }.

Default values: dl=0.1, interpolation=2, is_backward=0 and is_oriented=0.

[#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

-3d (+)

Shortcut for command sub3d. Yeah, the name starts with a dash, she's quirky like that.

sub3d (+)

tx,_ty,_tz

Shifts the selected 3D objects by the opposite of the displacement vector you give it (equivalent to the shortcut command 3d).

Default values: ty=tz=0.

[#1] sphere3d 10 repeat 5 { +sub3d[-1] 10,{u(-10,10)},0 color3d[-1] ${-rgb} } add3d

subdivide3d

Subdivides the primitives of the selected 3D objects. More primitives, more detail, more everything.

superformula3d

resolution>1,m>=1,n1,n2,n3

Puts a 2D superformula curve in as a 3D object. Yes, 2D curve, 3D object โ€” that's the bit, keep it.

Default values: resolution=1024, m=8, n1=1, n2=5 and n3=8.

[#1] superformula3d ,

surfels3d

0<=_left_right_attenuation<=1,0<=_top_bottom_attenuation<=1,0<=_closer_further_attenuation<=1

Converts the selected images into 3D objects made of 3D surfels (or 2D edgels for 2D images).

The binary shape is composed of all the non-zero voxels. The resulting 3D object gets colored according to the color of the non-zero voxels. Cute AND functional.

Default values: left_right_attenuation=1, top_bottom_attenuation=1 and closer_further_attenuation=1.

[#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

tensors3d

_radius_factor>=0,_shape={ 0:Box | >=N:Ellipsoid },_radius_min>=0

Generates 3D tensor fields from the selected images. When shape is >0, it gives the ellipsoid shape precision.

Default values: radius_factor=1, shape=2 and radius_min=0.05.

[#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

text_pointcloud3d

_"text1",_"text2",_smoothness

Puts in a 3D text pointcloud built from the two strings you specify.

Default values: text1="text1", text2="text2" and smoothness=1.

[#1] text_pointcloud3d "G'MIC","Rocks!"

text3d

text,_{ font_height>=0 | custom_font },_depth>0,_smoothness

Puts in a 3D text object from the text you give it. Typography but make it dimensional ๐Ÿ’…

Default values: font_height=53, depth=10 and smoothness=1.5.

[#1] text3d "G'MIC as a0D logo!"

t3d

Shortcut for command texturize3d.

texturize3d

[ind_texture],_[ind_coords]

Texturizes the selected 3D objects with the texture and coordinates you specify (equivalent to the shortcut command t3d).

When [ind_coords] is omitted, the default XY texture projection is what happens.

Default value: ind_coords=(undefined).

[#1] image.jpg torus3d 100,30 texturize3d[-1] [-2] keep[-1]

torus3d

_radius1,_radius2,_nb_subdivisions1>2,_nb_subdivisions2>2

Puts a 3D torus at (0,0,0) with the geometry you specify. Donut-shaped excellence ๐Ÿฉ

Default values: radius1=1, radius2=0.3, nb_subdivisions1=24 and nb_subdivisions2=12.

[#1] torus3d 10,3 +primitives3d 1 color3d[-2] ${-rgb}

triangle3d

x0,y0,z0,x1,y1,z1,x2,y2,z2

Puts a 3D triangle at the coordinates you specify. Three points, infinite potential.

[#1] repeat 100 { a:=$>*pi/50 triangle3d 0,0,0,0,0,3,{cos(3*$a)},{sin(2*$a)},0 color3d[-1] ${-rgb} } add3d

volume3d

Transforms the selected 3D volumetric images into 3D parallelepipedic objects. Flat things, but make it 3D.

[#1] image.jpg animate blur,0,5,30 append z volume3d

voxelize3d

_max_resolution>0,_fill_interior={ 0:No | 1:Yes },_preserve_colors={ 0:No | 1:Yes }

Converts the selected 3D objects into 3D volumetric images of binary voxels, using 3D mesh rasterization. Cube-ifying the whole situation fr fr ๐ŸงŠ

...and the defaults are max_resolution=128, fill_interior=1 and preserve_colors=0. That's the whole vibe check, bestie ๐Ÿซถ

Example time:

[#1] weird3d 48 +primitives3d 1 color3d[-2] ${-rgb}

๐ŸŽ€ 11.13. Flow Control ๐ŸŽ€

okay so this is the section where G'MIC stops being a filter list and starts being a whole language, and honestly? it ate ๐Ÿ’… loops, branches, error handling, threads โ€” the whole group chat. keep the little (+) tags on the names exactly how they're written, they're part of the name, no cap.

  • ap โ€” shortcut for command apply_parallel. that's it, that's the whole entry ๐Ÿ™ˆ
  • apply_parallel "command" โ€” apply specified command on each of the selected images, by parallelizing it for all images in the list. (equivalent to shortcut command ap). literally "go do this to everything, at the same time, bestie" โšก
[#1] image.jpg +mirror x +mirror y apply_parallel "blur 3"
  • apc โ€” shortcut for command apply_parallel_channels.
  • apply_parallel_channels "command" โ€” apply specified command on each of the selected images, by parallelizing it for all channel of the images independently. (equivalent to shortcut command apc). ๐Ÿฆ‹
[#1] image.jpg apply_parallel_channels "blur 3"
  • apo โ€” shortcut for command apply_parallel_overlap.
  • apply_parallel_overlap "command",overlap[%],nb_threads={ 0:Auto | 1 | 2 | 4 | 8 | 16 } โ€” apply specified command on each of the selected images, by parallelizing it on nb_threads overlapped sub-images. (equivalent to shortcut command apo). heads up: nb_threads must be a power of 2, no exceptions ๐Ÿ”ฅ

Default values: overlap=0,nb_threads=0.

[#1] image.jpg +apply_parallel_overlap "smooth 500,0,1",1
  • at โ€” shortcut for command apply_tiles.
  • apply_tiles "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 } โ€” apply specified command on each tile (neighborhood) of the selected images, optionally with overlapping tiles. (equivalent to shortcut command at). so many arguments, so little time ๐Ÿ˜ญ

Default values: tile_width=tile_height=tile_depth=10%,overlap_width=overlap_height=overlap_depth=0 and boundary_conditions=1.

[#1] image.jpg +equalize[0] 256 +apply_tiles[0] "equalize 256",16,16,1,50%,50%
  • apply_timeout "command",_timeout={ 0:No timeout | >0:With specified timeout (in seconds) } โ€” apply a command with a timeout. it sets the variable $_is_timeout to 1 if a timeout occurred, 0 otherwise. so you always know what happened ๐Ÿ’€

Default value: timeout=20.

  • check (+) condition โ€” evaluate specified condition and display an error message if it evaluated to false. tiny guardrail, huge energy ๐Ÿซถ
  • check3d (+) _is_full_check={ 0:No | 1:Yes } โ€” 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. slow and correct or fast and vibes, your call โœจ

Default value: is_full_check=1.

  • continue (+) โ€” go to end of current do...while, for...done, foreach...done, local...done or repeat...done block. skipping to the end of the paragraph like you do in every group chat ๐Ÿ˜Œ
[#1] image.jpg repeat 10 blur 1 if 1==1 continue fi deform 10 done
  • break (+) โ€” break current do...while, for...done, foreach...done, local...done or repeat...done block. the "i'm leaving" of control flow, iconic ๐ŸŒธ
[#1] image.jpg repeat 10 blur 1 if 1==1 break fi deform 10 done
  • do (+) โ€” start a do...while block.
[#1] image.jpg luminance i:=ia+2 do set 255,{u(100)}%,{u(100)}% while ia<$i
  • done (+) โ€” end a for/foreach/local/repeat...done block, and go to associated for/foreach/repeat if iterations remain. (equivalent to shortcut command }). yes, the shortcut is literally a curly brace, she's mysterious like that ๐Ÿ’…
  • elif (+) condition โ€” start a elif...[else]...fi block if previous if was not verified and test if specified condition holds. condition is a mathematical expression, whose evaluation is interpreted as { 0:False | other:True }.

Tutorial: https://gmic.eu/tutorial/iffi

  • else (+) โ€” execute following commands if previous if or elif conditions failed.

Tutorial: https://gmic.eu/tutorial/iffi

  • fi (+) โ€” end a if...[elif]...[else]...fi block. (equivalent to shortcut command fi).

Tutorial: https://gmic.eu/tutorial/iffi

  • error (+) message โ€” print specified error message on the standard error (stderr) and exit interpreter, except if error is caught by a onfail command. command selection (if any) stands for displayed call stack subset instead of image indices. so if you pass a selection here, it's not picking images โ€” it's picking which slice of the call stack gets shown ๐Ÿ“ฃ
  • eval (+) expression โ€” evaluate specified math expression. two flavors, bestie:
    • 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, eval is similar to fill without assigning the image values. ๐Ÿงฎ
  • x (+) โ€” shortcut for command exec.
  • exec (+) _is_verbose={ 0:No | 1:Yes },"command" โ€” execute external command using a system call. the status value is then set to the error code returned by the system call. if is_verbose=1, the executed command is allowed to output on stdout/stderr. (equivalent to shortcut command x). leaving the house, leaving the interpreter ๐Ÿšช

Default value: is_verbose=1.

  • xo โ€” shortcut for command exec_out.
  • exec_out _mode,"command" โ€” execute external command using a system call, and return resulting stdout and/or stderr. mode can be { 0:Stdout | 1:Stderr | 2:Stdout+stderr }. bringing the receipts back home ๐Ÿ’Œ
  • for (+) condition โ€” start a for...done block.
[#1] image.jpg rescale2d ,32 400,400,1,3 x=0 for $x<400 image[1] [0],$x,$x x+=40 done
  • foreach (+) โ€” start a foreach...done block, that iterates over all images in the selection, with a separate local environment for each one. one little private bubble per image, obsessed ๐Ÿซง
[#1] sample colorful,earth,duck,dog foreach[^2] +blur 10 sub normalize 0,255 done
  • if (+) condition โ€” start a if...[elif]...[else]...fi block and test if specified condition holds. condition is a mathematical expression, whose evaluation is interpreted as { 0:False | other:True }.
[#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

Tutorial: https://gmic.eu/tutorial/iffi

  • l (+) โ€” shortcut for command local.
  • local (+) โ€” start a local...[onfail]...done block, with selected images. (equivalent to shortcut command l). your own little room where the images can be weird in peace ๐ŸŽ€
[#1] image.jpg local[] 300,300,1,3 rand[0] 0,255 blur 4 sharpen 1000 done
[#2] image.jpg +local repeat 3 { deform 20 } done

Tutorial: https://gmic.eu/oldtutorial/_local

  • noarg (+) โ€” used in a custom command, noarg tells the command that its argument list has not ultimately been used, and so they must be evaluated next in the G'MIC 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. the indecisive friend, but make it a language feature ๐Ÿ˜…
  • onfail (+) โ€” execute following commands when an error is encountered in the body of the local...done block. the status value is set with the corresponding error message. the emotional support error handler fr fr ๐Ÿ’–
[#1] image.jpg +local blur -3 onfail mirror x done
  • parallel (+) _wait_threads,"command_1","command_2",... โ€” execute specified commands in parallel, each in a different thread. parallel threads share the list of images. wait_threads can be { 0:When current environment ends | 1:Immediately }. multithreading era โœจ

Default value: wait_threads=1.

[#1] image.jpg [0] parallel "blur[0] 3","mirror[1] c"
  • progress (+) 0<=value<=100 | -1 โ€” set the progress index of the current processing pipeline. this command is useful only when G'MIC is used by an embedding application. a little progress bar moment for the host app ๐ŸŒˆ
  • q (+) โ€” shortcut for command quit.
  • quit (+) โ€” quit G'MIC interpreter. (equivalent to shortcut command q). bye bestie ๐Ÿ‘‹
  • repeat (+) nb_iterations โ€” start nb_iterations iterations of a repeat...done block. nb_iterations is a mathematical expression that will be evaluated.
[#1] image.jpg split y repeat $! n=$> shift[$n] $<,0,0,0,2 done append y
[#2] image.jpg mode3d 2 repeat 4 imagecube3d rotate3d 1,1,0,40 snapshot3d 400,1.4 done

Tutorial: https://gmic.eu/oldtutorial/_repeat

  • return (+) โ€” return from current custom command. ๐Ÿƒโ€โ™€๏ธ
  • rprogress 0<=value<=100 | -1 | "command",0<=value_min<=100,0<=value_max<=100 โ€” set the progress index of the current processing pipeline (relatively to previously defined progress bounds), or call the specified command with specified progress bounds. the "relative to my last text" version of progress, iykyk ๐Ÿ’…
  • run "G'MIC pipeline" โ€” run specified G'MIC pipeline. pipeline-ception ๐ŸŒ€
  • skip (+) item โ€” do nothing but skip specified item. she said "not my problem" and moved on ๐Ÿ™ˆ
  • u (+) โ€” shortcut for command status.
  • status (+) status_string โ€” set the current status. used to define a returning value from a function. (equivalent to shortcut command u).
[#1] image.jpg command "foo : u0=Dark u1=Bright status ${u{ia>=128}}" text_outline ${-foo},2,2,23,2,1,255
  • while (+) condition โ€” end a do...while block and go back to associated do if specified condition holds. condition is a mathematical expression, whose evaluation is interpreted as { 0:False | other:True }. and we loop, and we loop, and we loop ๐Ÿ”

๐Ÿง  11.14. Neural Networks ๐Ÿง 

yes bestie, G'MIC has a neural network library. no i'm not kidding. welcome to the smart-kid table ๐Ÿ‘‘

  • nn_lib โ€” define the math functions that have to be included in a math expression, when using nn_lib, the G'MIC neural network library. it's giving "import the whole toolbox" ๐Ÿงฐ

Default value: mode=0.

  • nn_add out,in0,in1,_in2,_in3 โ€” add an add layer (element-wise addition) to the current network. the in_k arguments can be layer names or constant values (all cannot be constant values though). read that caveat again, bestie โ€” all of them can't be constants ๐Ÿ’€
  • nn_affine out,in,nb_channels>0,axis={ x | y | z | c },_learning_mode,_weight_decay>=0,_initialization

So yeah โ€” nn_affine says:

  • learning_mode can be one of { 0:No learning | 1:Weights only | 2:Biases only | 3:Weights+biases }
  • initialization can be one of { 0:Zero | 1:Identity | 2:Lecun-initialization | 3:He-initialization | 4:Residual He-initialization }
Heads up bestie: biases are always allocated, so if you want a pure linear layer you gotta pass learning_mode=1 (that's the one that uses zero-initialized biases). โœจ

Default value: learning_mode=3, weight_decay=0 and initialization=3.


๐ŸŽ€ nn_alias

out,in

Adds an alias layer to your current network โ€” it literally just creates a layer name alias, iykyk. No cap, that's the whole job. ๐Ÿ’…


๐Ÿฆ‹ nn_append

out,in0,in1,_in2,_in3,axis={ x | y | z | c }

Adds an append layer to the current network.

Tiny vibe check tho: all the input layers in_k must have same dimensions โ€” except along the specified axis, obvi. ๐ŸŒธ


๐ŸŒˆ nn_check_layer

layer_name

Checks that the network layer with the name you specified actually exists. It's giving bouncer-at-the-club energy. ๐Ÿ”ฅ


๐ŸŽ€ nn_clone

out0,_out1,_out2,_out3,in

Adds a clone layer to the current network.

This layer clones the input as one to four outputs. Iconic copy-paste behavior, honestly. โœจ


๐Ÿ’œ nn_conv

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>0,_dilation_y>0,_dilation_z>0,
  _shrink_x>=0,_shrink_y>=0,_shrink_z>=0,_boundary_conditions,_learning_mode,_weight_decay>=0,_initialization,_groups_c>0

Adds a conv layer (the generic 1D/2D/3D convolutional layer) to the current network. Very main character of it.

  • boundary_conditions can be { 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }
  • learning_mode can be { 0:No learning | 1:Weights only | 2:Biases only | 3:Weights+biases }
  • initialization can be { 0:Zero | 1:Identity | 2:Lecun-initialization | 3:He-initialization | 4:Residual He-initialization }

groups_c is the number of groups of the (grouped) convolution. It must divide both the number of input channels and nb_channels. So:

  • groups_c=1 โ†’ a standard convolution
  • groups_c=nb_channels=(number of input channels) โ†’ a depthwise convolution, slay ๐Ÿ’…

Default values: stride_x=stride_y=stride_z=1, dilation_x=dilation_y=dilation_z=1, shrink_x=shrink_y=shrink_z=0, boundary_conditions=0, learning_mode=3, weight_decay=0, initialization=3 and groups_c=1.


๐Ÿ“ nn_conv2d

out,in,nb_channels>0,_kernel_size>0,_stride>0,_dilation>0,_shrink>=0,_boundary_conditions,_learning_mode,_weight_decay>=0,_initialization,_groups_c>0

Adds a conv2d layer (2D convolutional layer) to the current network.

  • boundary_conditions can be { 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }
  • learning_mode can be { 0:No learning | 1:Weights only | 2:Biases only | 3:Weights+biases }
  • initialization can be { 0:Zero | 1:Identity | 2:Lecun-initialization | 3:He-initialization | 4:Residual He-initialization }

groups_c is the number of groups of the (grouped) convolution, and it must divide both the number of input channels and nb_channels. Same deal as before: groups_c=1 is a standard convolution, and groups_c=nb_channels=(number of input channels) is a depthwise convolution. ๐Ÿ’–

Default values: kernel_size=3, stride=1, dilation=1, shrink=0, boundary_conditions=0, learning_mode=3, weight_decay=0, initialization=3 and groups_c=1.


๐Ÿงš nn_conv3d

out,in,nb_channels>0,_kernel_size>0,_stride>0,_dilation>0,_shrink>=0,_boundary_conditions,_learning_mode,_weight_decay>=0,_initialization,_groups_c>0

Adds a conv3d layer (3D convolutional layer) to the current network. Yes bestie, three whole dimensions, we're thriving. ๐Ÿฆ‹

  • boundary_conditions can be { 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }
  • learning_mode can be { 0:No learning | 1:Weights only | 2:Biases only | 3:Weights+biases }
  • initialization can be { 0:Zero | 1:Identity | 2:Lecun-initialization | 3:He-initialization | 4:Residual He-initialization }

groups_c is the number of groups of the (grouped) convolution; it must divide both the number of input channels and nb_channels. groups_c=1 = a standard convolution, groups_c=nb_channels=(number of input channels) = a depthwise convolution. ๐Ÿ’…

Default values: kernel_size=3, stride=1, dilation=1, shrink=0, boundary_conditions=0, learning_mode=3, weight_decay=0, initialization=3 and groups_c=1.


๐ŸŒธ nn_crop

out,in,x0,y0,z0,c0,x1,y1,z1,c1,_boundary_conditions

Adds a crop layer to the current network.

boundary_conditions can be { 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }.

Default value: boundary_conditions=0.


โญ nn_div

out,in0,in1

Adds a div layer (element-wise division) to the current network.

Little note: in0 or in1 can be layer names or constant values โ€” but both cannot be constant values though. ๐Ÿ™ˆ (Can't divide vibes by vibes, apparently.)


๐Ÿฉท nn_dropout

out,in,0<=dropout_rate<1,_axes

Adds a dropout layer to the current network. Bye bestie, hope you don't come back ๐Ÿ‘‹ ๐Ÿ˜ญ

axes is a combination of { x | y | z | c } (e.g. xyz, c, xzc), or 0, and it gives the axes along which the same dropout decision is shared:

  • 0 โ†’ one decision per element
  • xyz โ†’ per channel (this is the default)
  • xyzc โ†’ whole layer (drop path)

๐Ÿ’œ nn_fc

out,in,nb_channels>0,_learning_mode,_weight_decay>=0,_initialization,_groups>0

Adds a fc layer (fully connected layer) to the current network. Fully connected, fully committed. ๐Ÿซถ

  • learning_mode can be { 0:No learning | 1:Weights only | 2:Biases only | 3:Weights+biases }
  • initialization can be { 0:Zero | 1:Identity | 2:Lecun-initialization | 3:He-initialization | 4:Residual He-initialization }

groups is the number of groups โ€” and the input size and nb_channels must be divisible by it.

Default value: learning_mode=3, weight_decay=0, initialization=3 and groups=1.


๐ŸŒˆ nn_fft

out,in,io_mode,_is_inverse={ 0:No | 1:Yes },_axes

Adds a fft layer (Fourier Transform) to the current network. Math girlies rise โœจ

The argument io_mode tells you about the meaning of the input/output data. It can be:

  • 0 โ†’ real โ†’ real
  • 1 โ†’ (real,imag) โ†’ real
  • 2 โ†’ real โ†’ (real, imag)
  • 3 โ†’ (real,imag) โ†’ (real,imag)

When you're dealing with (real,imag) data, the real and imaginary parts of the data (N channels each) are concatenated into a 2N-channels image. Lowkey genius.

The argument axes can be { 0 (all) | x | y | z | xy | xz | yz | xyz }.

Default value: is_inverse=0, axes=0 (all).


๐ŸŽ€ nn_init

_network_name

Initializes a new network with the specified name, and selects it as the current one. Fresh start era ๐Ÿ’…

Default value: network_name=nn.


๐Ÿฆ‹ nn_input

out,width,_height,_depth,_spectrum

Adds a new input to the current network.

Default values: height=1, depth=1 and spectrum=1.


๐Ÿ“ nn_load

'filename.gmz',_include_trainer_data={ 0:No | 1:Yes }

Loads and initializes a network (saved as a .gmz file).

Real talk: network files can be only loaded in .gmz format. No other format is getting in, periodt.

Default value: include_trainer_data=1.


๐Ÿ”ฅ nn_loss_add

out,in0,in1,...

Adds an add loss to the current network (sum of losses). It's literally just sum. Slay. โœจ


๐Ÿ’– nn_loss_bce

out,in,ground_truth,_weight

Adds a bce loss to the current network (binary cross entropy).

ground_truth can be a layer name, a variable name, or a scalar value.

Default value: weight=1.


๐ŸŒธ nn_loss_ce

out,in,ground_truth,_weight

Adds a ce loss to the current network (cross entropy).

ground_truth can be a layer name, a variable name, or a scalar value.

Default value: weight=1.


โญ nn_loss_l1

out,in,ground_truth,_weight

Adds a l1 loss to the current network (L1-norm).

ground_truth can be a layer name, a variable name, or a scalar value.

Default value: weight=1.


๐Ÿ’œ nn_loss_l2

out,in,ground_truth,_weight

Adds a l2 loss to the current network (L2-norm).

ground_truth can be a layer name, a variable name, or a scalar value.

Default value: weight=1.


๐Ÿงš nn_loss_lp

out,in,ground_truth,_p>0,_weight

Adds a lp loss to the current network (Lp-norm). Yes, the p is a parameter, we love a flexible icon ๐Ÿ’…

ground_truth can be a layer name, a variable name, or a scalar value.

Default value: p=1.5 and weight=1.


๐Ÿฉท nn_loss_mse

out,in,ground_truth,_weight

Adds a mse loss to the current network (mean-squared error).

ground_truth can be a layer name, a variable name, or a scalar value.

Default value: weight=1.


๐ŸŽ€ nn_loss_sigmoid_bce

out,in,ground_truth,_weight

Adds a sigmoid_bce loss to the current network (sigmoid followed by binary cross entropy).

ground_truth can be a layer name, a variable name, or a scalar value. Its value correspond to the desired probability (so, after the sigmoid). ๐Ÿซถ

Default value: weight=1.


๐Ÿฆ‹ nn_loss_smoothl1

out,in,ground_truth,_beta>0,_weight

Adds a smoothl1 loss to the current network (smooth L1-norm).

ground_truth can be a layer name, a variable name, or a scalar value.

Default values: beta=0.1 and weight=1.


๐ŸŒˆ nn_loss_softmax_ce

out,in,ground_truth,_weight

Adds a softmax_ce loss to the current network (softmax followed by cross entropy).

ground_truth can be a layer name, a variable name, or a scalar value.

Default value: weight=1.


๐Ÿ“ nn_matpatch2d

out,in,out_width>0,out_height>0,patch_size>0,0<=_overlap<patch_size,_arrangement={ 0:patch-as-column | 1:patch-as-row }

Adds a matpatch2d layer (rearrangement of matrix columns/rows as image patches) to the current network.

It's the inverse of nn_patch2dmat, bestie โ€” and overlapping patches are averaged. ๐Ÿซถ

See also: nn_patch2dmat.

Default values: overlap=0 and arrangement=1.


๐Ÿ’œ nn_maxpool2d

out,in,_patch_size>1,_is_maxabs={ 0:No | 1:Yes },_is_ceil={ 0:No | 1:Yes }

Adds a maxpool2d layer (2D max pooling) to the current network.

Vibe check on the borders: if is_ceil=1, partial patches at the image borders are pooled too (output size = ceil(size/patch_size)), otherwise they are dropped (output size = floor(size/patch_size)). ๐Ÿ‘‘

Default values: patch_size=2, is_maxabs=0 and is_ceil=0.


๐Ÿ”ฅ nn_maxpool3d

out,in,_patch_size>1,_is_maxabs={ 0:No | 1:Yes },_is_ceil={ 0:No | 1:Yes }

Adds a maxpool3d layer (3d max pooling) to the current network.

Same border rules, except now it's a volume: if is_ceil=1, partial patches at the volume borders are pooled too (output size = ceil(size/patch_size)), otherwise they are dropped (output size = floor(size/patch_size)). ๐Ÿ’…

Default values: patch_size=2, is_maxabs=0 and is_ceil=0.


โœจ nn_mmul

out,in0,in1
  • nn_mmul โ€” out,in0,in1 โ€” adds a mmul layer that does matrix multiplication in0*in1 to the current network. in0 or in1 must be of compatible size. ๐Ÿ’…
  • nn_mmult โ€” out,in0,in1 โ€” adds a mmult layer that does matrix multiplication in0*in1^t to the current network. in0 or in1 must be of compatible size. โœจ
  • nn_mul โ€” out,in0,in1,_in2,_in3 โ€” adds a mul layer (element-wise multiplication) to the current network. The in_k arguments can be layer names or constant values (but all of them canโ€™t be constant values, bestie). ๐Ÿซถ
  • nn_network โ€” _network_name โ€” get/set the current network name (and initialize the network if it doesnโ€™t already exist). This command returns the name of the currently selected network. ๐Ÿ‘‘
  • nn_nl โ€” out,in,_activation โ€” adds a nl layer (nonlinearity) to the current network. activation can be { elu | gelu | hardsigmoid | hardswish | leakyrelu | linear | logabs | 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 | tanhz3 | z2 | z3 | zpsinz }. Default value: activation=leakyrelu. ๐ŸŒธ
  • nn_noise โ€” out,in,_amplitude,_noise_type,_training_only={ 0:No | 1:Yes } โ€” adds a noise layer to the current network. noise_type can be { 0:Gaussian | 1:Uniform | 2:Salt&pepper | 3:Poisson | 4:Rice }. If training_only is set, the noise is applied to the input only during the network training phase. Default values: amplitude=0.1, noise_type=0 and training_only=1. ๐ŸŽ€
  • nn_norm โ€” out,in,p>=0,_axis={ 0 | x | y | z | c } โ€” adds a norm layer (Lp-norm computation) to the current network. p can be { 0:Sum of squares | >0:Lp-norm }. Default values: p=2 and axis=0. ๐Ÿ’–
  • nn_normalize โ€” out,in,axes,_normalization_type,_groups_x>=0,_groups_y>=0,_groups_z>=0,_groups_c>=0,_learning_mode โ€” adds a normalize layer to the current network. This normalization layer is generic and can simulate the behavior of a LayerNorm, an InstanceNorm, a GroupNorm, or an RMSNorm. axes defines the shape used to compute the mean/std of the normalization. axes can be { x | y | z | c | xy | xz | xc | yz | yc | zc | xyz | xyc | xzc | yzc | xyzc }. For instance:
    • axes=c means the vector-valued pixels of the input image are normalized independently, according to the channel values.
    • axes=xyz means each input channel of the input image is normalized independently, according to all (x,y,z) pixel values.

normalization_type can be { 0:Avg_std | 1:RMS | 2:Affine | 3:Linear }:

  • 0: Normalization by mean/std, followed by the affine transform gamma*x + beta.
  • 1: RMS normalization, followed by the linear transform gamma*x.
  • 2: No normalization, only the affine transform gamma*x + beta is applied.
  • 3: No normalization, only the linear transform gamma*x is applied.

For types 2 and 3, axes (and groups_*) only define along which dimensions the gamma (and beta) parameters are shared. When different from 0, a groups_* argument forces the corresponding complementary axis to be split into N groups. N must divide the corresponding input dimension, and a groups_* argument cannot be set for an axis that is already listed in axes. learning_mode can be { 0:No learning | 1:Gamma only | 2:Beta only | 3:Gamma+beta }. Default values: normalization_type=0, groups_x=groups_y=groups_z=groups_c=0 and learning_mode=3. ๐Ÿฆ‹

  • nn_parameters โ€” out,width>0,_height>0,_depth>0,_spectrum>0,_learning_mode,_weight_decay>=0,_initialization โ€” adds a parameters layer (4D grid of learnable parameters) to the current network. learning_mode can be { 0:No learning | 1:Weights }. initialization can be { 0:Zero | 1:Identity | 2:Lecun-initialization | 3:He-initialization | 4:Residual He-initialization }. Default values: height=depth=spectrum=1, learning_mode=1, weight_decay=0 and initialization=3. ๐Ÿ”ฅ
  • nn_patchdown2d โ€” out,in,_patch_size>1 โ€” adds a patchdown2d layer (2D downscale by patch) to the current network. Default value: patch_size=2. ๐ŸŒˆ
  • nn_patchdown3d โ€” out,in,_patch_size>1 โ€” adds a patchdown3d layer (3D downscale by patch) to the current network. Default value: patch_size=2. โญ
  • nn_patch2dmat โ€” out,in,patch_size>0,0<=_overlap<patch_size,_arrangement={ 0:patch-as-column | 1:patch-as-row } โ€” adds a patch2dmat layer (rearrangement of image patches as matrix columns or rows) to the current network. If arrangement=0, each patch is a column of the output matrix (width=nb_patches, height=patch_size^2*spectrum). If arrangement=1, each patch is a row of the output matrix (width=patch_size^2*spectrum, height=nb_patches). Default values: overlap=0 and arrangement=1. ๐Ÿงš
  • nn_patchup2d โ€” out,in,_patch_size>1 โ€” adds a patchup2d layer (2D upscale by patch) to the current network. Default value: patch_size=2. ๐Ÿ’œ
  • nn_patchup3d โ€” out,in,_patch_size>1 โ€” adds a patchup3d layer (3D upscale by patch) to the current network. Default value: patch_size=2. ๐Ÿ“
  • nn_permute โ€” out,in,permutation โ€” adds a permute layer (axes permutation) to the current network. ๐Ÿ’ซ
  • nn_print โ€” no args โ€” prints info on the current network. ๐Ÿ–จ๏ธ
  • nn_reshape โ€” out,in,width>0,_height>0,_depth>0,_spectrum>0 โ€” adds a reshape layer to the current network. Default values: height=depth=spectrum=1. โœจ
  • nn_resize โ€” out,in,width[%]>0,_height[%]>0,_depth[%]>0,_spectrum[%]>0,_interpolation โ€” adds a resize layer to the current network. interpolation can be { -1:None (memory content) | 0:None | 1:Nearest | 2:Average | 3:Linear | 4:Grid | 5:Bicubic | 6:Lanczos }. Default values: height=depth=spectrum=100% and interpolation=3. ๐ŸŒธ
  • nn_run โ€” out,in,"command",_width[%]>0,_height[%]>0,_depth[%]>0,_spectrum[%]>0 โ€” adds a run layer to the current network. Default values: width=height=depth=spectrum=100%. ๐Ÿƒโ€โ™€๏ธ
  • nn_save โ€” 'filename.gmz',_include_trainer_data={ 0:No | 1:Yes } โ€” saves the current network as a .gmz file. .gmz is a mandatory extension โ€” specifying another file extension will throw an error. Default value: include_trainer_data=1. ๐Ÿ’พ
  • nn_size โ€” no args โ€” returns the size of the current network (i.e. number of stored parameters). ๐Ÿ“
  • nn_split โ€” out0,out1,_out2,_out3,in,axis={ x | y | z | c },_size_out0>0,_size_out1>0,_size_out2>0,_size_out3>0 โ€” adds a split layer to the current network. Default values: unspecified sizes split equally the remaining size along axis (the remainder, if any, is added to the first unspecified output). โœ‚๏ธ
  • nn_store โ€” 'variable_name',_include_trainer_data={ 0:No | 1:Yes } โ€” stores the current network into a variable. Default value: include_trainer_data=1. ๐Ÿ“ฆ
  • nn_sub โ€” out,in0,in1 โ€” adds a sub layer (element-wise subtraction) to the current network. in0 or in1 can be layer names or constant values (both cannot be constant values though). โž–
  • nn_sum โ€” out,in,_is_average={ 0:No | 1:Yes },_axis={ 0 | x | y | z | c } โ€” adds a sum layer (sum or average computation) to the current network. Default values: is_average=0 and axis=0. โž•
  • nn_tmmul โ€” out,in0,in1 โ€” adds a tmmul layer (matrix multiplication in0^t.in1) to the current network. in0 or in1 must be of compatible size. ๐Ÿ”
  • nn_tmmult โ€” out,in0,in1 โ€” adds a tmmult layer (matrix multiplication in0^t.in1^t) to the current network. in0 or in1 must be of compatible size. ๐Ÿ”„
  • nn_transpose โ€” out,in โ€” adds a transpose layer (matrix transpose) to the current network. ๐Ÿ”ƒ
  • nn_trainer โ€” out,_loss,_optimizer,_"optimizer_params",_scheduler,_"scheduler_params" โ€” adds a network trainer to the current network, with specified optimizer and scheduler. optimizer can be { adam | adamax | rmsprop | sgd }. scheduler can be { constant | adaptive }.
    • Value of optimizer_params depends on the chosen optimizer:
      • adam, adamax: (learning_rate,beta1,beta2,weight_decay,clip_gradient_min,clip_gradient_max).
      • rmsprop: (learning_rate,momentum,beta,weight_decay,clip_gradient_min,clip_gradient_max).
      • sgd: (learning_rate,momentum,weight_decay,clip_gradient_min,clip_gradient_max).
    • Value of scheduler_params depends on the chosen scheduler:
      • constant: (none).
      • adaptive: (lr_min,lr_max,nb_warmup_iterations,nb_cooldown_iterations,patience_down,factor_down,patience_up,factor_up).

Default values: optimizer=adam, optimizer_params=(default), scheduler=constant and scheduler_params=(default). ๐Ÿง 

  • nn_varname โ€” layer_name,_accept_nonlayer_variable_name={ 0:False | 1:True } โ€” returns the variable name used in the math evaluator to store the output of the specified network layer. Default value: accept_nonlayer_variable_name=0. ๐Ÿท๏ธ

๐ŸŒˆ 11.15. Arrays, Tiles and Frames ๐ŸŒˆ

  • array โ€” M>0,_N>0,_expand_type={ 0:Min | 1:Max | 2:All } โ€” creates an MxN array from selected images. Default values: N=M and expand_type=0.

Example:

[#1] image.jpg array 3,2,2
  • array_fade โ€” M>0,_N>0,0<=_fade_start<=100,0<=_fade_end<=100,_expand_type={0:Min | 1:Max | 2:All} โ€” creates an MxN array from selected images. Default values: N=M, fade_start=60, fade_end=90 and expand_type=1.

Example:

[#1] image.jpg array_fade 3,2
  • array_mirror โ€” N>=0,_dir={ 0:X | 1:Y | 2:XY | 3:Tri-XY },_expand_type={ 0:No | 1:Yes } โ€” creates a 2^Nx2^N array from selected images. Default values: dir=2 and expand_type=0.

Example:

[#1] image.jpg array_mirror 2
  • array_random โ€” Ms>0,_Ns>0,_Md>0,_Nd>0 โ€” creates an MdxNd array of tiles from selected MsxNs source arrays. Default values: Ns=Ms, Md=Ms and Nd=Ns.

Example:

[#1] image.jpg +array_random 8,8,15,10
  • frame โ€” axes,size[%]>=0,_col1,...,_colN โ€” inserts an outer frame in selected images, along the specified axes. axes can be { x | y | z | xy | xz | yz | xyz }. ๐Ÿ–ผ๏ธ

โ€ฆand the very last of its defaults lands like this:

Default value: 'axes=xy', 'size=10%', 'col1=col2=col3=col4=255'.

โœจ Example โœจ

[#1] image.jpg frame xy,10%,255,128,0

๐ŸŽ€ frame_blur ๐ŸŽ€

_sharpness>0,_size>=0,_smoothness,_shading,_blur

Draws an RGBA-colored round frame in the selected images. Soft-focus frame moment ๐Ÿ’–

Default values: 'sharpness=10', 'size=30', 'smoothness=0', 'shading=1' and 'blur=3%'.

Example:

[#1] image.jpg frame_blur 3,30,8,10%

๐ŸงŠ frame_cube ๐ŸงŠ

_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

Insert 3D frames in the selected images. It's giving gallery installation, no cap ๐Ÿ–ผ๏ธ

Default values: 'depth=1', 'centering_x=centering_y=0' and 'left_side=right_side,lower_side=upper_side=0'.

Example:

[#1] image.jpg frame_cube ,

๐Ÿฆ‹ frame_fuzzy ๐Ÿฆ‹

size_x[%]>=0,_size_y[%]>=0,_fuzziness>=0,_smoothness[%]>=0,_R,_G,_B,_A

Draws an RGBA-colored fuzzy frame in the selected images. Furry little border, highkey adorable ๐Ÿฐ

Default values: 'size_y=size_x', 'fuzziness=5', 'smoothness=1' and 'R=G=B=A=255'.

Example:

[#1] image.jpg frame_fuzzy 20

๐ŸŽจ frame_painting ๐ŸŽจ

_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

Adds a painting frame to the selected images โ€” like your pic got hung up in a lil museum, periodt ๐Ÿ›๏ธ

Default values: 'size=10%', 'contrast=0.4', 'profile_smoothness=6%', 'R=225', 'G=200', 'B=120', 'vignette_size=2%', 'vignette_contrast=400', 'defects_contrast=50', 'defects_density=10', 'defects_size=1', 'defects_smoothness=0.5%' and 'serial_number=123456789'.

Example:

[#1] image.jpg frame_painting ,

๐ŸŒธ frame_pattern ๐ŸŒธ

M>=3,_constrain_size={ 0:No | 1:Yes } |
M>=3,_[frame_image],_constrain_size={ 0:No | 1:Yes }

Inserts the selected pattern frame into the selected images โœจ

Default values: 'pattern=0' and 'constrain_size=0'.

Example:

[#1] image.jpg frame_pattern 8

๐Ÿ’… frame_round ๐Ÿ’…

size_x[%]>=0,size_y[%]>=0,radius[%]>=0,_smoothness[%]>=0,_col1,...,_colN

Inserts an inner round frame in the selected images โ€” literally the rounded-corner aesthetic we deserve ๐Ÿซถ

Default values: 'size_x=size_y=5%', 'radius=30%', 'smoothness=0' and 'col=0,0,0,255'.


๐Ÿงš frame_seamless ๐Ÿงš

frame_size>=0,_patch_size>0,_blend_size>=0,_frame_direction={ 0:Inner (preserve image size) | 1:Outer }

Inserts a frame into the selected images so that tiling the resulting image makes the seams less visible. Sneaky seamless slay ๐Ÿช„

Default values: 'patch_size=7', 'blend_size=5' and 'frame_direction=1'.

Example:

[#1] image.jpg +frame_seamless 30 array 2,2

๐Ÿ’€ img2ascii ๐Ÿ’€

_charset,_analysis_scale>0,_analysis_smoothness[%]>=0,_synthesis_scale>0,_output_ascii_filename

Renders the 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. Terminal-core, honestly iconic ๐Ÿ–ฅ๏ธ

Default values: 'charset=[ascii charset]', 'analysis_scale=16', 'analysis_smoothness=20%', 'synthesis_scale=16' and '_output_ascii_filename=[undefined]'.

Example:

[#1] image.jpg img2ascii ,

๐Ÿ–ผ๏ธ imagegrid ๐Ÿ–ผ๏ธ

M>0,_N>0

Creates an MxN image grid from the selected images ๐Ÿ“ธ

Default value: 'N=M'.

Example:

[#1] image.jpg imagegrid 16

๐Ÿ imagegrid_hexagonal ๐Ÿ

_resolution>0,0<=_outline<=1

Creates a hexagonal grids from the selected images โ€” hive vibes, bestie ๐Ÿฏ

Default values: 'resolution=32', 'outline=0.1' and 'is_antialiased=1'.

Example:

[#1] image.jpg imagegrid_hexagonal 24

๐Ÿ”บ imagegrid_triangular ๐Ÿ”บ

pattern_width>=1,_pattern_height>=1,_pattern_type,0<=_outline_opacity<=1,_outline_color1,...

Creates triangular grids from the selected images. 'pattern type' can be { 0:Horizontal | 1:Vertical | 2:Crossed | 3:Cube | 4:Decreasing | 5:Increasing }.

Default values: 'pattern_width=24', 'pattern_height=pattern_width', 'pattern_type=0', 'outline_opacity=0.1' and 'outline_color1=0'.

Example:

[#1] image.jpg imagegrid_triangular 6,10,3,0.5

๐ŸŒˆ map_sprites ๐ŸŒˆ

_nb_sprites>=1,_allow_rotation={ 0:None | 1:90 deg. | 2:180 deg. }

Maps a set of sprites (defined as the 'nb_sprites' latest images of the selection) to other selected images, according to the luminosity of their pixel values โœจ

Example:

[#1] image.jpg rescale2d ,48 repeat 16 ball {8+2*$>},${-rgb} mul[-1] {(1+$>)/16} done map_sprites 16

๐Ÿ“ฆ pack ๐Ÿ“ฆ

is_ratio_constraint={ 0:No | 1:Yes },_sort_criterion

Packs the selected images into a single image. The returned status contains the list of new (x,y) offsets for each input image. Parameter 'is_ratio_constraint' indicates whether the resulting image should tend toward a square. Jigsaw queen behavior ๐Ÿงฉ

Default values: 'is_ratio_constraint=0' and 'sort_criterion=max(w,h)'.

Example:

[#1] image.jpg repeat 10 +rescale2d[-1] 75% balance_gamma[-1] ${-rgb} done pack 0

๐Ÿงฉ puzzle ๐Ÿงฉ

_width>0,_height>0,_M>=1,_N>=1,_curvature,_centering,_connectors_variability,_resolution>=1

Generates a binary puzzle mask with the specified size and geometry ๐ŸŽ€

Default values: 'width=height=512', 'M=N=5', 'curvature=0.5', 'centering=0.5', 'connectors_variability=0.5' and 'resolution=64'.

Example:

[#1] puzzle ,

๐ŸŒ€ rotate_tiles ๐ŸŒ€

angle,_M>0,N>0

Applies an MxN tiled-rotation effect on the selected images โ€” dizzy but make it fashion ๐Ÿ’ซ

Default values: 'M=8' and 'N=M'.

Example:

[#1] image.jpg to_rgba rotate_tiles 10,8 drop_shadow 10,10 display_rgba

โ†”๏ธ shift_tiles โ†”๏ธ

M>0,_N>0,_amplitude

Applies an MxN tiled-shift effect on the selected images ๐Ÿชฉ

Default values: 'N=M' and 'amplitude=20'.

Example:

[#1] image.jpg +shift_tiles 8,8,10

๐Ÿงธ taquin ๐Ÿงธ

M>0,_N>0,_remove_tile={ 0:None | 1:First | 2:Last | 3:Random },_relief,_border_thickness[%],_border_outline[%],_outline_color

Creates an MxN taquin puzzle from the selected images โ€” sliding puzzle era ๐Ÿ”ฅ

Default value: 'N=M', 'relief=50', 'border_thickness=5', 'border_outline=0' and 'remove_tile=0'.

Example:

[#1] image.jpg +taquin 8

๐Ÿ•ณ๏ธ tunnel ๐Ÿ•ณ๏ธ

_level>=0,_factor>0,_centering_x,_centering_y,_opacity,_angle

Applies a tunnel effect on the selected images โ€” main character falling into the void, lowkey stunning ๐ŸŒŒ

Default values: 'level=9', 'factor=80%', 'centering_x=centering_y=0.5', 'opacity=1' and 'angle=0'

Example:

[#1] image.jpg tunnel 20

๐ŸŽจ 11.16. Artistic ๐ŸŽจ


๐ŸŸฆ boxfitting ๐ŸŸฆ

_min_box_size>=1,_max_box_size>=0,_initial_density>=0,_min_spacing>0

Applies a box fitting effect on the selected images, as shown on the web page: http://www.complexification.net/gallery/machines/boxFittingImg/.

Default values: 'min_box_size=1', 'max_box_size=0', 'initial_density=0.25' and 'min_spacing=1'.

Example:

[#1] image.jpg boxfitting ,

๐Ÿ–Œ๏ธ brushify ๐Ÿ–Œ๏ธ

[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

Applies the specified brush to create painterly versions of the specified images ๐ŸŽจ 'brush_light_type' can be { 0:None | 1:Flat | 2:Darken | 3:Lighten | 4:Full }.

Default values: 'brush_nb_sizes=3', 'brush_min_size_factor=0.66', 'brush_nb_orientations=12', 'brush_light_type=0', 'brush_light_strength=0.25', 'brush_opacity=0.8', 'painting_density=20%', 'painting_contours_coherence=0.9', 'painting_orientation_coherence=0.9', 'painting_coherence_alpha=1', 'painting_coherence_sigma=1', 'painting_primary_angle=0', 'painting_angle_dispersion=0.2'

Example:

[#1] image.jpg 40,40 gaussian[-1] 10,4 spread[-1] 10,0 brushify[0] [1],1

๐Ÿ“บ cartoon ๐Ÿ“บ

_smoothness,_sharpening,_threshold>=0,_thickness>=0,_color>=0,quantization>0

Applies a cartoon effect on the selected images โ€” Saturday morning energy fr fr ๐Ÿ“

Default values: 'smoothness=3', 'sharpening=150', 'threshold=20', 'thickness=0.25', 'color=1.5' and 'quantization=8'.

Example:

[#1] image.jpg cartoon 3,50,10,0.25,3,16

๐Ÿซง color_ellipses ๐Ÿซง

_count>0,_radius>=0,_opacity>=0

Adds random colored ellipses to the selected images โ€” confetti but make it fine art ๐ŸŽŠ

Default values: 'count=400', 'radius=5' and 'opacity=0.1'.

Example:

[#1] image.jpg +color_ellipses ,,0.15

๐Ÿ”ท cubism ๐Ÿ”ท

_density>=0,0<=_thickness<=50,_max_angle,_opacity,_smoothness>=0

Applies a cubism effect on the selected images โ€” Picasso would be obsessed, ngl ๐Ÿ–ผ๏ธ

Default values: 'density=50', 'thickness=10', 'max_angle=75', 'opacity=0.7' and 'smoothness=0'.

Example:

[#1] image.jpg cubism ,

๐ŸŒช๏ธ draw_whirl ๐ŸŒช๏ธ

_amplitude>=0

Applies a whirl drawing effect on the selected images ๐Ÿ’ซ

Default value: 'amplitude=100'.

Example:

[#1] image.jpg draw_whirl ,

๐ŸŒ‘ drop_shadow ๐ŸŒ‘

_offset_x[%],_offset_y[%],_smoothness[%]>=0,_curvature_x,_curvature_y,_expand_size={ 0:No | 1:Yes }

Drop shadow behind the selected images โ€” yes this command shows up twice in this page, and yes both versions are getting their moment ๐Ÿ’–

Default values: 'offset_x=20', 'offset_y=offset_x', 'smoothness=5', 'curvature=0' and 'expand_size=1'.

Example:

[#1] image.jpg drop_shadow 10,20,5,0.5 expand. xy,20 display_rgba

๐ŸŒ’ drop_shadow ๐ŸŒ’

_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 }

Drop shadow behind the selected images (the extended cut, with layered output ๐ŸŽฌ).

Default values: 'offset_x=20', 'offset_y=offset_x', 'smoothness=5', 'curvature_x=curvature_y=0', 'expand_size=1' and 'output_separate_layers=0'.

Example:

[#1] image.jpg drop_shadow 10,20,5,0.5 display_rgba

๐Ÿฅš ellipsionism ๐Ÿฅš

_R[%]>0,_r[%]>0,_smoothness[%]>=0,_opacity,_outline>0,_density>0

Applies the ellipsionism filter to the selected images ๐ŸŒธ

Default values: 'R=10', 'r=3', 'smoothness=1%', 'opacity=0.7', 'outline=8' and 'density=0.6'.

Example:

[#1] image.jpg ellipsionism ,

๐Ÿ”ฅ fire_edges ๐Ÿ”ฅ

_edges>=0,0<=_attenuation<=1,_smoothness>=0,_threshold>=0,_nb_frames>0,_starting_frame>=0,frame_skip>=0

Generates a fire effect from the edges of the selected images โ€” literally setting the edges ablaze, it's giving spicy ๐ŸŒถ๏ธ๐Ÿ”ฅ

Default values: 'edges=0.7', 'attenuation=0.25', 'smoothness=0.5', 'threshold=25', 'nb_frames=1', 'starting_frame=20' and 'frame_skip=0'.

Example:

[#1] image.jpg fire_edges ,

๐Ÿฆ  fractalize ๐Ÿฆ 

0<=detail_level<=1

Randomly fractalize the selected images ๐ŸŒ€

Default value: 'detail_level=0.8'

For fractalize, the example is literally this:

[#1] image.jpg fractalize ,
  • glow ๐Ÿ’– โ€” signature: _amplitude>=0. Adds soft glow on selected images. Default: 'amplitude=1%'. Example: [#1] image.jpg glow ,.
  • halftone โœจ โ€” signature: 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. Applies halftone dithering to selected images, no cap. Defaults: 'nb_levels=5', 'size_dark=8', 'size_bright=8', 'shape=5' and 'smoothness=0'. Example: [#1] image.jpg halftone ,.
  • hardsketchbw ๐ŸŽ€ โ€” signature: _amplitude>=0,_density>=0,_opacity,0<=_edge_threshold<=100,_is_fast={ 0:No | 1:Yes }. Applies hard B&W sketch effect on selected images. Defaults: 'amplitude=1000', 'sampling=3', 'opacity=0.1', 'edge_threshold=20' and 'is_fast=0'. Example:
[#1] image.jpg +hardsketchbw 200,70,0.1,10 median[-1] 2 +local reverse blur[-1] 3 blend[-2,-1] overlay done
  • hearts ๐Ÿฆ‹ โ€” signature: _density>=0. Applies heart effect on selected images. Default: 'density=10'. Example: [#1] image.jpg hearts ,.
  • houghsketchbw ๐ŸŒธ โ€” signature: _density>=0,_radius>0,0<=_threshold<=100,0<=_opacity<=1,_votesize[%]>0. Applies a Hough B&W sketch effect on selected images. Defaults: 'density=100', 'radius=3', 'threshold=100', 'opacity=0.1' and 'votesize=100%'. Example: [#1] image.jpg +houghsketchbw ,.
  • lightrays ๐Ÿ’… โ€” signature: 100<=_density<=0,_center_x[%],_center_y[%],_ray_length>=0,_ray_attenuation>=0. Generates ray lights from the edges of selected images. Defaults: 'density=50%', 'center_x=50%', 'center_y=50%', 'ray_length=0.9' and 'ray_attenuation=0.5'. Example: [#1] image.jpg +lightrays , + cut 0,255.
  • light_relief ๐Ÿซถ โ€” signature: _ambient_light,_specular_lightness,_specular_size,_darkness,_light_smoothness,_xl,_yl,_zl,_zscale,_opacity_is_heightmap={ 0:No | 1:Yes }. Applies a relief light effect to selected images. Defaults: 'ambient_light=0.3', 'specular_lightness=0.5', 'specular_size=0.2', 'darkness=0', 'xl=0.2', 'yl=zl=0.5', 'zscale=1', 'opacity=1' and 'opacity_is_heightmap=0'. Example: [#1] image.jpg blur 2 light_relief 0.3,4,0.1,0.
  • linify ๐Ÿ˜ญ โ€” signature: 0<=_density<=100,_spreading>=0,_resolution[%]>0,_line_opacity>=0,_line_precision>0,_mode={ 0:Subtractive | 1:Additive }. Applies linify effect on selected images. The algorithm is inspired from the one described on the webpage http://linify.me/about.. Defaults: 'density=50', 'spreading=2', 'resolution=40%', 'line_opacity=10', 'line_precision=24' and 'mode=0'. Example: [#1] image.jpg linify 60.
  • mosaic ๐Ÿ”ฅ โ€” signature: 0<=_density<=100. Creates random mosaic from selected images. Defaults: 'density=30'. Example:
[#1] image.jpg mosaic , +fill "I!=J(1) || I!=J(0,1)?[0,0,0]:I"
  • old_photo ๐Ÿ‘‘ โ€” no argument signature here. Applies old photo effect on selected images. Example: [#1] image.jpg old_photo.
  • pencilbw ๐ŸŒˆ โ€” signature: _size>=0,_amplitude>=0. Applies B&W pencil effect on selected images. Defaults: 'size=0.3' and 'amplitude=60'. Example: [#1] image.jpg pencilbw ,.
  • pixelsort โญ โ€” signature: _ordering={ +:Increasing | -:Decreasing },_axis={ x | y | z | xy | yx },_[sorting_criterion],_[mask]. Applies a 'pixel sorting' algorithm on selected images, as described on the page: http://satyarth.me/articles/pixel-sorting/.. Defaults: 'ordering=+', 'axis=x' and 'sorting_criterion=mask=(undefined)'. Example: [#1] image.jpg +norm +ge[-1] 30% +pixelsort[0] +,y,[1],[2].
  • polaroid ๐Ÿ’€ โ€” signature: _size1>=0,_size2>=0. Creates polaroid effect in selected images. Defaults: 'size1=10' and 'size2=20'. Example: [#1] image.jpg to_rgba polaroid 5,30 rotate 20 drop_shadow , drgba.
  • polygonize ๐Ÿ™ˆ โ€” signature: _warp_amplitude>=0,_smoothness[%]>=0,_min_area[%]>=0,_resolution_x[%]>0,_resolution_y[%]>0. Applies polygon effect on selected images. Defaults: 'warp_amplitude=300', 'smoothness=2%', 'min_area=0.1%', 'resolution_x=resolution_y=10%'. Example:
[#1] image.jpg +polygonize 100,10 fill[-1] "I!=J(1) || I!=J(0,1)?[0,0,0]:I"
  • poster_edges ๐Ÿ“ โ€” signature: 0<=_edge_threshold<=100,0<=_edge_shade<=100,_edge_thickness>=0,_edge_antialiasing>=0,0<=_posterization_level<=15,_posterization_antialiasing>=0. Applies poster edges effect on selected images. Defaults: 'edge_threshold=40', 'edge_shade=5', 'edge_thickness=0.5', 'edge_antialiasing=10', 'posterization_level=12' and 'posterization_antialiasing=0'. Example: [#1] image.jpg poster_edges ,.
  • poster_hope ๐Ÿงš โ€” signature: _smoothness>=0. Applies Hope stencil poster effect on selected images. Default: 'smoothness=3'. Example: [#1] image.jpg poster_hope ,.
  • rodilius ๐Ÿ’œ โ€” signature: 0<=_amplitude<=100,_0<=thickness<=100,_sharpness>=0,_nb_orientations>0,_offset,_color_mode={ 0:Darker | 1:Brighter }. Applies rodilius (fractalius-like) filter on selected images. Defaults: 'amplitude=10', 'thickness=10', 'sharpness=400', 'nb_orientations=7', 'offset=0' and 'color_mode=1'. Example:
[#1] image.jpg rodilius 12,10,300,10 normalize_local 10,6
[#2] image.jpg normalize_local 10,16 rodilius 10,4,400,16 smooth 60,0,1,1,4 normalize_local 10,16
  • sketchbw ๐ŸŽจ โ€” signature: _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 }. Applies sketch effect to selected images. Defaults: 'nb_angles=2', 'start_angle=45', 'angle_range=180', 'length=30', 'threshold=3', 'opacity=0.03', 'bgfactor=0', 'density=0.6', 'sharpness=0.1', 'anisotropy=0.6', 'smoothness=0.25', 'coherence=1', 'is_boost=0' and 'is_curved=1'. Example: [#1] image.jpg +sketchbw 1 reverse blur[-1] 3 blend[-2,-1] overlay.
  • sponge ๐Ÿงฝ โ€” signature: _size>0. Applies sponge effect on selected images. Default: 'size=13'. Example: [#1] image.jpg sponge ,.
  • stained_glass ๐Ÿ’Ž โ€” signature: _edges[%]>=0, shading>=0, is_thin_separators={ 0:No | 1:Yes }. Generates stained glass from selected images. Defaults: 'edges=40%', 'shading=0.2' and 'is_precise=0'. Example: [#1] image.jpg stained_glass 20%,1 cut 0,20.
  • stars ๐ŸŒŸ โ€” signature: _density[%]>=0,_depth>=0,_size>0,_nb_branches>=1,0<=_thickness<=1,_smoothness[%]>=0,_R,_G,_B,_opacity. Adds random stars to selected images. Defaults: 'density=10%', 'depth=1', 'size=32', 'nb_branches=5', 'thickness=0.38', 'smoothness=0.5', 'R=G=B=200' and 'opacity=1'. Example: [#1] image.jpg stars ,.
  • stencil ๐Ÿ–Œ๏ธ โ€” signature: _radius[%]>=0,_smoothness>=0,_iterations>=0. Applies stencil filter on selected images. Defaults: 'radius=3', 'smoothness=1' and 'iterations=8'. Example: [#1] image.jpg +norm stencil. 2,1,4 +mul rm[0].
  • stencilbw ๐Ÿ–ค โ€” signature: _edges>=0,_smoothness>=0. Applies B&W stencil effect on selected images. Defaults: 'edges=15' and 'smoothness=10'. Example: [#1] image.jpg +stencilbw 40,4.
  • stylize ๐Ÿช„ โ€” signature: [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". Transfers 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. 'init_type' can be { 0:Best-match | 1:Identity | 2:Randomized }. Defaults: 'fidelity_finest=0.5', 'fidelity_coarsest=2', 'fidelity_smoothness_finest=3', 'fidelity_smoothness_coarsest=0.5', 'fidelity_chroma=0.1', 'init_type=0', 'init_resolution=16', 'init_max_gradient=0', 'patch_size_analysis=5', 'patch_size_synthesis=5', 'patch_size_synthesis_final=5', 'nb_matches_finest=2', 'nb_matchesc_coarsest=30', 'penalize_repetitions=2', 'matching_precision=2', 'scale_factor=1.85', 'skip_finest_scales=0' and this absolute beast of an image_matching_command:
'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"
  • tetris ๐Ÿ•น๏ธ โ€” signature: _scale>0. Applies tetris effect on selected images. Default: 'scale=10'. Example: [#1] image.jpg +tetris 10.
  • warhol ๐ŸŽจ โ€” signature: _M>0,_N>0,_smoothness>=0,_color>=0. Creates MxN Andy Warhol-like artwork from selected images. Defaults: 'M=3', 'N=M', 'smoothness=2' and 'color=20'. Example: [#1] image.jpg warhol 3,3,3,40.
  • weave ๐Ÿงต โ€” signature: _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. Applies weave effect to the selected images. 'angle' can be { 0:0 deg. | 1:22.5 deg. | 2:45 deg. | 3:67.5 deg. }. Defaults: 'density=6', 'thickness=65', 'shadow=40', 'shading=0.5', 'fibers_amplitude=0', _'fibers_smoothness=0', 'angle=0' and 'curvature_x=curvature_y=0'. Example: [#1] image.jpg weave ,.
  • whirls ๐ŸŒ€ โ€” signature: _texture>=0,_smoothness>=0,_darkness>=0,_lightness>=0. Adds random whirl texture to selected images. Defaults: 'texture=3', 'smoothness=6', 'darkness=0.5' and 'lightness=1.8'. Example: [#1] image.jpg whirls ,.

11.17. Warpings ๐ŸŒ€

  • deform โ€” signature: _amplitude[%]>=0,_interpolation,_boundary_conditions. Applies random smooth deformation on selected images. 'interpolation' can be { 0:None | 1:Linear | 2:Bicubic }. 'boundary_conditions' can be { 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }. Defaults: 'amplitude=10', 'interpolation=1' and 'boundary_conditions=3'. Example: [#1] image.jpg +deform[0] 10 +deform[0] 20.
  • euclidean2polar โ€” signature: _center_x[%],_center_y[%],_stretch_factor>0,_boundary_conditions={ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }. Applies euclidean to polar transform on selected images.
  • Defaults: center_x=center_y=50%, stretch_factor=1 and boundary_conditions=3.

(yeah that's the tail end of the previous one, don't @ me ๐Ÿ’…)

Example:

[#1] image.jpg +euclidean2polar ,

equirectangular2nadirzenith ๐ŸŒ

Takes your selected equirectangular pics and transforms them into nadir/zenith rectilinear projections. Glow-up for panorama girlies โœจ

fisheye ๐ŸŸ

_center_x,_center_y,0<=_radius<=100,_amplitude>=0

Slaps a fish-eye deformation on your selected images. Very "shot on a GoPro at a skate park" of you.

  • Defaults: x=y=50, radius=50 and amplitude=1.2.

Example:

[#1] image.jpg +fisheye ,

flower ๐ŸŒธ

_amplitude,_frequency,_offset_r[%],_angle,_center_x[%],_center_y[%],_boundary_conditions={ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }

Applies a flower deformation to your selected images. Petal-core fr fr ๐ŸŒผ

  • Defaults: amplitude=30, frequency=6, offset_r=0, angle=0, center_x=center_y=50% and boundary_conditions=3.

Example:

[#1] image.jpg +flower ,

kaleidoscope ๐ŸŽ€

_center_x[%],_center_y[%],_radius,_angle,_boundary_conditions={ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }

Makes a kaleidoscope effect out of your selected images. Main character energy, literally.

  • Defaults: center_x=center_y=50%, radius=100, angle=30 and boundary_conditions=3.

Example:

[#1] image.jpg kaleidoscope ,

map_sphere ๐Ÿชฉ

_width>0,_height>0,_radius,_dilation>0,_fading>=0,_fading_power>=0

Maps your selected images onto a sphere. Ball is life ๐Ÿ€

  • Defaults: width=height=512, radius=100, dilation=0.5, fading=0 and fading_power=0.5.

Example:

[#1] image.jpg map_sphere ,

nadirzenith2equirectangular ๐ŸŒ

Transforms your selected nadir/zenith rectilinear projections into equirectangular images. The reverse glow-up, we love a come-back story ๐Ÿ’–

polar2euclidean โญ•

_center_x[%],_center_y[%],_stretch_factor>0,_boundary_conditions={ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }

Applies a polar โ†’ euclidean transform on your selected images. Un-rounding them, basically ๐Ÿซถ

  • Defaults: center_x=center_y=50%, stretch_factor=1 and boundary_conditions=3.

Example:

[#1] image.jpg +euclidean2polar ,

raindrops ๐Ÿ’ง

_amplitude,_density>=0,_wavelength>=0,_merging_steps>=0

Applies a raindrops deformation on your selected images. Cozy window vibes, no umbrella needed โ˜”

  • Defaults: amplitude=80, density=0.1, wavelength=1 and merging_steps=0.

Example:

[#1] image.jpg +raindrops ,

ripple ๐ŸŒŠ

_amplitude,_bandwidth,_shape={ 0:Block | 1:Triangle | 2:Sine | 3:Sine+ | 4:Random },_angle,_offset

Applies a ripple deformation to your selected images. Slay, but make it liquid ๐Ÿ’ฆ

  • Defaults: amplitude=10, bandwidth=10, shape=2, angle=0 and offset=0.

Example:

[#1] image.jpg +ripple ,

rotoidoscope ๐ŸŒ€

_center_x[%],_center_y[%],_tiles>0,_smoothness[%]>=0,_boundary_conditions={ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }

Creates a rotational kaleidoscope effect from your selected images. Spinny and iconic, no cap.

  • Defaults: center_x=center_y=50%, tiles=10, smoothness=1 and boundary_conditions=3.

Example:

[#1] image.jpg +rotoidoscope ,

spherize ๐Ÿ”ฎ

_radius[%]>=0,_strength,_smoothness[%]>=0,_center_x[%],_center_y[%],_ratio_x/y>0,_angle,_interpolation

Applies a spherize effect to your selected images. Bubble-ify it bestie ๐Ÿซง

  • Defaults: radius=50%, strength=1, smoothness=0, center_x=center_y=50%, ratio_x/y=1, angle=0 and interpolation=1.

Example:

[#1] image.jpg grid 5%,5%,0,0,0.6,255 spherize ,

symmetrize ๐Ÿชž

_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 }

Symmetrizes your selected images with respect to the axis you picked. Balanced. Centered. That girl ๐Ÿ’…

  • Defaults: x=y=50%, angle=90, boundary_conditions=3, is_antisymmetry=0 and swap_sides=0.

Example:

[#1] image.jpg +symmetrize 50%,50%,45 +symmetrize[-1] 50%,50%,-45

transform_polar ๐Ÿงญ

"expr_radius",_"expr_angle",_center_x[%],_center_y[%],_boundary_conditions={ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }

Applies your own user-defined transform on the polar representation of the selected images. Bring your own math, bestie ๐Ÿงฎโœจ

  • Defaults: expr_radius=R-r, expr_rangle=a, center_x=center_y=50% and boundary_conditions=3.

(yeah, it says expr_rangle there โ€” that's what the page says, don't come for me ๐Ÿ™ˆ)

Example:

[#1] image.jpg +transform_polar[0] R*(r/R)^2,a +transform_polar[0] r,2*a

twirl ๐Ÿญ

_amplitude,_center_x[%],_center_y[%],_boundary_conditions={ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }

Applies a twirl deformation on your selected images. Swirl era ๐Ÿ’ซ

  • Defaults: amplitude=1, center_x=center_y=50% and boundary_conditions=3.

Example:

[#1] image.jpg twirl 0.6

warp (+) ๐Ÿงต

[warping_field],_mode,_interpolation,_boundary_conditions,_nb_frames>0

Warps your selected images using the displacement field you hand it.

  • mode can be { 0:Backward-absolute | 1:Backward-relative | 2:Forward-absolute | 3:Forward-relative }.
  • interpolation can be { 0:Nearest-neighbor | 1:Linear | 2:Cubic }.
  • boundary_conditions can be { 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }.
  • Defaults: mode=0, interpolation=1, boundary_conditions=0 and nb_frames=1.

Example:

[#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

Tutorial: https://gmic.eu/oldtutorial/_warp

warp_patch ๐Ÿฉน

[displacement_map],patch_width>=1,_patch_height>=1,_patch_depth>=1,_std_factor>0,_boundary_conditions,_fast_approximation={ 0:No | 1:Yes }

Patch-warps your selected images using the 2D or 3D displacement map you gave it (in backward-absolute mode, keep that in mind ๐Ÿ‘€).

The std_factor argument sets the std of the gaussian weights for the patch overlap, and it's equal to std = std_factor*patch_size. Math stays mathing ๐Ÿ“

boundary_conditions can be { 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }.

  • Defaults: std_factor=0.3, boundary_conditions=3 and fast_approximation=0.

warp_perspective ๐Ÿ“

_x-angle,_y-angle,_zoom>0,_x-center,_y-center,_boundary_conditions={ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }

Warps your selected images with a perspective deformation. It's giving "photo taken from a cool angle" ๐Ÿ”ฅ

  • Defaults: x-angle=1.5, y-angle=0, zoom=1, x-center=y-center=50 and boundary_conditions=2.

Example:

[#1] image.jpg warp_perspective ,

warp_rbf ๐ŸŽฏ

xs0[%],ys0[%],xt0[%],yt0[%],...,xsN[%],ysN[%],xtN[%],ytN[%]

Warps your selected images using RBF-based interpolation.

Each argument (xsk,ysk)-(xtk,ytk) is the coordinate pair of a keypoint, respectively on the source and target images. The whole set of keypoints defines the overall image deformation. Drag those points, bestie ๐Ÿซต

Example:

[#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%

warp_seamless ๐Ÿช„

[displacement_map],_sigma[%]>0,_blend_dimension={ 0:Auto | 1:1D | 2:2D | 3:3D }

Warps your selected 2D or 3D images using the given displacement field, with seamless blending. No visible seams, no notes ๐Ÿ’€โœจ

  • Defaults: sigma=5% and blend_dimension=0.

Example:

[#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]

water ๐ŸŒŠ

_amplitude,_smoothness>=0,_angle

Applies a water deformation on your selected images. Hydration but make it visual ๐Ÿ’ง

  • Defaults: amplitude=30, smoothness=1.5 and angle=45.

Example:

[#1] image.jpg water ,

wave ใ€ฐ๏ธ

_amplitude>=0,_frequency>=0,_center_x,_center_y

Applies a wave deformation to your selected images. Wavy, literally ๐ŸŒŠ

  • Defaults: amplitude=4, frequency=0.4 and center_x=center_y=50.

Example:

[#1] image.jpg wave ,

wind ๐Ÿƒ

_amplitude>=0,_angle,0<=_attenuation<=1,_threshold

Applies a wind effect on your selected images. Blowing in the wind, iconic behavior ๐ŸŒฌ๏ธ

  • Defaults: amplitude=20, angle=0, attenuation=0.7 and threshold=20.

Example:

[#1] image.jpg +wind ,

zoom ๐Ÿ”

_factor,_cx,_cy,_cz,_boundary_conditions={ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }

Applies a zoom factor to your selected images. Enhance. ENHANCE ๐Ÿ”Ž

  • Defaults: factor=1, cx=cy=cz=0.5 and boundary_conditions=0.

Example:

[#1] image.jpg +zoom[0] 0.6 +zoom[0] 1.5

๐Ÿ’€ 11.18. Degradations ๐Ÿ’€

(the chaos section, buckle up bestie)

cracks ๐Ÿชจ

0<=_density<=100,_is_relief={ 0:No | 1:Yes },_opacity,_color1,...

Draws random cracks on your selected images using the color you specify. Vintage, distressed, lowkey gorgeous ๐Ÿ’…

  • Defaults: density=25, is_relief=0, opacity=1 and color1=0.

Example:

[#1] image.jpg +cracks ,

light_patch โ˜€๏ธ

_density>0,_darkness>=0,_lightness>=0

Adds light patches to your selected images. Sunbeam moment โœจ

  • Defaults: density=10, darkness=0.9 and lightness=1.7.

Example:

[#1] image.jpg +light_patch 20,0.9,4

pixelate ๐ŸŸฆ

_scale_x>0,_scale_y>0,_scale_z>0

Pixelates your selected images using the scales you gave it. Retro game realness ๐ŸŽฎ

  • Defaults: scale_x=20 and scale_y=scale_z=scale_x.

Example:

[#1] image.jpg +pixelate ,

scanlines ๐Ÿ“บ

_amplitude,_bandwidth,_shape={ 0:Block | 1:Triangle | 2:Sine | 3:Sine+ | 4:Random },_angle,_offset

Applies a scanlines effect to your selected images. CRT TV aesthetic, we're so back ๐Ÿ“ผ

  • Defaults: amplitude=60, bandwidth=2, shape=0, angle=0 and offset=0.

Example:

[#1] image.jpg +scanlines ,

shade_stripes ๐Ÿฆ“

_frequency>=0,_direction={ 0:Horizontal | 1:Vertical },_darkness>=0,_lightness>=0

Adds shade stripes to your selected images. Striped and slaying ๐ŸŽ€

  • Defaults: frequency=5, direction=1, darkness=0.8 and lightness=2.

Example:

[#1] image.jpg +shade_stripes 30

shadow_patch ๐ŸŒ‘

_opacity>=0

Adds shadow patches to your selected images. Moody lighting, very editorial ๐Ÿ–ค

  • Default: opacity=0.7.

Example:

[#1] image.jpg +shadow_patch 0.4

shuffle ๐Ÿ”€

Shuffles the vectors of your selected images with the Fisher-Yates algorithm, as described at https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle. Fair and square, no cap ๐ŸŽฒ

Example:

[#1] uniform_distribution 8,3 shuffle

spread ๐ŸŒช๏ธ

_dx[%]>=0,_dy[%]>=0,_dz[%]>=0

Spreads the pixel values of your selected images randomly along x, y and z. Scatter them, bestie โœจ

  • Defaults: dx=3, dy=dx and dz=0.

Example:

[#1] image.jpg +spread 3

stripes_y ๐ŸŽ

_frequency>=0

Adds vertical stripes to your selected images. Straight up and down, periodt ๐Ÿ“

  • Default: frequency=10.

Example:

[#1] image.jpg +stripes_y ,

texturize_canvas ๐ŸŽจ

_amplitude>=0,_fibrousness>=0,_emboss_level>=0
  • texturize_canvas โ€” slaps a paint canvas texture onto your selected images ๐ŸŽจ

The defaults are amplitude=20, fibrousness=3 and emboss_level=0.6.

Example:

[#1] image.jpg +texturize_canvas ,

  • texturize_paper โ€” same energy but paper texture instead, cute and lowkey ๐ŸŽ€

Example:

[#1] image.jpg +texturize_paper
  • vignette โ€” _strength>=0,0<=_radius_min<=100,0<=_radius_max<=100

Gives your selected images that dreamy dark-corners vignette effect โœจ

Defaults: strength=100, radius_min=70 and radius_max=90.

Example:

[#1] image.jpg vignette ,
  • watermark_visible โ€” _text,0<_opacity<1,_{ size>0 | font },_angle,_mode={ 0:Remove | 1:Add },_smoothness>=0

Adds or removes a visible watermark on your selected images, bestie. Heads up tho โ€” the value range must be [0,255] ๐ŸŒธ

Defaults: text=(c) G'MIC, opacity=0.3, size=53, angle=25, mode=1 and smoothness=0.

Example:

[#1] image.jpg watermark_visible ,0.7

๐Ÿ”ฅ 11.19. Blending and Fading ๐Ÿ”ฅ

  • blend โ€” [layer],blending_mode,_opacity[%],_selection_is={ 0:Base-layers | 1:Top-layers } | / blending_mode,_opacity[%]

Blends your selected G, GA, RGB or RGBA images โ€” either by the specified layer, or blends all selected images together โ€” using the blending mode you pick. It's giving mixer-kid main character energy ๐Ÿซถ

The blending_mode can be one of: { 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 }.

And opacity must be in range [0,1] (or [0%,100%]), no cap.

Defaults: blending_mode=alpha, opacity=1 and selection_is=0.

Example:

[#1] image.jpg +drop_shadow , rescale2d[-1] ,200 rotate[-1] 20 +blend alpha display_rgba[-2]
[#2] image.jpg testimage2d {w},{h} blend overlay
[#3] command "ex : $""=arg repeat $""# +blend[0,1] ${arg{$>+1}} text_outline[-1] Mode:
       testimage2d {w},{h} ex add,alpha,and,average,blue,burn,darken
[#4] command "ex : $""=arg repeat $""# +blend[0,1] ${arg{$>+1}} text_outline[-1] Mode:
       testimage2d {w},{h} ex
       difference,divide,dodge,exclusion,freeze,grainextract,grainmerge
[#5] command "ex : $""=arg repeat $""# +blend[0,1] ${arg{$>+1}} text_outline[-1] Mode:
       testimage2d {w},{h} ex
       green,hardlight,hardmix,hue,interpolation,lighten,lightness
[#6] command "ex : $""=arg repeat $""# +blend[0,1] ${arg{$>+1}} text_outline[-1] Mode:
       testimage2d {w},{h} ex
       linearburn,linearlight,luminance,multiply,negation,or,overlay
[#7] command "ex : $""=arg repeat $""# +blend[0,1] ${arg{$>+1}} text_outline[-1] Mode:
       testimage2d {w},{h} ex
       pinlight,red,reflect,saturation,screen,shapeaverage,softburn
[#8] command "ex : $""=arg repeat $""# +blend[0,1] ${arg{$>+1}} text_outline[-1] Mode:
       testimage2d {w},{h} ex
       softdodge,softlight,stamp,subtract,value,vividlight,xor
  • nblend โ€” [layer],blending_mode,_opacity[%],_selection_is={ 0:Base-layers | 1:Top-layers } | / blending_mode,_opacity[%]

Same signature situation as blend above, bestie ๐Ÿ’…

  • blend_edges โ€” smoothness[%]>=0

Blends your selected images together using edges mode ๐Ÿฆ‹

Example:

[#1] image.jpg testimage2d {w},{h} +blend_edges 0.8
  • blend_fade โ€” [fading_shape]

Blends the selected images together using whatever fading shape you hand it ๐ŸŒˆ

Example:

[#1] image.jpg testimage2d {w},{h} 100%,100%,1,1,'cos(y/10)' normalize[-1] 0,1 +blend_fade[0,1] [2]
  • blend_median โ€” no args, it just does the thing.

Blends the selected images together using median mode โœจ

Example:

[#1] image.jpg testimage2d {w},{h} +mirror[0] y +blend_median
  • blend_seamless โ€” _is_mixed_mode={ 0:No | 1:Yes },_inner_fading[%]>=0,_outer_fading[%]>=0

Blends selected images with a seamless blending mode (Poisson-based, fancy fr fr).

Defaults: is_mixed=0, inner_fading=0 and outer_fading=100%.

  • fade_diamond โ€” 0<=_start<=100,0<=_end<=100

Creates a diamond fading from your selected images ๐Ÿ’Ž

Defaults: start=80 and end=90.

Example:

[#1] image.jpg testimage2d {w},{h} +fade_diamond 80,85
  • fade_linear โ€” _angle,0<=_start<=100,0<=_end<=100

Creates a linear fading from the selected images ๐Ÿ“

Defaults: angle=45, start=30 and end=70.

Example:

[#1] image.jpg testimage2d {w},{h} +fade_linear 45,48,52
  • fade_radial โ€” 0<=_start<=100,0<=_end<=100

Creates a radial fading from the selected images ๐ŸŒ€

Defaults: start=30 and end=70.

Example:

[#1] image.jpg testimage2d {w},{h} +fade_radial 30,70
  • fade_x โ€” 0<=_start<=100,0<=_end<=100

Creates a horizontal fading from the selected images โžก๏ธ

Defaults: start=30 and end=70.

Example:

[#1] image.jpg testimage2d {w},{h} +fade_x 30,70
  • fade_y โ€” 0<=_start<=100,0<=_end<=100

Creates a vertical fading from the selected images โฌ‡๏ธ

Defaults: start=30 and end=70.

Example:

[#1] image.jpg testimage2d {w},{h} +fade_y 30,70
  • fade_z โ€” 0<=_start<=100,0<=_end<=100

Creates a transversal fading from the selected images ๐ŸงŠ

Defaults: start=30 and end=70.

  • sub_alpha โ€” [base_image],0<=_minimize_alpha<=1

Computes the alpha-channel difference (the opposite of alpha blending, iconic) between the selected images and the specified base image.

The alpha difference A-B is defined as the image having minimal opacity, such that alpha_blend(B,A-B) = A.

The minimize_alpha argument relaxes the alpha-minimality constraint. Set it to 1 and alpha is constrained to be minimal. Set it to 0 and alpha is maximal (i.e. 255).

Default: minimize_alpha=1.

Example:

[#1] image.jpg testimage2d {w},{h} +sub_alpha[0] [1] display_rgba

๐ŸŽฌ 11.20. Image Sequences and Videos ๐ŸŽฌ

  • animate โ€” filter_name,"param1_start,...,paramN_start","param1_end,...,paramN_end",nb_frames>=0,_output_frames={ 0:No | 1:Yes },_output_filename | / delay>0,_back and forth={ 0:No | 1:Yes }

Animates a filter from starting parameters to ending parameters โ€” or just animates the selected images in a display window ๐ŸŽฅ

Default: delay=30.

Example:

[#1] image.jpg animate flower,"0,3","20,8",9
  • apply_camera โ€” _"command",_camera_index>=0,_skip_frames>=0,_output_filename

Applies the specified command on a live camera stream and shows it in display window [0] ๐Ÿ“ท

Fr tho: this command requires features from the OpenCV library, which is not enabled in G'MIC by default. Don't come for me when it errors.

Defaults: command="", camera_index=0 (that's the default camera), skip_frames=0 and output_filename="".

  • apply_files โ€” "filename_pattern",_"command",_first_frame>=0,_last_frame={ >=0 | -1:Last },_frame_step>=1,_output_filename

Applies a G'MIC command on the specified input image files, in a streamed way ๐Ÿ“

If a display window is open, the rendered frames get displayed in it while it's processing.

The output filename can have extension .avi or .mp4 (saved as a video), or any other usual image file extension (saved as a sequence of images).

Defaults: command=(undefined), first_frame=0, last_frame=-1, frame_step=1 and output_filename=(undefined).

  • apply_video โ€” video_filename,_"command",_first_frame>=0,_last_frame={ >=0 | -1:Last },_frame_step>=1,_output_filename

Applies a G'MIC command on all frames of the specified input video file, in a streamed way ๐ŸŽž๏ธ

If a display window is open, rendered frames show up in it during processing.

The output filename can have extension .avi or .mp4 (saved as a video), or any other usual image file extension (saved as a sequence of images).

Again: this one requires features from the OpenCV library, and that is not enabled in G'MIC by default ๐Ÿ’€

Defaults: first_frame=0, last_frame=-1, frame_step=1 and output_filename=(undefined).

  • average_files โ€” "filename_pattern",_first_frame>=0,_last_frame={ >=0 | -1:Last },_frame_step>=1,_output_filename

Averages the specified input image files, in a streamed way โž—

If a display window is open, rendered frames display in it during processing.

The output filename may have extension .avi or .mp4 (saved as a video), or any other usual image file extension (saved as a sequence of images).

Defaults: first_frame=0, last_frame=-1, frame_step=1 and output_filename=(undefined).

  • average_video โ€” video_filename,_first_frame>=0,_last_frame={ >=0 | -1:Last },_frame_step>=1,_output_filename

Averages the frames of the specified input video file, in a streamed way ๐Ÿ“น

If a display window is open, rendered frames display in it during processing.

The output filename may have extension .avi or .mp4 (saved as a video), or any other usual image file extension (saved as a sequence of images).

Yes bestie, OpenCV library features again โ€” not enabled in G'MIC by default ๐Ÿ™ˆ

Defaults: first_frame=0, last_frame=-1, frame_step=1 and output_filename=(undefined).

  • fade_files โ€” "filename_pattern",_nb_inner_frames>0,_first_frame>=0,_last_frame={ >=0 | -1:Last },_frame_step>=1,_output_filename

Generates a temporal fading from the specified input image files, in a streamed way ๐ŸŒ…

If a display window is open, rendered frames display in it during processing.

The output filename may have extension avi or mp4 (saved as a video), or any other usual image file extension (saved as a sequence of images).

Defaults: nb_inner_frames=10, first_frame=0, last_frame=-1, frame_step=1 and output_filename=(undefined).

  • fade_video โ€” video_filename,_nb_inner_frames>0,_first_frame>=0,_last_frame={ >=0 | -1:Last },_frame_step>=1,_output_filename

Okay bestie, so this next bit is all about creating a temporal fading sequence from a video file you specify, and it's done in a streamed way โ€” like, it doesn't load the whole thing at once, it's efficient ๐Ÿ’…. If you've got a display window open, you'll literally see the rendered frames popping up in it while it's processing. Heads up though: this command needs features from the OpenCV library, and that's not enabled in G'MIC by default, so don't come for me if it doesn't work out of the box ๐Ÿ˜ญ.

Default values are giving: nb_inner_frames=10, first_frame=0, last_frame=-1, frame_step=1 and output_filename=(undefined).

  • files2video โ€” Convert several files into a single video file. The signature is:
"filename_pattern",_output_filename,_fps>0,_codec

Default values: output_filename=output.mp4, fps=25 and codec=mp4v. Slay.

  • median_files โ€” Compute the median frame of specified input image files, in a streamed way. If a display window is open, the rendered frame is displayed in it during processing. Signature:
"filename_pattern",_first_frame>=0,_last_frame={ >=0 | -1:Last },_frame_step>=1,_frame_rows[%]>=1,_is_fast_approximation={ 0:No | 1:Yes }

Default values: first_frame=0, last_frame=-1, frame_step=1, frame_rows=20% and is_fast_approximation=0. No cap.

  • median_video โ€” Compute the median of all frames of an input video file, in a streamed way. If a display window is open, the rendered frame is displayed in it during processing. This command requires features from the OpenCV library (not enabled in G'MIC by default). Signature:
video_filename,_first_frame>=0,_last_frame={ >=0 | -1:Last },_frame_step>=1,_frame_rows[%]>=1,_is_fast_approximation={ 0:No | 1:Yes }

Default values: first_frame=0, last_frame=-1, frame_step=1, frame_rows=100% and is_fast_approximation=1. Periodt.

  • morph โ€” Create morphing sequence between selected images. Signature:
nb_inner_frames>=1,_smoothness>=0,_precision>=0

Default values: smoothness=0.1 and precision=7.

Example:

[#1] image.jpg +rotate 20,1,1,50%,50% morph 9

It's giving iconic.

  • morph_files โ€” Generate a temporal morphing from specified input image files, in a streamed way. If a display window is open, rendered frames are displayed in it during processing. The output filename may have extension .avi or .mp4 (saved as a video), or any other usual image file extension (saved as a sequence of images). Signature:
"filename_pattern",_nb_inner_frames>0,_smoothness>=0,_precision>=0,_first_frame>=0,_last_frame={ >=0 | -1:Last },_frame_step>=1,_output_filename

Default values: nb_inner_frames=10, smoothness=0.1, precision=7, first_frame=0, last_frame=-1, frame_step=1 and output_filename=(undefined). Obsessed.

  • morph_rbf โ€” 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. Signature:
nb_inner_frames>=1,xs0[%],ys0[%],xt0[%],yt0[%],...,xsN[%],ysN[%],xtN[%],ytN[%]

Highkey genius.

  • morph_video โ€” Generate a temporal morphing from specified input video file, in a streamed way. If a display window is open, rendered frames are displayed in it during processing. The output filename may have extension .avi or .mp4 (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 by default). Signature:
video_filename,_nb_inner_frames>0,_smoothness>=0,_precision>=0,_first_frame>=0,_last_frame={ >=0 | -1:Last },_frame_step>=1,_output_filename

Default values: nb_inner_frames=10, smoothness=0.1, precision=7, first_frame=0, last_frame=-1, frame_step=1 and output_filename=(undefined).

  • register_nonrigid โ€” Register selected source images with specified destination image, using non-rigid warp. Signature:
[destination],_smoothness>=0,_precision>0,_nb_scale>=0

Default values: smoothness=0.2, precision=7 and nb_scale=0(auto).

Example:

[#1] image.jpg +rotate 20,1,1,50%,50% +register_nonrigid[0] [1]

The way this just works is everything.

  • register_rigid โ€” Register selected source images with specified destination image, using rigid warp (shift). Signature:
[destination],_smoothness>=0,_boundary_conditions={ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }

Default values: smoothness=0.1% and boundary_conditions=0.

Example:

[#1] image.jpg +shift 30,20 +register_rigid[0] [1]

Iykyk.

  • transition โ€” Generate a transition sequence between selected images. Signature:
[transition_shape],nb_added_frames>=0,100>=shading>=0,_single_frame_only={ -1:Disabled | >=0 }

Default values: shading=0 and single_frame_only=-1.

Example:

[#1] image.jpg +mirror c 100%,100% plasma[-1] 1,1,6 transition[0,1] [2],5

Main character energy fr fr.

  • transition3d โ€” Create 3D transition sequence between selected consecutive images. axis_x, axis_y and axis_z can be set as mathematical expressions, depending on x and y. Signature:
_nb_frames>=2,_nb_xtiles>0,_nb_ytiles>0,_axis_x,_axis_y,_axis_z,_is_antialias={ 0:No | 1:Yes }

Default values: nb_frames=10, nb_xtiles=nb_ytiles=3, axis_x=1, axis_y=1, axis_z=0 and is_antialias=1.

Example:

[#1] image.jpg +blur 5 transition3d 9 display_rgba

This is giving 3D movie vibes ๐ŸŽฌ.

  • video2files โ€” 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. Signature:
input_filename,_output_filename,_first_frame>=0,_last_frame={ >=0 | -1:Last },_frame_step>=1

Default values: output_filename=frame.png, first_frame=0, last_frame=-1 and frame_step=1. Ate.


๐ŸŽ€ 11.21. Convenience Functions ๐ŸŽ€

These are the little helpers that just make life easier, bestie. No cap.

  • add_copymark โ€” Add copymark suffix in names of selected images. Simple but iconic.
  • alert โ€” 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. Signature:
_title,_message,_label_button1,_label_button2,...

Default values: title=[G'MIC Alert] and message=This is an alert box.. Pop-up queen ๐Ÿ‘‘.

  • arg0 โ€” Return the n-th argument of the specified argument list (where n goes from 0 to N). Signature:
n>=0,_arg_0,...,_arg_N

Zero-indexed, because we're cool like that.

  • arg1 โ€” Return the n-th argument of the specified argument list (where n goes from 1 to N). Signature:
n>=1,_arg_1,...,_arg_N

One-indexed for the traditionalists.

  • arg2var โ€” For each i in [1...N], set variable_name$i=argument_i. The variable name should be global to make this command useful (i.e. starts by an underscore). Signature:
variable_name,argument_1,...,argument_N

Global vars only, periodt.

  • average_vectors โ€” Return the vector-valued average of the latest of the selected images. Math but make it fashion.
  • base642img โ€” 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 img2base64. Signature:
"base64_string"

Decode era.

  • base642uint8 โ€” 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 uint82base64. Signature:
"base64_string"

Uint8 realness.

  • basename โ€” Return the basename of a file path, and optionally its folder location. When specified, variable_name_for_folder must starts by an underscore (global variable accessible from calling function). Signature:
file_path,_variable_name_for_folder

Path queen ๐Ÿ’….

  • bin โ€” Print specified binary integers into their octal, decimal, hexadecimal and string representations. Signature:
binary_int1,...

Binary slay.

  • bin2dec โ€” Convert specified binary integers into their decimal representations. Signature:
binary_int1,...

Math conversion, no biggie.

  • cat โ€” Print specified line selection of given filename on stdout. Signature:
filename,_display_line_numbers={ 0:No | 1:Yes },_line_selection,

Default values: display_line_numbers=1 and line_selection=^. Like cat but with extra flair.

  • color2name โ€” Return the name (as a string, in English) that most matches the specified color. Signature:
R,G,B

Color naming, adorable.

  • covariance_vectors โ€” Return the covariance matrix of the vector-valued colors in the latest of the selected images (for arbitrary number of channels). Parameter avg_outvarname is used as a variable name that takes the value of the average vector-value. Signature:
_avg_outvarname

Stats but make it cute.

  • da_freeze โ€” Convert each of the selected dynamic arrays into a 1-column image whose height is the number of array elements. Freeze frame ๐Ÿ“ธ.
  • date โ€” Return current date as a string YYYY/MM/DD. Time check.
  • dec โ€” Print specified decimal integers into their binary, octal, hexadecimal and string representations. Signature:
decimal_int1,...

Decimal flex.

  • dec2str โ€” Convert specified decimal integers into their string representation. Signature:
decimal_int1,...

String theory.

  • dec2bin โ€” Convert specified decimal integers into their binary representations. Signature:
decimal_int1,...

Binary babe.

  • dec2hex โ€” Convert specified decimal integers into their hexadecimal representations. Signature:
decimal_int1,...

Hex hag.

  • dec2oct โ€” Convert specified decimal integers into their octal representations. Signature:
decimal_int1,...

Octal obsession.

  • filename โ€” Return a filename numbered with specified indices. Signature:
filename,_number1,_number2,...,_numberN

Naming things is hard, but this helps.

  • filename_rand โ€” Return a random filename for storing temporary data. Random but iconic.
  • filename_dated โ€” Convert specified filename to one stamped with the current date (filename_YYYYMMDD_HHMMSS.ext). Signature:
filename

Dated but not in a bad way.

  • files (+) โ€” Return the list of files and/or subdirectories from specified path. path can optionally be a matching pattern. mode can be { 0:Files only | 1:Directories only | 2:Files + Directories }. Add 3 to mode to return full paths instead of filenames only. Signature:
_mode,path

Default value: mode=5. File listing but make it fashion.

  • files2img โ€” Insert a new image where each vector-valued pixel is a string encoding the filenames returned by command files. Useful to manage list of filenames containing characters that have a special meaning in the G'MIC language, such as spaces or commas. Signature:
_mode,path

Turning files into images? Witchcraft, but we love it.

  • fitratio_wh โ€” Return a 2D size width,height which is bigger than min_width,min_height and has the specified w/h ratio. Signature:
min_width,min_height,ratio_wh

Aspect ratio realness.

  • fitscreen โ€” Return the 'ideal' size WxH for a window intended to display an image of specified size on screen. Signature:
width,height,_minimal_size[%]>0,_maximal_size[%]>0 | [image],_minimal_size[%]>0,_maximal_size[%]>0

Screen fit, slay.

Default values: depth=1, minimal_size=128 and maximal_size=85%.


๐ŸŽ€ fontchart

fontchart display_mode

Drops the G'MIC font chart right at the end of the image list. ๐Ÿ’… The display_mode arg is like { 0: List of characters | N: List of fonts with height N }.

Default value: display_mode=0.

Example:

[#1] fontchart 0 fontchart 64

๐ŸŽ€ fps

Returns how many times this function gets called per second, or -1 if that info isn't available yet. Lowkey perfect for showing the framerate when you're displaying animations. ๐Ÿ”ฅ

๐ŸŽ€ hex

hex hexadecimal_int1,...

Prints those hexadecimal integers in their binary, octal, decimal and string representations. All the bases, bestie. โœจ

๐ŸŽ€ hex2dec

hex2dec hexadecimal_int1,...

Converts those hexadecimal integers into their decimal representations.

๐ŸŽ€ hex2img

hex2img "hexadecimal_string"

Inserts a brand-new 1xN image at the end of the list, with values given by that hexadecimal-encoded string. ๐Ÿซถ

๐ŸŽ€ hex2str

hex2str hexadecimal_string

Converts that hexadecimal string into a string. See also: str2hex.

๐ŸŽ€ img2base64

img2base64 _encoding={ 0:Base64 | 1:Base64url },_store_names={ 0:No | 1:Yes }

Encodes the selected images as a base64-encoded string. You can decode them later with the base642img command. ๐Ÿ‘‘

Default values: encoding=0 and store_names=1.

๐ŸŽ€ img2hex

Returns a representation of the last image as a hexadecimal-encoded string. Heads up: the input image has to have values that are integers in [0,255]. ๐Ÿ’€

๐ŸŽ€ img2str

Returns the content of the selected images, as special G'MIC input strings.

๐ŸŽ€ indexof

indexof string,_arg_0,...,_arg_N

Returns the lowest index i such that arg_i==string. If no arg_i matches, you get -1. ๐Ÿ™ˆ

๐ŸŽ€ is_mesh3d

Returns 1 if all of the selected images are 3D meshes, 0 otherwise.

๐ŸŽ€ is_change

is_change _value={ 0:False | 1:True }

Sets or unsets the is_change flag tied to the image list. This flag tells the interpreter whether the image list should be displayed when the pipeline ends. โœจ

Default value: value=1.

๐ŸŽ€ is_half

Returns 1 if the type of image pixels is limited to half-float.

๐ŸŽ€ is_ext

is_ext filename,_extension

Returns 1 if that filename has the given extension.

๐ŸŽ€ is_image_arg

is_image_arg string

Returns 1 if the string is a valid single image argument like [ind]. ๐ŸŽฏ

๐ŸŽ€ is_pattern

is_pattern string

Returns 1 if the string looks like a drawing pattern 0x.......

๐ŸŽ€ is_videofilename

is_videofilename filename

Returns 1 if the extension of that filename is typical for video files. ๐ŸŽฌ

๐ŸŽ€ is_macos

Returns 1 if the current computer OS is Darwin (MacOS), 0 otherwise. ๐ŸŽ

๐ŸŽ€ is_windows

Returns 1 if the current computer OS is Windows, 0 otherwise. ๐ŸชŸ

๐ŸŽ€ lof

lof feature

Returns the list of specified features (separated by commas) for each selected image.

๐ŸŽ€ math_lib

Returns a string that defines a bunch of useful macros for the embedded math evaluator. ๐Ÿงฎ

๐ŸŽ€ mad

Returns the MAD (Median Absolute Deviation) of the last selected image.

The MAD is defined as MAD = med_i|x_i-med_j(x_j)|. No cap, that's literally the formula. ๐Ÿ˜ญ

๐ŸŽ€ max_w

Returns the maximal width between selected images.

๐ŸŽ€ max_h

Returns the maximal height between selected images.

๐ŸŽ€ max_d

Returns the maximal depth between selected images.

๐ŸŽ€ max_s

Returns the maximal spectrum between selected images.

๐ŸŽ€ max_wh

Returns the maximal wxh size of selected images.

๐ŸŽ€ max_ds

Returns the maximal dxs size of selected images.

๐ŸŽ€ max_whd

Returns the maximal wxhxd size of selected images.

๐ŸŽ€ max_whds

Returns the maximal wxhxdxs size of selected images. ๐Ÿ’…

๐ŸŽ€ median_vectors

Returns the median vector value of the last selected image (median computed channel by channel).

๐ŸŽ€ min_w

Returns the minimal width between selected images.

๐ŸŽ€ min_h

Returns the minimal height between selected images.

๐ŸŽ€ min_d

Returns the minimal depth between selected images.

๐ŸŽ€ min_s

Returns the minimal s size of selected images.

๐ŸŽ€ min_wh

Returns the minimal wxh size of selected images.

๐ŸŽ€ min_ds

Returns the minimal dxs size of selected images.

๐ŸŽ€ min_whd

Returns the minimal wxhxd size of selected images.

๐ŸŽ€ min_whds

Returns the minimal wxhxdxs size of selected images. โœจ

๐ŸŽ€ name2color

name2color name

Returns the R,G,B color that matches the specified color name. ๐ŸŒˆ

๐ŸŽ€ nmd (+)

Shortcut for the named command. Periodt.

๐ŸŽ€ named (+)

named _mode,"name1","name2",...

Returns the set of indices corresponding to images in the selection with the specified names. ๐Ÿซถ

After this command returns, the status holds a list of indices (unsigned integers) separated by commas โ€” or an empty string if no images with those names were found.

(Equivalent to the shortcut command nmd.)

mode can be { 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) }.

๐ŸŽ€ narg

narg arg_1,arg_2,...,arg_N

Returns the number of specified arguments. Count 'em, bestie. ๐Ÿ”ข

๐ŸŽ€ normalize_filename

normalize_filename filename

Returns a "normalized" version of that filename โ€” no spaces, no capital letters.

๐ŸŽ€ oct

oct octal_int1,...

Prints those octal integers in their binary, decimal, hexadecimal and string representations. ๐Ÿ’œ

๐ŸŽ€ oct2dec

oct2dec octal_int1,...

Converts those octal integers into their decimal representations.

๐ŸŽ€ path_cache

Returns a path to store G'MIC data files for one user (value is OS-dependent). ๐Ÿ—‚๏ธ

๐ŸŽ€ path_cached_file

path_cached_file "filename"

Returns the path of that cached file, or "" if the file hasn't been cached yet.

๐ŸŽ€ path_current

Returns the current folder from where G'MIC has been run.

๐ŸŽ€ path_gimp

Returns a path to store GIMP configuration files for one user (value is OS-dependent).

๐ŸŽ€ path_tmp

Returns a path to store temporary files (value is OS-dependent). ๐Ÿงš

๐ŸŽ€ remove_copymark

Removes the copymark suffix in the names of selected images.

๐ŸŽ€ reset

Resets the global parameters of the interpreter environment. Fresh start energy. ๐ŸŒธ

๐ŸŽ€ shell_cols

Returns the estimated number of columns of the current shell.

๐ŸŽ€ size_value

Returns the size (in bytes) of image values.

๐ŸŽ€ std_noise

Returns the estimated noise standard deviation of the last selected image. ๐Ÿ’€

๐ŸŽ€ str

str string

Prints that string in its binary, octal, decimal and hexadecimal representations.

๐ŸŽ€ strbuffer

strbuffer buffer_size

Returns a string describing a size for that buffer size.

๐ŸŽ€ str2hex

str2hex "string"

Converts the specified string argument into a sequence of hexadecimal values (returned as a string). See also: hex2str.

Example:

[#1] hex=${"str2hex

[gmic]-0./ Start G'MIC interpreter.
[gmic]-0./ 48656c6c6f206d7920667269656e6473
[gmic]-0./ End G'MIC interpreter.

๐ŸŽ€ strcapitalize

strcapitalize string

Capitalizes that string. โœจ

๐ŸŽ€ strcontains

strcontains string1,string2

Returns 1 if the first string contains the second one.

๐ŸŽ€ strclut

strclut "string"

Returns a simplified version of that string that can be used as a CLUT name.

๐ŸŽ€ strlen

strlen string1

Returns the length of the specified string argument.

๐ŸŽ€ strlowercase

strlowercase string

Returns a lower-case version of that string.

๐ŸŽ€ strreplace

strreplace string,search,replace

Search and replace substrings in an input string. ๐Ÿ”

๐ŸŽ€ struppercase

struppercase string

Returns an upper-case version of that string. ๐Ÿ—ฃ๏ธ

๐ŸŽ€ strvar

strvar "string"

Returns a simplified version of that string that can be used as a variable name. (This version creates a lowercase result, no longer than 128 chars.)

๐ŸŽ€ strcasevar

strcasevar "string"

Returns a simplified version of that string that can be used as a variable name. (This version keeps the original case of the specified string, no longer than 128 chars.)

๐ŸŽ€ strver

strver _version,_prerelease

Returns the specified version number of the G'MIC interpreter, as a string. ๐Ÿท๏ธ

Default value: version=$_version and prerelease=.

๐ŸŽ€ tic

Initializes the tic-toc timer. Use it together with toc. โฑ๏ธ

๐ŸŽ€ time

Returns the current time as a string hh:mm:ss.

๐ŸŽ€ toc

Displays the elapsed time of the tic-toc timer since the last call to tic. This command returns the elapsed time in the status value. Use it together with tic. ๐Ÿ•ฐ๏ธ

๐ŸŽ€ uint82base64

uint82base64 _encoding={ 0:Base64 | 1:Base64url }

Encodes the values of the latest of the selected images as a base64-encoded string. The string can be decoded using the base642uint8 command. Selected images must have values that are integers in [0,255]. ๐Ÿ’…

Default values: encoding=0.


๐ŸŒˆ 11.22. Other Interactive Commands ๐ŸŒˆ

๐ŸŽฎ demos

demos _run_in_parallel={ 0:No | 1:Yes | 2:Auto }

Shows a menu to select and view all the G'MIC interactive demos. Pick your fighter. ๐Ÿ‘‘

๐ŸŽฎ x_2048

Launches the 2048 game. Slay the tiles, bestie. ๐Ÿ”ฅ

๐ŸŽฎ x_blobs

Launches the blobs editor.

../img/x_blobs.jpg [image: 'x_blobs']

๐ŸŽฎ x_bouncing

Launches the bouncing balls demo. ๐Ÿ€

๐ŸŽฎ x_color_curves

x_color_curves _colorspace={ rgb | cmy | cmyk | hsi | hsl | hsv | lab | lch | ycbcr | last }

Applies color curves on the selected RGB[A] images, using an interactive window. Set colorspace to last to apply the last defined color curves without opening interactive windows. ๐ŸŽจ

Default value: colorspace=rgb.

๐ŸŽฎ x_colorize

x_colorize _is_lineart={ 0:No | 1:Yes },_max_resolution={ 0 | >=128 },_multichannels_output={ 0:No | 1:Yes },_[palette1],_[palette2],_[grabber1]

Colorizes the selected B&W images, using an interactive window. When it's >0, the max_resolution argument defines the maximal image resolution used in the interactive window. ๐Ÿ–Œ๏ธ

Default values: is_lineart=1, max_resolution=1024 and multichannels_output=0.

๐ŸŽฎ x_connect4

Launches the Connect Four game. Four in a row or it's giving nothing. ๐Ÿ”ด๐ŸŸก

๐ŸŽฎ xz

Shortcut for the x_crop command.

๐ŸŽฎ x_crop

Crop selected images interactively. If multiple input images are selected, the same crop is applied to all images. (equivalent to shortcut command 'xz'). ๐Ÿ’…

  • x_cut โ€” Clip value ranges of selected images interactively. โœ‚๏ธ
  • x_fire โ€” Launch the fire effect demo. ๐Ÿ”ฅ
  • x_fireworks โ€” Launch the fireworks demo. ๐ŸŽ†
  • x_fisheye โ€” Launch the fish-eye effect demo. ๐ŸŸ
  • x_fourier โ€” Launch the fourier filtering demo. ๐ŸŒŠ
  • x_grab_color _variable_name โ€” Open a color grabber widget from the first selected image. Argument variable_name specifies the variable that contains the selected color values at any time. Assigning '-1' to it forces the interactive window to close. Default values: 'variable_name=xgc_variable'. ๐ŸŽจ
  • x_hanoi โ€” Launch the Tower of Hanoi game. ๐Ÿ—ผ
  • x_histogram โ€” Launch the histogram demo. ๐Ÿ“Š
  • x_hough โ€” Launch the hough transform demo. ๐Ÿ“
  • x_jawbreaker 0<_width<20,0<_height<20,0<_nb_colors<=8 โ€” Launch the Jawbreaker game. Default values: 'width=12', 'height=13' and 'nb_colors=5'. ๐Ÿฌ
  • x_landscape โ€” Launch the virtual landscape demo. ๐Ÿž๏ธ
  • x_life โ€” Launch the game of life. ๐Ÿงฌ
  • x_light โ€” Launch the light effect demo. ๐Ÿ’ก
  • x_mandelbrot _is_julia={ 0:No | 1:Yes },_c0r,_c0i โ€” Launch Mandelbrot/Julia explorer. ๐ŸŒ€
  • x_mask_color _colorspace={ all | rgb | lrgb | ycbcr | lab | lch | hsv | hsi | hsl | cmy | cmyk | yiq },_spatial_tolerance>=0,_color_tolerance>=0 โ€” Interactively select a color, and add an alpha channel containing the corresponding color mask. Argument colorspace refers to the color metric used to compute color similarities, and can be basically one of { rgb | lrgb | ycbcr | lab | lch | hsv | hsi | hsl | cmy | cmyk | yiq }. You can also select one particular channel of this color space, by setting colorspace as colorspace_channel (e.g. hsv_h for the hue). Default values: 'colorspace=all', 'spatial_tolerance=5' and 'color_tolerance=5'. ๐ŸŒˆ
  • x_metaballs3d โ€” Launch the 3D metaballs demo. ๐Ÿซง
  • x_minesweeper 8<=_width<=20,8<=_height<=20 โ€” Launch the Minesweeper game. ๐Ÿ’ฃ
  • x_minimal_path โ€” Launch the minimal path demo. ๐Ÿ›ค๏ธ
  • x_morph _nb_frames>=2,_preview_fidelity={ 0:Coarsest | 1:Coarse | 2:Normal | 3:Fine | 4:Finest } โ€” Launch the interactive image morpher. Default values: 'nb_frames=16' and 'preview_fidelity=3'. ๐Ÿซ 
  • x_pacman โ€” Launch pacman game. ๐Ÿ‘ป
  • x_paint โ€” Launch the interactive painter. ๐Ÿ–Œ๏ธ
  • x_plasma โ€” Launch the plasma effect demo. ๐ŸŒŒ
  • x_quantize_rgb _nbcolors>=2 โ€” Launch the RGB color quantization demo. ๐ŸŽ›๏ธ
  • x_reflection3d โ€” Launch the 3D reflection demo. ๐Ÿชž
  • x_rubber3d โ€” Launch the 3D rubber object demo. ๐Ÿช€
  • x_segment _max_resolution={ 0:Auto | >=128 } โ€” Segment foreground from background in selected opaque RGB images, interactively. Return RGBA images with binary alpha-channels. Default value: 'max_resolution=1024'. ๐Ÿช„
  • x_select_color _variable_name โ€” Display an RGB or RGBA color selector. Argument variable_name 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 '-1' to it forces the interactive window to close. Default value: 'variable_name=xsc_variable'. ๐ŸŽจ
  • x_select_function1d _variable_name,_background_curve_R,_background_curve_G,_background_curve_B โ€” 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 variable_name specifies the variable that contains the selected function keypoints at any time. Assigning '-1' to it forces the interactive window to close. Default values: 'variable_name=xsf_variable', 'background_curve_R=220', 'background_curve_G=background_curve_B=background_curve_T'. ๐Ÿ“ˆ
  • x_select_palette _variable_name,_number_of_columns={ 0:Auto | >0 } โ€” Open a RGB or RGBA color selector widget from a palette. The palette is given as a selected image. Argument variable_name specifies the variable that contains the selected color values (as R,G,B,[A]) at any time. Assigning '-1' to it forces the interactive window to close. Default values: 'variable_name=xsp_variable' and 'number_of_columns=2'. ๐ŸŽจ
  • x_shadebobs โ€” Launch the shade bobs demo. ๐Ÿซง
  • x_spline โ€” Launch spline curve editor. ๐ŸŽข
  • x_starfield3d โ€” Launch the 3D starfield demo. โญ
  • x_tetris โ€” Launch tetris game. ๐Ÿงฑ
  • x_threshold โ€” Threshold selected images interactively. โš–๏ธ
  • x_tictactoe โ€” Launch tic-tac-toe game. โŒโญ•
  • x_tixy "expression" โ€” Animate specified mathematical expression with a 16x16 grid of circles, using the rules described at https://tixy.land. ๐Ÿ”ต
  • x_warp _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 โ€” Launch the interactive image warper. Default values: 'nb_keypoints_xgrid=nb_keypoints_ygrid=2', 'nb_keypoints_contours=0' and 'preview_fidelity=1'. ๐Ÿช„
  • x_waves โ€” Launch the image waves demo. ๐ŸŒŠ
  • x_whirl _opacity>=0 โ€” Launch the fractal whirls demo. Default values: 'opacity=0.2'. ๐ŸŒ€

12. Examples of Use โœจ

gmic 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: ๐Ÿ’–

View a list of images: ๐Ÿ‘€

$ gmic file1.bmp file2.jpeg

Convert an image file: ๐Ÿ”„

$ gmic input.bmp output output.jpg

Create a volumetric image from a movie sequence: ๐ŸŽฌ

$ gmic input.mpg append z output output.hdr

Compute the image gradient norm: ๐Ÿ“

$ gmic input.bmp gradient_norm

Denoise a color image: ๐Ÿงผ

$ gmic image.jpg denoise 30,10 output denoised.jpg

Compose two images using overlay layer blending: ๐Ÿซถ

$ gmic image1.jpg image2.jpg blend overlay output blended.jpg

Evaluate a mathematical expression: ๐Ÿงฎ

$ gmic echo "cos(pi/4)^2+sin(pi/4)^2={cos(pi/4)^2+sin(pi/4)^2}"

Plot a 2D function: ๐Ÿ“ˆ

$ 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

../img/example_plot.png [image: '2D Plot']

Plot a 3D elevated function in random colors: ๐ŸŒˆ

$ 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)*sin(Y))'"

../img/example_elevation3d.png [image: '3D Elevation']

Plot the isosurface of a 3D volume: ๐Ÿซง

$ gmic mode3d 5 moded3d 5 isosurface3d "'x^2+y^2+abs(z)^abs(4*cos(x*y*z*3))'",3

../img/example_isosurface3d.png [image: '3D Isosurface']

$ 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

../img/example_logo.png [image: '3D G'MIC Logo']

Generate a 3D ring of torii: ๐Ÿฉ

$ 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

../img/example_torii.png [image: '3D Ring']

Create a vase from a 3D isosurface: ๐Ÿบ

$ 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

../img/example_vase.png [image: '3D Vase']

Launch a set of interactive demos: ๐ŸŽฎ

$ gmic demos
** G'MIC comes with ABSOLUTELY NO WARRANTY; for details visit: https://gmic.eu **

And thatโ€™s the whole slay, bestie ๐Ÿ’– The very last line is the G'MIC(1) footer โ€” source/version and date โ€” so Iโ€™m not copy-pasting it, just giving it the respect it deserves: source/version + date, iconic, periodt. ๐ŸŽ€โœจ

๐Ÿ“ฆ where this page comes from