Table of Contents  ▸  Examples of Use◀  Scientific Publications

Examples of Use

gmic is a generic image processing tool which can be used in a wide variety of situations. The few 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 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)+if(c==0,u(0,-1),cos(X*10))" 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))'"

Plot the isosurface of a 3D volume:
$ gmic mode3d 5 moded3d 5 double3d 0 isosurface3d "'x^2+y^2+abs(z)^abs(4*cos(x*y*z*3))'",3

Render a G'MIC 3D logo:
$ gmic 0 text G\'MIC,0,0,53,1,1,1,1 expand_xy 10,0 blur 1 normalize 0,100 +plasma 0.4 add blur 1 elevation3d -0.1 moded3d 4

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 double3d 0

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

Launch a set of interactive demos:
$ gmic demos

◀  Scientific Publications