PreMultiply
- std.PreMultiply(vnode: all clip, vnode: all alpha)
PreMultiply simply multiplies clip and alpha in order to make it more suitable for later operations. This will yield much better results when resizing and a clip with an alpha channel and MaskedMerge can use it as input. The alpha clip must be the grayscale format equivalent of clip.
Note that limited range pre-multiplied contents excludes the offset. For example with 8 bit input 60 luma and 128 alpha would be calculated as ((60 - 16) * 128)/255 + 16 and not (60 * 128)/255.
When clip is a YUV clip with subsampled chroma, alpha is resized down to the chroma resolution with bilinear resampling before being multiplied into the chroma planes. This resampling is chroma-location aware: each frame’s
_ChromaLocationproperty (guessing 0, left, when absent) determines the sub-pixel shift needed to keep alpha aligned with the luma plane. The resampling also follows_FieldBased, siting the chroma per field for interlaced frames – except on the GPU path, which currently always sites progressively, so interlaced GPU output differs slightly from the CPU path there. Progressive output is identical between the two.