| IBlur |
Function
The IBlur function blurs the image, with the amount of blur
set by a second control image. Maximum blur occurs in the white areas of the
second image, and no blur occurs
in the black areas.
In the following example, the first node tree uses a Ramp that is approximately one-half of the height of the image as a mask for a blur. Some bad blending occurs in the lower portion of the image.
In the second node tree, a Ramp is used as a second input into IBlur, and
the result is a nice
blend of the blurred and non-blurred areas.
| Ramp as a mask into Blur | Ramp fed into IBlur |
![]() |
![]() |
![]() |
![]() |
The above script is saved as doc/cook/iblur_example.shk.
|
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...