SVG Tutorial
SVG Tutorial
Contents
1. Introduction
n 1.1 Images on the Web
n 4.2 Coordinates
n 4.3 Rendering Model
6. Grouping
n 6.1 Introduction
n 7.2 Colour
n 7.4 Opacity
9. Text
n 9.1 Rendering Text
n 11.4 Maskings
12. Interaction
n 12.1 Scripting and the DOM
Appendices
A. SVG Colours
B. SVG Elements and their Attributes
n B.1 Attribute Value Types
n B.2 SVG Elements Described in this Document
C. References
-- 1 --
1. Introduction
1.1 Images on the Web
1.2 Supported Image Formats
1.3 Images are not Computer Graphics
1.4 Multimedia is not Computer Graphics
2.1 CGM
The ISO Computer Graphics Metafile (CGM) Standard [9] is a format for describing vector graphic
pictures compactly. It has proven to be a very good format for a whole range of demanding 2-
dimensional graphics presentation applications [10]. CGM first became an ISO standard in 1987 and
has been enhanced over the years by enriching the drawing primitive set and providing more
structural information. As it became richer, the concept of CGM Profiles for specific application sectors
evolved.
In 1997, an analysis was done by W3C to see if it would be possible to define a CGM Web Profile that
could satisfy the requirements for computer graphics on the Web. It passed most of the necessary
criteria. CGM was an open specification that had been widely implemented. CGM separated abstract
syntax from the concrete representation allowing multiple encodings to be defined. The vector drawing
facilities were more than what was required. The HTML <OBJECT> element could be used to add
CGM diagrams to a Web page. However, styling in CGM was provided by the bundle table approach
also used in the ISO standards, PHIGS and GKS. This was a different approach to the one adopted in
Cascading Style Sheets (CSS) on the Web to separate style and content. A major drawback was that
linkage between drawings in the manner of the Web was not provided.
3. Introduction
3.1 Scalable Vector Graphics
3.2 An XML Application
3.3 Submissions to W3C
3.4 SVG: an XML Application
3.5 Getting Started with SVG
The text element has a start and end tag written as <text> and </text> and the content of the element
is the string Abracadabra. The text element has two attributes, x and y. These are defined as part of
the start tag. Being an XML application, several rules have to be obeyed:
-- 8 --
There can only be one outer element (the root element) that encloses the complete drawing
definition.
Every start tag must have a correctly nested end tag
The form of the start and end tags must be identical. If the start tag is upper case so must be
the end tag.
Attributes must be enclosed in quotes (either single or double)
If the content of the element is null, a shorthand can be used:
The slash before the closing > in the second line indicates that the element does not have any
content. Effectively, all the content is encapsulated in the name of the element and its attributes. The
two examples of the rect element given above are equivalent.
The initial XML declaration and the Document Type Declaration for SVG 1.0 can be omitted and future
examples will do this.
-- 10 --
The object element in HTML 4.0 is similar to the img element in that it allows the user to insert an
external object (myfirstsvg.svg in this case) into a web page. It differs in that it allows you to insert
applets and other HTML pages as well as graphics and images. The user can specify a number of
alternatives. Here we have given a text message to indicate that the SVG could not be rendered but
we could have had an <img> element that defines a png image of the diagram as an alternative.
Providing some alternative is useful at the moment as not everybody has an SVG plug-in installed in
their browser. The recommended SVG plug-in at the moment is the one from Adobe which can be
installed in most of the modern browsers. It is free. You should add it to your favourite browser before
you start using SVG. Visit the Adobe site [39] and follow the instructions.
There are a number of stand-alone viewers for SVG that can also be used [40] [41] [42]. You just open
the SVG file and it will be displayed in the viewer's window. There are also support tools for
constructing SVG diagrams just as there are tools for constructing web pages. Some of these also
have the ability to view a previously defined SVG file. A complete list of the tools and viewers available
is maintained on the W3C web site [29].
-- 11 --
4.2 Coordinates
All graphics elements are rendered conceptually on to an SVG infinite canvas. A viewport can be
established that defines a finite rectangular region within the canvas. Rendering uses the painter's
model; elements later in the document are rendered on top of the preceding ones.
The viewport is specified by attributes of the svg element. Explicit width and height attributes can be
set as in the example in Section 3.5. An alternative is to use the viewBox attribute which specifies the
lower and upper bounds of the viewport in bot the X and Y directions.
The coordinate system used by the SVG diagram as a whole, when displayed as part of a web page,
is a negotiation between the SVG plug-in, what the user would like and the real estate available from
the browser.
A complete SVG document containing the drawing defined above could be:
This situation is reasonably straightforward. The svg element has a viewBox attribute that requests
that the area from (0,0) to (500,300) in user coordinates is visible in the browser window. The object
element requests an area 500 wide and 300 high to put the diagram in. As no units are specified, the
assumption is that the units requested are the browser's view of what a pixel width is. Assuming this
area is available, the diagram will appear 500 pixels wide and 300 pixels high. A unit in the diagram
will be equivalent to a pixel as specified by the browser.
The two approaches (width/height and viewport) are subtly different. In the first example using width
and height, no units have been specified so pixels are the assumed coordinate system. The viewport
required is 320 pixels wide and 220 pixels high. The local user coordinate system for the duck is also
set to be 320 by 220 with one pixel equal to one local user coordinate. In the second case, the local
user coordinate is set to 500 wide and 300 high and this is to be mapped to fit in the viewport. A small
viewport would have the mapping from user coordinate to pixels different from a large viewport. If the
aspect ratio of the viewport is different from that of the viewBox then various options are provided as
to how the user would like the mapping to take place.
In SVG, if no units are specified the assumption is that the coordinates are defined in the local
coordinate system. However, in defining the viewport size and in specifying the drawing, the complete
set of units defined in CSS are available to the user (em, ex, px, pt, pc, cm, mm, in, %).
If the drawing is to be displayed as part of a Web page, a complex negotiation takes place between
the SVG plug-in and the browser taking into account any constraints imposed by the user on inserting
the drawing in the Web page or by the styling applied to the page as a whole. As a result of this
negotiation, part of the image could be clipped, scaled or distorted, depending on how the constraints
are resolved. The user can control the effect somewhat through a preserveAspectRatio attribute and
by specifying whether all the drawing must be visible or whether some parts can be obscured.
We shall assume in our examples that the size of the SVG diagram is defined by the viewBox
attribute and that the object element achieves a mapping of this into an equivalent area on the web
page. There are other ways of defining the size of the SVG diagram and it can be specified in units
other than pixels. The negotiation can be quite complex if the area required is unavailable or the units
are real world ones (centimetres, say) and if the aspect ratio of the requested area is different from the
area used by the SVG document.
-- 13 --
This defines two rectangles, the first is yellow with a black border; the second is hollow with a red
border.
-- 15 --
The second method using styling is illustrated by:
This achieves the same visual result as the first approach. The "style" element encloses a style sheet
expressed in the CSS syntax. (The CDATA annotation is used in order to escape the style language
from the XML syntax checker.) Two styles are defined, the first for rectangles in general (filled in
yellow with a black border) and a second for rectangles belonging to the class "different" defining
rectangles with a red border and hollow interior.
The same effect could be achieved by defining an external sheet in the file mystyle.css as:
Style can also be associated directly with an element through the style attribute. The example above
could also be written:
SVG allows pictures to have arbitrary hierarchical structure. CSS provides powerful mechanisms for
controlling appearance, both on the basis of the values of attributes (usually the class attribute, but
other attributes could be used also) and the actual structure of the SVG element tree. It is also
possible to write:
which would select rectangles whose class attribute contains the value different in a set of space
separated class attribute values. The "." notation introduced earlier in fact corresponds to the "~="
construct. A more complex example is shown below.
-- 16 --
The selector '>' matches any rect element that is the first child of a g element.
-- 17 --
One of the important concepts in CSS is the notion of cascade. Three different types of style sheet
can be associated with a document: author, user and user agent. The author of a document can
supply style information, so can the user and so can the user agent (usually a browser). In general,
style sheets from these three sources may overlap in the styling they specify for a particular element
(indeed there may be overlap from within a single style sheet - there is an example of this in Figure
4.4) and so the notion of cascade is introduced to define the effect. In essence, weights are assigned
to each style rule and when several rules apply, the one with the greatest weight takes precedence.
The details are quite involved and go beyond the scope of this paper. The interested reader is referred
to the CSS2 specification [22]. One of the consequences though of this general mechanism is that
presentation attributes attached to SVG elements have lower priority than other CSS style rules
specified in author style sheets or style attributes. SVG and CSS do not have the equivalent of the
GKS Aspect Source Flags [26], so there is no general way to ensure that the analogues of individual
attribute specification (presentation attributes) will actually apply in all contexts in which SVG is used.
From a graphics perspective this might be considered unfortunate, but it is the price paid for
embedding graphics in a context where different priorities normally pertain.
SVG is now looking at the requirements of mobile devices. One of the problems that has arisen is that
for some devices it would be useful if the attributes could be tailored to the particular device. Zooming
in on an SVG diagram using a mobile phone soon results in a single line covering the whole display.
One option being considered by the Working Group is the possibility of attributes being defined
indirectly with the values pointed at being set differently on different devices. So it is possible that the
final attribute model for SVG will be quite similar to the one used in GKS.
Recall that HTML is a markup language for marking up the content of a textual document. The styling
of that document is achieved by defining the style to be applied to each of the markup elements. For
example, the <p> element produces justified text, the <h1> element is bold and in red etc. Similarly,
SVG defines the content of a diagram which may be styled in different ways. However, in graphics it is
less clear what is style and what is content. For example, a pie chart might use colours to differentiate
between individual segments. As long as it provides that differentiation, the specific colour chosen is
normally not very relevant. On the other hand, if the diagram depicts a traffic light, interchanging the
area to be drawn in green with the one in red would not be a good idea. This applies to most of the
rendering attributes in SVG. Consequently the decision was made to allow all the rendering attributes
to either be regarded as styling or as an integral part of the content of the diagram.
The use of styling is an extension of the use of styling in HTML. Styling can be achieved by adding a
style element to the SVG file:
In this example, the first rectangle will be drawn in yellow with a black boundary whereas the second
will be drawn with a red boundary and no internal fill as it belongs to the class different which has a
more precise styling than rectangles in general. The stylesheet is enclosed within a CDATA construct
to ensure that XML does not do any processing on the style rules. The same effect could be achieved
by defining an external sheet in the file mystyle.css as:
rect {stroke:black;fill:yellow}
rect.different {stroke:red; fill:none}
-- 18 --
and attaching it to the SVG document by:
The rules of precedence between linking to an external style sheet, embedding and importing style
sheets, attaching styling to an element and user defined style sheets are the same as for CSS when
used with HTML.
The alternative method of controlling the rendering of an element is to use the rendering attributes
directly:
<rect x="20" y="30" width="300" height="200" rx="10" ry="10" fill="yellow" stroke="black" />
<rect stroke="red" fill="none" x="20" y="330" width="300" height="200" rx="10" ry="10" />
Each property that can be defined as part of the style attribute associated with the element can also
be defined as a separate attribute. The local effect is the same in both cases. Rather than switch
between the two approaches, in this Primer we will define all the local and global rendering via styling.
Readers should be aware that they have the choice. A good basis for making a global choice is to use
styling when the rendering is not content and use the individual attributes when the rendering is part of
the content. Mixing the two does not give the effect that a graphics programmer might anticipate. If
you use a rendering attribute, it has lower precedence than any styling introduced by a style sheet. In
consequence, if you use rendering attributes do not use style sheets at all.
The title element is normally added straight after the svg element and it may be made available to the
user by the browser. Similarly, the desc element can be used to provide comments throughout a
document. Normally it is the first element after a g element.
-- 19 --
This produces the background for a set of diagrams defined on the (0,0) to (512,320) space as
follows:
5.2 Path
The path element defines a shape that can be open or closed. A path consists of a sequence of path
segments and in many cases this is a single path segment in which case path and path segment are
synonymous. Each path segment consists of a sequence of commands where the first defines a new
current position and the remainder define a line or curve from the current position to some new
position which becomes the current position for the next part of the curve and so on. The form of the
path element is as follows:
The d attribute defines the path. In the example above it defines a path that consists of establishing a
current position at the origin (Move to 0,0) and the path goes from there to the point (100,100) as a
straight Line. This would be the new current position if there were subsequent commands in the
sequence. The following path is a triangle:
Here the first line is horizontal from the origin to the point (100,0) and then a straight line goes to the
point (50,100). The command Z closes the path with a straight line from (50,100) back to (0,0), the
starting position for the path segment.
A path with two path segments would have the form:
SVG is designed for a wide range of applications on the Web. The drawings may be complex and
download times are important. In consequence, the conciseness of path expressions is of fundamental
importance. It is for this reason that the path expressions themselves are not defined using a more
verbose XML syntax. Every attempt is made to keep the number of characters in path expressions to
the minimum. For this reason, paths are not restricted to polylines. Quadratic and cubic Bezier splines
and elliptical arcs are also provided.
White space has been used to separate the coordinates in the first path segment. Commas can also
be used as is shown in the second path segment. For transmission efficiency, surplus separation can
be removed. Some of the condensing rules are:
-- 21 --
The coordinate follows the command letter with no intervening space
Negative coordinates have no separation from the previous coordinate
Numbers starting with a decimal point need no white space if it is unambiguous
If the next command is the same as the previous one, the command letter can be omitted
For example:
<path d="M0,0L.5.5.8.2Z">
<path d="M 150, 50 L 200, 100 L 250, 100 L 250, 50 L 300, 50 L 300, 10 L350, 60">
Paths can also be defined as curves (quadratic and cubic bezier, and elliptical arcs). Probably the
most useful is the cubic bezier. This has the initial letter C and has three coordinates as its
parameters. A curved path is defined from the current position (either established by a Move
command or a previous line or curve command) to the third point defined in the cubic bezier. The first
two points define the bezier control points that give the shape of the curve (Figure 5.2). The
positioning of the control points change the shape of the curve under the user's control as can be seen
in Figure 5.3. The coordinates used position the curves as they appear on the diagram.
SVG includes a number of semantic and syntactic measures to reduce the size of path expressions
even further:
Using relative coordinates
Using relative instead of absolute coordinates can reduce the number of characters per coordinate
significantly. Each command has a lower case equivalent which defines the coordinate values as
relative to the current position.
Smooth curves
Often adjacent curves need to be joined smoothly, that is by sharing a tangential direction at the
joint. This is achieved by defining the first control point of the second curve as the reflection of the
second control point of the first curve. By defining separate commands for smooth joining curves (T
and S for the quadratic and cubic splines) a number of coordinate pairs can be omitted.
-- 24 --
Syntactic simplifications
White space can be omitted when the result is unambiguous. For example, no space is required
between the command letter and the coordinate value; negative coordinates do not need a
separation from the previous one; if the next command is the same as the previous one, the
command letter can be omitted.
The number of points in the path defined by lines is 43 while the bezier definition uses 25. The path
could also be defined using relative coordinates in which case it would be:
Note that it does not really make any difference whether you complete the closed curve with upper or
lowercase Z as the effect is identical. Removing unnecessary spaces reduces the path definition to
160 characters compared with the 443 characters in the initial line path representation:
SVG files can also be compressed using the gzip compression algorithms. The viewer decompresses
the SVG picture on the fly. The SVG element definitions can be significantly compressed by this
approach.
5.3 Text
The second most important drawing element is text. It has a large number of styling properties that we
will discuss later. Here, we will just define the three main elements. Figure 5.5 shows the three main
types of text that can be generated:
Text defined just using the text element
Text that uses the tspan element to vary the properties and attributes being used in the text
presentation
Text where the path is defined by the textPath element
<path id="duck" d="M 0 312 C 40 360 120 280 160 306 C 160 306 165 310 170 303
C 180 200 220 220 260 261 C 260 261 280 273 290 268 C 288 280 272 285 250 285
C 195 283 210 310 230 320 C 260 340 265 385 200 391 C 150 395 30 395 0 312 Z"/>
<text style="font-size:10">
<textPath xlink:href="#duck">
We go up, then we go down, then up again around his head. Now we are upside down as we
go round his neck and along the bottom to the tail.
</textPath>
</text>
<text>
<tspan x="30" dy="30" font-size="16">This </tspan>
<tspan x="330" dy="30" fill="red">is </tspan>
<tspan x="530" dy="30" font-weight="normal">a </tspan>
<tspan x="130" dy="30" font-family="Courier" font-size="28">single </tspan>
<tspan x="330" dy="30" fill="green">text </tspan>
<tspan x="30" dy="60" font-style="italic">string </tspan>
<tspan x="430" dy="30" font-size="18">that </tspan>
<tspan x="330" dy="30" font-size="20">has </tspan>
<tspan x="230" dy="30" font-size="24">been </tspan>
<tspan x="130" dy="30" font-size="28">distributed <</tspan>
<tspan dx="30" dy="30">across </tspan>
<tspan dx="130" dy="30">the </tspan>
<tspan dx="-230" dy="30">canvas</tspan>
</text>
The use of the text element by itself has attributes x and y that define the origin for the text. The origin
is by default at the bottom left of the first character and the characters are displayed from left to right.
Attributes associated with the text can change the start position, the characteristics of the text and the
drawing direction. We will discuss these later.
If the position of parts of the text or the text's attributes need to change from that which is available
using the text element, these can be adjusted by including within the text element a tspan element.
The text within a tspan may have its origin specified either by absolute x and y attributes or relative dx
and dy attributes. The current text position is incremented by the amount specified in the case of the
relative attribute. For both dx and dy, the attribute can be a list in which case the first number defines
the increment for the first character, the second defines the increment from that character for the
second character and so on. The characters in the text string within the tspan element can each be
rotated by a defined number of degrees by using the rotate attribute. Again, a list of numbers can be
provided to define the orientation of each character in the text sequence.
-- 26 --
6. Grouping
6.1 Introduction
6.2 Coordinate Transformations
6.3 Clipping
6.4 Masking
6.1 Introduction
Frequently there is a need to group drawing elements together for one reason or another. One reason
is if a set of elements share the same attribute. However, probably the major use is to define a new
coordinate system for a set of elements by applying a transformation to each coordinate specified in a
set of elements. Grouping is also useful as the source or destination of a reference.
Grouping in SVG is achieved by the g element. A set of elements can be defined as a group by
enclosing them within a g element. For example:
<g style="fill:red;stroke:black">
<circle cx="70" cy="100" r="50" />
<rect x="150" y="50" rx="20" ry="20" width="135" height="100" />
<line x1="325" y1="150" x2="375" y2="50" />
<polyline points="50, 250 75, 350 100, 250 125, 350 150, 250 175, 350" />
<polygon points=" 250, 250 297, 284 279, 340 220, 340 202, 284" />
<ellipse cx="400" cy="300" rx="72" ry="50" />
</g>
The g element can have any of the attributes or style properties defined for it that are generally
applicable to individual drawing elements. In the example above, all the basic shapes will be rendered
with the interior red and the border black.
<g transform="translate(100,0)">
<circle cx="70" cy="100" r="50" />
<rect x="150" y="50" rx="20" ry="20" width="135" height="100" />
</g>
Instead of the circle being drawn centred on the point (70,100) it will now be drawn centred on the
point (170,100). The rectangle will have a top left corner of (250,50) instead of (150,50).
Consequently, a useful method of defining a composition made up of a number of graphical objects is
to define each object as a group using the most appropriate coordinate system and then use the
transformations applied to the group to construct the graphic as a whole. Groups can be nested to any
depth and transformations applied to each. In consequence, a diagram can be constructed out of sub-
assemblies that come together to produce objects that are then composed to produce the diagram.
-- 28 --
The possible transformations are:
Transformation Meaning Parameters
translate Defines a translation of the coordinates x and y defining the x and y translation
sx and sy defining the scaling in the X
and Y directions
scale Defines a scaling of the X and Y coordinates
s defining the same scaling in the X
and Y directions
angle, x and y defining a clock-wise
rotation of angle degrees about the
rotate Defines a rotation about a point point (x,y)
angle defining a clock-wise rotation of
angle degrees about the origin
angle degrees defining a skew of the X
skewX Defines a skew along the X axis
position by Y*tan(angle)
angle degrees defining a skew of the Y
skewY Defines a skew along the Y axis
position by X*tan(angle)
It is also possible to define a matrix that performs a composite set of transformations.
The transform attribute can consist of a sequence of individual transformations in which case they are
performed in the order right to left. The same effect can be achieved in a much more readable way by
nesting several g elements, each with a single transformation. It is recommended that the nested
approach is the one taken.
Figure 6.1 gives a montage of various transformations where the text defining the transformation is
also transformed.
6.3 Clipping
A group of elements can be clipped against a clip path which is defined by a clipPath element:
<clipPath id="myClip">
<circle cx="350" cy="100" r="50"/>
</clipPath>
<g style="stroke:none;clip-path:url(#myClip)">
<rect style="fill:red" x="0" y="0" width="500" height="20" />
<rect style="fill:white" x="0" y="20" width="500" height="20" />
<rect style="fill:blue" x="0" y="40" width="500" height="20" />
<rect style="fill:red" x="0" y="60" width="500" height="20" />
<rect style="fill:white" x="0" y="80" width="500" height="20" />
<rect style="fill:blue" x="0" y="100" width="500" height="20" />
<rect style="fill:white" x="0" y="120" width="500" height="20" />
<rect style="fill:blue" x="0" y="160" width="500" height="20" />
<rect style="fill:red" x="0" y="180" width="500" height="20" />
<rect style="fill:white" x="0" y="200" width="500" height="20" />
<rect style="fill:blue" x="0" y="220" width="500" height="20" />
<rect style="fill:red" x="0" y="240" width="500" height="20" />
<rect style="fill:white" x="0" y="260" width="500" height="20" />
<rect style="fill:blue" x="0" y="280" width="500" height="20" />
<rect style="fill:red" x="0" y="300" width="500" height="20" />
<rect style="fill:white" x="0" y="320" width="500" height="20" />
</g>
The group of rectangles are clipped against the circle basic shape. The clipPath element has an id
attribute and the g element has a style or attribute clip-path that specifies the path to be used for
clipping. It is also possible to clip against a path or even text:
<clipPath id="myClip">
<path d="M 0 112 C 40 160 120 80 160 106 C 160 106 165 110 170 103 C 180 0 220 20 260
61 C 260 61 280 73 290 68 C 288 80 272 85 250 85 C 195 83 210 110 230 120 C 260 140 265
185 200 191 C 150 195 30 195 0 112 Z"/> </clipPath>
<clipPath id="myClip">
<text x="10" y="310" style="font-size:150">DUCK</text>
</clipPath>
For referenced items, such as clip paths, it is considered good practice to surround them with a defs
element to emphasise that they are not rendered directly. The defs element acts rather like a g
element that has the visibility attribute set to hidden.
-- 30 --
Figure 6.2 shows the results of the three clipping paths defined above.
7. Filling
7.1 Fill Properties
7.2 Colour
7.3 Fill Rule
7.4 Opacity
7.5 Colour Gradients
The fill property can either define a colour to be used to paint the area or it can define a colour
gradient. We will discuss how colours are specified first and leave the specification of gradients until
later.
-- 31 --
7.2 Colour
Colour values are used for various operations in SVG including filling and stroking. Colour can be
defined in the same set of ways that it can be defined in CSS:
A colour name such as red, blue, green etc.
A numerical RGB specification defining the red, green and blue components of the colour in
one of three ways:
n rgb(r,g,b) where r, g and b are values in the range 0 to 255
n #rrggbb where rr, gg and bb define a value in the range 0 to 255 as two hexadecimal
values
The four rectangles defined below will all be filled with approximately the same colour (the short
hexadecimal form does not quite have the required accuracy).
There are over 140 colour names defined in SVG and these are given in Appendix A. Figure 7.1
shows a sample of the colours available.
7.4 Opacity
Graphics in SVG are not restricted to being invisble or opaque. It is possible for any area to be filled at
an opacity that varies between 1.0 (opaque) and 0.0 (transparent). Properties are available for
specifying the opacity of filling and stroking separately but for simple examples it is sufficient to use
the opacity to control both stroke and fill opacity together. Rules exist for combining two semi-
transparent objects that overlap each other. Figure 7.3 shows various objects of different levels of
transparency overlapping.
Here the fill property is defined by pointing at the definition MyGradient. The gradient specification has
the form:
This is the one used at the top right hand side of Figure 7.4. The element is either a linearGradient or
a radialGradient. Note the use of Camel case with each word separating the previous one by
capitalising the first character. This is used throughout SVG. The main element defines the major
parameters of the gradient and the offset element defines the way the gradient is rendered in more
detail.
In this particular example, the main attributes of the linear gradient are the id used to associate it with
its use, the point (x1,y1) that defines the start of the gradation and the point (x2,y2) that defines where
the gradation ends. Outside this range, the first and last values are retained. This allows the user to
define a middle part of the fill as being graded while the remainder has the solid colours defined at the
start and end. In the top left part of the Figure, the start, middle and end offset positions are identified
by circles.
In the example above, positions are defined between (x1,y1) and (x2,y2) where certain colours will
appear. In this example, the colour at (x1,y1) (offset=0.0, the starting position) will be blue and at
(x2,y2) (offset=1.0, the finishing position) it will be green. Half way between, the colour will be white
(offset=0.5). The number of offsets can be as many as you like as can be seen in the top right where
the duck has a large number of offsets specified.
Defining radial gradients is slightly more complex:
8. Stroking
8.1 Stroke Properties
8.2 Width and Style
8.3 Line Termination and Joining
9. Text
9.1 Rendering Text
9.2 Font Properties
9.3 Text Properties
The writing-mode property defines the direction that the text is drawn. The possible values are lr, tb,
and rl.
10. Animation
10.1 Simple Animation
10.2 How the Animation takes Place
10.3 Animation along a Path
10.4 When the Animation takes Place
Note the attributeType attribute, which differentiates whether the target is XML (this is the default) or
CSS.
-- 41 --
To animate a property, the attributeType is given the value CSS and the CSS name is defined by the
attributeName attribute. The results of this animation are shown in Figure 10.2.
There is no dur attribute: the effect of set is instantaneous. Note also that the values for from and to
are not necessarily numerical, as shown in the example.
An example for the animateTransform element is:
which will move the centre of the circle from its initial position to the point (90,70) in 3 seconds.
-- 42 --
The animateTransform element animates the transformation to be applied to a graphical object. In
the example below, the scaling, rotation and translation of the duck are animated. Note that only a
single transformation can be animated per element so to achieve this compound effect the path
element is enclosed within two grouping elements and one transformation animation is applied to
each. The result is shown in Figure 10.3.
<g>
<g>
<path d="M 20 100 c 40 48 120 -32 160 -6 c 0 0 5 4 10 -3 c 10 -103 50 -83 90 -42 c 0 0 20 12
30 7 c -2 12 -18 17 -40 17 c -55 -2 -40 25 -20 35 c 30 20 35 65 -30 71 c -50 4 -170 4 -200 -79
z">
<animateTransform attributeName="transform" attributeType="XML" type="scale" from="0.4"
to="0.3" begin="0s" dur="4s" fill="freeze" />
</path>
<animateTransform attributeName="transform" attributeType="XML" type="rotate" from="0"
to="21" begin="4s" dur="7s" fill="freeze" />
</g>
<animateTransform attributeName="transform" attributeType="XML" type="translate"
from="0,0" to="40,20" begin="11s" dur="4s" fill="freeze" />
</g>
The to and from attributes can have the colour specified in any of the usual ways.
-- 43 --
This also specifies that the rectangle width should change in 8 seconds from 120 to 200, but in this
case intermediate values that must be reached at 2 and 4 seconds (a very fast change at the
beginning, but slowing down at the end) are also specified.
To achieve a somewhat similar (but much smoother) effect one can also define a spline function for
the time change:
The spline used (defined in the [0,1] interval) is shown at the bottom left of Figure 6.3. The change of
values is relatively fast at the beginning of the 8 second animation and slows down towards the end.
Finally, the two control methods can be combined: a separate key spline could be defined for each key
time interval.
For the animation elements described so far it is possible to define an attribute calcMode that
specifies how the animation proceeds over time. One of its possible values is linear which is the
default. A more interesting value is spline. In this case, a values attribute defines a list of values and
a spline function which defines the intermediate value to be used at a specific point in time. The spline
function to be used is defined by the keySplines attribute. For example:
The first animate element animates the cy value from 90 to 10 over 10 seconds but with the
intermediate positions defined by a cubic bezier which goes from (0,0) to (1,1) with control points (1,0)
and (0,1). The four coordinates of the two control points are the four values defined by the keySplines
attribute. The X-axis defines the fraction of the duration passed while the Y-axis gives the fraction of
the distance travelled.
In Figure 10.4, the shape of the change for various values of keySplines is shown. The top left shows
that if the first control point (in grey) coincides with the start point and the second control point in green
coincides with the second control point then the result is a linear change.
-- 44 --
In the example, the (0 .75 .25 1) value defines a curve where there rapid change earlier on followed by
very little change near the end. The value (1 0 0 1) has little change early and late but very rapid
change in the middle period.
<path>
<animate attributeName="d" from="M 20 100 c 40 48 120 -32 160 -6 c 0 0 5 4 10 -3 c 10 -103
50 -83 90 -42 c 0 0 20 12 30 7 c -2 12 -18 17 -40 17 c -55 -2 -40 25 -20 35 c 30 20 35 65 -30
71 c -50 4 -170 4 -200 -79"
to="M 80 100 c 40 48 120 -2 160 -36 c 0 0 5 -11 10 -18 c 10 -73 50 -23 90 -12 c 0 0 20 -48 30
22 c -2 12 -18 47 -40 17 c 5 -2 20 -5 -20 35 c 30 20 35 95 -30 86 c -80 -116 -260 94 -200 -94"
fill="freeze" dur="1s"/>
</path>
<path d="M0 0 v -2.5 h10 v-5 l5 7.5 l-5 7.5 v-5 h -10 v-2.5" style="fill:red">
<animateMotion dur="6s" repeatCount="indefinite" path="M 100 150 c 0 -40 120 -80 120 -40 c
0 40 120 80 120 40 c 0 -60 -120 -100 -120 -40 c 0 60 -120 100 -120 40" rotate="auto" />
</path>
-- 46 --
The object consists of an arrow and the animateMotion element animates along a figure of eight path
defined by the cubic beziers and starting on the left side. The rotate attribute defines the orientation of
the arrow as it proceeds along the path. The value auto keeps the orientation of the arrow so that it
always points along the path. A value specified as a number indicates that the arrow should stay at
that constant rotation from its initial position irrespective of where it is on the curve. The value auto-
reverse positions the arrow so that it always points away from the direction of motion. Figure 10.7
shows four examples of the rotate attribute with the positions of the arrow as the animation takes
place in each case. The latest position is opaque and the earlier positions are displayed with
decreasing opacity.
The second animation object would begin when the first one ends, while the third animation begins 8
seconds after the beginning of the second. Animation objects can be bound to user interactions:
11.1 Linking
Linking in SVG is much the same as in HTML. SVG has an a element that indicates the hyperlink and
defines where the link goes. For example:
<a xlink:href="http://www.w3.org">
<rect width="200" height="40" /> <text x=100" y="30" style="text-anchor:middle">My
button</text>
</a>
This example consists of a rectangle with the word My button in the middle. Clicking on any part of
the rectangle causes the browser to link to the W3C home page. Note that the URL is defined by
xlink:href rather than href. This is because the aim is to use all the functionality of XLink when it is
finalised. At the moment this acts just the same as the href attribute in HTML. The user should be
careful to enclose both the rectangle and the text within the a element. Otherwise, clicking on the part
of the rectangle where the text is would not cause the link to take place. The text appears later than
the rectangle and so sits on top of the rectangle.
11.2 Symbols and their Use
Many drawings consist of the same object appearing a number of times in different places with
possible minor variations. An example would be symbols on a map. SVG provides a rather simple
minded symbol facility that is useful on occasions. However, by providing no parameterisation of the
symbol, the times it is useful are limited.
A symbol can contain any of the usual drawing elements. For example:
<symbol id="duck">
<path d="M 10 90
c 40 48 120 -32 160 -6
c 0 0 5 4 10 -3 c 10 -103 50 -83 90 -42
c 0 0 20 12 30 7 c -2 12 -18 17 -40 17
c -55 -2 -40 25 -20 35 c 30 20 35 65 -30 71
c -50 4 -170 4 -200 -79 z"/>
<text x="150" y="120" style="text-anchor:middle">The Duck</text>
</symbol>
The symbol consists of the path defining the duck and the text The Duck positioned in its centre. An
instance of the symbol is created by the use element as follows:
The use element is effectively replaced by a g element with any attributes associated with the use
element being transfered to the g element except that the origin specified by the attributes x and y
become a transform attribute appended to the end of any transformations defined on the g element.
This is a rather bizarre way of doing it and requires some careful thought before understanding what
the result is likely to be. Figure 11.1 shows various examples of the use element:
-- 49 --
The first use is quite straightforward. The duck and associated text are drawn in outline (top left) and
the font size is specified by the font-size property to be 40. The second use in the top right sets the
fill property to be red and changes the font to Verdana. Notice that if the text is filled so is the path. It
would have been better if the two could have been defined separately either by having separate fill
properties for text and path or being able to parameterise the symbol.
The third use illustrates the problem as no outline is drawn and it is only by making the text overflow
the duck that it can be seen at all. This small duck also illustrates the problem with the way the use is
executed. The transform to be applied is changed (by the x, y positioning attributes) to:
transform="scale(0.5) translate(0,400)"
Multiple transforms are applied right to left. In this case this results in the object being scaled but the
translate is also scaled. So the translation applied is only (0,200) which is why the red duck appears
where it does.
In the fourth use, the x and y values are set to zero resulting in no additional transformation being
generated. The scaling is done first followed by the translation in this case. A good rule is therefore if
you are going to transform the symbol, do all the transformation using the transform property.
The final example shows how the writing direction can be changed.
11.3 Images
Sometimes it is useful to include bitmap images in an SVG document. These can be PNG, GIF and
JPG images and are included in much the same way that images are included in an HTML document:
The image is positioned with the top left corner at the position specified and fitted into the width and
height given.
Note that a valid image type is SVG so that an SVG diagram can be embedded in another. The logo at
the head of this document is an embedded SVG drawing.
11.4 Masking
SVG also provides a facility called masking. The mask object effectively defines the transparency
value to be applied to the drawing at each position defined by the mask. For example:
First a pink rectangle is drawn and then the text is drawn twice. The first one fills the text in blue but
the transparency value of the text comes from the mask which is a gradient that is fully transparent on
the left and fully opaque on the right. The second draws the black outline.
Figure 11.2 shows the masked text at the top followed by a blue rectangle masked in a similar way
and finally the duck masked by a circle with transparency varying from opaque on the right to
transparent on the left.
-- 51 --
12. Interaction
12.1 Scripting and the DOM
12.2 Interaction Events
12.3 Interaction Methods
The attributes onmouseover and onmouseout on the two rect specify the names of script functions
to be invoked when the corresponding event occurs. The parameter passed to the function enables
the corresponding element to be located in the document object tree.
The function onmouseover changes the fill-opacity property of the element to the value 0.5. This
function is invoked when the mouse moves onto the region covered by the rectangle. The function
onmouseout resets the fill-opacity property of the element to the value 1.0. This function is invoked
when the mouse moves out of the region.
The functionality provided by CGM and SVG is very similar. In consequence, there is some work
underway attempting to provide a common Document Object Model [25] for interacting with
documents in both WebCGM and SVG formats. There are some minor differences that would not be
accommodated by this common DOM. Disjoint polylines, pie slices, predefined dash styles are
available with the WebCGM Profile but not available in SVG. SVG provides transformable symbols
instantiated by the use element, bundled attribute styling using the g element, pattern and gradient
fills. These facilities are available in CGM but not the WebCGM Profile.
-- 53 --
This defines a diagram consisting of a single opaque blue rectangle close to the left hand edge. When
the mouse or pointing device is clicked over it, the rectangle is repositioned further to the right and
becomes semi-transparent.
As scripting languages vary in their capabilities and browsers vary in their support of them, the user
may need some trial and error to get started. A general point is that the SVG script element behaves
in much the same way as the one in HTML. In consequence, following the style used for HTML
scripting will usually work for SVG as well.
In the example, the onclick attribute calls the script function changerect when the mouse click occurs.
The variable evt passed as parameter to the changerect function enables the object over which the
mouse was clicked to be identified. The property target of evt gives a reference to the object clicked.
The variable svgobj is set to the object that was clicked. The ECMAScript method getStyle gives a
reference to the object's style attribute, setProperty sets the value of a style property. The method
setAttribute sets an attribute value.
The event onactivate is more general than onclick and will work with devices other than mouse-like
devices. The onload event gives a general method of invoking a script when an SVG document is
loaded. For example:
13 Filter Effects
13.1 Motivation
13.2 Filter Data Flow
13.3 Filter Primitives
13.1 Motivation
One important use for graphics on the Web is to include various types of artwork on the Web pages.
These can be company logos, sophisticated advertisement images, computer arts, etc. In general,
such images are produced by complex image processing tools resulting in images rich in shades and
colours. SVG includes a number of tools, collectively called filter primitives, which can be used to
achieve similar effects. The filters are obviously executed on the client side and that usually means
that even very complex visual images can be described through relatively small files, rather than
transmitting large pixel images. Also, the combination of filter effects with the more traditional graphics
described in the earlier sections opens up rich possibilities for artwork creation.
As noted earlier, an SVG agent produces an image, conceptually, into a canvas. If no filter processing
occurs, this image is then transmitted to the screen directly, using the painters' model. Filtering in SVG
can occur between these two steps: the user can define filters which will operate on the output of the
image generation on the canvas and it is the output of this filter which will, eventually, appear on the
screen itself.
<defs>
<g transform="translate(10,-190)" id="theDuck" stroke="none" fill="sandybrown">
<path d="M 0 312 ... z"/>
</g>
<filter id="MyFilter">
<feGaussianBlur in="SourceAlpha" stdDeviation="4" result="blur"/>
<feOffset in="blur" dx="4" dy="4" result="offsetBlur"/>
<feSpecularLighting in="blur" surfaceScale="5" specularConstant="1"
specularExponent="10" lightColor="green" result="specOut">
<fePointLight x="-5000" y="-10000" z="20000"/>
</feSpecularLighting>
<feComposite in="specOut" in2="SourceAlpha" operator="in" result="specOut" />
<feComposite in="SourceGraphic" in2="specOut" operator="arithmetic"
k1="0" k2="1" k3="1" k4="0" result="litPaint"/>
<feMerge>
<feMergeNode in="offsetBlur"/>
<feMergeNode in="litPaint"/>
</feMerge>
</filter>
</defs>
<use xlink:href="#theDuck" filter="#MyFilter"/>
-- 58 --
Given the complex visual effects of the result, the size of the SVG source is not particularly large
compared to the original image of the duck.
The specification of each filter is quite complicated and relies on an intimate knowledge of various
image processing techniques. However, it can be expected that authoring tools that can export SVG
will hide the details from the casual user. Appendix A lists the filter primitives available in SVG with a
short description of their functionalities.
-- 59 --
14.1 Implementations
Current information concerning the state of browser plug-ins, stand-alone viewers, editors and
converters is kept at the W3C SVG Working Group Home Page [29].
In October 2001, Adobe released the 3.0 version of their plug-in that works with most browsers
(Opera, IE and Netscape at least) on Mac and PC platforms. Mozilla has a project for native support of
SVG but the timescales keep slipping. Stand-alone viewers are available from IBM, Apache (Batik)
and CSIRO . Toolkits are available from Apache and CSIRO. Editors are available from JASC
(WebDraw), Mayura (Mayura Draw) and support for SVG is included in Adobe Illustrator and Corel
Draw. This is not a definitive list but just gives an indication of the level of support. Many existing
graphics design packages have added an SVG export or import function.
To help implementers debug their applications, W3C maintains an SVG Test Suite [30] of over 100
basic functionality tests for SVG. Each test comes with a PNG image that shows what the test should
produce in terms of output.
14.2 Metadata
Searching for content is a major function on the Web. SVG attempts to make the textual content of a
picture easy to find by allowing international text to appear as a sequence of text characters
irrespective of writing direction. A search engine that is aware of the tspan element can search for
multi-line text and text that may be scattered around the diagram.
SVG also provides a metadata element whose contents should be elements from other XML
namespaces. In particular, the metadata could be expressed in RDF [31]. An ontology such as the
Dublin Core [32] could be used to express information concerning the creator, the date it was
produced etc. For CAD applications, the metadata might point into the application database to define
the parts and materials to which the diagram refers.
SVG provides the mechanisms to allow rich metadata to be added to SVG diagrams. It will be
interesting to see how this is used in practice.
A. SVG Colours
Colour Name RGB Value Colour Name RGB Value
aliceblue (240, 248, 255) darkslategrey ( 47, 79, 79)
antiquewhite (250, 235, 215) darkturquoise ( 0, 206, 209)
aqua ( 0, 255, 255) darkviolet (148, 0, 211)
aquamarine (127, 255, 212) deeppink (255, 20, 147)
azure (240, 255, 255) deepskyblue ( 0, 191, 255)
beige (245, 245, 220) dimgray (105, 105, 105)
bisque (255, 228, 196) dimgrey (105, 105, 105)
black ( 0, 0, 0) dodgerblue ( 30, 144, 255)
blanchedalmond (255, 235, 205) firebrick (178, 34, 34)
blue ( 0, 0, 255) floralwhite (255, 250, 240)
blueviolet (138, 43, 226) forestgreen ( 34, 139, 34)
brown (165, 42, 42) fuchsia (255, 0, 255)
burlywood (222, 184, 135) gainsboro (220, 220, 220)
cadetblue ( 95, 158, 160) ghostwhite (248, 248, 255)
chartreuse (127, 255, 0) gold (255, 215, 0)
chocolate (210, 105, 30) goldenrod (218, 165, 32)
coral (255, 127, 80) gray (128, 128, 128)
cornflowerblue (100, 149, 237) grey (128, 128, 128)
cornsilk (255, 248, 220) green ( 0, 128, 0)
crimson (220, 20, 60) greenyellow (173, 255, 47)
cyan ( 0, 255, 255) honeydew (240, 255, 240)
darkblue ( 0, 0, 139) hotpink (255, 105, 180)
darkcyan ( 0, 139, 139) indianred (205, 92, 92)
darkgoldenrod (184, 134, 11) indigo ( 75, 0, 130)
darkgray (169, 169, 169) ivory (255, 255, 240)
darkgreen ( 0, 100, 0) khaki (240, 230, 140)
darkgrey (169, 169, 169) lavender (230, 230, 250)
darkkhaki (189, 183, 107) lavenderblush (255, 240, 245)
darkmagenta (139, 0, 139) lawngreen (124, 252, 0)
darkolivegreen ( 85, 107, 47) lemonchiffon (255, 250, 205)
darkorange (255, 140, 0) lightblue (173, 216, 230)
darkorchid (153, 50, 204) lightcoral (240, 128, 128)
darkred (139, 0, 0) lightcyan (224, 255, 255)
darksalmon (233, 150, 122) lightgoldenrodyellow (250, 250, 210)
darkseagreen (143, 188, 143) lightgray (211, 211, 211)
darkslateblue ( 72, 61, 139) lightgreen (144, 238, 144)
darkslategray ( 47, 79, 79) lightgrey (211, 211, 211)
-- ii --
Colour Name RGB Value Colour Name RGB Value
lightpink (255, 182, 193) paleturquoise (175, 238, 238)
lightsalmon (255, 160, 122) palevioletred (219, 112, 147)
lightseagreen ( 32, 178, 170) papayawhip (255, 239, 213)
lightskyblue (135, 206, 250) peachpuff (255, 218, 185)
lightslategray (119, 136, 153) peru (205, 133, 63)
lightslategrey (119, 136, 153) pink (255, 192, 203)
lightsteelblue (176, 196, 222) plum (221, 160, 221)
lightyellow (255, 255, 224) powderblue (176, 224, 230)
lime ( 0, 255, 0) purple (128, 0, 128)
limegreen ( 50, 205, 50) red (255, 0, 0)
linen (250, 240, 230) rosybrown (188, 143, 143)
magenta (255, 0, 255) royalblue ( 65, 105, 225)
maroon (128, 0, 0) saddlebrown (139, 69, 19)
mediumaquamarine (102, 205, 170) salmon (250, 128, 114)
mediumblue ( 0, 0, 205) sandybrown (244, 164, 96)
mediumorchid (186, 85, 211) seagreen ( 46, 139, 87)
mediumpurple (147, 112, 219) seashell (255, 245, 238)
mediumseagreen ( 60, 179, 113) sienna (160, 82, 45)
mediumslateblue (123, 104, 238) silver (192, 192, 192)
mediumspringgreen ( 0, 250, 154) skyblue (135, 206, 235)
mediumturquoise ( 72, 209, 204) slateblue (106, 90, 205)
mediumvioletred (199, 21, 133) slategray (112, 128, 144)
midnightblue ( 25, 25, 112) slategrey (112, 128, 144)
mintcream (245, 255, 250) snow (255, 250, 250)
mistyrose (255, 228, 225) springgreen ( 0, 255, 127)
moccasin (255, 228, 181) steelblue ( 70, 130, 180)
navajowhite (255, 222, 173) tan (210, 180, 140)
navy ( 0, 0, 128) teal ( 0, 128, 128)
oldlace (253, 245, 230) thistle (216, 191, 216)
olive (128, 128, 0) tomato (255, 99, 71)
olivedrab (107, 142, 35) turquoise ( 64, 224, 208)
orange (255, 165, 0) violet (238, 130, 238)
orangered (255, 69, 0) wheat (245, 222, 179)
orchid (218, 112, 214) white (255, 255, 255)
palegoldenrod (238, 232, 170) whitesmoke (245, 245, 245)
palegreen (152, 251, 152) yellow (255, 255, 0)
yellowgreen (154, 205, 50)
-- iii --
C. References
[1] 'How the Web was Born'. James Gillies , Robert Cailliau. Oxford University Press, 2000.
[2] 'Weaving the Web'. Tim Berners-lee with Mark Fischetti. HarperCollins, 1999.
[3] 'Spinning the Web'. Andrew Ford. Thomson, 1995.
[4] 'http://www.w3.org/TR/REC-png: PNG (Portable Network Graphics) Specification'. World Wide
Web Consortium, 1996.
[5] 'PNG, The Definitive Guide'. Greg Roelofs. O'Reilly, 1999.
[6] 'http://www.w3.org/TR/REC-xml : Extensible Markup Language (XML) 1.0 (Second Edition) '.
World Wide Web Consortium, 2000.
[7] 'http://www.w3.org/TR/MathML2: Mathematical Markup Language (MathML) Version 2.0'. World
Wide Web Consortium, 2001.
[8] 'http://www.w3.org/TR/smil20: Synchronized Multimedia Integration Language (SMIL 2.0)
Specification'. World Wide Web Consortium, 2001.
[9] 'ISO/IEC 8632:1999: Information technology -- Computer graphics -- Metafile for the storage and
transfer of picture description information
[10] 'The CGM Handbook'. Lofton Henderson, Anne Mumford. Academic Press, 1992.
[11] 'http://www.cgmopen.org'. CGM Open.
[12] 'http://www.w3.org/TR/REC-WebCGM: WebCGM Profile' World Wide Web Consortium, 1999.
[13] 'http://www.w3.org/TR/xlink/: XML Linking Language (XLink) Version 1.0'. World Wide Web
Consortium, 2000.
[14] 'http://www.micrografx.com/resources/activeCGM.asp'. Micrografx ActiveCGM plug-in.
[15] 'http://www.sysdev.com/plugins/default.htm'. SDI CGM plug-in.
[16] 'http://www.tech-illustrator.com/'. Tech Illustrator WebCGM Hotspot Plug-in.
[17] 'http://www.w3.org/Submission/1998/05/: Web Schematics'. Submission to W3C, March 1998.
[18] 'http://www.w3.org/Submission/1998/06/: Precision Graphics Markup Language (PGML)'.
Submission to W3C, April 1998.
[19] 'http://www.w3.org/Submission/1998/08/: Vector Markup Language (VML) '. Submission to
W3C, May 1998.
[20] 'http://www.w3.org/Submission/1998/20/: DrawML'. Submission to W3C, December 1998
[21] 'http://www.w3.org/TR/SVG/ : Scalable Vector Graphics (SVG) 1.0 Specification'. World Wide
Web Consortium, 2000.
[22] 'http://www.w3.org/TR/REC-CSS2: Cascading Style Sheets, level 2 (CSS2) Specification'.
World Wide Web Consortium, 1998.
[23] 'http://www.w3.org/TR/REC-xml-names : Namespaces in XML'. World Wide Web Consortium,
1999.
[24] 'http://www.w3.org/TR/xslt: XSL Transformations (XSLT) Version 1.0' World Wide Web
Consortium, 1999.
[25] 'http://www.w3.org/TR/DOM-Level-2-Core : Document Object Model (DOM) Level 2 Core
Specification'. World Wide Web Consortium, 2000.
[26] 'ISO Standards for Computer Graphics - The First Generation'. D.B. Arnold, D.A. Duce.
Butterworths, 1990
[27] 'GKS-94: An Overview'. K.W. Brodlie, L.B. Damnjanovic, D.A. Duce, F.R.A. Hopgood. IEEE
Computer Graphics and Applications, pp. 64-71, 1995.
[28] 'http://www.khoral.com/'. Khoros.
[29] 'http://www.w3.org/Graphics/SVG/'. W3C SVG Overview.
[30] 'http://www.w3.org/Graphics/SVG/Test/'. SVG Test Suite.
-- xv --
[31] 'http://www.w3.org/TR/REC-rdf-syntax/: Resource Description Framework (RDF) Model and
Syntax Specification', 1999.
[32] 'http://dublincore.org/'. Dublin Core.
[33] 'http://www.cs.washington.edu/homes/gjb/CSVG/'. CSVG Home Page
[34] 'A Constraint Extension to Scalable Vector Graphics'. G. J. Badros, J.J Tirtowidjojo, K.Marriott,
B Meyer, W. Portnoy, A. Borning. Tenth International World Wide Web Conference, Hong Kong,
may 2001, pp 489-498.
[35] 'Compositing Digital Images'. T. Porter and T. Duff. Computer Graphics, 1984. 18(3): p. 253-
259.
[36] 'Texturing and Modeling, A Procedural Approach'. David Ebert, et al (Chapter by Ken Perlin).
AP Professional, Cambridge, 1994.
[37] 'http://www.w3.org/Graphics/SVG/'. Overview of SVG Activity.
[38] 'http://www.w3.org/Graphics/SVG/Group/'. SVG Working Group Home Page.
[39] 'http://www.adobe.com/svg/'. Adobe SVG Plug-in plus tutorial information and demonstrations.
[40] 'http://sis.cmis.csiro.au/svg/'. CSIRO SVG Tool Kit. Can display SVGs and convert SVGs to
JPEG.
[41] 'http://www.alphaworks.ibm.com/tech/svgview'. IBM SVG Viewer.
[42] 'http://xml.apache.org/batik/'. Apache's Batik which derives from Jackaroo.
[43] 'http://www.jasc.com/webdraw.asp'. Jasc WebDraw SVG Editor.
[44] 'http://www.mayura.com/'. Mayura Draw Editor.
[45] 'http://www.levien.com/svg/'. Gill: Gnome Illustration Application.
[46] 'http://www.digapp.com/newpages/svg2pdf.html'. Converts SVGs to PDF.
[47] 'http://www.padc.mmpc.is.tsukuba.ac.jp/member/morik/fdssvg/'. Converts bitmap images to
SVG.
[48] 'http://broadway.cs.nott.ac.uk/projects/SVG/svgpl/'. .
[49] ''. SVG-PL, a Perl library for creating legal SVG documents.
[50] 'http://www.w3.org/Graphics/SVG/Test/'. SVG Conformance Test Suite.
[51] 'http://www.savagesoftware.com/products/svgtoolkit.html'. Savage Software SVG Toolkit.
[52] 'http://www.square1.nl/index.htm'. Graphics Connection Conversion Tools.
[53] 'http://www.celinea.com/'. CR2V, Raster to Vector Converter.
[54] 'http://www.graphicservlets.com/wmf2svg.htm'. WMF to SVG Converter.
[55] ''. .
[56] ''. .
[57] ''. .
[58] ''. .
[59] ''. .
[60] ''. .
[61] ''. .