JSFiddle - React, Tailwind, and code Playground

by Douglas Duhaime

HTML

<img id="image" width="300" height="300" src="http://i.imgur.com/LDR6AWn.png?1">
<canvas id="myCanvas" width="300" height="300" >

CSS

canvas {
    border:1px solid #d3d3d3;
}

JavaScript

var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
var img = document.getElementById("image");
ctx.drawImage(img, 0, 0);