JSFiddle - React, Tailwind, and code Playground

HTML

<canvas width="942" height="628"></canvas>

<!-- пример сайта know-online.com -->

JavaScript

var imgSource = "http://know-online.com/examples/nsk.jpg"; // оригинальная картинка

// выполнение функции, когда картинка загрузится
var img = new Image();
img.src = imgSource;
img.onload = function(){
 
    var canvas = document.querySelector('canvas')
    var ctx = canvas.getContext("2d");
    ctx.beginPath();

    // рисование круглой фигуры
    ctx.arc(img.width/2, img.height/2, img.height/2, 0, Math.PI*2, true);
    ctx.closePath();
    ctx.fill();
 
    // картинка показывается на пересечении самой картинки и фигуры
    ctx.globalCompositeOperation = 'source-in';

    // добавление картинки в canvas
    ctx.drawImage(img,0,0);
}