Flood fill suggestion - Bound threshold
Some of the stuff I do with the calligraphy tool has gaps between sections I would like to colour. Visually the gaps don't bother me, but I can't use Flood Fill when the area isn't properly closed.
It would be nice there was a threshold where we could say that gaps of a certain size should be considered closed. I imagine it would be like a thickness to the paint where if it's very thick it can't flow through a small gap.
microUgly wrote:
Some of the stuff I do with the calligraphy tool has gaps between sections I would like to colour. Visually the gaps don't bother me, but I can't use Flood Fill when the area isn't properly closed.
It would be nice there was a threshold where we could say that gaps of a certain size should be considered closed. I imagine it would be like a thickness to the paint where if it's very thick it can't flow through a small gap.
Hi. I just committed a change to Subversion that adds simple auto gap filling to Paint Bucket. You can change the gap sizes (small, medium, large) that it will fill using the dropdown in the toolbar when Paint Bucket is selected. Let me know how this works for you.
Thanks,
John
Wow, I'm glad I asked. I didn't expect a result so quickly.
This is exactly what I was looking for, but the flow effect can be a little difficult to predict.
Where you click in a specific region effects where the fill will flow. With the same setting sometimes it will flow into more areas than other times. Sometimes "Small" flows further than "None".
Setting to "Large", and sometimes "Medium", will give the error "Area is not bounded, cannot fill" even when smaller settings work fine.
But, overall the tool works great.
Also, whilst I'm here, and I apologise if this is an issue that has already been explained, but is it possible for the fill tool to ignore the viewport and apply to an entire drawing at 1:1 ratio? I expect if it was that's the way it would work already, but I had to ask.
John Bintz wrote:
microUgly wrote:
Some of the stuff I do with the calligraphy tool has gaps between sections I would like to colour. Visually the gaps don't bother me, but I can't use Flood Fill when the area isn't properly closed.
It would be nice there was a threshold where we could say that gaps of a certain size should be considered closed. I imagine it would be like a thickness to the paint where if it's very thick it can't flow through a small gap.
Hi. I just committed a change to Subversion that adds simple auto gap filling to Paint Bucket. You can change the gap sizes (small, medium, large) that it will fill using the dropdown in the toolbar when Paint Bucket is selected. Let me know how this works for you.
Thanks,
John
This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
microUgly said:
This is exactly what I was looking for, but the flow effect can be a little difficult to predict.
Where you click in a specific region effects where the fill will flow. With the same setting sometimes it will flow into more areas than other times. Sometimes "Small" flows further than "None".
Can you send me an example .svg file that exhibits this behavior, and tell me which areas you're trying to fill?
Also, whilst I'm here, and I apologise if this is an issue that has already been explained, but is it possible for the fill tool to ignore the viewport and apply to an entire drawing at 1:1 ratio? I expect if it was that's the way it would work already, but I had to ask.
The biggest issue with rendering the whole drawing is memory & CPU usage, since a copy of the current drawing (viewport-bound or otherwise) needs to be rendered to memory before the fill can be calculated. I want to avoid having a different operating mode for the fill tool if I can help it, as well. For your larger areas, have you tried using [Shift]-click to both fill in the visible areas and to join the resulting paths? This would work at any zoom level, including 1:1.
Thanks,
John
John Bintz wrote:
Can you send me an example .svg file that exhibits this behavior, and tell me which areas you're trying to fill?
Download from http://www.microugly.com/temp/denyse-bui-inks.svg
My monitor is running at 1280 x 1042 and I'm working with the picture at 71% zoom. If you click different areas of her chest with "Small" and undo (repeatedly) you'll eventually you capture some situations where the fill will spread further than other times. Sometimess it will flow into her arm whilst othertimes it won't.
With the same viewport, if you change to "Large" you can't click anywhere on her chest and get an error about bounded area.
Hope this helps.
microUgly wrote:
Download from http://www.microugly.com/temp/denyse-bui-inks.svg
My monitor is running at 1280 x 1042 and I'm working with the picture at 71% zoom. If you click different areas of her chest with "Small" and undo (repeatedly) you'll eventually you capture some situations where the fill will spread further than other times. Sometimess it will flow into her arm whilst othertimes it won't.
With the same viewport, if you change to "Large" you can't click anywhere on her chest and get an error about bounded area.
I just reworked the internals of the flood fill algorithm, which improved how auto gap works significantly. I was able to fill in the parts of your drawings consistently with the different auto gap settings. Fills may take a little more time to process now, but I want to make sure the algorithm works before I start any optimizations.
Let me know if these changes improve the fill quality for you.
John
With a quick trial it appears to be behaving consitantly and predictably now.
Thanks very much for this.
John Bintz wrote:
microUgly wrote:
Download from http://www.microugly.com/temp/denyse-bui-inks.svg
My monitor is running at 1280 x 1042 and I'm working with the picture at 71% zoom. If you click different areas of her chest with "Small" and undo (repeatedly) you'll eventually you capture some situations where the fill will spread further than other times. Sometimess it will flow into her arm whilst othertimes it won't.
With the same viewport, if you change to "Large" you can't click anywhere on her chest and get an error about bounded area.
I just reworked the internals of the flood fill algorithm, which improved how auto gap works significantly. I was able to fill in the parts of your drawings consistently with the different auto gap settings. Fills may take a little more time to process now, but I want to make sure the algorithm works before I start any optimizations.
Let me know if these changes improve the fill quality for you.
John
This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
microUgly wrote:
With a quick trial it appears to be behaving consitantly and predictably now.
Thanks very much for this.
You're welcome. :) This is a feature I've been wanting to add, but never had the motivation until someone asked for it. I just committed one final set of changes. I put back a few of the optimizations that were taken out as I was rewriting the internals of Paint Bucket to work better. Try it now and make sure it's still as accurate as before. It should be a lot faster, with both regular and autogap fills. I tried it on your test drawing and one of my comic pages and it worked fine for me.
Thanks,
John
Sorry for the delayed reply. Looks to be working perfectly, and fast.
Thanks again
John Bintz wrote:
microUgly wrote:
With a quick trial it appears to be behaving consitantly and predictably now.
Thanks very much for this.
You're welcome. :) This is a feature I've been wanting to add, but never had the motivation until someone asked for it. I just committed one final set of changes. I put back a few of the optimizations that were taken out as I was rewriting the internals of Paint Bucket to work better. Try it now and make sure it's still as accurate as before. It should be a lot faster, with both regular and autogap fills. I tried it on your test drawing and one of my comic pages and it worked fine for me.
Thanks,
John
participants (2)
-
John Bintz
-
microUgly