Swap
From Avisynth wiki
(Difference between revisions)
Raffriff42 (Talk | contribs) m (added category) |
Raffriff42 (Talk | contribs) (formatting, links, phrasing) |
||
Line 1: | Line 1: | ||
− | {{ | + | {{FuncDef |
− | + | |SwapUV(clip ''clip'') | |
+ | }} | ||
− | + | :Swaps ''U'' and ''V'' (chroma) channels. Corrects certain decoding errors – faces blue instead of red, etc. | |
− | |||
− | ''' | + | {{Func2Def |
+ | |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 {{FuncArg|clip}}, but | ||
+ | :with a [[YV12]] source, '''UToY''' is half {{FuncArg|clip}}'s width and height. | ||
− | |||
− | '' | + | {{Func2Def |
+ | |UToY8(clip ''clip'') | ||
+ | |VToY8(clip ''clip'') | ||
+ | }} | ||
− | + | ::Shorthand for '''UToY.'''[[ConvertToY8]] and '''VToY.'''[[ConvertToY8]], but faster. Added in v2.60. | |
+ | |||
− | ''' | + | {{FuncDef |
+ | |YToUV(clip ''clipU'', clip ''clipV'' [, clip ''clipY'' ] ) | ||
+ | }} | ||
− | + | :Copies {{FuncArg|clipU}}:''Y'' to output ''U'' and {{FuncArg|clipV}}:''Y'' to output ''V''. | |
− | video = | + | :If {{FuncArg|clipY}} is given, copies {{FuncArg|clipY}}:''Y'' to output ''Y''; else output ''Y'' is 50% grey. |
− | u_chroma = UToY(video).Blur(1.5) | + | :Depending on the color format, the image resolution can be changed. |
− | YToUV(u_chroma, video.VToY) | + | |
− | MergeLuma(video) | + | |
+ | ==== Color models ==== | ||
+ | [[YUY2]] and [[YV12]] are supported. Starting from v2.60, [[Y8]], [[YV411]], [[YV16]] and [[YV24]] are also supported. | ||
+ | |||
+ | |||
+ | == Example == | ||
+ | * Blurs the U chroma channel | ||
+ | <div {{BoxWidthIndent|28|1}} > | ||
+ | video = [[ColorBars]](512, 512).[[ConvertToYV12]] | ||
+ | u_chroma = '''UToY'''(video).[[Blur]](1.5) | ||
+ | '''YToUV'''(u_chroma, video.'''VToY''') | ||
+ | [[MergeLuma]](video) | ||
+ | </div> | ||
[[Category:Internal_filters]] | [[Category:Internal_filters]] | ||
[[Category:Levels_and_Chroma_filters]] | [[Category:Levels_and_Chroma_filters]] |
Revision as of 03:55, 28 January 2016
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. Added in v2.60.
YToUV(clip clipU, clip clipV [, clip clipY ] )
- Copies clipU:Y to output U and clipV:Y to output V.
- If clipY is given, copies clipY:Y to output Y; else output Y is 50% grey.
- Depending on the color format, the image resolution can be changed.
Color models
YUY2 and YV12 are supported. Starting from v2.60, Y8, YV411, YV16 and YV24 are also 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)