ShowAlpha: Difference between revisions
From Avisynth wiki
Jump to navigationJump to search
Raffriff42 (talk | contribs) m added category |
Raffriff42 (talk | contribs) formatting, links, phrasing |
||
| Line 1: | Line 1: | ||
{{Template: | {{Template:FuncDef | ||
|ShowAlpha(clip ''clip'' [, string ''pixel_type'' ] ) | |||
}} | |||
Returns the alpha channel of an [[RGB32]] clip as greyscale. | |||
:{{Par2|pixel_type|string|"RGB32"}} | |||
::Sets the color format of the output. | |||
::Allowed {{FuncArg|pixel_types}} are [[RGB]], [[RGB32]], [[RGB24]], [[YUY2]], [[YV12]] and (in v2.60) [[Y8]]. | |||
::Default is "RGB"; note "RGB" and "RGB32" are equivalent arguments here. | |||
::[[YUV]] clips are full range (0—255), and so can be used as the ''mask'' argument to [[Overlay]]. | |||
''' | {{Template:Func3Def | ||
|ShowRed(clip ''clip'' [, string ''pixel_type'' ] ) | |||
|ShowGreen(clip ''clip'' [, string ''pixel_type'' ] ) | |||
|ShowBlue(clip ''clip'' [, string ''pixel_type'' ] ) | |||
}} | |||
Returns the selected channel of an [[RGB32]] or [[RGB24]] clip as greyscale. | |||
:{{Par2|pixel_type|string|"RGB32"}} | |||
::Sets the color format of the output. | |||
::Allowed {{FuncArg|pixel_types}} are [[RGB]], [[RGB32]], [[RGB24]], [[YUY2]], [[YV12]] and (in v2.60) [[Y8]]. | |||
::Default is "RGB"; note "RGB" and "RGB32" are equivalent arguments here. | |||
::For RGB32 output the selected channel is copied to all three color channels, but not to the Alpha channel, which is left untouched. | |||
::For [[YUV]] output the selected channel is copied to the ''Y'' (luma) channel, and the ''U'' and ''V'' (chroma) channels are set to grey (128). | |||
::[[YUV]] clips are full range (0—255), and so can be used as the ''mask'' argument to [[Overlay]]. | |||
== Examples == | |||
* Shows alpha channel of clip | |||
<div {{BoxWidthIndent|36|1}} > | |||
[[AviSource]]("clip.avi") | [[AviSource]]("clip.avi") | ||
ShowAlpha | ShowAlpha | ||
</div> | |||
* Swaps red and blue channels | |||
<div {{BoxWidthIndent|36|1}} > | |||
AviSource("clip.avi") | AviSource("clip.avi") | ||
[[MergeRGB]](ShowBlue("YV12"), Last, ShowRed("YV12")) | [[MergeRGB]]( ShowBlue("YV12"), Last, ShowRed("YV12") ) | ||
</div> | |||
== Changelog == | |||
{| border="1" | {| border="1" | ||
|- | |- | ||
Revision as of 07:29, 27 January 2016
ShowAlpha(clip clip [, string pixel_type ] )
Returns the alpha channel of an RGB32 clip as greyscale.
- string pixel_type = "RGB32"
ShowRed(clip clip [, string pixel_type ] )
ShowGreen(clip clip [, string pixel_type ] )
ShowBlue(clip clip [, string pixel_type ] )
Returns the selected channel of an RGB32 or RGB24 clip as greyscale.
- string pixel_type = "RGB32"
- Sets the color format of the output.
- Allowed pixel_types are RGB, RGB32, RGB24, YUY2, YV12 and (in v2.60) Y8.
- Default is "RGB"; note "RGB" and "RGB32" are equivalent arguments here.
- For RGB32 output the selected channel is copied to all three color channels, but not to the Alpha channel, which is left untouched.
- For YUV output the selected channel is copied to the Y (luma) channel, and the U and V (chroma) channels are set to grey (128).
- YUV clips are full range (0—255), and so can be used as the mask argument to Overlay.
Examples
- Shows alpha channel of clip
AviSource("clip.avi") ShowAlpha
- Swaps red and blue channels
AviSource("clip.avi")
MergeRGB( ShowBlue("YV12"), Last, ShowRed("YV12") )
Changelog
| v2.60 | Added pixel_type "Y8" |
| v2.56 | Added ShowBlue, ShowGreen and ShowRed. |