JSFiddle - React, Tailwind, and code Playground
by balefrost
HTML
<canvas id="test" width="300" height="300"></canvas>
JavaScript
cv = document.getElementById("test");
ctx = cv.getContext("2d");
var im = new Image();
im.onload = function () {
ctx.drawImage(im, -140, -70);
ctx.globalCompositeOperation = 'destination-in';
ctx.beginPath();
ctx.arc(110, 110, 100, 0, 2*Math.PI, true);
ctx.fill();
}
im.src = "http://i.imgur.com/GN7IGRm.jpg?1";