title: Detect path around nontransparent part of image on canvas
body: <p>I'm drawing an image onto a canvas using drawImage. It's a PNG that is surrounded by transparent pixels, like this:</p>
  
  <p><a href="https://i.stack.imgur.com/cp7hM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cp7hM.png" alt="enter image description here"></a></p>
  
  <p>How can I detect a path to the visible part of that image on the canvas?</p>
  
  <p>Check it out full code on <a href="https://github.com/gokujy/ioniccanvas.github.io" rel="nofollow noreferrer">Github</a></p>
  
  <p>Check it out live demo <a href="https://ioncanvas.sitesforhosting.co.in/" rel="nofollow noreferrer">IonCanvas</a></p>