VideoTransparency

VideoTransparency

is an option that specifies whether to create a video with a transparency channel.

Details

  • Transparent videos are typically used at an intermediate stage of a process for separating foreground from background or overlaying videos.
  • Typical settings for VideoTransparency are:
  • Falsecreate a video with no transparency
    Truewhen transparent frames are generated, create a transparent video when possible, fail otherwise
    Automaticwhen transparent frames are generated, create a transparent video when possible, drop transparency otherwise
  • Whether transparency can be stored in the generated video file depends on the video container and codec.
  • Use RemoveAlphaChannel to explicitly remove the alpha channel from a video.

Examples

open allclose all

Basic Examples  (1)

By default, many functions create non-transparent videos:

Generate a video with an alpha channel:

Overlay the transparent video over an image:

Scope  (3)

If VideoTransparency is set to False, the alpha channel of all frames is dropped:

If VideoTransparency is set to Automatic, the alpha channel will be preserved if possible:

Since not all encoders support alpha channels, an appropriate one needs to be chosen:

If the selected encoder does not support transparency, the alpha channel is dropped:

Not all formats support an encoder that is capable of encoding an alpha channel:

If VideoTransparency is set to True, the alpha channel of the images will be preserved:

Since not all encoders support alpha channels, an appropriate one needs to be chosen:

If the selected encoder does not support alpha channels, the evaluation will fail:

Applications  (1)

Create a transparent video that can be presented on a variety of backgrounds:

Overlay the transparent video onto a virtual background:

Properties & Relations  (2)

Setting VideoTransparency to True will not create an alpha channel if one does not already exist:

Use SetAlphaChannel to explicitly add an alpha channel to a video:

By default, images are blended with White if the alpha channel needs to be removed:

Use RemoveAlphaChannel to control how the alpha channel is removed:

Wolfram Research (2022), VideoTransparency, Wolfram Language function, https://reference.wolfram.com/language/ref/VideoTransparency.html.

Text

Wolfram Research (2022), VideoTransparency, Wolfram Language function, https://reference.wolfram.com/language/ref/VideoTransparency.html.

CMS

Wolfram Language. 2022. "VideoTransparency." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/VideoTransparency.html.

APA

Wolfram Language. (2022). VideoTransparency. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/VideoTransparency.html

BibTeX

@misc{reference.wolfram_2024_videotransparency, author="Wolfram Research", title="{VideoTransparency}", year="2022", howpublished="\url{https://reference.wolfram.com/language/ref/VideoTransparency.html}", note=[Accessed: 21-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_videotransparency, organization={Wolfram Research}, title={VideoTransparency}, year={2022}, url={https://reference.wolfram.com/language/ref/VideoTransparency.html}, note=[Accessed: 21-November-2024 ]}