NEW: paint bucket fill along dragged path
bulia's new "touch selection" and improvements to the Rubberband object have given me what I've needed to properly implement a feature he and I talked about a while back: dragging the cursor while using Paint Bucket now performs the fill operation from all points along the drag path.
Just like touch selection, you have to hold [ Alt ] to get this feature; otherwise it works as before, where a single click fills from the one click point. The color used for the drag fill algorithm is the color at the initial click point. This becomes very useful if you have a series of similarly-colored yet separated areas (Ex: inked fingers on a relaxed hand). Normally, to fill this object, you'd have to click once in each of these areas (fingers, thumb, hand) with the same fill color. Now, click and hold [ Alt ] in one of the areas, drag the cursor through the other areas, release the cursor, and all of the areas you've touched are filled.
One possible addition to this would be an additional modifier to change the behavior of the fill color selection. Instead of the initial click point, each point along the drag would define the fill color. This way, you could drag from one end of a gradient to the other end and, with a low Threshold, fill the gradient. This would require a little reworking to the fill algorithm, but if there's interest, I'll add it.
John
On 4/15/07, John Bintz <jcoswell@...1414...> wrote:
Just like touch selection, you have to hold [ Alt ] to get this feature; otherwise it works as before, where a single click fills from the one click point. The color used for the drag fill algorithm is the color at the initial click point. This becomes very useful if you have a series of similarly-colored yet separated areas (Ex: inked fingers on a relaxed hand). Normally, to fill this object, you'd have to click once in each of these areas (fingers, thumb, hand) with the same fill color. Now, click and hold [ Alt ] in one of the areas, drag the cursor through the other areas, release the cursor, and all of the areas you've touched are filled.
Excellent, thanks! I propose to call this "touch filling" for consistency :)
One possible addition to this would be an additional modifier to change the behavior of the fill color selection. Instead of the initial click point, each point along the drag would define the fill color. This way, you could drag from one end of a gradient to the other end and, with a low Threshold, fill the gradient. This would require a little reworking to the fill algorithm, but if there's interest, I'll add it.
That's what I originally had in mind, and I still think it will be useful for filling in more life-like images, for example on imported photos. Of course I cannot be sure exactly how useful it will be without trying, but why can't we try? :)
If it is indeed useful, I think we can have both modes: gradient fill by simple drag and touch fill by alt+drag.
Another possibility is to use SIOX for this mode. We already have it in our codebase - it's used as one of the tracing modes. Its inputs are exactly this: a bitmap and a path covering some areas of it, and it selects all areas that "look similar" (see http://www.siox.org/). It would be perfect to try both SIOX and a simple fill-from-each-point and compare the results - maybe one of these will be less useful than the other, but maybe they will be both useful so we'll keep both :)
On Apr 15, 2007, at 9:24 AM, bulia byak wrote:
Another possibility is to use SIOX for this mode. We already have it in our codebase - it's used as one of the tracing modes. Its inputs are exactly this: a bitmap and a path covering some areas of it, and it selects all areas that "look similar" (see http://www.siox.org/). It would be perfect to try both SIOX and a simple fill-from-each-point and compare the results - maybe one of these will be less useful than the other, but maybe they will be both useful so we'll keep both :)
Then we'd get not "magic wand", but instead....
... "magic touch" !
:-)
bulia byak wrote:
If it is indeed useful, I think we can have both modes: gradient fill by simple drag and touch fill by alt+drag.
I just implemented a basic gradient fill mode triggered by a regular drag. It's still a quite buggy, however. :(
Another possibility is to use SIOX for this mode. We already have it in our codebase - it's used as one of the tracing modes. Its inputs are exactly this: a bitmap and a path covering some areas of it, and it selects all areas that "look similar" (see http://www.siox.org/). It would be perfect to try both SIOX and a simple fill-from-each-point and compare the results - maybe one of these will be less useful than the other, but maybe they will be both useful so we'll keep both :)
I'll take a look into this one sometime next week.
John
participants (3)
-
bulia byak
-
John Bintz
-
Jon A. Cruz