GNOME Bugzilla – Bug 126748
the 'select regions by colors' tool should update the selection in realtime when changing the threshold
Last modified: 2006-08-01 09:48:51 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.
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?
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.
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.
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?
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.
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.
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.
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.
It now works as it always did in the fuzzy select tool: by click and drag in the canvas to adjust the threshold.
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.
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.