ShowAlpha: Difference between revisions

From Avisynth wiki
Jump to navigationJump to search
No edit summary
Y8
Line 5: Line 5:
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].
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].


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).
In v2.56 ShowAlpha/Red/Green/Blue now returns RGB24, RGB32, YUY2, or YV12 (and in v2.60 also Y8) 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:'''
'''Examples:'''
Line 19: Line 19:
'''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.
|}
|}
todo: add Y8 as pixel type


[[Category:Internal filters]]
[[Category:Internal filters]]

Revision as of 19:54, 13 August 2014

ShowAlpha(clip clip, string pixel_type)
ShowBlue(clip clip, string pixel_type)
ShowGreen(clip clip, string pixel_type)
ShowRed(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.

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].

In v2.56 ShowAlpha/Red/Green/Blue now returns RGB24, RGB32, YUY2, or YV12 (and in v2.60 also Y8) 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:

# 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.