JSFiddle - React, Tailwind, and code Playground

HTML

<img src="http://www.songfacts.com/original.jpg" id="image2">
    
    
    <canvas width="80" height="80" id="canvas"/>

CSS

canvas {border:1px solid red;}

JavaScript

$(document).ready(function() {

var	width = 80, height = 80;
var ctx = document.getElementById('canvas').getContext('2d'),
img = new Image,
w = 200,
h = 200,
x = 800,
y = 100; 
img.src = $('#image2').attr('src');

ctx.drawImage(img, x, y, w, h, 0, 0, width, height);

});