In my post about WebP image encoding I mentioned that the format allows for transparency. WebM video frames (with the VP8/VP9 codec) use the same encoding as WebP images, and it makes sense that they would support transparency too. So you can get videos with transparent backgrounds, neat.

I hopped on Gmod, recorded a demo against blue walls, and then rendered the frames to a video with this FFmpeg script.

Download that and play it in something like mpv, you’ll see the blue background.

A while ago I came across a version of the Bad Apple video with the white areas mapped to alpha transparency. I didn’t make this video, and unfortunately can’t find where I originally downloaded it from. I just saved it because I thought it fit really well with the shadow art. It’s also appropriate given how much anime scene groups have consistently pushed the use of open-source containers like Matroska (which WebM is derived from), among other innovations.

I’ve embedded the video here below, with a set of RGB sliders which set the background colour. Have a play around with it :)



This is a cool little experiment, although I don’t see it having much practical use. I wasn’t sure you could even make transparent video frames before researching this, which is weird because there are examples going back as far as 2013. WebM video transparency has been around for about seven years already, yet it’s not widely used on the web, or at least I haven’t noticed until now.