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 331051 - Incorrect alpha in gaussian blur (RLE+IIR)
Incorrect alpha in gaussian blur (RLE+IIR)
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Plugins
2.3.x
Other Linux
: Normal normal
: 2.2
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2006-02-13 20:55 UTC by Stephane Chauveau
Modified: 2008-01-15 14:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Screenshot of vertical and horizontal RLE blurs on alpha lines (11.49 KB, image/jpeg)
2006-02-13 20:58 UTC, Stephane Chauveau
Details
same with inverted src and dest (18.60 KB, image/jpeg)
2006-02-13 21:08 UTC, Stephane Chauveau
Details

Description Stephane Chauveau 2006-02-13 20:55:54 UTC
I was working on speeding up the gaussian blur (RLE) when I noticed something odd regarding the alpha channels. 

During vertical blur, the alpha channel is processed with
  
     if (has_alpha)
        multiply_alpha (src, height, bytes);

     /* ... apply the blur src -> dest ... */

     if (has_alpha)
        separate_alpha (src, height, bytes);
 
and during horizontal blur: 
      
     if (has_alpha)
        multiply_alpha (dest, width, bytes);

     /* ... apply the blur src -> dest ... */

     if (has_alpha)
        separate_alpha (dest, width, bytes);
  
That does not really make sense because dest is not yet filled when multiply_alpha() is called and src is not used anymore after separate_alpha().
So multiply_alpha() should always be applied to src while separate_alpha() should b applied to dest.

Just to be sure I applied some horizontal and vertical gaussian blurs to vertical and horizontal bars. The result should be symetrical but it is not at all.
Comment 1 Stephane Chauveau 2006-02-13 20:58:14 UTC
Created attachment 59292 [details]
Screenshot of vertical and horizontal RLE blurs on alpha lines
Comment 2 Stephane Chauveau 2006-02-13 21:08:49 UTC
Created attachment 59293 [details]
same with inverted src and dest

The version with  multiply_alpha (src ,...) and separate_alpha(dest,...) looks a lot better to me.
Comment 3 Sven Neumann 2006-02-14 07:28:16 UTC
Fixed in both branches. Thanks a lot for noticing us about this problem.

2006-02-14  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/gauss.c (gauss): apply multiply_alpha() on the
	source buffer, not the destination (bug #331051, spotted by
	Stephane Chauveau).
Comment 4 weskaggs 2006-08-21 16:09:32 UTC
Stephane, it looks like either this change, or else the speedups you introduced at about the same time, have caused a bit of breakage.  If possible, could you take a look at bug #343047 and give us your opinion about how to handle it?
Comment 5 Stephane Chauveau 2006-08-26 22:44:52 UTC
I believe that the problem is that only half of the fix was backported.
The separate_alpha() used in the vertical pass is still applied to 'src'. It should be applied to 'dest'.




 
Comment 6 Sven Neumann 2006-08-29 06:46:13 UTC
Stephane, if you have comments on bug #331051, please add them to bug #331051, not here.