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
0and 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], ifnameuses 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 commandnamefor 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,3Dor4Darray of scalar values, uniformly discretized on a rectangular or parallelepiped domain. ๐ - The four dimensions are:
width, the number of image columns (size along thex-axis).height, the number of image rows (size along they-axis).depth, the number of image slices (size along thez-axis). The depth is equal to1for typical color or grayscale2Dimages.spectrum, the number of image channels (size along thec-axis). The spectrum is equal to3and4for standardRGBandRGBAcolor 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,heightanddepthof an image are considered as spatial dimensions, while thespectrumrepresents the spectral dimension. Thus, a4Dimage in G'MIC should be most often regarded as a3Ddataset of multi-spectral voxels. Most G'MIC commands adhere to this convention (e.g. by default, commandblurblurs4Dimages only along the three spatialxyz-axes). ๐ - G'MIC stores all the image data as buffers of
floatvalues (32bits, value range[-3.4E38,+3.4E38]). It performs all its image processing operations with floating-point numbers. Each image pixel then requires32bits per channel (except if double-precision buffers have been enabled during the compilation of the software, in which case64bits 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-.extstand for the standard input/output (stdin/stdout) streams, optionally forced to be in a specificextfile format (e.g.-.jpgor-.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.selectionmay represent one or several images (see section Command Items and Selections to learn more about selections). ๐จ๏ธwidth[%],_height[%],_depth[%],_spectrum[%],_values[xN]: Insert one orNnew 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].valuescan be either a sequence of numbers separated by commas,, or a mathematical expression, as e.g. in input item256,256,1,3,[x,y,128]which creates a256x256RGB 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 orNnew 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 a3x3matrix (scalar image), with values running from1to9. ๐ข('string'[:delimiter])[xN]: Insert one orNnew images from the given string, by filling the images with the character codes composing the string. When specified,delimiterdefines the main orientation of the image. Delimiter can bex(equivalent to,which is the default),y(eq. to;),z(eq. to/) orc(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 orNnew "empty" images, containing no pixel data. Empty images are used only in rare occasions. ๐ซฅ
- Input item
name=valuedeclares a new variablename, 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). ๐จโ๐ฉโ๐ง
- When it starts with an underscore
- 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 commandparallelfor 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=1foo+=3. โ - Input item
name.=stringappendsstringat the end of variablename. โก๏ธ - Input item
name..=stringprependsstringat the beginning of variablename. โฌ ๏ธ - Multiple variable assignments and updates are allowed, with expressions:
name1,name2,...,nameN=valueorname1,name2,...,nameN=value1,value2,...,valueNwhere assignment operator=can be replaced by one of the allowed operators (e.g.+=). ๐ - Variables usually store numbers or strings. Use command
storeto assign variables from image data (and syntaxinput $variableto 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,
resizeandrare 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 forselection: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 imagesname1andname2.
- 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 arepeat..doneloop 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 commandreverse[selection]. - Selections
[-1],[-2]and[-3]are used so often that they got their own shortcuts:.,..and...๐. Soblur..is equivalent toblur[-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,,1is invalid butblur 1is 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,,2orflower ,are correct.
- 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,
- 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.
- 2D grayscale/color files:
- 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
.pngor.tifffile, 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 commandsplit3dfor 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
.jpgfile, you'll get a loss of information. ๐ญ Use the G'MIC-specific file extension.gmzto 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]]]. Setlast_frame==-1to tell it must be the last frame of the video. Setstepto0to force an opened video file to be opened/closed. Output framerate and codec can also be set by using the output expressionfilename.avi,_fps,_codec,_keep_openwherekeep_opencan be{ 0:No (default) | 1:Yes }.codecis a 4-char string (see http://www.fourcc.org/codecs.php ) or0for the default codec.keep_openindicates whether the output video file must be kept open for appending new frames afterwards. ๐ฅ .cimg[z]files: Only crops and sub-images of.cimgfiles can be loaded, using the input expressionsfilename.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,z1orfilename.cimg,N0,N1,x0,y0,z0,c0,x1,y1,z1,c1. Specifying-1for one coordinates stands for the maximum possible value. Output expressionfilename.cimg[z][,datatype]can be used to force the output pixel type.datatypecan be{ auto | bool | uint8 | int8 | uint16 | int16 | uint32 | int32 | uint64 | int64 | float32 | float64 }. So many types, I know โ but you got this. ๐.rawbinary files: Image dimensions and input pixel type may be specified when loading.rawfiles with input expressionfilename.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 expressionfilename.raw[,datatype].datatypecan be the same as for.cimg[z]files. ๐ง.yuvfiles: Image dimensions must be specified when loading, and only sub-frames of an image sequence may be loaded, using the input expressionfilename.yuv,width,height[,chroma_subsampling[,first_frame[,last_frame[,step]]].chroma_subsamplingcan be{ 420 | 422 | 444 }. When saving, chroma subsampling mode can be specified with output expressionfilename.yuv[,chroma_subsampling]. ๐.tifffiles: Only sub-images of multi-pages tiff files can be loaded, using the input expressionfilename.tif,_first_frame,_last_frame,_step. Output expressionfilename.tiff,_datatype,_compression,_force_multipage,_use_bigtiffcan be used to specify the output pixel type, as well as the compression method.datatypecan be the same as for.cimg[z]files.compressioncan 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_multipagecan be{ 0:No (default) | 1:Yes }.use_bigtiffcan be{ 0:No | 1:Yes (default) }. That's a whole lot of compression options and honestly? Slay. ๐ฅ.pdffiles: When loading a file, the rendering resolution can be specified using the input expressionfilename.pdf,resolution, whereresolutionis an unsigned integer value. ๐.giffiles: Animated gif files can be saved, using the input expressionfilename.gif,fps>0,nb_loops. Specifynb_loops=0to get an infinite number of animation loops (this is the default behavior). Loops forever, just like my love for Unix. ๐.jpegand.webpfiles: The output quality may be specified (in %), using the output expressionfilename.jpg,30(here, to get a 30% quality output).100is the default. โญ.pngfiles: The bit depth can be specified (8 or 16), using the output expressionfilename.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. ๐ฆ.mncfiles: The output header can be set from another file, using the output expressionfilename.mnc,header_template.mnc. ๐.pan,.cpp,.hpp,.cand.hfiles: The output datatype can be selected with output expressionfilename[,datatype].datatypecan be the same as for.cimg[z]files. โจ.gmicfiles: 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 expressionfilename.gmic[,add_debug_info]wheredebug_infocan 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. ๐
- Video files: Only sub-frames of an image sequence may be loaded, using the input expression
- 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. ๐ช $nameand${name}are both substituted by the value of the named variable (set previously by the itemname=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 from0(first loop iteration) tonb_iterations - 1(last iteration).$<does the opposite (except forforandwhileloops, where$<isnanas the number of iterations is unknown). Loop drama, honestly. ๐ญ$%: A value that linearly goes from0(first iteration) to1(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.cliorgimp). ๐$_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.gmicoruser.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 asyymmdd. For stable releases, this variable is set to0. ๐ฆ$_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 to1if colored text output is allowed on the console. Otherwise, set to0. Colors on or off, that's the vibe check. ๐
$$nameand$${name}โ both get swapped out for the G'MIC script code of thecustom commandcalled 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 by102,111,111, and{'foo':;}by102;111;111. This is lowkey giving character-code realness. ๐{image,feature[:delimiter]}โ becomes a specific feature of the image[image]. Theimagecan 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 specifiedfeaturecan 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
featureis 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 by3.14159(while{pi}is substituted by3.141592653589793). ๐ญ - A
featuredelimited 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 byfoo, and item{`vector8(65)`}byAAAAAAAA. ๐ฅ
{*}โ 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). Requestedfeaturescan 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
featurestands 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 afeature(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 in3+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.filloreval). ๐ฅ - When the context allows it, a formula is evaluated for each pixel of the selected images (e.g.
filloreval). โจ - 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 vectorsAandB. 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 vectorsAandB. classic.atan2(y,x)โ it's the two-argument glow-up ofatan(), takingyandx, exactly like in C/C++. iconic behavior fr.perm(k,n,_with_order)โ counts the permutations ofkobjects pulled from a set ofnobjects. math girlies stay winning โจgauss(x,_sigma,_is_normalized)โ returnsexp(-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 backxif it's chilling inside the range[min, max], otherwise it clamps tominormax. gatekeeping your values, respectfully ๐งabscut(x,min,_max,_offset)โ returnscut(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'sN). nosey but useful ๐arg0(i,a_0,..,a_N)โ gives you thei-th argumenta_i, where indexiruns from0toN.arg1(i,a_1,..,a_N)โ literally the same thing but the indexiruns from1toNinstead. one-based besties rise ๐indexof(ref,a_0,..,a_N)โ finds the indexiofrefinside the lista_k, or returns-1ifrefisn't in the list at all (rude). indexistarts from0.isnum(),isnan(),isinf(),isint(),isbool()โ these test the type of the number or expression you give them, and they return0(false) or1(true). vibe check for numbers ๐isfile('path')/isdir('path')โ returns0(false) or1(true) depending on whether that string argument is a path to an existing file (or, forisdir, a directory) ๐๏ธispercentage(arg)โ returns1(true) ifargends with a%, and0(false) otherwise. percent-coded โจisvarname('str')โ returns0(false) or1(true) depending on whether that string is a valid variable name. name-checking, literally.isvar(varname)โ returns0(false) or1(true) depending on whethervarnameis already a defined variable. is she already in the group chat or not ๐ซถisin(v,a_1,...,a_n)โ returns0(false) or1(true) depending on whether the first argumentvshows up in the set of other argumentsa_i. basically "are you on the list" ๐๏ธisint(x,_xmin,_xmax)โ returns1(true) ifxis an integer sitting in the range[xmin,xmax], otherwise0(false). whole-number only, no decimals allowed ๐inrange(value,m,M,include_m,include_M)โ returns0(false) or1(true) depending on whether the value lies in range[m, M]. theinclude_mandincludeMargs tell it how the boundariesmandMget treated (in or out, bestie, your call) ๐argkth(),argmin(),argmax(),argminabs(),argmaxabs(),avg(),kth(),min(),max(),minabs(),maxabs(),med(),prod(),std(),sum()andvar()โ 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()andvvar()โ 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].typepicks 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.directioncan be{ -1:To-lowest | 0:To-nearest | 1:To-highest }. pick your fighter โจsoftmax(V,_temperature)andsoftmin(V,_temperature)โ return the softmax and softmin of vectorVrespectively. the default value fortemperatureis1. soft girl summer but make it vector math ๐ธsoftargmax(V,_temperature)andsoftargmin(V,_temperature)โ return the softargmax and softargmin of vectorVrespectively. default fortemperatureis1. yeah, they really made both flavors ๐ญlerp(a,b,t)โ returnsa*(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 offsetsoffset0andoffset1. 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 (0otherwise).hโ height of the current image, if any (0otherwise).dโ depth of the current image, if any (0otherwise).sโ spectrum of the current image, if any (0otherwise).rโ shared state of the current image, if any (0otherwise).whโ shortcut forwidth*height.whdโ shortcut forwidth*height*depth.whdsโ shortcut forwidth*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 (0otherwise). that's a whole squad right there ๐xm,ym,zm,cmโ the pixel coordinates of the minimum value in the current image, if any (0otherwise).xM,yM,zM,cMโ the pixel coordinates of the maximum value in the current image, if any (0otherwise).
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 functionresize(#ind,..)gets used inside the math expression. if that happens, it's safer to calll(),w(_#ind),h(_#ind), ...s(_#ind)andin(_#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 (0otherwise).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 (0otherwise).Nmust be an integer in range[0,9]. don't push it ๐R,G,BandAโ equivalent toi0,i1,i2andi3respectively. rgb girlies, this is your moment ๐Iโ the currently processed vector pixel in the current image, if any (0otherwise). the number of vector components equals the number of image channels (so for anRGBimage,I=[ R,G,B ]). slay ๐_0and_1โ vectors whose dimension equals the number of channels of the current image, and whose values are all0or all1respectively.- You can add
#indto 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#0denotes the average value of the first image in the list. iykyk ๐ฅ xโ the currently processed column of the image, if any (0otherwise).yโ the currently processed row of the image, if any (0otherwise).zโ the currently processed slice of the image, if any (0otherwise).cโ the currently processed channel of the image, if any (0otherwise).tโ the thread id when an expression is evaluated with multiple threads (0means the master thread).nโ the maximum number of threads when the expression is evaluated in parallel (sotruns from0ton-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 between1.0and the next value representable by a double.uโ a random value between[0,1], following a uniform distribution.vโ a random integer that's either0or1, following a uniform distribution.gโ a random value following a gaussian distribution of variance1(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 is0.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 is0.- 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 variablesi,I,R,G,B, etc. act as read-only values. so writingI = [255,0,0]ori = 128will create (or overwrite) a new local variableiorIinside 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 ]ori(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 aN-dimensional vector with scalar coefficientsak. iconic.vectorN(a0,a1,,...,aN-1)โ does the exact same thing, except theakget 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 expressionN.- In all of the expressions above, the
akcan themselves be vectors, and they get concatenated into one single vector. nesting, slay. - You grab the scalar element
akof a vectorXwithX[k]. - You grab the sub-vector
[X[p],X[p+s]...X[p+s*(q-1)]](of sizeq) of a vectorXwithX[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)andsame(A,B,_nb_vals,_is_case_sensitive)(vector equality test). - Function
normP(u1,...,un)computes the LP-norm of the specified vector โPbeing a constant orinf, as in e.g.norm1(). - Function
normp(V,_p)computes the Lp-norm of the vectorV. Herepcan be variable, and the default value forpis2. - Function
unitnorm(V,_p)returns a normalized versionV/normp(V)of vectorV. Default value forpis2. - Function
resize(A,size,_interpolation,_boundary_conditions)returns a resized version of a vectorAwith the given interpolation mode.interpolationcan be { -1:None (memory content) | 0:None | 1:Nearest | 2:Average | 3:Linear | 4:Grid | 5:Bicubic | 6:Lanczos }, andboundary_conditionscan be { 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }. - Function
find(A,B,_starting_index,_search_step,_max_iterations)returns the index where sub-vectorBappears in vectorAโ or-1ifBis not contained inA๐ญ. ArgumentAcan 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-exponentiationcabs()โ complex moduluscarg()โ complex argumentcconj()โ complex conjugatecexp()โ complex exponentialclog()โ complex logarithmccos()โ complex cosinecsin()โ complex sinecsqr()โ complex squarecsqrt()โ complex square rootctan()โ complex tangentccosh()โ complex hyperbolic cosinecsinh()โ complex hyperbolic sinectanh()โ 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 multiplicationdet(A)โ determinantdiag(V)โ diagonal matrix from a vectoreig(A)โ eigenvalues/eigenvectorseye(n)โ n x n identity matrixinvert(A,_nb_colsA)โ matrix inversemul(A,B,_nb_colsB)โ matrix-matrix multiplicationqr(A, _nb_colsA,_is_reduced_form)rot(u,v,w,angle)โ 3D rotation matrixrot(angle)โ 2D rotation matrixsolve(A,B,_nb_colsB)โ solver of linear system A.X = Bsvd(A,_nb_colsA)โ singular value decompositiontrace(A)โ matrix tracetranspose(A, nb_colsA)โ matrix transpose
ngl tiny little detail that saves your life: argumentnb_colsBmay be omitted if it is equal to1. โจ
๐ฆ 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 sizew*h*d*swith values generated from the given formula, as if one were filling an image with dimensions(w,h,d,s). IfAis specified, it must be a vector of sizew*h*d*N(Ncan be different froms). It is then passed as a reference image (of sizewxhxdxN) 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 theresize()function. It lets you resize the vectorA, 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 imageA(of size(wA,hA,dA,sA), treated as a vector of size(wA*hA*dA*sA)) by the warping fieldB(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 imageAby the colormapP. This is the math evaluator equivalent of command index. - Function
permute(A,wA,hA,dA,sA,permutation)returns a permuted version of the imageA(of size(wA,hA,dA,sA), treated as a vector of sizewA*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 imageA(of size(wA,hA,dA,sA), treated as a vector of sizewA*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 imageA(of size(wA,hA,dA,sA), treated as a vector of sizewA*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 vectorA. This is the math evaluator equivalent of command histogram. - Function
equalize(A,nb_levels,_min_value,_max_value)returns the equalized version of the vectorA. This is the math evaluator equivalent of command equalize. - Function
normalize(A,_min_value,_max_value)returns the normalized version of the vectorA. This is the math evaluator equivalent of command normalize. - Function
mproj(S,nb_colsS,D,nb_colsD,method,max_iter,max_residual)projects a matrixSonto 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 functionifft(). These functions replace the content ofRandIin-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 vectorA, 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 vectorA. This is the math evaluator equivalent of command noise. - Function
rand(#size,_min_value,_max_value,_pdf,_precision)returns a vector ofsizerandom 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 givencharacter string(e.g.''foo''is equal to[ 102,111,111 ])._'character'returns the ASCII code of the given character (e.g._'A'is equal to65).- A special case happens for empty strings: values of both expressions
['']and''''are0. ๐ yes really. - Functions
lowercase()anduppercase()return a string with all string characters lowercased or uppercased. - Function
s2v(str,_starting_index,_is_strict)parses stringstrand returns the value contained in it. - Function
v2s(expr,_nb_digits,_siz)returns a vector of sizesizwhich contains the character representation of values described by expressionexpr.nb_digitscan 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)โ insertsNnew elementselt_kstarting from indexposin dynamic array[ind].da_push(_#ind,elt1,_elt2,...,_eltN)โ insertsNnew elementselt_kat the end of dynamic array[ind].da_pop(_#ind)โ same asda_back()but also removes the last element from dynamic array[ind].da_push_heap(_#ind,elt1,_elt2,...,_eltN)andda_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)andda_push_heap_n(_#ind,n,elt1,_elt2,...,_eltN)โ variants that insert the given elements consecutively,ntimes. If no elements are given, they insertnempty elements. No notes.da_remove(_#ind,_start,_end)โ removes elements located between indicesstartandend(included) in dynamic array[ind].da_freeze(_#ind)โ converts a dynamic array into a1-column image with heightda_size(#ind). Glow-up into image form.- The value of the k-th element of dynamic array
[ind]is retrieved withi[_#ind,k](if the element is a scalar value), orI[_#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 expression1;2;piis evaluated aspi. 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
constbefore 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 expressionexpr.o2c(_#ind,offset,_boundary_conditions)andc2o(_#ind,x,_y,_z,_c,_boundary_conditions)โ convert image offset to image coordinates and vice-versa. Argumentboundary_conditionscan be{ 0:None | 1:Return -1 if out-of-range }.fill(target,expr)orfill(target,index_name,expr)โ fills the vector variabletarget, 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 variabletarget, treated as an image of size(w,h,d,s), using the given expression.u(max)oru(min,max,_include_min,_include_max)โ returns a random value in range0...maxormin...max, following a uniform distribution. Each range extremum can be included (default) in the distribution or not.v(max)orv(min,max,_include_min,_include_max)โ does the same but returns an integer in the specified range. Integer behavior, no crumbs.f2ui(value)andui2f(value)โ convert a large unsigned integer as a negative floating-point value (and vice-versa), so that32-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 (0otherwise).interpolation_typecan be{ 0:Nearest neighbor | 1:Linear | 2:Cubic }.boundary_conditionscan be{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }. Omitted coordinates are replaced by their default values, which are respectivelyx,y,z,c,interpolationandboundary. 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 atoffsetin the associated image buffer (or0if 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]andi[offset,_boundary_conditions]โ similar expressions used to access pixel values for any numbered image[ind]in the list.I/J[_#ind,offset,_boundary_conditions]andI/J(_#ind,_x,_y,_z,_interpolation,_boundary_conditions)โ do the same asi/j[_#ind,offset,_boundary_conditions]andi/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 ifindis 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 vectorS, 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 spriteSin image[ind](or in the default image selected ifindis 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 spriteSin the vectorD, 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 ifindis not specified) at given coordinates. It draws a single line ifnb_verticesis set to2.polygon(_#ind,-nb_vertices,coords,_opacity,_pattern,_color)โ draws an outlined polygon in image[ind](or in the default image selected ifindis not specified) at given coordinates and with line pattern. It draws a single line ifnb_verticesis set to2. Outline era.ellipse(_#ind,xc,yc,radius1,_radius2,_angle,_opacity,_color)โ draws a filled ellipse in image[ind](or in the default image selected ifindis 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 ifindis 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 ifindis not specified) with given coordinates. This is the math evaluator equivalent of commandflood.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 functionsw(_#ind),h(_#ind),d(_#ind),s(_#ind),wh(_#ind),whd(_#ind)andwhds(_#ind)instead of the corresponding constant variables.if(condition,expr_then,_expr_else)โ returns value ofexpr_thenorexpr_else, depending on the value ofcondition{ 0:False | other:True }.expr_elsecan be omitted, in which case0is returned if the condition does not hold. Using the ternary operatorcondition?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 ofexpressionuntilconditionvanishes (or until abreak()instruction is encountered if noconditionis 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 expressioninit, then iteratively evaluatesbody(followed byprocedureif specified) whileconditionholds (i.e. not zero). It may happen that no iterations are done, in which case the function returnsnan. Otherwise, it returns the last value ofbody. 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 asfor(init,condition,expression)but with no initializing expression specified, periodt. ๐repeat(nb_iters,expr)orfill(nb_iters,iter_name,expr)โ runsnb_itersiterations of the given expressionexpr, likeV = 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()andcontinue()โ respectively terminate or continue execution of the current loop or block. know the difference bestie โจfsize('filename')โ returns the size of the givenfilename(or-1if the file does not exist). ๐date(attr,'path')โ returns the date attribute for the givenpath(file or directory), withattrbeing{ 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,...)orprint(#ind)โ prints the value of the given expressions (or image information) on the console, and returns the value of the last expression (ornanin case of an image). Functionprints(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)ordisplay(#ind)โ displays the contents of the vectorX(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)andend(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. infill ">begin(foo = 0); ++foo"). ๐copy(dest,src,_nb_elts,_inc_d,_inc_s,_opacity)โ copies an entire memory block ofnb_eltselements starting from a source valuesrcto a specified destinationdest, with increments defined byinc_dandinc_srespectively 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 vectorX, treated as an image of size(w,h,d,s). ๐งฎref(expr,a)โ references the given expressionexpras variable namea. ๐ชข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 expressionexpr(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_namewith the value of expressionA. IfAis a vector variable, it is assumed to encode a string. ๐ชstore('variable_name',A,_w,_h,_d,_s,_is_compressed)โ transfers the data of vectorAas 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 ofsizevalues, or as a scalar (ifsizeis zero or not specified). ๐ฃname(_#ind,size)โ returns a vector of sizesize, whose values are the character codes of the name of image[ind](or default image selected ifindis 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 imageIwith the(wK,hK,dK,sK)-sized kernelK(the meaning of the other arguments is the same as in commandcorrelate). Similar functionconvolve(...)is also defined for computing the convolution betweenIandK. ๐ง
๐ฆ 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,evalorinputcommands 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
fillorevalcommands 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-expressionexprin a single thread at a time. ๐ begin_t(expr)andend_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]=valueandj[_#ind,offset]=valueset a pixel value at a location other than the current one in the image[ind](or in the current image if argument#indis omitted), either with global coordinates/offsets (withi(...)andi[...]), or relatively to the current position(x,y,z,c)(withj(...)andj[...]). These expressions always returnvalue. ๐จ
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 toolgmicautomatically runs the commandcli_startif it's defined. ๐ซถ- Custom command names have to use the character set
[a-zA-Z0-9_]and cannot start with a number. - Any
# commentexpression 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
$-expressionsare 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.$iand${i}both get swapped for thei-th argument. Negative indices like${-j}are allowed and refer to thej-th latest argument. And$0gets 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 todefaultotherwise (defaultcan be a$-expressiontoo).${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). ๐ธ$=vargets swapped for the set of instructions that will assign each argument$ito the named variablevar$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
$-expressionsfor 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:
- Custom command names have to use the character set
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
+commandby 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, invokingcommandis 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_keypointsis the maximal number of keypoints generated by the compression method. Ifmax_keypoints<0, the removal step is not done when the number of maximal keypoints has been reached.max_keypoints=0meansno limits. ๐ฅerr_avgis the desired average compression error.err_maxis the desired pointwise max compression error.err_commandis 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 thumbnailsLMB: Select thumbnail or shift thumbnail bar0-9,ARROWS(optionally+SHIFT),B,BACKSPACE,C,E,END,H,HOME,SPACE: Navigate and select thumbnails (addCTRLif the mouse pointer is outside the thumbnail bar).
- Image view:
LMBorMMB: Image panRMBorMW: Image zoomARROWS(optionally+SHIFT),HOME,END: Shift viewA: Switch alpha renderingC: Center viewE: Go to lower-right cornerRETURN: Reset viewG: Toggle gridH: Go to upper-left cornerK: Switch backgroundM: Toggle 3D viewN: Switch normalizationP: Print info about current image pixel onstdoutPAGEUPorPAGEDOWN: Raise/lower base channelR: Rotate imageT: Plot as a 1D curveV: Crop imageZ: Switch zoom factor0-9: Set zoom factor. ๐
- 3D mesh view:
LMB: Mesh rotationCTRL+LMBorMMB: Mesh panRMB: Mesh zoomA: Toggle axesD: Switch face side modeF: Change focal lengthJ: Start/stop animationK: Switch backgroundO: Switch outline modeP: Print 3D pose matrix onstdoutR: Switch rendering modeT: Switch motion rendering modeX: Show/hide bounding-boxU: Switch animation modeZ: Toggle z-buffer. ๐ง
- 2D images specific:
CTRL+LMB: Rectangular selection.
- 3D volumetric images specific:
CTRL+MW: Pan along orthogonal axisX: 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
.gmzfile - Ctrl+L โ save a copy of the image list as a
.gmzfile ๐ฆ - Ctrl+S โ save a screenshot as a
.pngfile ๐ธ - 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 numberNof images whose information is initially printed onstderrorstdout._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 tobounding-boxmode (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_typecan be{ 0:None | 1:Lines | 2:Splines | 3:Bar }.vertex_typecan be{ 0:None | 1:Points | 2,3:Crosses | 4,5:Circles | 6,7:Squares }.xmin,xmax,ymin,ymaxset the coordinates of the displayed xy-axes.- if the specified
widthorheightis0, 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_typecan be{ r<0:Dots with radius -r | 0:No outline | r>0:Lines+dots with radius r }.fill_colorcan 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 returns0or1. 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#@guilines.
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_typecan be {0:None |1:Lines |2:Splines |3:Bar }.vertex_typecan be {0:None |1:Points |2,3:Crosses |4,5:Circles |6,7:Squares }.xmin,xmax,ymin,ymaxset 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 information on selected images, on the standard error (stderr). (Equivalent to shortcut command p, bestie.)
When you invoke it with a+prefix (so likestdoutinstead of onstderr. 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_typecan be {0:Point |1:Segment |2:Rectangle |3:Ellipse }.- The arguments
X,Y,Zdetermine 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 ๐
datatypecan be {auto|uint8|int8|uint16|int16|uint32|int32|uint64|int64|float32|float64}.- Specify
datatypeif 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.gmzfile). - If
store_namesis set to1, serialization uses the.gmzformat 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], whereNis the number of specified arguments. - If
Nis higher than the number of images in the selection, an error is thrown. Rude, but fair. - If
Nis 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 isvalue[%] | [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 isvalue[%] | [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 formod. that's it, that's the whole vibe.mod,+โ arg isvalue[%] | [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 formmul. iconic abbreviation behavior.mmul,+โ arg isvalue[%] | [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 them*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 formul.mul,+โ arg isvalue[%] | [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 forneq. no cap.neq,+โ arg isvalue[%] | [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 foror.or,+โ arg isvalue[%] | [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 forpow.pow,+โ arg isvalue[%] | [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 appliesi*180/pi. easy math, slay ๐rol,+โ arg isvalue[%] | [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 isvalue[%] | [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 forsub.sub,+โ arg isvalue[%] | [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 isvalue[%] | [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 is0<=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 isgamma>=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 isdatatype_source,datatype_target. Casts the datatype of the image buffer from the specified source type to the specified target type. Bothdatatype_sourceanddatatype_targetcan 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. Setmaximum_sequence_length=0to disable the maximum length constraint. Default values:is_binary_data=0andmaximum_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=33andreconstruction_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 ], whereMinandMaxdefine the value range of the decompressed image, andUse_RBFtells 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
strengthis positive, image brightness is amplified. - if
strengthis 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_400kodak_tmax_3200kodak_tmax_3200_+kodak_tmax_3200_++kodak_tmax_3200_-kodak_tmax_3200_altkodak_tri-x_400kodak_tri-x_400_+kodak_tri-x_400_++kodak_tri-x_400_-kodak_tri-x_400_altkorben_214la_la_landlandscapelandscape_01landscape_02landscape_03landscape_04landscape_05landscape_1landscape_10landscape_2landscape_3landscape_4landscape_5landscape_6landscape_7landscape_8landscape_9lateafternoonwanderlustlatesunsetlavarklc_1lc_10lc_2lc_3lc_4lc_5lc_6lc_7lc_8lc_9lenox_340levexlife_giving_treelightlight_blownlitorelittle_womenloganlomolomography_redscale_100lomography_x-pro_slide_200london_nightslongbeachmorninglorolottalouettalow_altitudelow_contrast_bluelow_key_01lucky_64lushgreenlushgreensummermad_max_fury_roadmaeskymagenta_daymagenta_day_01magenta_dreammagenta_yellowmagentacoffeemagichourmarriage_storymatrixmckinnon_75memoriesmercatometropolismilo_5minimalistcaffeinationmodern_filmmodern_films_01modern_films_02modern_films_03modern_films_04modern_films_05modern_films_06modern_films_07moltimono_2mono_tintedmonochromemonochrome_1monochrome_2moody_1moody_10moody_2moody_3moody_4moody_5moody_6moody_7moody_8moody_9moonlightmoonlight_01moonlight_2moonrisemorning_6morroco_16mostly_bluemother!motusmoviz_1moviz_10moviz_11moviz_12moviz_13moviz_14moviz_15moviz_16moviz_17moviz_18moviz_19moviz_2moviz_20moviz_21moviz_22moviz_23moviz_24moviz_25moviz_26moviz_27moviz_28moviz_29moviz_3moviz_30moviz_31moviz_32moviz_33moviz_34moviz_35moviz_36moviz_37moviz_38moviz_39moviz_4moviz_40moviz_41moviz_42moviz_43moviz_44moviz_45moviz_46moviz_47moviz_48moviz_5moviz_6moviz_7moviz_8moviz_9muccamute_shiftmuted_01muted_fademysticpurplesunsetnahnatural_01natural_02natural_03natural_vividnaturalboostnegativenemesisneon_770neutralneutral_pumpneutral_teal_orangeneutral_warm_fadenewspapernight_01night_02night_03night_04night_05night_blade_4night_king_141night_spynight_viewnightfromdaynightlifenigrumno_time_to_dienostalgiahoneynostalgicnw-1nw-10nw-2nw-3nw-4nw-5nw-6nw-7nw-8nw-9old_westonce_upon_a_timeonce_upon_a_time_in_hollywoodondaonly_redonly_red_and_blueoperation_yelloworange_dark_4orange_dark_7orange_dark_lookorange_toneorange_underexposedorangeandblueorangespadrepaladinpaladin_1875parasitepartiapasadena_21passing_bypersopicolapink_fadepirates_of_the_caribbeanpitaya_15pmcinematic_01pmcinematic_02pmcinematic_03pmcinematic_04pmcinematic_05pmcinematic_06pmcinematic_07pmnight_01pmnight_02pmnight_03pmnight_04pmnight_05polaroid_664polaroid_665polaroid_665_+polaroid_665_++polaroid_665_-polaroid_665_--polaroid_665_negativepolaroid_665_negative_+polaroid_665_negative_-polaroid_665_negative_hcpolaroid_667polaroid_669polaroid_669_+polaroid_669_++polaroid_669_+++polaroid_669_-polaroid_669_--polaroid_669_coldpolaroid_669_cold_+polaroid_669_cold_-polaroid_669_cold_--polaroid_672polaroid_690polaroid_690_+polaroid_690_++polaroid_690_-polaroid_690_--polaroid_690_coldpolaroid_690_cold_+polaroid_690_cold_++polaroid_690_cold_-polaroid_690_cold_--polaroid_690_warmpolaroid_690_warm_+polaroid_690_warm_++polaroid_690_warm_-polaroid_690_warm_--polaroid_polachromepolaroid_px-100uv+_coldpolaroid_px-100uv+_cold_+polaroid_px-100uv+_cold_++polaroid_px-100uv+_cold_+++polaroid_px-100uv+_cold_-polaroid_px-100uv+_cold_--polaroid_px-100uv+_warmpolaroid_px-100uv+_warm_+polaroid_px-100uv+_warm_++polaroid_px-100uv+_warm_+++polaroid_px-100uv+_warm_-polaroid_px-100uv+_warm_--polaroid_px-680polaroid_px-680_+polaroid_px-680_++polaroid_px-680_-polaroid_px-680_--polaroid_px-680_coldpolaroid_px-680_cold_+polaroid_px-680_cold_++polaroid_px-680_cold_++_altpolaroid_px-680_cold_-polaroid_px-680_cold_--polaroid_px-680_warmpolaroid_px-680_warm_+polaroid_px-680_warm_++polaroid_px-680_warm_-polaroid_px-680_warm_--polaroid_px-70polaroid_px-70_+polaroid_px-70_++polaroid_px-70_+++polaroid_px-70_-polaroid_px-70_--polaroid_px-70_coldpolaroid_px-70_cold_+polaroid_px-70_cold_++polaroid_px-70_cold_-polaroid_px-70_cold_--polaroid_px-70_warmpolaroid_px-70_warm_+polaroid_px-70_warm_++polaroid_px-70_warm_-polaroid_px-70_warm_--polaroid_time_zero_expiredpolaroid_time_zero_expired_+polaroid_time_zero_expired_++polaroid_time_zero_expired_-polaroid_time_zero_expired_--polaroid_time_zero_expired_---polaroid_time_zero_expired_coldpolaroid_time_zero_expired_cold_-polaroid_time_zero_expired_cold_--polaroid_time_zero_expired_cold_---portraitportrait_1portrait_10portrait_2portrait_3portrait_4portrait_5portrait_6portrait_7portrait_8portrait_9progressenprotect_highlights_01prussian_bluepseudogreypurplepurple_2quraqqq_12radarrandasred_afternoon_01red_day_01red_dream_01redblueyellowredsreds_oranges_yellowsreeve_38remy_24rest_33retroretro_brown_01retro_magenta_01retro_summer_3retro_yellow_01rocketmanrollei_ir_400rollei_ortho_25rollei_retro_100_tonalrollei_retro_80srotate_mutedrotate_vibrantrotatedrotated_crushsatidsaturated_bluesaving_private_damonscalascience_fictionscrittleseasegesselorsensumseparationserenityseringe_4serpentseventies_magazinesevsuzshade_kings_inkshadow_king_39shinesicariosinoskin_tonesslog_to_rec_709_basicslog_to_rec_709_contrastyslog_to_rec_709_crush_shadowsslog_to_rec_709_green_correctionsmart_contrastsmokeysmooth_clearsmooth_cromeishsmooth_fadesmooth_green_orangesmooth_sailingsmooth_teal_orangesoft_fadesoftblackandwhitesoftwarmingsolarized_colorsolarized_color_2soldispider-man_far_from_homespotlightspringmorningsprocket_231spy_29standardstar_wars_the_rise_of_skywalkerstranostreetstringastudio_skin_tone_shapersubtle_bluesubtle_greensubtle_yellowsullysummersummer_altsunlight_love_11sunlightlovesunnysunny_altsunny_richsunny_warmsunsetsunset_aqua_orangesunset_intense_violet_bluesunset_violet_moodsuper_warmsuper_warm_richsutro_fxsweet_bubblegumsweet_gelattotaลdemirrr_1taigatake_offtarracoteal-orange_for_flogteal_fadeteal_moonlighttealmagentagoldtealorangetealorange_1tealorange_2tealorange_3technicalfx_backlight_filterteigen_28tenettensiongreen_1tensiongreen_2tensiongreen_3tensiongreen_4terra_4the_dark_knightthe_darkest_hourthe_gentelmenthe_grand_budapest_hotelthe_hurt_lockerthe_irishmanthe_lighthousethe_lobsterthe_martianthe_matricesthe_revenantthe_shape_of_waterthe_social_networkthe_two_popesthe_way_backthor_ragnarokthriller_2tiraretoastedgardentop_gun_mavericktrent_18true_colors_8turkiest_42tuttotweed_71ultra_wateruncut_gemsundeniableundeniable_2underwaterunknownupglowurban_01urban_02urban_03urban_04urban_05urban_cowboyuzbek_bukharauzbek_marriageuzbek_samarcandevalizevalskyvelvetiavenomvery_warm_greenishvfb_21vibrantvibrant_alienvibrant_contrastvibrant_cromeishvictoryvintagevintage_01vintage_02vintage_03vintage_04vintage_05vintage_163vintage_altvintage_brightervintage_chromevintage_mobvintage_warmth_1violet_tastevireo_37vitavividvubeswar_for_the_planet_of_the_apeswarmwarm_dark_contrastywarm_fadewarm_fade_1warm_highlightwarm_neutralwarm_sunset_redwarm_tealwarm_vintagewarm_yellowwavefirewaveswell_seewesternwestern_6westernlut_2westernlut_2_13whiter_whiteswingspanwinterlighthousewipewolf_of_wall_streetwonder_womanwooden_gold_20x-men_dark_phoenixyangabuz_8yellow_55byellow_film_01yellowstoneyou_can_do_itzed_32zeke_39zilverfx_bw_solarizationzilverfx_infraredzilverfx_vintage_bwzombieland_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
strengthis positive, the contrast gets amplified ๐ฅ - If
strengthis 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 to0, the number of rows is estimated automatically. - If
'M'is set to0, 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 to0, 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==1ormode==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==1ormode==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_conditionsis meaningless. - When
interpolation==0,boundary_conditionscan be{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }. - When
interpolation=={ 3 | 5 | 6 },boundary_conditionscan 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_conditionsis meaningless. - When
interpolation==0,boundary_conditionscan be{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }. - When
interpolation=={ 3 | 5 | 6 },boundary_conditionscan 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(whereNis a positive integer) โ split the image intoNhomogeneous parts.-N[%](whereNis a positive integer) โ split the image as blocks of sizeN(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:
- Zhang Z. (1999). Flexible camera calibration by viewing a plane from unknown orientation.
- 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 groupscenter(xcenter,ycenter,zcenter),stride(xstride,ystride,zstride),dilation(xdilation,ydilation,zdilation),offset(xoffset,yoffset,zoffset) andsize(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. specifyingxoffsetwithout also specifyingyoffsetandzoffsetis 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 groupscenter(xcenter,ycenter,zcenter),stride(xstride,ystride,zstride),dilation(xdilation,ydilation,zdilation),offset(xoffset,yoffset,zoffset) andsize(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. specifyingxoffsetwithout also specifyingyoffsetandzoffsetis 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โ Backward0โ Centered1โ Forward2โ Sobel3โ Rotation-invariant (this one's the default, bestie ๐)4โ Deriche5โ Vanvliet6โ FB-Maxabs
And boundary_conditions is giving four options only:
0โ Dirichlet1โ Neumann2โ Periodic3โ 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 fornb_scales, the number of used scales is relative tonb_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)) withdthe 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 numbersx0,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 samplesYk = Mt*(Xk - avg)/std, which are the projections of theXkin a vector sub-space of (lower) dimensiontarget_dim.avgis the average vector of all theXk(or the zero vector ifnormalization_mode==0).stdis the standard deviation vector of all theXk(or the all-ones vector ifnormalization_mode<2).Mtis the transpose ofM, the matrix of thetarget_dimfirst eigenvectors (arranged by columns) of the covariance matrix of theXk.2: Output vectoravg: the average of theXk.4: Output vectorstd: the standard deviations of theXk.8: Output matrixM: 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 isN. - If set to
N<0, the size along the specified axis is at mostN.
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>0ssimโ 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.thicknessis the thickness of the drawing, specified in pixels.tiltis an angle, specified in degrees.tilt_strengthmust be a floating-point in[0,1](or in[0,100]if specified as a percentage).is_closedis 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
13and128are 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=1andcolor1=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=255andcolor4=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=5andpattern_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=0andmode=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
Nvertices is specified as anNxNadjacency matrix giving the weights of every edge connecting vertices โ set it toinfwhen two vertices aren't connected, iykyk. - This command returns a
1xNx1x2image holding the[distance,parent]info:distanceis the minimal distance from vertex#yto thestarting_vertex(i.e. the sum of edge weights making up the minimal path between those two vertices).parentis the index of the next vertex you have to follow to reach thestarting_vertexthrough 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
Mvectors of dimensionN(withM>1), specified as an image with sizeMxNx1x1,Mx1xNx1,Mx1x1xN,1xMxNx1,1xMx1xNor1x1xMxN. - The command returns a brand-new set of random vectors with similar geometry. ๐ฆ
Default values:relevant_dimension=100%, andaverage_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.methodsays 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 everymethod-2iterations.
max_itersets the max number of iterations processed for each signal. If it's set to0(the default),max_iterequals the number of columns in D. (only meaningful for matching pursuit and its variants, jsyk)max_residualgives 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=0andmax_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-5andmax_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รmifis_reduced_form==0, ormรmin(m,n)otherwise. - R is an upper-trianguler matrix of size
mรnifis_reduced_form==0ormin(m,n)รnotherwise. - 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=1andis_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 (or800x800if 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
- 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 commandapply_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 commandap). 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 commandapply_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 commandapc). ๐ฆ
[#1] image.jpg apply_parallel_channels "blur 3"
apoโ shortcut for commandapply_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 onnb_threadsoverlapped sub-images. (equivalent to shortcut commandapo). heads up:nb_threadsmust 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 commandapply_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 commandat). 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_timeoutto1if a timeout occurred,0otherwise. 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 currentdo...while,for...done,foreach...done,local...doneorrepeat...doneblock. 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 currentdo...while,for...done,foreach...done,local...doneorrepeat...doneblock. 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 ado...whileblock.
[#1] image.jpg luminance i:=ia+2 do set 255,{u(100)}%,{u(100)}% while ia<$i
done(+) โ end afor/foreach/local/repeat...doneblock, and go to associatedfor/foreach/repeatif iterations remain. (equivalent to shortcut command}). yes, the shortcut is literally a curly brace, she's mysterious like that ๐elif(+)conditionโ start aelif...[else]...fiblock if previousifwas not verified and test if specified condition holds.conditionis a mathematical expression, whose evaluation is interpreted as { 0:False | other:True }.
Tutorial: https://gmic.eu/tutorial/iffi
else(+) โ execute following commands if previousiforelifconditions failed.
Tutorial: https://gmic.eu/tutorial/iffi
fi(+) โ end aif...[elif]...[else]...fiblock. (equivalent to shortcut commandfi).
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 aonfailcommand. 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,
evalis similar to fill without assigning the image values. ๐งฎ
x(+) โ shortcut for commandexec.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. ifis_verbose=1, the executed command is allowed to output on stdout/stderr. (equivalent to shortcut commandx). leaving the house, leaving the interpreter ๐ช
Default value: is_verbose=1.
xoโ shortcut for commandexec_out.exec_out_mode,"command"โ execute external command using a system call, and return resultingstdoutand/orstderr.modecan be { 0:Stdout | 1:Stderr | 2:Stdout+stderr }. bringing the receipts back home ๐for(+)conditionโ start afor...doneblock.
[#1] image.jpg rescale2d ,32 400,400,1,3 x=0 for $x<400 image[1] [0],$x,$x x+=40 done
foreach(+) โ start aforeach...doneblock, 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 aif...[elif]...[else]...fiblock and test if specified condition holds.conditionis 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 commandlocal.local(+) โ start alocal...[onfail]...doneblock, with selected images. (equivalent to shortcut commandl). 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,noargtells 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 thelocal...doneblock. 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_threadscan 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 commandquit.quit(+) โ quit G'MIC interpreter. (equivalent to shortcut commandq). bye bestie ๐repeat(+)nb_iterationsโ startnb_iterationsiterations of arepeat...doneblock.nb_iterationsis 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. ๐โโ๏ธrprogress0<=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 ofprogress, 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 commandstatus.status(+)status_stringโ set the current status. used to define a returning value from a function. (equivalent to shortcut commandu).
[#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 ado...whileblock and go back to associateddoif specified condition holds.conditionis 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 usingnn_lib, the G'MIC neural network library. it's giving "import the whole toolbox" ๐งฐ
Default value: mode=0.
nn_addout,in0,in1,_in2,_in3โ add anaddlayer (element-wise addition) to the current network. thein_karguments 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_affineout,in,nb_channels>0,axis={ x | y | z | c },_learning_mode,_weight_decay>=0,_initialization
So yeah โ nn_affine says:
learning_modecan be one of{ 0:No learning | 1:Weights only | 2:Biases only | 3:Weights+biases }initializationcan 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_conditionscan be{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }learning_modecan be{ 0:No learning | 1:Weights only | 2:Biases only | 3:Weights+biases }initializationcan 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 convolutiongroups_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_conditionscan be{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }learning_modecan be{ 0:No learning | 1:Weights only | 2:Biases only | 3:Weights+biases }initializationcan 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_conditionscan be{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }learning_modecan be{ 0:No learning | 1:Weights only | 2:Biases only | 3:Weights+biases }initializationcan 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 elementxyzโ 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_modecan be{ 0:No learning | 1:Weights only | 2:Biases only | 3:Weights+biases }initializationcan 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 โ real1โ(real,imag) โ real2โ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 ammullayer that does matrix multiplicationin0*in1to the current network.in0orin1must be of compatible size. ๐nn_mmultโout,in0,in1โ adds ammultlayer that does matrix multiplicationin0*in1^tto the current network.in0orin1must be of compatible size. โจnn_mulโout,in0,in1,_in2,_in3โ adds amullayer (element-wise multiplication) to the current network. Thein_karguments 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 anllayer (nonlinearity) to the current network.activationcan 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 anoiselayer to the current network.noise_typecan be{ 0:Gaussian | 1:Uniform | 2:Salt&pepper | 3:Poisson | 4:Rice }. Iftraining_onlyis set, the noise is applied to the input only during the network training phase. Default values:amplitude=0.1,noise_type=0andtraining_only=1. ๐nn_normโout,in,p>=0,_axis={ 0 | x | y | z | c }โ adds anormlayer (Lp-norm computation) to the current network.pcan be{ 0:Sum of squares | >0:Lp-norm }. Default values:p=2andaxis=0. ๐nn_normalizeโout,in,axes,_normalization_type,_groups_x>=0,_groups_y>=0,_groups_z>=0,_groups_c>=0,_learning_modeโ adds anormalizelayer to the current network. This normalization layer is generic and can simulate the behavior of a LayerNorm, an InstanceNorm, a GroupNorm, or an RMSNorm.axesdefines the shape used to compute the mean/std of the normalization.axescan be{ x | y | z | c | xy | xz | xc | yz | yc | zc | xyz | xyc | xzc | yzc | xyzc }. For instance:axes=cmeans the vector-valued pixels of the input image are normalized independently, according to the channel values.axes=xyzmeans 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 transformgamma*x + beta.1: RMS normalization, followed by the linear transformgamma*x.2: No normalization, only the affine transformgamma*x + betais applied.3: No normalization, only the linear transformgamma*xis 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 aparameterslayer (4D grid of learnable parameters) to the current network.learning_modecan be{ 0:No learning | 1:Weights }.initializationcan 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=0andinitialization=3. ๐ฅnn_patchdown2dโout,in,_patch_size>1โ adds apatchdown2dlayer (2D downscale by patch) to the current network. Default value:patch_size=2. ๐nn_patchdown3dโout,in,_patch_size>1โ adds apatchdown3dlayer (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 apatch2dmatlayer (rearrangement of image patches as matrix columns or rows) to the current network. Ifarrangement=0, each patch is a column of the output matrix (width=nb_patches,height=patch_size^2*spectrum). Ifarrangement=1, each patch is a row of the output matrix (width=patch_size^2*spectrum,height=nb_patches). Default values:overlap=0andarrangement=1. ๐งnn_patchup2dโout,in,_patch_size>1โ adds apatchup2dlayer (2D upscale by patch) to the current network. Default value:patch_size=2. ๐nn_patchup3dโout,in,_patch_size>1โ adds apatchup3dlayer (3D upscale by patch) to the current network. Default value:patch_size=2. ๐nn_permuteโout,in,permutationโ adds apermutelayer (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 areshapelayer to the current network. Default values:height=depth=spectrum=1. โจnn_resizeโout,in,width[%]>0,_height[%]>0,_depth[%]>0,_spectrum[%]>0,_interpolationโ adds aresizelayer to the current network.interpolationcan 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%andinterpolation=3. ๐ธnn_runโout,in,"command",_width[%]>0,_height[%]>0,_depth[%]>0,_spectrum[%]>0โ adds arunlayer 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.gmzfile..gmzis 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 asplitlayer to the current network. Default values: unspecified sizes split equally the remaining size alongaxis(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 asublayer (element-wise subtraction) to the current network.in0orin1can 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 asumlayer (sum or average computation) to the current network. Default values:is_average=0andaxis=0. โnn_tmmulโout,in0,in1โ adds atmmullayer (matrix multiplicationin0^t.in1) to the current network.in0orin1must be of compatible size. ๐nn_tmmultโout,in0,in1โ adds atmmultlayer (matrix multiplicationin0^t.in1^t) to the current network.in0orin1must be of compatible size. ๐nn_transposeโout,inโ adds atransposelayer (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.optimizercan be{ adam | adamax | rmsprop | sgd }.schedulercan be{ constant | adaptive }.- Value of
optimizer_paramsdepends 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_paramsdepends 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).
- Value of
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 anMxNarray from selected images. Default values:N=Mandexpand_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 anMxNarray from selected images. Default values:N=M,fade_start=60,fade_end=90andexpand_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 a2^Nx2^Narray from selected images. Default values:dir=2andexpand_type=0.
Example:
[#1] image.jpg array_mirror 2
array_randomโMs>0,_Ns>0,_Md>0,_Nd>0โ creates anMdxNdarray of tiles from selectedMsxNssource arrays. Default values:Ns=Ms,Md=MsandNd=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.axescan 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 webpagehttp://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 displaywindow[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 animage_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=1andboundary_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=50andamplitude=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%andboundary_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=30andboundary_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=0andfading_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=1andboundary_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=1andmerging_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=0andoffset=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=1andboundary_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=0andinterpolation=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=0andswap_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%andboundary_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%andboundary_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.
modecan be{ 0:Backward-absolute | 1:Backward-relative | 2:Forward-absolute | 3:Forward-relative }.interpolationcan be{ 0:Nearest-neighbor | 1:Linear | 2:Cubic }.boundary_conditionscan be{ 0:Dirichlet | 1:Neumann | 2:Periodic | 3:Mirror }.- Defaults:
mode=0,interpolation=1,boundary_conditions=0andnb_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=3andfast_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=50andboundary_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%andblend_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.5andangle=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.4andcenter_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.7andthreshold=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.5andboundary_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=1andcolor1=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.9andlightness=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=20andscale_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=0andoffset=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.8andlightness=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=dxanddz=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.avior.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.avior.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_yandaxis_zcan be set as mathematical expressions, depending onxandy. 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 (wherengoes from0toN). 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 (wherengoes from1toN). Signature:
n>=1,_arg_1,...,_arg_N
One-indexed for the traditionalists.
arg2varโ For each i in [1...N], setvariable_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 commandimg2base64. 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 commanduint82base64. Signature:
"base64_string"
Uint8 realness.
basenameโ Return the basename of a file path, and optionally its folder location. When specified,variable_name_for_foldermust 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). Parameteravg_outvarnameis 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 stringYYYY/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.pathcan optionally be a matching pattern.modecan be{ 0:Files only | 1:Directories only | 2:Files + Directories }. Add3tomodeto 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 commandfiles. 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 sizewidth,heightwhich is bigger thanmin_width,min_heightand 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. Argumentvariable_namespecifies 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_jawbreaker0<_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. Argumentcolorspacerefers 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 settingcolorspaceascolorspace_channel(e.g.hsv_hfor the hue). Default values:'colorspace=all','spatial_tolerance=5'and'color_tolerance=5'. ๐x_metaballs3dโ Launch the 3D metaballs demo. ๐ซงx_minesweeper8<=_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. Argumentvariable_namespecifies 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_namespecifies 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. Argumentvariable_namespecifies 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']
Render a G'MIC 3D logo: ๐
$ 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
- arch rolling: gmic 4.0.7-1 ยท CECILL-C
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms