Erasing Parts of an Image on HTML5 Canvas?
问题 I have an HTML5 Canvas. I am using the KineticJS(KonvaJS) canvas library. On a blank canvas I dram an image as shown in the figure below. Now I want to create a circle Shape which can be used to erase parts of the image. The red circle in the image is the eraser. How can I erase parts of an Image on HTML5 Canvas? 回答1: You can use Compositing to "erase" pixels. Specifically you use destination-out compositing. KineticJS does not support compositing, but you still have a couple of options: