WEB TECHNOLOGIES
ERCIM News No.41 - April 2000 [contents]

Vector Graphics

by David Duce


This article describes two recent developments in 2D web graphics, WebCGM and Scalable Vector Graphics. Work in progress at CLRC and Oxford Brookes University exploring the translation of higher level languages into Scalable Vector Graphics is also described.

Ever since the introduction of images via GIFs in the Mosaic browser, the only way of including simple vector graphics (flow diagrams, floor plans, simple layouts etc) in a web document has been to compose the vector graphics using some other system and translate the result into a pixel-based image. This leads to an inefficient representation, inability to search for the content in the diagram (particularly the text), and an inability to make changes. Furthermore, the resulting image is completely inaccessible to people with disabilities or users working in environments where visual representations are inappropriate, unless alternative descriptions are included. Two recent developments are changing this picture: WebCGM and Scalable Vector Graphics. Both address 2D graphics. Some of the requirements for the inclusion of 3D graphics in web pages have been addressed by the VRML (Virtual Reality Modelling Language) standard; 3D graphics is outside the scope of this article, other than to note that VRML is being further developed within the Web3D consortium, see http://www.web3d.org/ for details.

Vector graphics offers a number of advantages over image-based graphics: vector graphics are fully scalable without loss of resolution, file sizes are independent of resolution (leaving aside considerations of level of detail), a rich set of primitives is typically provided, text is represented as text strings, hotspots can be defined by drawing elements. There are both proprietary and open systems around, for example the proprietary systems PDF (Adobe), WMF (Microsoft) and DXF (Autocad). Open systems include the ISO/IEC standard CGM (Computer Graphics Metafile) and the recommendation under development in the World Wide Web Consortium SVG (Scalable Vector Graphics). CGM and SVG are briefly described below.

WebCGM

CGM, the Computer Graphics Metafile, is an ISO/IEC standard for the storage and transfer of picture description information. The first edition of CGM appeared in 1987 and a number of extensions have been standardized since then. CGM is widely used to describe technical illustrations and has a strong following in fields of engineering including the aeronautical and automobile industry and the defence industry. CGM provides a rich set of primitives and attributes for describing pictures. Abstract and concrete syntax are separated in a nice way, the functionality of the drawing elements are defined in Part 1 of the standard and three concrete representations (binary, clear text and character encodings) are defined in Parts 2 to 4. Another important concept in CGM is the idea of a profile. Profiles enable the standard to be tailored to the needs of specific application areas in well-controlled ways, for example by restricting the range of primitives and attribute values that need to be supported in order to meet the specific needs of a particular area.

WebCGM is a profile of CGM designed to meet the needs for scalable 2D vector graphics in electronic documents on the World Wide Web. CGM was developed by the CGM Open Consortium in collaboration with W3C staff and with the support of the W3C-LA leveraging action funded by the EU. Staff at a number of ERCIM institutes have been engaged in this activity. The publication of WebCGM as a W3C Recommendation represents a significant interoperability agreement between major players in this field. As well as providing a rich set of primitives, WebCGM also includes elements to group graphical objects for linking, layering and searching.

There are two points to note about WebCGM are that there isn’t an XML representation of WebCGM and also it does not use the web style sheet mechanisms. For some applications, these are significant limitations.

Scalable Vector Graphics (SVG)

SVG is a Recommendation under development in the World Wide Web Consortium. The SVG activity started around 1998 with the submission of a proposal called Web Schematics by Bob Hopgood and David Duce at RAL and Vincent Quint at INRIA. Shortly afterwards a consortium led by Adobe submitted a proposal called PGML and a few weeks later a consortium led by Microsoft submitted a proposal entitled VML (Vector Markup Language). W3C responded by establishing a working group on scalable vector graphics and after an initial requirements phase, the first working draft of SVG appeared in February 1999.

Since that time SVG has matured considerably and prototype implementations have started to appear. Unlike WebCGM, SVG is represented in XML and fully utilizes the style sheet and DOM mechanisms provided by other W3C Recommendations. In terms of application areas, it is fair to say that WebCGM is slanted more towards the CAD and engineering areas, whereas SVG is slanted more towards business graphics and graphics arts. SVG is based on the painter’s drawing model. Shapes defined by paths may be filled and stroked in a variety of styles. Fill styles include rich gradient and radial fills and filter effects such a Gaussian blur, specular and diffuse lighting may be applied to shapes or groups of shapes. Animation facilities are also under development in conjunction with other W3C Working Groups.

Web Schematics

This is work in progress at RAL and now Oxford Brookes University to explore how higher level (in a sense modeling) languages, can be translated into SVG. So far an XML language based on the Unix pic language for picture description has been designed and its translation into SVG using the DOM and a scripting language has been demonstrated. The language provides a more declarative way to describe diagrams than SVG. 

Links:
WebCGM: http://www.w3.org/Graphics/WebCGM/
SVG: http://www.w3.org/Graphics/SVG/
SVG plug-in viewer: http://www.adobe.com/SVG 

Please contact:
David Duce - Oxford Brookes University and CLRC
Tel: +44 1865 48 4379
E-mail: daduce@brookes.ac.uk