GNOME Bugzilla – Bug 510210
Equalize incorrectly acts on the alpha channel
Last modified: 2008-10-30 20:08:18 UTC
Please describe the problem: When executing equalise (Colours -> Auto -> Equalise) while having a layer selected whose non-transparent area is not rectangular, the image viewing window shows the manipulation as applying to the WHOLE rectangle covered by the layer, not just the parts that actually contain image data (i.e. not transparent). Other options in Colours -> Auto behave correctly, only manipulating image that actually belongs to the layer. Steps to reproduce: 1. Open a photo 2. make a non-rectangular selection (mine was feathered, could play a role?) 3. copy selection to a new layer (Ctl+C,Ctl+V, go to layer window, select "floating selection", use button in layer window to "Create new") 4. Colours -> Auto -> Equalise while both layers are set to visible Actual results: Image portion covered by layer frame is shown with new colour values corresponding to an "equalise" correction. Expected results: Only image portion that actually belongs to layer gets corrected (NB rectangle was not selected, either, and correct layer was active) Does this happen every time? Every time I tried. Other information:
Ran some further tests, and found out that what actually happens is that Equalise causes more image data to be pasted into the layer; i.e. it expands the image to fill the rectangle, taking image data from another layer. An additional point of note is that it is unclear (to me, at least) how Equalise decides which layer to draw the image data from when it does this. In any case, a highly unorthodox behaviour!
Could you attach a small example image in XCF format that we can use to try to reproduce the problem?
I can confirm this, although the problem description is not quite correct: what is happening is that "equalize" is equalizing the alpha channel along with the color channels. I am attaching a patch that should correct it -- this code is used in all of the other lut-funcs in app/base/lut-funcs.c, but apparently was accidentally left out for the "equalize" lut.
Created attachment 103114 [details] [review] patch for app/base/lut-funcs.c
Looks like the right fix. Please commit in both branches.
Fix committed to both branches (after fixing a typo). 2008-01-18 Bill Skaggs <weskaggs@primate.ucdavis.edu> * app/base/lut-funcs.c (equalize_lut_func): Don't equalize the alpha channel. Fixes bug #510210.