Function
This blurs the image, with the amount of blur being set by a second control
image. Therefore, where the second image is white, you will have maximum blur,
and where it is black, you will have no blur. In this example, the first tree
uses a Ramp that is about half the height of the image as a mask for
a blur. You can see there is some bad blending where the most blur occurs at
the bottom of the image. In the second tree, we instead use the Ramp
as a second input into IBlur, and we get a nice blending of the blurred with
the non-blurred areas.
This script is saved as doc/cook/iblur_example.shk.
Note this function will go much slower than the normal Blur.
Ramp as a mask into Blur | Ramp fed into IBlur |
![]() |
![]() |
![]() |
![]() |
Parameters
|
Type
|
Defaults
|
Function
|
controlImg |
image
|
The second image is the control image for the blur. Its brightness determines how much blur occurs in the first image. | |
x/yPixels |
float
|
0, xPixels | The amount of blur as described in Pixels, ie 200 will blur 200 pixels to either side of the current pixel. |
spread |
int
|
0 |
This tells Shake to consider outside of the frame or not. 0 = Compute within the frame Because of the infinite workspace, it is sometimes handy to compute outside of the frame as well, for example, if the IBlur is placed after a Scale command. Note that if nothing is outside of the frame (ie, black), you will see a black edge. |
x/yFilter |
string
|
"gauss" | Jump to Filter Types |
steps |
int
|
5 | This is the amount of steps. The intensity of the control image is divided up X amount of zones, with X being equal to steps. |
stepBlend |
float
|
1 | This controls the blending between the amount of regions (see below). If you put this at 0, each step will have a constant blur value. If this is 1, there is a continuous blend between the different regions. |
controlChannel |
string
|
"a" | The channel of the second image to use to control the amount of blur. |
channels |
string
|
"rgba" | The channels of the first image to blur. |
invert |
int
|
0 | Inverts the controlChannel. |
Synopsis
image IBlur( image img, image controlImg, float xPixels, float yPixels, int spread, const char * xFilter, const char * yFilter, int steps, float stepBlend, const char * controlChannel, const char * channels, int invert );
Script
image IBlur( img, controlImg, xPixels, yPixels, spread, "xFilter", "yFilter", steps, stepBlend, "controlChannel", "channels", invert );
Command Line
shake -iblur image xPixels yPixels spread etc...