[This local archive copy is from the official and canonical URL, http://www.oasis-open.org/html/webcgm1.html, 1999-04-14; please refer to the canonical source document if possible.]

OASIS - Organization for the Advancement of Structured Information Standards

Members Only

OASIS Committees




CGM Open


Industrial-Strength Vector Graphics for the Web

By John C. Gebhardt, InterCAP Graphics Systems
and Lofton Henderson, Inso Corporation
Sponsor Members of CGM Open,
An Affiliate of OASIS


An OASIS / CGM Open White Paper



For years, companies, industry groups, and government organizations have used Computer Graphics Metafiles (CGMs) for storing and exchanging 2D graphics.  CGM is a format defined by the International standard ISO/IEC 8632:1992 for digitally describing vector, raster, and hybrid (raster and vector) graphic pictures very compactly.  It has proven to be a very good format for the technical illustrations in electronic documentation, geophysical data visualization, and other demanding 2-dimensional graphics presentation applications.

About the same time the CGM standard matured, the World Wide Web began to explode and graphics began to play an increasingly important role.  Until recently, graphics on the Web consisted of raster images – pictures represented as large arrays of colored pixels. The formats typically used to transmit these images are GIF, JPEG, and more recently PNG. 

However, rather than sending pixel values over the Internet, an alternate approach is to send the instructions for drawing lines, circles, ellipses, curves,  and other shapes.

The advantages of describing pictures abstractly are manyfold:

ü Vector graphics can be scaled up and down easily and quickly while retaining the quality of the picture, unlike raster images, which scale poorly and display poorly at resolutions other than that for which the image was originally created.

ü In most cases, vector graphics require less bandwidth and can be accessed and viewed faster than images.

ü Vector graphics can be edited and manipulated far easier than images.

ü It is easy to combine vector graphics with metadata (non-graphical data) for defining how pieces of a picture should react and behave in response to user interactions.

ü Metadata and text in vector graphics can be searched as easily as text in an HTML page.

Because of the inherent advantages of vector graphics, vendors and users of CGM began to experiment with using the WWW and CGM to publish 2D vector graphics on the Web. While some of these experiments have been very successful, the CGMs produced by one vendor could not be interpreted properly by viewers produced by another. 

The graphics are generally not the problem. The problem is with the metadata associated with the “graphical objects” within the metafile and the behavior associated with this metadata. For example, each vendor would invent its own metadata for defining hotspots and decided what their viewer would do when it encountered a hotspot. Authoring tools and viewers were not interchangable.

Thus WebCGM was born. WebCGM is a collaborative effort between users, vendors and the W3C to define a profile of the CGM standard, including standard metadata, behavior, addressing scheme, as well as a simple but powerful subset of graphic primitives. Its purpose is for CGM to be used more effectively in multi-vendor WWW applications without fear of interoperability problems.


CGM (Computer Graphics Metafile) has been an ISO standard for vector and composite vector/raster picture definition since 1987. It has been a registered MIME type for use on the Internet since 1995.

WebCGM was developed as a joint effort of the CGM Open Consortium, in collaboration the W3C under the W3C-LA project. The W3C has been working on integrating CGM with the Web since 1996. In June of 1997 it identified the need for a profile of CGM for use on the Web.  Shortly thereafter, a group of vendors and large users of CGM technology met and agreed to form a consortium. As a result of those early meetings CGM Open was incorporated in May 1998.  The first technical project of the infant CGM Open group was WebCGM, which became a Recommendation of the W3C on January 21, 1999. WebCGM was based on the ATA (Air Transport Association) CGM profile, "GREXCHANGE 2.4." This profile is recognized as the best defined and most widely implemented in industry, and it has the valuable attribute that there is already an associated product certification testing service. The metadata definitions and semantics were based on a consensus of vendor practice for adding metadata and behaviors to CGM graphics.



WebCGM is an "intelligent graphics" profile of the CGM standard, which means that in addition to graphical content based on CGM Versions 1-3, the profile defines the semantics of non-graphical content (metadata) based on CGM Version 4, Application Structures. The non-graphical content allows the definition of hierarchies of application objects, as well as the association of metadata, such as link specifications and layer definitions, with the objects.

CGMs that are compliant with WebCGM are binary files that follow published applicable W3C requirements for a scalable graphics format. The design criteria for the graphical content of WebCGM balances graphical expressive power on the one hand, and simplicity and ease of implementation on the other. The ATA profile was taken as the starting point for the graphical content and modified only where it did not meet the requirements articulated in the W3C requirements. The graphical content of WebCGM is a simplified, but powerful subset of the ATA profile.

A small but powerful set of metadata elements is standardized in WebCGM, to support:

ü Hyperlinking and document navigation

ü Picture structuring and layering 

ü Search and query on WebCGM picture content.


The Structure of a WebCGM

A WebCGM is a Version 1, 2, 3, or 4 CGM as defined in ISO/IEC 8632:1992, with some restrictions. The restrictions improve the interoperability of WebCGM, and simplify the production of WebCGM interpreter (viewer) tools.

A WebCGM, as shown in Figure 1, consists of one or more Pictures. Each picture contains CGM graphic elements, as well as (optionally) Application Structures. Application Structures define objects within each picture, which are comprised of groups of graphical primitives. These objects may contain attributes or properties. WebCGM defines four types of groups - "graphical object," "layer," "paragraph” and “sub-paragraph,” as well as a few properties which each group may have.


Figure 1. WebCGM File Structure



Pictures As Standalone Images

The picture is a basic building block of a WebCGM file. In the CGM standard, pictures are independent graphical presentations. In particular, as defined in the ISO standard, each picture has an implicit or explicit opaque background.

Many pictures may be stored in a single metafile. Properties that apply to all pictures are defined in the Metafile Descriptor. These include descriptive information about the metafile, the precisions of numbers, as well as identifiers for fonts and symbol libraries.

Properties, which apply to the elements in the body of a single picture, are contained in the Picture Descriptor. These include such information as picture size and scaling, specification modes for aspects such as line width, and background color.

CGM supports both raster and vector graphics in the same picture. WebCGM permits the use of popular raster compression methods - CCITT group 4, JPEG, and the deflate (LZ77 derivative) method of PNG - for raster content embedded within pictures.

Graphic elements within pictures are rendered in the order they appear in the metafile. Elements rendered first may be wholly or partially hidden by elements rendered later. In the CGM standard, the writing mode of primitives is "replacement" - content is rendered opaquely on top of previous content. To meet per-primitive (and per-pixel) transparency requirements, WebCGM includes a  registered extension for Alpha transparency, as well as  registered colour models RGB-alpha and sRGB-alpha. These are specified in the ISO Register of Graphical Items.

Pictures As Overlays

Pictures may be overlayed on previous content by specifying that the background is transparent, or translucent. This may be handled in two ways with WebCGM. First, the "TRANSPARENT" parameter of the OBJECT tag may be used. Second, the Alpha-transparency ESCAPE element may be included in the Picture Descriptor and applied to the background color of the picture.

Pictures As Symbols

WebCGM also contains provisions to use pictures in other metafiles or the same metafile as symbols, and to instance them into a picture.


Intelligence - Objects, Layers, Hyperlinks, Metadata

Within a WebCGM picture, groups of graphical primitives can be defined which structure graphics to meet the requirements of integration into Web documents. Groups in WebCGM are realized as standard Version 4 Application Structures (APS) of ISO CGM.

Four specific group types are defined and allowed in WebCGM: 'grobject', 'layer', 'para', and 'subpara'. The detailed syntax and semantics of these, including viewer behavior, are defined in the WebCGM Profile. What follows is a brief conceptual summary.

Every group has at least one explicit property, its unique identifier (a parameter of the Begin APS element). WebCGM groups may have several explicit attributes associated with them. These attributes are realized as standard Version 4 Application Structure Attribute elements (APS Attributes) of ISO CGM.

WebCGM Group Types

WebCGM defines the following group (APS) types, to support the capabilities of hyperlinking, layered pictures, and text search within graphics:

§ grobject - (graphical object) the basic grouping APS for identification of objects, principally used to identify sources and destinations of hyperlinks.

§ layer - an APS type that allows the division of pictures into a set of graphical layers, for use by viewers in selective presentation and "2-1/2 D" effects.

§ para - (paragraph) an APS type to facilitate text search within graphics, in cases such as multi-element, multi-line text, and other cases (e.g., polygonized text) where text search might otherwise be difficult (or impossible).

§ subpara - may be used to identify smaller fragments of text within APS of type 'para', enabling, for example, the marking of the larger text block (the "paragraph") for searching purposes, and the tagging of smaller fragments as hotspots.

To maximize interoperability, WebCGM does not allow private group types.

WebCGM Objects and Navigation

Groups of types 'para,' 'subpara' and 'grobject' may be used for picking and navigation operations in hyperlinked Web documents. These three APS types are called "objects" in WebCGM.

Objects may contain an explicit 'region' APS Attribute, which provides the boundary for picking operations. This is known as the overlay model of object identification (for picking and linking). It is useful in cases of badly structured legacy graphics, raster content, and in some cases to optimize picking operations.

Objects which contain graphical content have an implicit property: the boundary or bounding extent of the enclosed graphical object. This extent is used for for picking and navigation operations in hyperlinked Web documents, in the absence of a 'region' attribute. Use of this implicit boundary property for picking and navigation operations is referred to as the embedded model - a powerful model for newly authored Web documents.

Objects may also be the target of a link. Viewers are expected to move the object into view and scale them to fit into the viewer's rectangle. If the object contains a 'ViewContext' attribute the rectangle described therein will be moved and scaled to fit into the viewer's rectangle.

WebCGM Group Properties

Properties or attributes of WebCGM groups are encoded as APS Attribute elements. Each APS Attribute has a "type" parameter, which identifies the property or attribute. WebCGM defines the following allowable group APS Attribute types:

§ Region - defines a spatial region, to be (optionally) associated with an APS for picking and navigation purposes.

§ ViewContext - defines a rectangle, to be associated with an APS for establishing the initial view upon execution of a link to that APS.

§ linkURI - defines a link, whose target is specified by a URI, for hyperlinking to text content, other pictures, or objects within the same or other picture. "#" fragment syntax is defined to allow addressing pictures and objects in multi-picture metafiles, and specifying viewer behavior upon link traversal.

§ LayerName - the name (or number) to be assigned within an APS of type 'layer'.

§ LaterDiscription – descriptive text associated with a layer .

§ ScreenTip - a string to be associated with an object, to be shown in the typical Web browser "screen tip" style when cursor passes over the object.

§ Name - a "common name" attribute to be associated with a grobject that gives a useful search handle or way of defining searchable subtypes of the object type.

§ Content - an optional attribute of the 'para' and 'subpara' APS, which can give something reasonable for in the case of badly structured text within WebCGM instances.

WebCGM Edition 1.0 does not allow private attribute types.

Content Model

The formal specification of the content model of the CGM Version 4 functionality of WebCGM - the "Intelligence" content is defined below.

The CGM standard does not define a way to formally express profile and content rules.  XML has been chosen as the language for expressing metadata content in WebCGM. XML is not valid content in WebCGM metafile instances.  One advantage to the choice of XML as the formal language is that validating parsers are widely available. Even though XML syntax is not valid in WebCGM instances, such tools could be adapted to perform content validation of WebCGM instances.

<!-- To document the structure of the CGM Version 4      -->

<!-- content of WebCGM the following DTD fragment        -->

<!-- has been developed.                                 -->

<!--                                                     -->

<!-- PICBODY is included in this DTD fragment for        -->

<!-- purposes of demonstrating that the layer, grobject, -->

<!-- and para structures can exist within the picture    -->

<!-- body level in a CGM instance. The gdata element     -->

<!-- with its associated gprim entity attribute is       -->

<!-- intended to represent the model for CGM data        -->

<!-- stored as an external entity.                       -->



<!ELEMENT picbody - - (layer+ | (grobject | para | gdata)*)>


<!ELEMENT layer - - (grobject | para | gdata)+             >

<!ATTLIST layer

  id           ID         #REQUIRED

  layername    CDATA      #REQUIRED

  layerdesc    CDATA      #IMPLIED                         >


<!ELEMENT grobject - - (grobject | para | gdata)*          >

<!ATTLIST grobject

  id           ID         #REQUIRED

  region       CDATA      #IMPLIED

  viewcontext  CDATA      #IMPLIED

  linkurl      CDATA      #IMPLIED

  screentip    CDATA      #IMPLIED

  name         CDATA      #IMPLIED                         >


<!ELEMENT para - - (subpara | gdata)*                      >

<!ATTLIST para

  id           ID         #REQUIRED

  region       CDATA      #IMPLIED

  viewcontext  CDATA      #IMPLIED

  linkurl      CDATA      #IMPLIED

  screentip    CDATA      #IMPLIED

  content      CDATA      #IMPLIED                         >


<!ELEMENT subpara - - (gdata)*                             >

<!ATTLIST subpara

 id           ID         #REQUIRED

 region       CDATA      #IMPLIED

 viewcontext  CDATA      #IMPLIED

 linkurl      CDATA      #IMPLIED

 screentip    CDATA      #IMPLIED

 content      CDATA      #IMPLIED                          >

<!ELEMENT gdata - o EMPTY                                  >

<!ATTLIST gdata

 cgmprim       ENTITY     #REQUIRED                       




WebCGM supports bi-directional hyperlinking within individual WebCGM instances, between WebCGM instances and other Web media types.

In-line linking is supported, from WebCGM objects (APS of type 'grobject', 'para', and 'subpara') to WebCGM graphic files, pictures and objects, as well as to text and other media types. WebCGM fully supports linking from other media to WebCGM files, pictures, and objects.

Links from WebCGM objects are realized as 'linkURI' APS Attribute elements contained within the definitions of the objects. The address of the link (the first parameter of the 'linkURI') is any valid URL according to the rules of RFC 1738.

Objects may contain multiple 'linkURI' APS attribute instances, for which case the associated 'LinkTitle' parameter is available to help the user select the destination. The WebCGM profile prescribes a uniform viewer requirement to offer destination choice to the user for such multi-destination cases.

The target of a link, either from within a WebCGM or from another media type (e.g., HTML text), may be a WebCGM instance. This WebCGM profile defines an optional "fragment syntax" for addressing pictures and objects within a WebCGM metafile. A "#" character terminates the base URL, and following the "#" is the WebCGM syntax for picture and object addressing, and for specifying viewer behavior upon execution of the link.

The fragment syntax, in full generality, is:


The <pict-part> is identified by a keyword and has two pieces, the picture locator (either the 'PictureId' string parameter of the CGM, or the picture sequence number), and viewer behavior upon navigating to the picture. The <obj-part> similarly is identified by a keyword and has two pieces, the Id parameter of the object (APS), and viewer behavior.

The syntax is well-defined so that in many common cases, keywords and pieces can be eliminated and defaulted. So, for example, <base-URL>#<string> unambigously identifies the object (APS) whose Id parameter is "<string>" in the first picture of the metafile pointed to by "<base-URL>".


ISO CGM defines three encodings of the CGM functionality: Binary, Character, and Clear Text encodings for WebCGM files. WebCGM, like other leading industry profiles of CGM, limits the encoding to Binary for the purposes of conforming interchange. It is the Binary encoding which is registered as a MIME type for internet use.

Graphical Content

The graphical content of WebCGM is a subset of the ATA profile,  and the Model Profile (MP) of the CGM standard. It is chosen to balance the requirements of high expressive power, and simplicity to implement. The WebCGM graphical content comprises a subset of CGM Version 1, 2, and 3 elements which has been recommended by a strong consensus of the CGM Open Consortium, as meeting those criteria and representing state of the art in current CGM technology.

Graphical Primitives

The most obvious aspect of a graphics format is the collection of graphical primitives - those drawing elements which define the geometric and other presentation content of the format. CGM:1992 contains a rich selection of vector graphics primitives, plus fully integrated state-of-the-art compressed tile raster content.

WebCGM includes a large subset of these primitives, deemed to be the most useful for Web vector graphics and the most easily and reliably implemented:

The simple generic drawing primitives - polylines and disjoint polylines, polygons, polygon sets.

A number of specialized objects, for convenience and efficiency - rectangles, circles and ellipses, circular and elliptical arcs and pie slices. These come in both unfilled (line) and filled flavors.

§ Graphical Text primitives - WebCGM mandates the Restricted Text primitive of CGM (which carries its extent box with it), as well as the Append Text element (continuation of a text string, after change of attributes such as font, color, ...)

§ Closed Figure and Compound Line - these primitive allow the construction of complex paths as a concatenation of any of the other line and fill primitives. The path may either be drawn according to CGM line attributes, or filled according to any of the permissible fill attributes.

§ Polysymbol - the Polysymbol element allows the sizing and placement into WebCGM pictures of "symbols", which are defined in an external Symbol Library (which, in turn, is just another valid WebCGM metafile).

§ Smooth curves - the smooth piece-wise cubic Bezier capability of the CGM:1992 Polybezier element is included in WebCGM.

§ Raster capabilities - the simple, uncompressed (except for run-length) Cell Array element of CGM:1992 (Version 1) is included in WebCGM, as is the compressed, tiled Tile Array capability of CGM version 3. The popular Web compression formats of CCITT Group 4, PNG, and JPEG are among the supported compression types. These raster capabilities are fully integrated with the scalable vector capabilities of WebCGM.

Attributes and Controls

Attribute elements and control elements determine the details of the appearance of graphical primitives.

Line attributes of WebCGM include line dash styles, line width, line color, and the controls over appearance of line cap and line join. Dash styles can either be predefined, or can be defined precisely by the generator of the metafile.

Fill attributes control the appearance of the interior of filled primitives. One attribute controls the overall style of the filled-area interior - solid color, hatch, bitmap-style pattern, empty, and hollow. In the case of hatch interior, the style can either be one of a handful of predefined, or can be precisely defined in the metafile. The pattern can be defined as a small "raster tile" of two or more colors.

The related Edge attributes control the appearance of edges of filled areas, and are for the most part identical to Line attributes.

The appearance of graphical text can be controlled by the attributes of font and character set (see later), text size, orientation, inter-character spacing, expansion-compression of nominal character aspect rations - the important aspects needed for precise control in modern graphical text presentation. The orientation attribute actually give control not just of rotation, but skewness and aspect distortion, i.e., it is equivalent to a local transformation on text elements.

WebCGM supports clipping to rectangular regions. All graphical primitives are uniformly affected by clipping.

Three notions of transparency are supported in WebCGM, as described previously. First, a WebCGM picture can be placed with transparent background via the TRANSPARENT parameter of the OBJECT tab; second, the same can be done via an Escape element  for Polysymbols instanced into a picture; third, per-element and per-pixel translucency (on a continuum between fully opaque and fully transparent) can be defined via an alpha-transparency Escape element

The full range of standard CGM:1992 color models is limited in WebCGM Edition 1.0. The [grex24] RGB model is included, as well as the models: RGB-alpha; the colorimetric RGB space of the Web, sRGB; and sRGB-alpha. The latter three are registered in ISO for CGM reference.

2.5.4 Character Sets and Fonts

Fully international text is supported in WebCGM by:

ü Allowing Unicode UTF-8 or UTF 16 to be selected in the character set designation and selection mechanisms.

ü Requiring the use of the CGM:1992 Font Properties element, in the case of fonts outside of a required core set of 13. The Font Properties element carries a handful of parameters which are descriptive of a set of font attributes which are most commonly used to classify and call out fonts.

The default character sets are "ISOLatin1" and "Symbol. A core set of 13 fonts, (the “Adobe 13”)are required in WebCGM implementations.



“WebCGM: Industrial-Strength Vector Graphics for the Web” was written by Interleaf (www.interleaf.com). Interleaf is a sponsor member of OASIS, the Organization for the Advancement of Structured Information Standards (www.oasis-open.org).

OASIS is a nonprofit, international consortium dedicated to accelerating the adoption of product-independent formats based on public standards. These standards include XML, SGML and HTML as well as others that are related to structured information processing. Members of OASIS are providers, users and specialists of the technologies that make these standards work in practice.

 1999 CGM Open. All rights reserved.

The information in this document is subject to change without notice and does not represent a commitment on the part of CGM Open or OASIS. No part of this document may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying and recording, or for any purpose without the express written consent of CGM Open.

OASIS - Main / Library / whitepapers / WebCGM vector graphics

OASIS Webmaster


About Us



Site Map