Closed Bug 852100 Opened 11 years ago Closed 5 years ago

SVG filters may shift and blur elements in embedded image

Categories

(Core :: SVG, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 608812

People

(Reporter: blambov, Unassigned)

References

Details

Attachments

(4 files, 1 obsolete file)

Attached file firefox-filter.html
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:19.0) Gecko/20100101 Firefox/19.0
Build ID: 20130307122903

Steps to reproduce:

The attached file contains an embedded SVG element that's not aligned on a pixel boundary. The embedded SVG contains two rectangles, one of which is under a filter that does nothing.


Actual results:

The two rectangles look different: the one under the filter is blurry, and its text is not as readable.


Expected results:

The two rectangles should look the same.
We're seeing this in many Flash ad conversions, where blur being removed or a shadow being added at the end of a transition results in a visible wobble of portions of the image.
I can confirm the problem of comment#0 .

http://hg.mozilla.org/mozilla-central/rev/b03bb3ce8cee
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:22.0) Gecko/20130318 Firefox/22.0 ID:20130318030947

And the problem existed since Firefox4...
Status: UNCONFIRMED → NEW
Ever confirmed: true
Version: 19 Branch → Trunk
Attachment #726134 - Attachment mime type: text/plain → text/html
From the SVG specification...

http://www.w3.org/TR/SVG/filters.html#feOffsetElement

When applying this filter, the destination location may be offset by a fraction of a pixel in device space. In this case a high quality viewer should make use of appropriate interpolation techniques, for example bilinear or bicubic

Which is pretty much what we do. Makes it fuzzy for you though.

You should be able to modify filterRes to get a result which works better for your use cases.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → INVALID
This is not feOffset-specific. Any filter will cause it.

I believe the reason is that the buffer created for the image source is snapped to pixel boundaries relative to the SVG origin, while that should have been done relative to the origin of the page.
Attachment #726197 - Attachment mime type: text/plain → text/html
Status: RESOLVED → UNCONFIRMED
Ever confirmed: false
Resolution: INVALID → ---
Assignee: nobody → cku
No longer depends on: 1338393
Attached patch hacking (obsolete) — Splinter Review
Assignee: cku → nobody
Status: UNCONFIRMED → RESOLVED
Closed: 11 years ago5 years ago
Resolution: --- → DUPLICATE
Attachment #8897329 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: