Opened 9 years ago

Last modified 3 years ago

#15 assigned enhancement

One-click contiguous brush grab

Reported by: finticemo Owned by: PulkoMandy
Priority: major Milestone: 2.9
Component: GrafX2 Version: 2.4
Keywords: Cc:


In my experience it is very common to want to grab a single-color contiguous region for transforming and stamping.

If possible, it would be good to have a way to do this in one click rather than having to create a detailed polygon to extract it.

As I imagine it, it would work exactly like floodfill, except that it would generate a mask to grab a brush with, rather than painting pixels onto the image.

Perhaps it could replace the current Right Click function on the 'Lasso' half of the brush grabbing button -- which seems to be redundant with the Right Click function on the other half of the brush grabbing button.

Change History (11)

comment:1 by finticemo, 9 years ago

EDIT: After some more careful checking, it seems that the 'Restore' function on the 'Lasso' part of the Brush Grab button does something different from the Restore function on the other half of the button.
It appears to restore a 1px brush.

However, this brush claims to be a grabbed brush and not the standard 1px brush, even though it works in all ways identically to the standard 1px brush. That part seems like a UI bug.

Perhaps doubly so, since the documentation for Lasso tool claims explicitly that the Brush Restore function is the 'same as above'.

So, I'm not sure what is going on there. But for now, I'll file it as a separate bug.

comment:2 by DawnBringer, 9 years ago

I have a script for picking up a brush under the mousepointer. If the single color is important it could easily be modified to just flood on the color under the mousepointer.
You can find it in the ToolBox key-dir:

comment:3 by finticemo, 9 years ago

@annassar : Oh, you're Dawnbringer?
Thanks for the script pointer -- MagicBrushGrab, right? -- I'll check it out. I do have to say though, that because the slots to keybind scripts to are limited to 9, I'm hesitant to keybind scripts for really frequent functions.

comment:4 by finticemo, 9 years ago

Type: defectenhancement

in reply to:  3 comment:5 by DawnBringer, 9 years ago

Yeah, I'm DB :) So I got around to take a look at this and fixed a script for picking up the color-area under the mousepointer. It scans in all eight directions so it can flood diagonal pixels:

I've got a related script (bru_db_ExtractPenColor.lua) that will strip all colors but the pencolor from a brush, it's a very short piece of code:

cf = getforecolor()
cb = getbackcolor()

q = {}
q[true]  = cf
q[false] = cb

w, h = getbrushsize()

for y = 0, h - 1, 1 do
  for x = 0, w - 1, 1 do

    putbrushpixel(x, y, q[(getbrushbackuppixel(x,y) == cf)]);


comment:6 by PulkoMandy, 6 years ago

Milestone: 2.52.6

comment:7 by PulkoMandy, 6 years ago

Owner: changed from Adrien Destugues to PulkoMandy
Status: newassigned

comment:8 by Thomas Bernard, 5 years ago

If that feature is implemented with a lua script, I think we can close the issue.

comment:9 by PulkoMandy, 5 years ago

Milestone: 2.62.7

Move open tickets to 2.7 milestone

comment:10 by PulkoMandy, 4 years ago

Milestone: 2.72.8

comment:11 by PulkoMandy, 3 years ago

Milestone: 2.82.9
Note: See TracTickets for help on using tickets.