Tutorial

gmic \

-input street.png \

-input 100%,100%,1,1,'h-y' \

-normalize[-1] 0,1 \

'(0^1^0)' \

-resize[-1] [-3],[-3],[-1],[-1],1 \

-split[-1] c \

-append[-4,-3] c \

-append[-2,-1] c \

-eigen2tensor[-2,-1] \

-repeat 3 \

-smooth[-2] [-1],50 \

-done \

-rm[-1] \

-input street.png \

-input 100%,100%,1,1,'h-y' \

-normalize[-1] 0,1 \

'(0^1^0)' \

-resize[-1] [-3],[-3],[-1],[-1],1 \

-split[-1] c \

-append[-4,-3] c \

-append[-2,-1] c \

-eigen2tensor[-2,-1] \

-repeat 3 \

-smooth[-2] [-1],50 \

-done \

-rm[-1] \

Tensors | Here‘s the Big Change: we made Cosine constant one and Sine constant zero, instead of the other way around. Recall that the sine of 90° is one, and its cosine is zero. 90° points from top to bottom. Or if you want, bottom to top. With that we blurred in a vertical orientation. Here, cosine is one and sine is zero, which corresponds to 0° and we blurred in a horizontal direction. | |

Horizontal Blur | Do you see an emerging pattern? You betcha. |

Kleine_Houtstraat: Horizontal blur storm settling in.

gmic angle=38.629 \

-input street.png \

100%,100%,1,1,'h-y' \

-normalize[-1] 0,1 \

'(0^{cos(pi*$angle/180)}^{sin(pi*$angle/180)})' \

-resize[-1] [-3],[-3],[-1],[-1],1 \

-split[-1] c \

-append[-4,-3] c \

-append[-2,-1] c \

-eigen2tensor[-2,-1] \

-repeat 3 \

-smooth[-2] [-1],50 \

-done \

-rm[-1] \

-input street.png \

100%,100%,1,1,'h-y' \

-normalize[-1] 0,1 \

'(0^{cos(pi*$angle/180)}^{sin(pi*$angle/180)})' \

-resize[-1] [-3],[-3],[-1],[-1],1 \

-split[-1] c \

-append[-4,-3] c \

-append[-2,-1] c \

-eigen2tensor[-2,-1] \

-repeat 3 \

-smooth[-2] [-1],50 \

-done \

-rm[-1] \

Tensors | G'MIC lets us declare variables (angle=38.629) and reference the values later: $angle. The $ signet tells G'MIC to look up the value of angle and substitute the expression with its value. That's exactly what we did later in the expression pi*$angle/180. That expression converts degrees into radians, as there happens to be one pi’s worth of radians for every one hundred eighty degrees and radian measure is what G'MIC expects. | |

Any Angle Blur | In the Greater Scheme Of Things, we're now setting Cosine and Sine to the angle by which we want to blur. Play with this yourself. Go put bunches of different angles in there. |

Kleine_Houtstraat: Now a blur storm at any angle settling in.

gmic angle=32.754 \

-input street.png \

-input 100%,100%,1,1,'y' \

-normalize[-1] 0,1 \

'(0^{cos(pi*$angle/180)}^{sin(pi*$angle/180)})' \

-resize[-1] [-3],[-3],[-1],[-1],1 \

-split[-1] c \

-append[-4,-3] c \

-append[-2,-1] c \

-eigen2tensor[-2,-1] \

-repeat 3 \

-smooth[-2] [-1],50 \

-done \

-rm[-1] \

-input street.png \

-input 100%,100%,1,1,'y' \

-normalize[-1] 0,1 \

'(0^{cos(pi*$angle/180)}^{sin(pi*$angle/180)})' \

-resize[-1] [-3],[-3],[-1],[-1],1 \

-split[-1] c \

-append[-4,-3] c \

-append[-2,-1] c \

-eigen2tensor[-2,-1] \

-repeat 3 \

-smooth[-2] [-1],50 \

-done \

-rm[-1] \

