Swap
From Avisynth wiki
(Difference between revisions)
Raffriff42 (Talk | contribs) (→See also: add AVS+ info) |
(add link to avs+ documentation) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
+ | <div {{BlueBox2|40|0|3px solid purple}} > | ||
+ | {{AvsPlusFullname}}<br> | ||
+ | Up-to-date documentation: [https://avisynthplus.readthedocs.io/en/latest/avisynthdoc/corefilters/swap.html https://avisynthplus.readthedocs.io] | ||
+ | </div> | ||
+ | |||
Swaps chroma channels in [[YUV]] clips. | Swaps chroma channels in [[YUV]] clips. | ||
__TOC__ | __TOC__ | ||
Line 37: | Line 42: | ||
{{FuncDefH4|YToUV}} | {{FuncDefH4|YToUV}} | ||
{{FuncDef | {{FuncDef | ||
− | |YToUV(clip ''clipU'', clip ''clipV'' [, clip ''clipY'' ] ) | + | |YToUV(clip ''clipU'', clip ''clipV'' [, clip ''clipY'' [, clip ''clipA'' ] ] ) |
}} | }} | ||
:Copies the ''Y'' (luma channel) of {{FuncArg|clipU}} to the ''U'' channel of the output clip and the ''Y'' (luma channel) of {{FuncArg|clipV}} to the ''V'' channel of the output clip. | :Copies the ''Y'' (luma channel) of {{FuncArg|clipU}} to the ''U'' channel of the output clip and the ''Y'' (luma channel) of {{FuncArg|clipV}} to the ''V'' channel of the output clip. | ||
:If {{FuncArg|clipY}} is given, copies the ''Y'' (luma channel) of {{FuncArg|clipY}} to the ''Y'' channel of the output clip. | :If {{FuncArg|clipY}} is given, copies the ''Y'' (luma channel) of {{FuncArg|clipY}} to the ''Y'' channel of the output clip. | ||
+ | :{{AvsPluscon}} And if {{FuncArg|clipA}} is given too, copies the ''Y'' (luma channel) of {{FuncArg|clipA}} to the ''A'' channel of the output clip. | ||
:Depending on the color format, the image resolution can be changed. | :Depending on the color format, the image resolution can be changed. | ||
</div> | </div> | ||
Line 48: | Line 54: | ||
==== See Also ==== | ==== See Also ==== | ||
*Show [[RGB]] channels with [[ShowAlpha|ShowAlpha/Red/Green/Blue]]. | *Show [[RGB]] channels with [[ShowAlpha|ShowAlpha/Red/Green/Blue]]. | ||
− | *{{AvsPluscon}} [[Extract]] for | + | *{{AvsPluscon}} [[Extract]] for {{Deep_color}} support. |
Line 63: | Line 69: | ||
* Show ''U'' and ''V'' channels stacked for illustration purposes. | * Show ''U'' and ''V'' channels stacked for illustration purposes. | ||
** Note that with a [[YV12]] source (like the one below), the ''U'' and ''V'' images will be half the size of the original. | ** Note that with a [[YV12]] source (like the one below), the ''U'' and ''V'' images will be half the size of the original. | ||
− | ** In the ''U'' and ''V'' images, gray will be at 128 and colors will | + | ** In the ''U'' and ''V'' images, gray will be at 128{{D}} and saturated colors will appear brighter or darker. |
{{HalfBreak}} | {{HalfBreak}} | ||
:[[File:SwapEx-Sintel9150.jpg]] | :[[File:SwapEx-Sintel9150.jpg]] |
Latest revision as of 05:24, 17 September 2022
AviSynth+
Up-to-date documentation: https://avisynthplus.readthedocs.io
Swaps chroma channels in YUV clips.
Contents |
SwapUV(clip clip)
- Swaps U and V (chroma) channels. Corrects certain decoding errors – faces blue instead of red, etc.
UToY(clip clip)
VToY(clip clip)
- Copies U or V chroma plane to the Y luma plane.
- All color (chroma) information is removed, so the image is now greyscale.
- Depending on the color format, the image resolution can be changed – i.e.,
- with a YV24 source, UToY is the same width and height as clip, but
- with a YV12 source, UToY is half clip's width and height.
UToY8(clip clip)
VToY8(clip clip)
- Shorthand for UToY.ConvertToY8 and VToY.ConvertToY8, but faster.
YToUV(clip clipU, clip clipV [, clip clipY [, clip clipA ] ] )
- Copies the Y (luma channel) of clipU to the U channel of the output clip and the Y (luma channel) of clipV to the V channel of the output clip.
- If clipY is given, copies the Y (luma channel) of clipY to the Y channel of the output clip.
- AVS+ And if clipA is given too, copies the Y (luma channel) of clipA to the A channel of the output clip.
- Depending on the color format, the image resolution can be changed.
[edit] See Also
- Show RGB channels with ShowAlpha/Red/Green/Blue.
- AVS+ Extract for Deep Color support.
[edit] Examples
- Blur the U chroma channel
video = ColorBars(512, 512).ConvertToYV12 u_chroma = UToY(video).Blur(1.5) YToUV(u_chroma, video.VToY) MergeLuma(video)
- Show U and V channels stacked for illustration purposes.
StackVertical( \ Subtitle("YV12 original", align=2), \ StackHorizontal( \ UtoY.Subtitle("UtoY", align=2), \ VtoY.Subtitle("VtoY", align=2) \ ) \ )
[edit] Changes
v2.60 | Added UToY8, VToY8. |
v2.60 | Added new color formats Y8, YV411, YV16 and YV24. |