ShowAlpha

From Avisynth wiki
(Difference between revisions)
Jump to: navigation, search
(added links to filters used in the examples)
 
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Template:Func4Def|ShowAlpha(clip ''clip'', string ''pixel_type'')|ShowBlue(clip ''clip'', string ''pixel_type'')|ShowGreen(clip ''clip'', string ''pixel_type'')|ShowRed(clip ''clip'', string ''pixel_type'')}}
+
{{Template:FuncDef
 +
|ShowAlpha(clip ''clip'' [, string ''pixel_type'' ] )
 +
}}
  
ShowAlpha shows the alpha channel of a RGB32 clip, available in v2.53. ShowBlue/ShowGreen/ShowRed shows the selected channel of a RGB clip, available in v2.56.
+
Returns the alpha channel of an [[RGB32]] clip as greyscale.  
  
In v2.54 ShowAlpha now returns RGB, YUY2, or YV12 via the pixel_type argument. The latter two can be used to layer an RGB clip with alpha transparency data onto a YUV clip using the 3-argument form of Overlay, because when setting pixel_type to YUY2 or YV12 the luma range is [0,255].
+
:{{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]].  
  
In v2.56 ShowAlpha/Red/Green/Blue now returns RGB24, RGB32, YUY2, or YV12 via the pixel_type argument. For RGB32 output the selected channel is copied to all R, G and B channels, but not the Alpha channel which is left untouched. For YUV output the selected channel is copied to the Luma channel, the chroma channels are set to grey (0x80).
 
  
'''Examples:'''
+
{{Template:Func3Def
 +
|ShowRed(clip ''clip'' [, string ''pixel_type'' ] )
 +
|ShowGreen(clip ''clip'' [, string ''pixel_type'' ] )
 +
|ShowBlue(clip ''clip'' [, string ''pixel_type'' ] )
 +
}}
  
# shows alpha channel of clip
+
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]].
 +
 
 +
 
 +
==== See Also ====
 +
*Show [[YUV]] channels with [[ConvertToY8]] / [[UToY]] / [[VToY]].
 +
*{{AvsPluscon}} [[Extract]] for {{Deep_color}} support.
 +
 
 +
 
 +
==== Examples ====
 +
* Shows alpha channel of clip
 +
<div {{BoxWidthIndent|36|1}} >
 
  [[AviSource]]("clip.avi")
 
  [[AviSource]]("clip.avi")
  ShowAlpha()
+
  ShowAlpha
 +
</div>
  
# swaps red and blue channels:
+
* 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:'''
+
 
 +
==== Changelog ====
 
{| border="1"
 
{| border="1"
 +
|-
 +
| v2.60
 +
| Added pixel_type "Y8"
 
|-  
 
|-  
 
| v2.56
 
| v2.56
 
| Added ShowBlue, ShowGreen and ShowRed.
 
| Added ShowBlue, ShowGreen and ShowRed.
 
|}
 
|}
 
  
 
[[Category:Internal filters]]
 
[[Category:Internal filters]]
 +
[[Category:Levels_and_Chroma_filters]]

Latest revision as of 03:44, 28 April 2017

ShowAlpha(clip clip [, string pixel_type ] )

Returns the alpha channel of an RGB32 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.
YUV clips are full range (0-255), and so can be used as the mask argument to Overlay.


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.


[edit] See Also


[edit] Examples

  • Shows alpha channel of clip
AviSource("clip.avi")
ShowAlpha
  • Swaps red and blue channels
AviSource("clip.avi")
MergeRGB( ShowBlue("YV12"), Last, ShowRed("YV12") )


[edit] Changelog

v2.60 Added pixel_type "Y8"
v2.56 Added ShowBlue, ShowGreen and ShowRed.
Personal tools