Tensors | No big deal blurring backwards. We changed the angle just for variation, giving you an example of how it's done, and we changed the ramp formula from h-y to y so that the ramp runs from zero to one instead of the other way around. In case you've missed it, you should spend some time with our Ramp Recipes. | |

Bottom Up Blur | Every gray scale ramp you have there can be used here. You can make a bazillion ramps and never repeat yourself. Now think of all the different ways you can make a ramp: Every single way can make a blur! Open road off to far horizons; we've hardly even taken the first steps. And yet there's more. |

Kleine_Houtstraat: Now a blur storm emerging from the ground.

gmic ang1=7.438 ang2=17.513 \

-input street.png \

-input 100%,100%,1,1,'x*cos(pi*$ang1/180)+y*sin(pi*$ang1/180)' \

-normalize[-1] 0,1 \

'(0^{cos(pi*$ang2/180)}^{sin(pi*$ang2/180)})' \

-resize[-1] [-3],[-3],[-1],[-1],1 \

-split[-1] c \

-append[-4,-3] c \

-append[-2,-1] c \

-eigen2tensor[-2,-1] \

-repeat 3 \

-smooth[-2] [-1],50 \

-done \

-rm[-1] \

-input street.png \

-input 100%,100%,1,1,'x*cos(pi*$ang1/180)+y*sin(pi*$ang1/180)' \

-normalize[-1] 0,1 \

'(0^{cos(pi*$ang2/180)}^{sin(pi*$ang2/180)})' \

-resize[-1] [-3],[-3],[-1],[-1],1 \

-split[-1] c \

-append[-4,-3] c \

-append[-2,-1] c \

-eigen2tensor[-2,-1] \

-repeat 3 \

-smooth[-2] [-1],50 \

-done \

-rm[-1] \

Tensors | The Big Thing here is the introduction of another variable and a formula which lets us run a ramp at any angle, which is something you have may have noticed if you went through the Ramp Recipes. | |

Multi Angle Blur | So rather than run a ramp from top to bottom, or left to right, we run it at an angle of 7.48°, which is almost a horizontal ramp at a slight tilt. We introduced another angle variable just so that we could set the blur direction independently of the ramp direction. |

Kleine_Houtstraat: And a blur storm coming in with the wind.

gmic \

-input street.png \

-input 100%,100%,1,1,'h-y' \

-input 100%,100%,1,1,'y' \

-normalize[-2,-1] 0,1 \

'(0^1)' \

-resize[-1] [-4],[-4],[-1],[-1],1 \

-split[-1] c \

-append[-4,-3] c \

-append[-2,-1] c \

-eigen2tensor[-2,-1] \

-repeat 3 \

-smooth[-2] [-1],50 \

-done \

-rm[-1] \

-input street.png \

-input 100%,100%,1,1,'h-y' \

-input 100%,100%,1,1,'y' \

-normalize[-2,-1] 0,1 \

'(0^1)' \

-resize[-1] [-4],[-4],[-1],[-1],1 \

-split[-1] c \

-append[-4,-3] c \

-append[-2,-1] c \

-eigen2tensor[-2,-1] \

-repeat 3 \

-smooth[-2] [-1],50 \

-done \

-rm[-1] \

Tensors | Wuff. | |

OK, a minor bit. We changed the image reference to -4 because we separated out the EigenTwo image from the one-pixel proto-image, making our image list longer by one. We then set up EigenTwo as a ramp running from zero to one, with EigenOne running from one to zero. We also put the business of running things at angles to one side to make the effect straightforward. | ||

Eigen 1+2 | But what exactly is the effect? | |

It seems that we are ramping from a horizontal blur on the bottom to a vertical blur on the top, with a kind of neutral blurring in the middle. | ||

Well, it is time to put the G'MIC toy to one side because we now have some Explaining to do. | ||

See you on the next page. |

Kleine_Houtstraat: And a three phase blur storm.

G'MIC is an open-source software distributed under the
**CeCILL** free software licenses (LGPL-like and/or

GPL-compatible).
Copyrights (C) Since July 2008,
David Tschumperlé - GREYC UMR CNRS 6072, Image Team.