About Filters

While Color corrections change the value of an individual pixel according to a mathematical equation (i.e., *2, -.5, etc), filters calculate the new value of a pixel by examining its neighbors, and passing it through what is called a Spatial Filter. Classic filter functions are blurs, image sharpening, embossing, and median filtering. You can also create your own unique filters, of any resolution, with the Convolve function. Spatial filters are also applied when re-sampling an image that is being geometrically transformed, i.e., after a Scale operation or Rotate.


Masking Filters

If you want to have an image control the amount of filtering, we recommend using the special Image-based filters like IBlur, ISharpen, IRBlur instead of simply masking the effect off. Although the function will be slower, the effect will clearly be of higher quality. In this example, we want to blur some Text with a Ramp controlling how much blur occurs:

The first try is to simply attach a Blur node, and then use the Ramp as the mask. The result is not very compelling, since you merely end up with a blend between sharp and blurred elements. Note the Ramp has a alpha value of 1 for both ends, you should change your alpha1 value to 0.

The better way to do this is to use the dedicated IBlur node, with the Ramp as the second input image, instead of a mask input:

 

Filter Characteristics

Shake has been specially engineered to use the highest quality filtering process when doing transformations, blurs, and convolve effects. This investment insures top possible image quality. This will be especially noticeable on animated effects, whether it is an animated transformation, or simply if the parameters of a blur are animated.

It is our experience that it is very hard to decide on a single filter for use on both up and down resizing. That's why the "default" filter was built the way it is: it uses mitchell when going up and sinc when going down (the switch is automatic). The choice was made after projecting several versions of the same shots, processed with different filters, to a small panel of film pros. Other filters, like box (the closest thing to what people may know as "bi-linear") may give subjectively superior results in some cases (in particular on static imagery), but poor handling of high frequencies quickly become apparent.

Often, you can set different filters for X and Y, so therefore you may be increasing the X resolution, but decreasing the Y resolution. You usually have the option to set both directions, keeping in mind that default automatically uses mitchell to zoom up and sinc to zoom down. If there are not two options, like in Resize, simply place two Resize operations, one zoom the X, and the second zooming the Y. Your speed hit will be minor.

The subpixel control affects the way fractional resize is performed: If your resize value is not an integer, i.e., 512 zooming to 1024 is integer by a factor of 2, 512 zooming to 1023 is not an integer, as it is a factor of 1.998, you will have subpixel sampling. For Resize, if the new width or height is not an integer (either because it was set that way, or because of a proxy scale), you have a choice of either snapping to the closest integer (subpixel off) or generate transparent pixels for the last row and column (subpixel on).

Filter
Description
box Relatively inexpensive and gives a "boxy" look. Default size is 1x1.
default By default, mitchell is used to go up, and sinc to go down.
dirac Dirac and impulse are the same. Default size is 0x0.
gauss Gaussian lacks in sharpness, but is good with ringing and aliasing. Default size is 5x5.
impulse Fast but lower quality. Default size is 0x0.
lanczos Similar to the sinc filter, but with less sharpness and ringing. Default size is 6x6.
mitchell This is the default filter when scaling up. A good balance between sharpness and ringing, and so a good choice for scaling up. Default size is 4x4. This is also known as a high-quality Catmull-Rom filter.
quad Like triangle, but blurrier with fewer artifacts. Default size is 3x3.
sinc This is the default filter when scaling down. Keeps small details when scaling down with good aliasing. Ringing problems make it a questionable choice for scaling up.. Default size is 4x4. It also can deliver negative values, which can be interesting when working in float/channel bit depth.
triangle Not highest quality, but fine for displaying a scaled image on your screen. Default size is 2x2.