I have a canvas with an image painted on it.
When the user clicks on the image, I need to find the area of color that the user clicked on. An area is defined as a set of four-sided connected pixels with the same color as the pixel that was clicked.
I need an area in the shape that I could use to set the clipping path on the canvas so that I can fill the area with, say, a gradient, etc.
Are there any efficient algorithms for finding the boundary? Something more optimal than the algorithms for filling the bay (I do not need to fill, I just need to find a way around my region).
source share