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 343911 - Description of "Selection sharpen" operation is incorrect
Description of "Selection sharpen" operation is incorrect
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: libgimp
git master
Other All
: Normal minor
: 2.4
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2006-06-05 13:14 UTC by saulgoode
Modified: 2006-06-05 20:36 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description saulgoode 2006-06-05 13:14:15 UTC
Please describe the problem:
The description of the PDB function 'gimp_selection_sharpen' specifies that if the pixel's value is greater than zero, the pixel is assigned the value of 255. In actuality, pixels with values ranging from 0 to 127 are assigned the value of "0" and pixels in the range 128 to 255 are assigned the value of "255".

Steps to reproduce:
1. Make a selection.
2. Feather the selection
3. Perform an <Image>/Select/Sharpen


Actual results:
The resulting selection no longer includes the extremes of the feathering.

Expected results:
The resulting selection should include every pixel which previously had a non-zero value.

Does this happen every time?
Yes.

Other information:
Line 1092 of the file 'app/core/gimpchannel.c' appears to be where threshold is specified as "127".

  lut = threshold_lut_new (0.5, 1)
Comment 1 Sven Neumann 2006-06-05 14:01:35 UTC
The docs seem to be wrong here, the behaviour is IMO correct.
Comment 2 saulgoode 2006-06-05 17:17:17 UTC
Not to be overly argumentative, but I would propose for discussion that the behavior as documented would prove more useful. 

When partial alpha values are to be used in an animated GIF (for example, anti-aliased text), unless it is "processed" beforehand, the image is aliased. One way around this is to perform an "Alpha to selection", "sharpen" the selection, "Copy visible" the layers underneath, and then Merge Down the original layer. This results in a layer that contains only the appropriate pixels, properly anti-aliased. With the present behavior of "select->sharpen", the "sharpen" has to be performed by saving the selection mask to a channel, performing a Threshold on the channel, and then restoring the channel to the selection mask. 

I understand changing the behavior might break things (I think this is unlikely, as noone has reported the documentation error previously), the "safe" thing to do is to change the documentation; but I can't think of any situation were having the threshold set at "127" (as it currently is) would be similarly useful.

Comment 3 Sven Neumann 2006-06-05 20:26:56 UTC
Editing animated GIFs is not what GIMP is meant to be used for.  Sharpening the selection should result in a selection identical to what is visualized by the marching ants.  We will fix the documentation.
Comment 4 Sven Neumann 2006-06-05 20:36:10 UTC
2006-06-05  Sven Neumann  <sven@gimp.org>

	* tools/pdbgen/pdb/selection.pdb: fixed documentation of
	gimp-selection-sharpen (bug #343911).

	* libgimp/gimpselection_pdb.c: regenerated.