Filling small holes in an image efficiently #2251
-
Hi there! Firstly, thanks for the library. I'm really enjoying using it! Is there a built-in way to fill in areas of an image? I see that there's methods that allow you to fill in paths or polygons which sounds good to me, but I don't see any efficient way of generating these objects without simply getting the boundary pixels of every one manually which would mean looping through the image and manually checking each pixel's neighbours... There must be a better way. I've attached an image to show the kind of areas that I'm talking about. Note that there are black holes in white areas of the image and white holes in black areas. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Generating polygons based on pixel graphic data is definitely beyond the scope of the ImageSharp and ImageSharp.Drawing libraries. I would do the filling some other way anyways, maybe by flooding the pixels from a starting point, if you mean some mspaint-like filling here. |
Beta Was this translation helpful? Give feedback.
-
Just wanted to throw in that
It wont help with the larger wholes, though. |
Beta Was this translation helpful? Give feedback.
Generating polygons based on pixel graphic data is definitely beyond the scope of the ImageSharp and ImageSharp.Drawing libraries.
I would do the filling some other way anyways, maybe by flooding the pixels from a starting point, if you mean some mspaint-like filling here.