Matte mask

Using the images below, an image in canvas (left), is masked using a matte (center), where red is mapped to alpha.
The rabbit (right) is in a simple html image element underneath the canvas element.

Animated, dynamically created versionmatte mask