CombinePlanes

From Avisynth wiki
(Difference between revisions)
Jump to: navigation, search
(Avisynthplus - new filter)
 
m (typo)
Line 3: Line 3:
 
__TOC__
 
__TOC__
  
=== Syntax and Parameters ===
+
==== Syntax and Parameters ====
 
<div style="max-width:62em" >
 
<div style="max-width:62em" >
 
{{FuncDef|CombinePlanes(clip, <br>  
 
{{FuncDef|CombinePlanes(clip, <br>  

Revision as of 16:55, 21 April 2017

Combines planes of source clip(s) into a target clip. Similar to ShufflePlanes in Vapoursynth.
Performs the functionality of SwapUV, YToUV, MergeChroma, MergeRGB and more.

Contents


Syntax and Parameters

CombinePlanes(clip,
      [string planes, string source_planes, string pixel_type, clip sample_clip ] )

CombinePlanes(clip, clip,
      [string planes, string source_planes, string pixel_type, clip sample_clip ] )

CombinePlanes(clip, clip, clip,
      [string planes, string source_planes, string pixel_type, clip sample_clip ] )

CombinePlanes(clip, clip, clip, clip,
      [string planes, string source_planes, string pixel_type, clip sample_clip ] )

clip   =
Source clip(s). At least one is required. Up to four clips are accepted.
Each clip defines a color plane in the output, as defined by the planes and source_planes arguments.
If the clip count is less than the given planes defined, then the last available clip is used as a source for all later planes.
string  planes = ""
The target plane order (e.g. "YVU", "YYY", "RGB"); missing target planes will be undefined in the target.
string  source_planes = "YUVA" or "RGBA"
The source plane order, defaulting to "YUVA" or "RGBA" depending on the video format.
Source clips can even be mixed from greyscale, YUV, YUVA or planar RGB(A) — the only rule being that the relevant source plane character should match with the clip format, respectively.
string  pixel_type =
Set color format of the returned clip. Supports all AVS+ color formats.
clip  sample_clip =
If supplied, output pixel_type will match that of sample_clip.

Examples

#combine greyscale clips into YUVA clip
U8 = source.UToY8()
V8 = source.VToY8()
Y8 = source.ConvertToY()
A8 = source.AddAlphaPlane(128).AToY8()
CombinePlanes(Y8, U8, V8, A8, planes="YUVA", source_planes="YYYY", 
\               sample_clip=source) #pixel_type="YUV444P8"
# Copy planes between planar RGB(A) and YUV(A) without any conversion
# yuv 4:4:4 <-> planar rgb
source = last.ConvertBits(32) # 4:4:4
cast_to_planarrgb = CombinePlanes(source, planes="RGB", source_planes="YUV", 
\               pixel_type="RGBPS")
# get back a clip identical with "source"
cast_to_yuv = CombinePlanes(cast_to_planarrgb, planes="YUV", source_planes="RGB", 
\               pixel_type="YUV444PS")
#create a black and white planar RGB clip using Y channel
#source is a YUV clip
grey = CombinePlanes(source, planes="RGB", source_planes="YYY", 
\               pixel_type="RGBP8")
#copy luma from one clip, U and V from another
#source is the template
#sourceY is a Y or YUV clip
#sourceUV is a YUV clip
grey = CombinePlanes(sourceY, sourceUV, planes="YUV", 
\               source_planes="YUV", sample_clip = source)

Changes

20161110 first added
Personal tools