Approaches to Flood Fill

Someone had asked about implementing flood fill of solid areas with an alternate solid color.  And i said i'd show off some different approaches.

 

So here's a test image with some different solid boundaries surrounding flat colored (white in this case) regions.

9733184476?profile=RESIZE_710x

I used a Region Draw Pen Mode option with a 2 pixel brush and Fill From set to From in paint Fill Setup. So no anti-aliasing on the painted lines, hard edges (which is that you typically want for this kind of thing).  I did not turn off Paint Color Modulate, so the color is drifting a little bit in the line drawing, which we will see the effect of in a few examples.  In general you would want to set the Modulate Amount in Paint Color Modulate to 0 for this kind of thing, so the line stays a single consistent solid color.

So the simplest way to do a flood fill wil color is to go to Selection operation mode, and use the Canvas selection option with Local Growth and No Soft.

9733187493?profile=RESIZE_710x

Click in the region you are interested in flood filling with color, and slightly move the mouse 1 pixel (small amount) before releasing to do the selection.   

As you increase the mouse movement before the release, you are extending the color range of the selection. So you will spill over the boundary if you move it enough to increase the color range to make that happen.

Note that i have the Source Area setup for my color choice i want to flood fill with.

So now you erase to the source color (canvas menu or tuse the eraser icon in the operation toolbar to do it), and you are done.

9733192672?profile=RESIZE_710x

And yes, this is 2 steps (2 action steps in a PASeq as well).

Someone had asked about a way to do it in one step, and i implied you could do it using the paint synth.  Was true in old Studio Artist, not really in V5.5.5. So i will fix that in V6.  We added some things in V5 to make the grow Region from StartPoint Path Shape option more useable, and lost he ability to use it for straight old fashioned flood fill in the canvas. 

You can set the source to your canvas and then use the Geodesic Contour brush type, but that's even more involved than just doing it with local canvas selection followed by a masked erase to solid source color.

 

You need to be a member of Studio Artist to add comments!

Join Studio Artist

Email me when people reply –

Replies

  • Now there are several different 'interpolator' IpOp effects that can be used to 'flood fill' in default colored regions with color.  

    The first one is Flat Region Colorize.

    If i run it on that last canvas image above, i get the following.

    9733248076?profile=RESIZE_930x

    So with the particular parameter settings shown in the screen shot, you get the following. Each flat colored region is filled with an average of the source coloring (the color mean) from the associated spatial local area of the region (and it's spatial mapping to the current source image).

    Note the boundary lines are filled with multiple dots of color as opposed to being solid.  Remember i said i forgot to turn off the color modulation along the paint path, and you can see what that does in the image above for this kind of usage.  If i had turned it off so the lines were actually a solid color, then they would be a new local mean solid color above.

     

    Geodesic Interpolation is another kind of IpOp interpolator effect.  it really performs extrapolation from the edges of a flat colored region boundary into the interior.

    So with the settings shown in the screen shot below, we get the following kind of coloring flood fill.

    9733251654?profile=RESIZE_930x

    Now if i change the parameter settings so that the blue color used for my original region flood fill is setup as the background color, then we get the following.

    9733253253?profile=RESIZE_930x

    Do you grok how this effect works now?

     

    Geodesic Falloff is another kind of flood fill like algorithm, one that can be used to create more elaborate special effects.  You can set it up to do something very similar to Geodesic Interpolation, but i configured it differently below to get the following.

    9733254291?profile=RESIZE_930x

    If i set the Algorithm to Interpolation i would have gotten something more like Geodesic Interpolation.

     

    Geodesic Variator is yet another kind of flood fill like effect, but one designed for more artistic effects like the example show below.

    9733255667?profile=RESIZE_930x

    Pay close attention to my Repetition setting in the screen shot.  If you play around with it you will understand why i set it up that way (very useful when recording it into a PASeq so you can have just 1 action step as opposed to 20 to make ti go this far out).

     

    The Sparse Interpolator is yet another effect that is similar to the above.  Although the way it works internally is very different than the flood fill like algorithms used in the above.

    9733263092?profile=RESIZE_930x

    I say flood fill, but only Geodesic Interpolator and Geodesic Variator are truly flood fill style like algorithms internally. Geodesic Falloff is constructing a directed geodesic distance map across the regions being interpolated, so much more sophisticated in terms of how it works. Sparse Interpolator is building a sparse interpolation map across multiple spatial octaves of processing, so it uses a spatial pyramid and is pretty sophisticated in terms of the processing going on inside of it.

     

    So there is a quick journey through the zoo of different IpOp interpolation algorithms that can be used for 'flood fill' like effects.

    • thank you, this is very helpful. along these likes, i was trying to automate an artmapping process by using vectorizer to a reduced palette and selecting global color (from the palette) and using an erase to color or generate other ops from the selection. my problem is that i have to click on the canvas to pick the color, but i'm trying to automate the process on a movie source. is there a way to record an operation which is the equivalent of 'select current source color' or 'select color mem x' or 'select palette y' global color from the canvas/source/style.

      e.g. in the image above i'd like to be able to select orange and make a path out of that, then select purple and do the same, etc. without having to look for an orange/purple pixel to click on each frame. 9739264500?profile=RESIZE_930x

      • The Selective Color Matte IpOp effect lets you build a bw matte image off of the current source color,  the current source color memories, the current color palette colors.  You specify  Tolerance and a Transition range values for the matte construction.

        You can route the output to the Selection if you want it in the selection buffer rather than the canvas.

         

        If this what you were looking for, or am i missing what you are asking?

        • yes, this will work for what i am trying to do, thanks, i'll try it out.

  • it would be great if you could show how to use the geo-contour brush. one of the things i'm trying to do is automated floodfill that does not require me to intervene in the selection by clicking but fills from a map. the flat region style below is like that, but it would be cool if i can work it into a path scan process. i tried something like this with grow region from start point but i can't quite get it to follow the regions:9739377298?profile=RESIZE_930x

This reply was deleted.

Is anybody making a copy of all the material in the Tutorials Forum

Since the Forum is going away in June, has anyone started to make a copy of all the stuff in the Tutorials forum?I've made copies of some of the tutorial material on the main site, but haven't looked at the Tutorial Forum yet.I'm going to continue copying as much as I can for my own personal use anyway, but if anyone else is doing it, or has already started doing it, please let me know.Maybe we can co-ordinate our efforts. ps can't ..... believe John, would let this happen without so much as a…

Read more…
1 Reply · Reply by Thor Johnson Apr 13