Author Topic: Blur not working on curved path  (Read 519 times)

February 22, 2019, 11:12:10 AM
Read 519 times

ImaGeek

  • Jr. Member

  • Offline
  • ***

  • 13
I'm working on a file that calls for blurred path lines and the blur function is not working properly. I've attached an Inkscape file to demonstrate the problem. A circle object blurs fine. Paths and arcs don't. Stroke width definitely plays a role. I see no problem with a 1 pixel stroke and a big problem with 5 pixels.

When I decided to try replicating the problem in a new document, I found that curve size makes a difference too. A curve 150 mm wide with a 5 pixel stroke blurred without problem at 1%. When that same curve is reduced down to 50 mm with the same 5 pixel stroke, it becomes as boxy as the ones in the attached file.

Is this a bug?

  • .092
  • Windows 10 Home

February 22, 2019, 02:10:47 PM
Reply #1

Lazur

  • IC Mentor

  • Offline
  • ******
  • Inkscape Filters Wizard

  • 1,154
  • Gender
    Male

    Male
Hi.

Yes, there seems to be a bug with it.

Blurring, which you can set with the slider in the fill and stroke panel,
is achieved by a simple filter, consisting only of a "Gaussian Blur" filter primitive.
Moving the slider or typing in a percentage value adds a new filter definition into your file's defs section. The filtered object has the filter linked in its attributes. When rendering the object, thus the blurring will appear.

Filters affect the rendering of a certain area on screen. That rendering area is defined relative to the object's visual bounding box on which the filter is applied. Built in filters have their filtered area set to 120% relative to the unfiltered object.
If the visuals generated are larger than the bounding box, you will see the same phenomenon.

However blurring with the slider is different. It doesn't create a 1,2 times larger filtered area, as then it would get cut off way more often.
Besides, the custom generated blur filter's bounding box is intended to update with the filtering percentage.
Bug seems to occure when the blurring value is too small, the bounding box isn't updating with the same ratio it should.

But that doesn't mean your svg is buggy or that the cut off look is not the intended appearance code-wise. Browsers render those with the same cutoff amount as the filter's filtered area is "hard-wired" in your file.
It can be corrected manually, by increasing the filtered area.
That can be achieved by the filter editor's filter general settings tab, or by
grouping your objects with a larger transparent rectangle for example and applying the filter on the group.

So it's not a mandatory bug or a rendering issue as per se but more like there is a glitch in the intentional behave.

February 23, 2019, 06:03:00 AM
Reply #2

ImaGeek

  • Jr. Member

  • Offline
  • ***

  • 13
Thank you for the explanation, Lazur. I had already explored the filter editor, so am passingly familiar with it. I opened it to see if expanding the box helped. Today, after restarting Inkscape yet again (I tried that a couple of times with no effect before I posted that file), it is behaving better, but still not perfect. A spiral of 2.731 mm x 2.481 mm with a stroke of .7 px has significant cut-off at 1% blur.

AHA! It's not so much the size of the bounding box, but the path's position within it. No amount of exanding the size helped. Then I noticed the path was jammed in the top left corner of a large box. By changing coordinates from the default of -0.01 to -0.04, the problem is solved for this curve. That's an awkward, clunky solution, but it does save the day.

Is the filter supposed to calculate this and set coordinates accordingly on its own? How can I report this to the development team?

  • .092
  • Windows 10 Home

February 23, 2019, 08:35:00 AM
Reply #3

Lazur

  • IC Mentor

  • Offline
  • ******
  • Inkscape Filters Wizard

  • 1,154
  • Gender
    Male

    Male
The blur slider should update automatically the filter definition of the filtered area size and position.
Manually editing the filter's general settings requires to adjust the "origin" which I forgot to mention. The cutoff appears on all sides as the filtered area is set up to be center-aligned on the object's bounding box. However the filter definition uses the top left corner as an origin. Updating only the filtered area thus can correct only two edges by that.
Stroke width shouldn't affect the calculations of the filtered area though.

The bug tracker was recently migrated to  gitlab:
https://gitlab.com/inkscape/inbox/issues/

Previous bugs were tracked here:
https://bugs.launchpad.net/inkscape

Here are some more information on the reporting:
https://inkscape.org/develop/bug-management/

February 23, 2019, 09:07:57 AM
Reply #4

ImaGeek

  • Jr. Member

  • Offline
  • ***

  • 13
I see now what's happening. I zoomed way in on that small spiral and based on movement of the arrows, I see that when I set the blur to 1%, the bounding box shrinks to a size smaller than the unblurred object. The bounding box does expand as the blur increases, but it remains too small until at least 15% for that small object. The object is centered in the box. I don't understand why it was in the corner when I used the filter editor to adjust it earlier. I notice that the filter editor does not pick up the settings until I hit 2%, then it expands in both dimensions, and both size and offset.

Thanks for those links. I'll document what I've found and submit.
  • .092
  • Windows 10 Home