Filter effects: Background Image mostly broken

Bug #501873 reported by Timo Honkasalo
50
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Inkscape
Confirmed
Medium
Unassigned

Bug Description

Possibly related to Bug #194928, but to me it seems that the error is produced somewhere after reading the background buffer (since the bug report didn't include a screenshot, I can't tell if my bug looks similar). Also, I have noticed this affects more filters than only the displacement map.

A sample SVG file illustrates the problem. On layer 1 there are some shapes. On layer 2 there is a green circle object to which several filter effects can be applied (open the filter effects dialog and you'll see them). Each filter takes the background image, applies an effect to it and composites it with the source alpha to cut the effect to the shape of the circle. The filters are named after the effect they use.

If you try the filters you'll notice that only color matrix, blend and lighting effects render properly. Gaussian blur, displacement map, offset, morphology and convolution matrix produce ugly rendering artifacts. In gaussian blur the rendering is continuous but it seems like it's rendered in blocks, but the blocks are misaligned. In other effects, there are blocky gaps in the rendered output (although in convolution matrix the gaps are only few pixels wide, I've added a desaturation color matrix to make them more apparent). For effects other that Gaussian blur, using background alpha produces similar artifacts. The bug also appears when exported to bitmap.

When using Gaussian blur, the edges of the artifacts are sharp, which suggests that the error is produced after the blurring. Also, when a displacement map effect is preceded with a color matrix that adds 1 to the alpha values, making sure that the source to the displacement includes no transparent pixels, gaps still appear in the final output. All this implies that the original background image is copied correctly, and the error appears at a later stage.

I think it might be noteworthy that in color matrix and blend, which are working, the value of an output pixel only depend on the value of the source pixel at the same location, while the broken effects use also other source pixels. The lighting effects also use neighbouring pixel values though, but they only use the alpha channel values.

EDIT: this was Inkscape version 0.47 r22583 on Debian squeeze PPC.

Revision history for this message
Timo Honkasalo (timo-honkasalo) wrote :
Revision history for this message
Timo Honkasalo (timo-honkasalo) wrote :
Revision history for this message
Timo Honkasalo (timo-honkasalo) wrote :
description: updated
Revision history for this message
Chris Morgan (chris.morgan) wrote :

Reproduced in Ubuntu 10.04 with Inkscape 0.47+devel-r9474. This is a real nuisance with a "frosted glass" effect I've just made, as it messes it up somewhat in its feGaussianBlur of the background. It happens both in the canvas and in an exported PNG file, making my nice filter sadly deficient at the moment.

Changed in inkscape:
status: New → Confirmed
jazzynico (jazzynico)
Changed in inkscape:
importance: Undecided → Medium
Revision history for this message
ivan louette (ivan-louette) wrote :

I found that if the filter is applied to an object wider than the background image the discontinuities most often disappear and even export to bitmap works fine. I specify "wider" because it only works when object exceeds the width of the background image ; it doesn't work if it only exceeds in height) My workaround at the moment is applying the filter to a group which includes an object outside the background image (to the left or the right) like in the attached file.

If discontinuities appear when opening the file, simply Ctrl+click the quadrangle outside on the left and move it slightly. They should disappear and exporting bitmap should work right.

Revision history for this message
ivan louette (ivan-louette) wrote :

I forgot it was tested with Inkscape 0.48+devel r11761 on Kubuntu 12.04 64 bits and 32 bits !

I doesn't solve the problem in Inkscape 0.48.3.1 r9886 on the same systems.

Revision history for this message
Brian Gomes Bascoy (gomesbascoy) wrote :

Probably duplicated, check Bug #262865
Is this bug still reproducible in the current trunk (0.49) ?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.