Blur node
This documentation is for version 4.0 of Blur (net.sf.cimg.CImgBlur).
Description
Blur input stream or compute derivatives.
The blur filter can be a quasiGaussian, a Gaussian, a box, a triangle or a quadratic filter.
Note that the Gaussian filter [1] is implemented as an IIR (infinite impulse response) filter [2][3], whereas most compositing software implement the Gaussian as a FIR (finite impulse response) filter by cropping the Gaussian impulse response. Consequently, when blurring a white dot on black background, it produces very small values very far away from the dot. The quasiGaussian filter is also IIR.
A very common process in compositing to expand colors on the edge of a matte is to use the premultblurunpremult combination [4][5]. The very small values produced by the IIR Gaussian filter produce undesirable artifacts after unpremult. For this process, the FIR quadratic filter (or the faster triangle or box filters) should be preferred over the IIR Gaussian filter.
References:
[1] https://en.wikipedia.org/wiki/Gaussian_filter
[2] I.T. Young, L.J. van Vliet, M. van Ginkel, Recursive Gabor filtering. IEEE Trans. Sig. Proc., vol. 50, pp. 27992805, 2002. (this is an improvement over YoungVan Vliet, Sig. Proc. 44, 1995)
[3] B. Triggs and M. Sdika. Boundary conditions for Youngvan Vliet recursive filtering. IEEE Trans. Signal Processing, vol. 54, pp. 23652367, 2006.
[4] Nuke Expand Edges or how to get rid of outlines. http://franzbrandstaetter.com/?p=452
[5] Colour Smear for Nuke. http://richardfrazer.com/toolstutorials/coloursmearfornuke/
Uses the ‘vanvliet’ and ‘deriche’ functions from the CImg library.
CImg is a free, opensource library distributed under the CeCILLC (close to the GNU LGPL) or CeCILL (compatible with the GNU GPL) licenses. It can be used in commercial applications (see http://cimg.eu).
Inputs
Input 
Description 
Optional 

Source 
No 

Mask 
Yes 
Controls
Parameter / script name 
Type 
Default 
Function 

Size / 
Double 
x: 0 y: 0 
Size (diameter) of the filter kernel, in pixel units (>=0). The standard deviation of the corresponding Gaussian is size/2.4. No blur is applied if size < 0.24 (Gaussian and quasiGaussian) or <= 1 (box, triangle and quadratic). 
Uniform / 
Boolean 
Off 
Apply the same amount of blur on X and Y. 
X derivation order / 
Integer 
0 
Derivation order in the X direction. (orderX=0,orderY=0) does smoothing, (orderX=1,orderY=0) computes the X component of the image gradient. 
Y derivation order / 
Integer 
0 
Derivation order in the Y direction. (orderX=0,orderY=0) does smoothing, (orderX=0,orderY=1) computes the X component of the image gradient. 
Border Conditions / 
Choice 
Black 
Specifies how pixel values are computed out of the image domain. This mostly affects values at the boundary of the image. If the image represents intensities, Nearest (Neumann) conditions should be used. If the image represents gradients or derivatives, Black (Dirichlet) boundary conditions should be used.
Black (black): Dirichlet boundary condition: pixel values out of the image domain are zero.
Nearest (nearest): Neumann boundary condition: pixel values out of the image domain are those of the closest pixel location in the image domain.

Filter / 
Choice 
Gaussian 
Bluring filter. The quasiGaussian filter should be appropriate in most cases. The Gaussian filter is more isotropic (its impulse response has rotational symmetry), but slower.
QuasiGaussian (quasigaussian): QuasiGaussian filter (0order recursive Deriche filter, faster)  IIR (infinite support / impulsional response).
Gaussian (gaussian): Gaussian filter (Van Vliet recursive Gaussian filter, more isotropic, slower)  IIR (infinite support / impulsional response).
Box (box): Box filter  FIR (finite support / impulsional response).
Triangle (triangle): Triangle/tent filter  FIR (finite support / impulsional response).
Quadratic (quadratic): Quadratic filter  FIR (finite support / impulsional response).

Expand RoD / 
Boolean 
On 
Expand the source region of definition by 1.5*size (3.6*sigma). 
Crop To Format / 
Boolean 
On 
If the source is inside the format and the effect extends it outside of the format, crop it to avoid unnecessary calculations. To avoid unwanted crops, only the borders that were inside of the format in the source clip will be cropped. 
Alpha Threshold / 
Double 
0 
If this value is nonzero, any alpha value below this is set to zero. This is only useful for IIR filters (Gaussian and QuasiGaussian), which may produce alpha values very close to zero due to arithmetic precision. Remind that, in theory, a black image with a single white pixel should produce nonzero values everywhere, but a few VFX tricks rely on the fact that alpha should be zero far from the alpha edges (e.g. the premultblurunpremult trick to fill holes)). A threshold value of 0.003 is reasonable, and values between 0.001 and 0.01 are usually enough to remove these artifacts. 
(Un)premult / 
Boolean 
Off 
Divide the image by the alpha channel before processing, and remultiply it afterwards. Use if the input images are premultiplied. 
Invert Mask / 
Boolean 
Off 
When checked, the effect is fully applied where the mask is 0. 
Mix / 
Double 
1 
Mix factor between the original and the transformed image. 