GNOME Bugzilla – Bug 331051
Incorrect alpha in gaussian blur (RLE+IIR)
Last modified: 2008-01-15 14:05:41 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.
Created attachment 59292 [details] Screenshot of vertical and horizontal RLE blurs on alpha lines
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.
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).
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?
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'.
Stephane, if you have comments on bug #331051, please add them to bug #331051, not here.