1ctx.save();
2ctx.beginPath();
3// use lineTo and BezierTo here to make the path you want, which is a rectangle the size of the image with two rounded corners.
4ctx.closePath();
5ctx.clip();
6
7// draw the image using ctx.drawImage(..
8ctx.restore(); // so clipping path won't affect anything else drawn afterwards