Swap: Difference between revisions

From Avisynth wiki
Jump to navigationJump to search
Raffriff42 (talk | contribs)
m Examples: simplify
Raffriff42 (talk | contribs)
See also: add AVS+ info
Line 2: Line 2:
__TOC__
__TOC__


== Syntax and Parameters ==
<!-- ==== Syntax and Parameters ==== -->
<div style="max-width:62em" >
<div style="max-width:62em" >
{{FuncDefH4|SwapUV}}
{{FuncDefH4|SwapUV}}
{{FuncDef
{{FuncDef
Line 32: Line 33:


:Shorthand for '''UToY.'''[[ConvertToY8]] and '''VToY.'''[[ConvertToY8]], but faster.
:Shorthand for '''UToY.'''[[ConvertToY8]] and '''VToY.'''[[ConvertToY8]], but faster.
   
   
{{FuncDefH4|YToUV}}
{{FuncDefH4|YToUV}}
{{FuncDef
{{FuncDef
Line 45: Line 46:




== Examples ==
==== See Also ====
*Show [[RGB]] channels with [[ShowAlpha|ShowAlpha/Red/Green/Blue]].
*{{AvsPluscon}} [[Extract]] for high bit depth support.
 
 
==== Examples ====
<div style="max-width:62em" >
<div style="max-width:62em" >
* Blur the U chroma channel
* Blur the U chroma channel
Line 54: Line 60:
  [[MergeLuma]](video)
  [[MergeLuma]](video)
</div>
</div>


* Show ''U'' and ''V'' channels stacked for illustration purposes.  
* Show ''U'' and ''V'' channels stacked for illustration purposes.  
Line 72: Line 77:
</div>
</div>


== Changes ==
 
==== Changes ====
{| border="1"
{| border="1"
|-
|-

Revision as of 14:33, 23 April 2017

Swaps chroma channels in YUV clips.

SwapUV

SwapUV(clip clip)

Swaps U and V (chroma) channels. Corrects certain decoding errors – faces blue instead of red, etc.


UToY, VToY

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, VToY8

UToY8(clip clip)
VToY8(clip clip)

Shorthand for UToY.ConvertToY8 and VToY.ConvertToY8, but faster.


YToUV

YToUV(clip clipU, clip clipV [, clip clipY ] )

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.
Depending on the color format, the image resolution can be changed.


See Also


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.
    • 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 be either brighter or darker.
 
StackVertical(
\  Subtitle("YV12 original", align=2),
\  StackHorizontal(
\       UtoY.Subtitle("UtoY", align=2), 
\       VtoY.Subtitle("VtoY", align=2)
\  )
\ )


Changes

v2.60 Added UToY8, VToY8.
v2.60 Added new color formats Y8, YV411, YV16 and YV24.