Swap
SwapUV(clip clip)
UToY(clip clip)
VToY(clip clip)
YToUV(clip clipU, clip clipV [, clip clipY])
UToY8(clip clip)
VToY8(clip clip)
The first four of the above filters are available starting from v2.5. The last two from v2.60.
SwapUV swaps chroma channels (U and V) of a clip. Sometimes the colors are distorted (faces blue instead of red, etc) when loading a DivX or MJPEG clip in AviSynth v2.5, due to a bug in the decoders. You can use this filter to correct it.
UToY copies chroma U plane to Y plane. All color (chroma) information is removed, so the image is now greyscale. Depending on the YUV format, the image resolution can be changed.
VToY copies chroma V plane to Y plane. All color (chroma) information is removed, so the image is now greyscale. Depending on the YUV format, the image resolution can be changed.
YToUV puts the luma channels of the two clips as U and V channels. Luma is now 50% grey. Starting from v2.51 there is an optional argument clipY which puts the luma channel of this clip as the Y channel. Depending on the YUV format, the image resolution can be changed.
UToY8 (added in v2.60) is a shorthand for UToY.ConvertToY8, and VToY8 (added in v2.60) is a shorthand for VToY.ConvertToY8, but faster.
Starting from v2.53, YUY2 is supported. Starting from v2.60, Y8, YV411, YV16, YV24 are supported.
Example:
# Blurs the U chroma channel: video = Colorbars(512, 512).ConvertToYV12 u_chroma = UToY(video).Blur(1.5) YToUV(u_chroma, video.VToY) MergeLuma(video)