(08-28-2023, 04:13 PM)notl Wrote: using the paint bucket to fill an area, identifying where it reaches an edge, then identifying where it connects on the opposite side, then flood filling that new area, and so on until it returns to the bit that was first filled.
I'm not going to help you code something, it's way above my head, on the other hand I'll show you how to do it in GIMP without you having the need to search to identify where is where.
There is a tool that does not show up in the tool box by default, it's called Offset
Go to Edit > Preferences a window opens, go to Interface > Toolbox on the left side scroll-down and tick the eye of the Offset tool, now it appears in the toolbox
Colore your things, once you have reached the edges, select the Offset tool then click on your image, a window open click on that biggest button w/2 - h/2 >OK
Continue to color, once reached the edges, reselect the Offset tool, do it again...
once you cannot reach any edge, you're done, no labyrinth to follow, no calculation needed
If the black pattern does not look like the original at the end, just put it back to the original pattern with .. -> yes again -> the Offset tool one more time
Yes I did colored it with the bucket tool -> line art detection "on", and the offset tool
Patrice