var src = 'https://picsum.photos/id/237/200/300';
var stage = new Konva.Stage({
container: 'container',
width: 400,
height: 300,
});
// with help of clipFunc on the layer
var layer = new Konva.Layer({
clipFunc: function(ctx) {
ctx.arc(130, 140, 70, 0, Math.PI * 2, false);
}
});
stage.add(layer);
Konva.Image.fromURL('https://picsum.photos/id/237/200/300', function(theDog) {
theDog.setAttrs({
x: 0,
y: 0,
scaleX: 1,
scaleY: 1,
});
layer.add(theDog);
layer.batchDraw();
});