Blur is applied after transform, not before

Bug #168157 reported by Daniel Pope
2
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Critical
Buliabyak-users

Bug Description

Blurring a shape and then transforming it non uniformly - either by scaling
in one direction only or shearing it applies the filter attribute _before_
the transform attribute.

While this is a perfectly valid way to look at it (and I assume this is to
spec as far as SVG is concerned), I would guess that beginner users may be
confused as I think that it is more intuitive to consider blur as applying
orthogonally unless they explicitly group an object and then transform it.
Stroke, for example, is ALWAYS orthogonal regardless of transformations.

Either way, this poses a problem: after blur is applied there are two
different transformations that can be applied - to the underlying shape and
to the result of the blur filter on that shape.

Inkscape only allows the latter - the former is not possible.

Incidentally, non-uniform scaling of blurred shapes causes Inkscape to
compute the bounding box for the blur filter wrongly - this is another bug
but not one I can be bothered to post separately.

Possible solutions:

- Alter the transform operation on blurred objects to apply the the
underlying object (unless the blur object is later grouped).

- Add another button alongside the current four, (scale stroke, rounded
corners, transform gradients and patterns). This would provide a toggle as
to whether blur is transformed at all.

- Alter the semantics of filters, allowing child objects of filters to be
selected rather than just the result. Even better would be to unify all
non-commutative filters, including clip, mask, and blur plus any future
filters (note that opacity is probably not commutative with all of the
filters SVG specifies and would also have to be included when those were
implemented) within one "Filter Properties" window, which would, like the
Layers window, allow filters to be moved up or down in the stack, deleted
and added, and let transformations be modified at every level of the stack.

Revision history for this message
Buliabyak-users (buliabyak-users) wrote :

Originator: NO

I'm aware of this bug, and it's actually pretty bad because per my reading
of SVG spec, you transform AFTER the filter, not before (and Batik applies
it after the filter too). We are not compliant with this and it really
can't be fixed without a very serious rearchitecturing of Inkscape's
internals.

Revision history for this message
Daniel Pope (djpope) wrote :

Originator: YES

Ah, that's not good. So images that are created with this version of
Inkscape which rely on the non-compliant behaviour will break in future
versions with compliant behaviour, not to mention other apps? This sounds
like it should block 0.45.
File Added: non_uniform_blur.svg

Revision history for this message
Buliabyak-users (buliabyak-users) wrote :

Originator: NO

In principle, yes. However, the discrepancy in rendering will only happen
for objects that are scaled non-uniformly and then rotated, which is a
rather specific set of conditions. Simple non-uniform scaling does scale
the x/y radius of the filter and therefore gives the same result as
transforming after blur. On the other hand the blur is way too useful to
remove it because of this issue. My opinion is that the potential
discrepancy should be prominently described in the release notes but not
block the release. Anyway, I will now post a message to inkscape-devel
(which I recommend you to join if you haven't already) to seek others'
opinions.

Revision history for this message
Bryce Harrington (bryce) wrote :

Originator: NO

Thanks for the very detailed bug report!

I am marking this a critical bug, however as Bulia has said, the 0.45
release shouldn't be blocked by this bug.

I'm assigning to bulia since he's taken a lead in the discussions, but
please re-assign if appropriate.

Revision history for this message
Buliabyak-users (buliabyak-users) wrote :

Originator: NO

Fixed by Niko Kiirala - thanks!

Revision history for this message
Dennisverbeek (dennisverbeek) wrote :

Originator: NO

This bug is not fixed.

This solution:

- Add another button alongside the current four, (scale stroke, rounded
corners, transform gradients and patterns). This would provide a toggle
as
to whether blur is transformed at all.

should have been implemented to really solve this bug.

New bugreport submitted.

[ 1777141 ] Blur coupled with object size.
https://sourceforge.net/tracker/index.php?func=detail&aid=1777141&group_id=93438&atid=604306

Revision history for this message
su_v (suv-lp) wrote :

Removing bug watch for sf1777141 -> follow-up report in the Launchpad bug tracker is:

Bug #172097 “Blur coupled with object size.”
<https://bugs.launchpad.net/inkscape/+bug/172097>

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

Other bug subscribers

Bug attachments

Remote bug watches

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