Copyright © 2004 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark, document use and software licensing rules apply.
This Working Draft defines features of the Scalable Vector Graphics (SVG) Language that are specifically for display and printing environments.
This document defines the markup used by SVG Compositing.
This section describes the status of this document at the time of its publication. Other documents may supersede this document. The latest status of this document series is maintained at the W3C.
This document is an editors draft. It defines features of SVG specific to compositing. It is a draft in progress; some descriptions in this document may be incomplete. This document shows the current thoughts of the SVG Working Group on the use of SVG for compositing and should not yet be considered stable. There is an accompanying SVG Compositing 1.2, Part 1: Primer that lists the ways SVG Compositing may be used for displaying and compositing.
This document has been produced by the W3C SVG Working Group as part of the W3C Graphics Activity within the Interaction Domain. The Working Group expects to advance this Working Draft to Recommendation Status.
We explicitly invite comments on this specification. Please send them to public-svg-compositing@w3.org (archives). For comments on the core SVG language, use www-svg@w3.org: the public email list for issues related to vector graphics on the Web (archives). Acceptance of the archiving policy is requested automatically upon first post to either list. To subscribe to these lists send an email to public-svg-compositing-request@w3.org or www-svg-request@w3.org with the word subscribe in the subject line.
Publication as a Working Draft does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.
This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.
This draft of SVG Compositing is a snapshot of a work-in-progress.
The main purpose of this document is to encourage public feedback. The best way to give feedback is by sending an email to public-svg-compositing@w3.org. Please include some kind of keyword that identifies the area of the specification the comment is referring to in the subject line of your message (e.g Compositing blend modes). If you have comments on multiple areas of this document, then it is probably best to split those comments into multiple messages.
The public are welcome to comment on any aspect in this document, but there are a few areas in which the SVG Working Group are explicitly requesting feedback. These areas are noted in place within this document like this.
This document lists features that may be used in the context of display and printing. The various usage scenarios are listed in the SVG Compositing Requirements document.
This document is normative.
This document contains explicit conformance criteria that overlap with some RNG definitions in requirements. If there is any conflict between the two, the explicit conformance criteria are the definitive reference.
When compositing using Porter-Duff extended blending operations color and opacity values may fall outside the range zero to one.
The 'clip-to-self' property determines if the object effects pixels not covered by the object.
Value: | object | canvas | inherit |
Initial: | canvas |
Applies to: | All elements that render. The host language is responsible for stating which elements render. For SVG: container elements and graphics elements. |
Inherited: | no |
Percentages: | N/A |
Media: | visual |
Animatable: | yes |
The 'clip-to-self' property is not the only property that can affect regions not covered by the source graphic. Some compositing operations defined in the 'comp-op' property may effect pixels where the source graphic is completely transparent.
The 'enable-background' property controls how the group image canvas for group compositing is initialised and managed.
Value: | accumulate | new [ <x> <y> <width> <height> ] | inherit |
Initial: | accumulate |
Applies to: | Elements that contain elements that render. The host language is responsible for stating which elements contain elements that render. For SVG: container elements. |
Inherited: | no |
Percentages: | N/A |
Media: | visual |
Animatable: | no |
The optional <x>, <y>, <width> and <height> parameters indicate in user space, the subregion of the container element where objects are composited onto. These parameters act as a clipping rectangle on the group image canvas enabling the SVG usage agent to potentially allocate a smaller temporary image buffer than the effective bounds of the container element. If not all the <x>, <y>, <width> and <height> values are specified, or if either <width> or <height> are specified as a value less than 1, then the objects are composited as if the 'enable-background' property was set to accumulate.
For groups with an 'enable-background' value set to accumulate, the compositing operation used to place the group onto the background is modified. The operation will apply any reduction to the background caused by the objects.
Elements containing a 'comp-op' property value of clear, src, dst, dst-over, src-in, dst-in, src-out, dst-out, src-atop, dst-atop, xor can potentially reduce the opacity of the destination and are only valid where one of the element's ancestorial container element has the 'enable-background' property set to new. Elements without an ancestor with the 'enable-background' property set to new these operations are technically an error.
The 'knock-out' property determines if the color and opacity of an object replaces the color and opacity of objects it overlaps in the container.
Value: | replace | preserve | inherit |
Initial: | preserve |
Applies to: | Elements that contain elements that render. The host language is responsible for stating which elements contain elements that render. For SVG: container elements. |
Inherited: | no |
Percentages: | N/A |
Media: | visual |
Animatable: | no |
For a complex group where the 'knock-out' property is set to replace, the buffer is created. The initial contents of the buffer and whether a secondary opacity channel is created depends on the value of the 'enable-background' property.
The 'comp-op' property determines the compositing operation used when placing elements onto the canvas.
Value: | clear | src | dst | src-over | dst-over | src-in | dst-in | src-out | dst-out | src-atop | dst-atop | xor | plus | multiply | screen | overlay | darken | lighten | color-dodge | color-burn | hard-light | soft-light | difference | exclusion | inherit |
Initial: | src-over |
Applies to: | Elements that contain elements that render. The host language is responsible for stating which elements contain elements that render. For SVG: container elements. |
Inherited: | no |
Percentages: | N/A |
Media: | visual |
Animatable: | yes |
For many of the operators listed above, the destination is modified in regions of the image where the source is completely transparent. Pixels that the source does not touch are considered transparent, and as such may be modified, depending on the compositing operation.
The authors of this specification are the participants of the W3C SVG Working Group.