Blending/Composing

The globalCompositeOperation attribute sets how shapes and images are drawn onto the existing bitmap.

Properties:


To Do

Try the following options in the drawDestination function:

  1. Add the following line at the beginning of the drawDestination function:
    ctx.globalAlpha = 0.2;
    ctx.fillStyle = 'green';
    ctx.fillRect(10, 10, 100, 100);
    ctx.fillStyle = 'red';
    ctx.fillRect(50, 50, 100, 100);