STMap

The STMap node allows you to move pixels around in an image. STMap uses two channels to figure out where each pixel in the resulting image should come from in the input channels. You can use the Copy node to merge the two distortion channels in with your image channels and then select the two channels in the U and V selection boxes. The U and V values are the absolute position of the source pixel. The values are normalized to be between 0 and 1, where 0 is the bottom left corner of the input image, and 1 is the top right corner.

You can also calculate the lens distortion on one image and apply that distortion to another image using the STMap node. See LensDistortion for more details.

Inputs and Controls

Connection Type

Connection Name

Function

Input

stmap

The input you want to use to alter the source image.

src

The source image to which you want to apply the effect.

mask

An optional image to use as a mask. By default, the distortion is limited to the non-black areas of the mask.

At first, the mask input appears as triangle on the right side of the node, but when you drag it, it turns into an arrow labeled mask. If you cannot see the mask input, ensure that the mask control is disabled or set to none.

Control (UI)

Knob (Scripting)

Default Value

Function

STMap Tab

channels

channels

all

The distortion is only applied to these channels.

If you set this to something other than all or none, you can use the checkboxes on the right to select individual channels.

UV channels

uv

none

The two channels that are used to calculate the distortion for the input image. The U and V values are the absolute position of the source pixel. The values are normalized to be between 0 and 1, where (0,0) is the bottom left corner of the input image, and (1,1) is the top right corner.

blur channel

N/A

disabled

Enables the associated blur channel to the right. Disabling this checkbox is the same as setting the channel to none.

blur

none

Values in this channel are added to the size of the area to sample, to add extra blur or diffusion to the distortion.

blur scale

blur_scale

1

Adjust the blur amount by multiplying the blur values by this.

mask channel

N/A

disabled

Enables the associated mask channel to the right. Disabling this checkbox is the same as setting the channel to none.

maskChannel

none

The channel to use as a mask. The distortion is limited to the non-black areas of this channel.

invert

invert_mask

disabled

Inverts the mask so the distortion is limited to the non-white areas of the mask.

premultiplied

premultiplied

disabled

Check this if the UV and blurchannels have been premultiplied by the alpha channel, such as when output by a renderer.

filter

filter

Cubic

Select the filtering algorithm to use when remapping pixels from their original positions to new positions. This allows you to avoid problems with image quality, particularly in high contrast areas of the frame (where highly aliased, or jaggy, edges may appear if pixels are not filtered and retain their original values).

Impulse - remapped pixels carry their original values.

Cubic - remapped pixels receive some smoothing.

Keys - remapped pixels receive some smoothing, plus minor sharpening (as shown by the negative -y portions of the curve).

Simon - remapped pixels receive some smoothing, plus medium sharpening (as shown by the negative -y portions of the curve).

Rifman - remapped pixels receive some smoothing, plus significant sharpening (as shown by the negative -y portions of the curve).

Mitchell - remapped pixels receive some smoothing, plus blurring to hide pixelation.

Parzen - remapped pixels receive the greatest smoothing of all filters.

Notch - remapped pixels receive flat smoothing (which tends to hide moire patterns).

Lanczos4, Lanczos6, and Sinc4 - remapped pixels receive sharpening which can be useful for scaling down. Lanczos4 provides the least sharpening and Sinc4 the most.