After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 126748 - the 'select regions by colors' tool should update the selection in realtime when changing the threshold
the 'select regions by colors' tool should update the selection in realtime w...
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Tools
git master
Other All
: Normal enhancement
: 2.4
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2003-11-11 19:10 UTC by Fabio Chelly
Modified: 2006-08-01 09:48 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Fabio Chelly 2003-11-11 19:10:58 UTC
Description of Problem:

The 'select regions by colors' tool would be a 
lot more powerful if it was able to update the 
selection automatically when the user change the 
threshold.

Steps to reproduce the problem:
1. choose the 'select regions by colors' tool 
2. click on the picture
3. change the threshols

Actual Results:

You need to click again on the picture to see 
then changes

Expected Results:

The changes should be visible in real time, in 
the 'selection editor' dialog.
Like this, we would see instantly the white area 
in the B&W mask be enlarged or reduced to fit 
what we really want to select.

How often does this happen? 

Everytime

Additional Information:

This would really improve the 'select regions by 
colors' tool.
Comment 1 Sven Neumann 2003-11-11 19:31:16 UTC
Sounds like a nice idea on first thought. On second it becomes
complicated, it not undoable. The tool modifies the selection. How
should it behave if in Add, Replace or Intersect mode?
Comment 2 Fabio Chelly 2003-11-14 20:50:36 UTC
I think it should be a new mode 'magic update': another button after 
intesect mode which would appears for 'magic wand' and 'select 
regions by colors' only.

After a click on the picture, the coordinates are stored and the 
button becomes enabled.
When the user drag the threshold slider, the selection editor is 
updated in real time. If updating the dotted selection in real time 
takes too much time, this selection can be updated only when the 
user release the slider.
Comment 3 weskaggs 2006-06-13 23:50:24 UTC
I managed to come up with a way of doing this, using some of the tricks developed for the new rectangle-select tool.  Seems to handle Replace, Add etc correctly, but should certainly get some testing.

2006-06-13  Bill Skaggs  <weskaggs@primate.ucdavis.edu>

	* app/tools/gimpbycolorselect.[ch]: allow modifying threshold
	without having to re-click on image each time.  Fixes
	bug #126748.
	
Comment 4 Michael Natterer 2006-06-14 09:50:07 UTC
IMHO this should work the same way as the free select tool. Currently
it's not only inconsistent between the two tools, it's also inconsistent
in how it handles tool options. Why does changing the threshold option
update the tool, but not the mode buttons or any other tool options.

We also don't have any tool that updates what it *has done* (as opoosed
to what's it currently doing, involving visible draw tool action)

Also, did you try that with undo disabled?
Comment 5 weskaggs 2006-06-14 14:38:30 UTC
You probably mean the fuzzy select tool instead of the free select tool.  That could work the same, but there is not as much need, because you can adjust the threshold there by mouse dragging.

Concerning no other tool doing something similar, it is not true -- the text tool does.

Concerning disable of undo, I have tried it (by setting max undo memory to 0), and it doesn't cause any problems as far as I can tell.  The mechanism does not *require* undo, it just tries to avoid messing up the undo history.

Basically if you ever used this tool, you would see the reason for the change:  a user hardly ever knows the right threshold to start with, and having to reclick at the same spot each time you change it makes the tool close to unusable.

From a logical point of view, it might make more sense either to allow the threshold to be adjusted by mouse dragging, or to have the threshold control in a dialog rather than the options, but imho this change is enough to make the tool usable.

Comment 6 Michael Natterer 2006-06-15 08:34:25 UTC
The fuzzy and by color select tools do almost the same, so they should
allow setting the threshold the same way IMHO. Better not have a feature
than having it inconsistently.

It's probably best to factor out the common part to gimpregionselecttool.
Will look into that this weekend.
Comment 7 Michael Natterer 2006-07-31 11:43:40 UTC
Fixed in CVS by making by color select behave the same way as
fuzzy select:

2006-07-31  Michael Natterer  <mitch@gimp.org>

	* app/tools/Makefile.am
	* app/tools/gimpregionselecttool.[ch]: new abstract base class
	which does about the same as GimpFuzyySelectTool did, apart from
	creating the mask of the selected region.

	* app/tools/gimpbycolorselecttool.[ch]
	* app/tools/gimpfuzzyselecttool.[ch]: removed all code and only
	implement GimpRegionSelectTool::get_mask(). Fuzzy and by-color
	select behave exactly the same now. Fixes bug #126748.
Comment 8 david gowers 2006-07-31 18:08:52 UTC
This should be reopened. Now the dynamic behaviour doesn't work for either tool, where before it did work for the by-color-select tool. Tried on both greyscale and RGB images.
Comment 9 Michael Natterer 2006-08-01 08:26:08 UTC
It now works as it always did in the fuzzy select tool: by click and
drag in the canvas to adjust the threshold.
Comment 10 david gowers 2006-08-01 09:32:50 UTC
That's useful and far better than the previous behaviour, but I'm certain this bug report is about something different:

"
The 'select regions by colors' tool would be a 
lot more powerful if it was able to update the 
selection automatically when the user change the 
threshold."

.. I take this to mean, being able to seed a selection by clicking, then changing the threshold effects the selected area based on that seed, until you reseed it.
The change you made doesn't provide that; it provides drag-to-adjust-threshold to the by-color-select tool, and dynamic response remains unimplemented.

You said "Better not have a feature than having it inconsistently" but I think you closed this bug upon fixing a related (unreported) bug. Also, from what I recall, there isn't any particular reason that the technique Bill used to implement dynamic threshold response can't be applied to Fuzzy Select as well.
Comment 11 Michael Natterer 2006-08-01 09:48:51 UTC
Well I consider that technique a hack since it involves the undo
system. I don't like the way the undo system is being abused in the
new rect select tool either.

Also, my original argument still stands: why would changing threshold
modify the tool's result, but not e.g. ADD/SUB/INTERSECT or any other
tool option. 

We can implement such things when we have an undo history that is aware
of the procedures/nodes executed: simply change the node's arguments and
run the pipeline again. Sprinkling this kind of hacks all over the
place *now* doesn't make GIMP better or more stable.