by John December
First introduced as a public draft in 1999 and as a recommendation (SVG 1.0) in 2001 by the World Wide Web Consortium1, 2, the Scalable Vector Graphics (SVG) serve an important role for presenting graphics on the Web as well as in offline and mobile devices.
The overall purpose of SVG is to be a language for the representation of shapes. Specifically, SVG is a language, defined by XML, used to create vector graphics for display on computer systems.
SVG graphics can include geometric forms--such as lines, points, polygons, curves, circles--as well as text and embedded digital images. These graphics can be displayed, transformed, shaded, textured, animated, and made interactive. SVG is an open standard, which means that its specification is publicly available (at W3C) and many SVG freeware and commercial software tools are available from a wide variety of developers and vendors. SVG graphics are vector graphics defining shapes such as points, lines, curves, and polygons. This is in contrast to raster graphics, such as those used in a digital photograph, which are based on a large set of individual pixels. SVG graphics are represented in data files that are plain text which is readable by humans and easily edited using a simple text editor.
SVG graphics can be used to create maps, cartoons, diagrams of all kinds, games, and learning tools. Anything that involves static or animated shapes can be done with SVG.
You can create a data file that contains SVG elements describing graphics such as lines, polygons, text, or images. For example, create a file called hello.svg that contains this text:
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "https://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"> <svg xmlns="https://www.w3.org/2000/svg" xmlns:xlink="https://www.w3.org/1999/xlink" width='300px' height='300px'> <title>Small SVG example</title> <circle cx='120' cy='150' r='60' style='fill: gold;'> <animate attributeName='r' from='2' to='80' begin='0' dur='3' repeatCount='indefinite' /></circle> <polyline points='120 30, 25 150, 290 150' stroke-width='4' stroke='brown' style='fill: none;' /> <polygon points='210 100, 210 200, 270 150' style='fill: lawngreen;' /> <text x='60' y='250' fill='blue'>Hello, World!</text> </svg>
If you have a SVG-enabled browser or if you install a SVG viewer like this one from Adobe, you can open the file you created or view this SVG demo embedded in an HTML file like this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "https://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv = "Content-Type" content = "text/html; charset=iso-8859-1"> <title> Simple SVG Demo </title> </head> <body> <object type="image/svg+xml" data="hello.svg" width="300" height="300"></object> </body> </html>
When you have the SVG graphics displayed in your browser, push down the right mouse button and select "View Source" to see the underlying SVG code.
If you don't have an SVG-enabled browser or did not install a SVG viewer, you won't see the SVG graphics.
SVG has great potential as a standard language for vector graphics. Unlike Flash technology which does many of the same things as SVG, SVG's status as an open W3C standard means that it will enjoy widespread support as an integral part of Web graphics. Many different developers will support SVG since it won't be under the control of a single company. It is expected that SVG viewing capability will be built into new Web browsers and that SVG use will continue to expand for many mobile devices such as telephones and handheld computers.