Page background is not an SVG element

Bug #180890 reported by MenTaLguY on 2008-01-06
52
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Inkscape
Medium
Unassigned

Bug Description

Since we cannot make blend modes work correctly over transparent backgrounds within the confines of SVG, we will need a good workaround. The problems are, unfortunately, extremely user-visible.

The best idea I've been able to come up with so far is to add an opaque rectangle as a child of the root <svg> element, underneath the bottom-most layer. The rectangle should be:

- opaque
- have its fill synchronized with the document background color
- have its dimensions synchronized with the document dimensions

The rectangle would be added the first time that blend mode is engaged for a layer in the document, and ideally removed when no layers any longer have a special blending mode. Export transparency should also be disabled when blend modes are in use.

Edit: This is about the double counting background problem as described in http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Filters-Compositing.html

Note that this only applies to blend modes applied via the "blend mode" selector UI. If people want to use feBlend directly as a filter, that usage should probably not trigger the "backstop rectangle". Also note that this workaround is only useful if "blend modes" are restricted to layers.

Changed in inkscape:
importance: Undecided → Critical
milestone: none → 0.46
status: New → Confirmed
Changed in inkscape:
assignee: nobody → mental
Martin Andersen (msandersen) wrote :

Wouldn't simply changing the page colour to some solid colour (white if it isn't already set, full opacity of any other colour set) fix this, rather than a "backstop rectangle"? Obviously then you wouldn't have to resize anything.

No. The SVG rendering model for background accumulation buffers (used for filter input) starts with a transparent buffer and provides no way to paint anything into that buffer before objects are rendered into it. It never includes the page color. The only way to pre-paint opaque pixels to the buffer before objects are rendered into it is to give them an opaque sibling at the very bottom (i.e. something like a "backstop rectangle").

Besides a rect, another option might be an empty group with an feFlood filter applied with the filter effect area being the document dimensions.

Bryce Harrington (bryce) wrote :

Mental, how is the implementation status of this so far?

I don't think it's attainable for 0.46 at this point. There are really too many subtle implementation and architectural issues.

Bryce Harrington (bryce) wrote :

Sounds good; I've listed this as a known issue in the ReleaseNotes, and moved the milestone to 0.47. Mental, feel free to unassign yourself if you'd like to leave the task for someone else to do (but if so please offer mentorship in case a future developer has Q's).

Changed in inkscape:
milestone: 0.46 → 0.47
tags: added: filters-svg
ScislaC (scislac) on 2009-09-25
Changed in inkscape:
milestone: 0.47 → none
Krzysztof Kosinski (tweenk) wrote :

The fact that the page background is not an actual SVG element also has the negative effect that images with non-transparent background render incorrectly in other SVG renderers. When I set a black background I would expect the image to show up that way in other viewers.

I don't think it's critical though - there are valid workarounds, for example creating a background rect manually. Dropping to Medium.

summary: - work around deficiencies of feBlend-based blend modes
+ Page background is not an SVG element
Changed in inkscape:
importance: Critical → Medium
Niko Kiirala (kiirala) on 2011-12-10
description: updated
jazzynico (jazzynico) on 2014-02-03
Changed in inkscape:
status: Confirmed → Triaged
Tavmjong Bah (tavmjong-free) wrote :

'background' is/will be added in SVG 2.

Roul P. (perhelion1) wrote :

> "'background' is/will be added in SVG 2."

As we can see these happens only in years. -.- This is would be also not a proper solution, because no backward compatibility.
I don't understand why this high wanted feature don't get solved since over 12 years (2005-01 reported Bug #166213), it's fucking simple!!

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

Other bug subscribers