title: looking for algorithm to find boundary of color region
body: <p>I have a canvas with image drawn to it.</p>
  
  <p>When the user clicks on the image, I need to find the color region that the user clicked on. A region is defined as a set of 4-way connected pixels with the same color as the pixel that was clicked on.</p>
  
  <p>I need the region in a form that I could use to set a clipping path on the canvas, so that I could fill the area with, say, a gradient, etc.</p>
  
  <p>Are there efficient algorithms for finding a boundary? Something more optimal than flood fill algorithms (I do not need to fill, I just need to find a path around my region).</p>