Opened 5 years ago

Last modified 6 months ago

#15 assigned enhancement

One-click contiguous brush grab

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

Description

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 (10)

comment:1 Changed 5 years ago by finticemo

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 Changed 5 years ago by DawnBringer

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: http://goto.glocalnet.net/axe/toolbox13.zip

comment:3 Changed 5 years ago by finticemo

@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 Changed 5 years ago by finticemo

Type: defectenhancement

comment:5 in reply to:  3 Changed 5 years ago by DawnBringer

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: http://hem.bredband.net/ricfha/script/bru_db_ColorAreaGrab.lua

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)]);

  end
end

comment:6 Changed 2 years ago by PulkoMandy

Milestone: 2.52.6

comment:7 Changed 2 years ago by PulkoMandy

Owner: changed from Adrien Destugues to PulkoMandy
Status: newassigned

comment:8 Changed 20 months ago by Thomas Bernard

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

comment:9 Changed 19 months ago by PulkoMandy

Milestone: 2.62.7

Move open tickets to 2.7 milestone

comment:10 Changed 6 months ago by PulkoMandy

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