Benefits of Converting CGM to SVG for use in technical graphics

Stefan Gordon

DocSoft Inc.
Oklahoma City


Stefan Gordon heads the development of XML (Extensible Markup Language) based graphics software at Oklahoma based, DocSoft Inc.


The benefits of using SVG (Scalable Vector Graphics) and XML to replace CGM for technical graphics use are investigated with a strong focus on the process and practicality of converting existing CGM data into SVG . The presentation will be primarly based on an example workflow showing SVG for technical graphics as well as the conversion process.

Table of Contents

Benefits of XML based data
History of CGM in technical graphics industry
Practicality of replacing a CGM workflow with SVG
Reality of converting existing CGM files into SVG
Example GIS SVG workflow

Benefits of XML based data

XML is an open and clear-text storage format which provides for simplicity in creation and transformation of data. The ease with which XML is integrated into software applications and large scale work-flows is unmatched with any other storage format and therefore yields unprecedented savings in required manpower and financial overhead.

The most powerful benefits of XML are realized when data is stored in a database which natively supports XML . From this single source all forms of data and historical archives can be maintained, accessed and published on the fly with little or no user interaction necessary.

SVG furthers these benefits by providing a method of storing all graphics in a native XML format which can reside and interact with all other XML data.

History of CGM in technical graphics industry

CGM is a format defined by the International standard ISO/IEC 8632:1999 ( for digitally describing vector, raster, and hybrid (raster and vector) graphic pictures very compactly. It is an effective format for technical illustrations in technical documentation and other two dimensional graphics.

WebCGM is a 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.

Practicality of replacing a CGM workflow with SVG

As corporate entities strive to reduce overhead and streamline data publishing and interaction it becomes apparent that there is room for a more advanced and developer-friendly data format. The use of SVG combined with other XML based data allows for decreased cost of deployment by reducing the need for proprietary software necessary to interact with information and utilizing open standards that are in constant development.

Visually, SVG will provide the same result as CGM but with innumerable advantages at the backend. Using existing technologies it is possible to generate graphics on the fly as data is updated, while simultaneously maintaining and providing easy access to all historical versions. Graphics and technical documentation will become more portable and easily moved to devices such as PDA’s as well as being easily integrated into web pages and print documents.

The shift from CGM to SVG becomes more practical when you consider the availability of tools to convert from CGM to SVG with no loss of data. The following example demonstrates an SVG workflow as well as conversion from prior CGM based data.

Reality of converting existing CGM files into SVG

On a very abstract level, CGM and SVG are quite similar, both being vector based formats and both capable of displaying raster images when necessary in a variety of compression formats. On the surface both formats are able to give a visually similar experience, but as comparison becomes more low-level large differences begin to appear.

The most apparent difference between CGM and SVG is the storage format. CGM is stored in a binary format which is encoded/decoded by viewers and editors. SVG is stored in an open XML format which requires no decoding but requires somewhat more disk space unless compressed into SVGZ. While the binary format was sensible when CGM was first introduced, it is no longer as important due to the decreased cost of computing power and storage capacity.

When converting CGM into SVG the CGM file must first be passed through a binary decoder which can interpet all the CGM elements for conversion. This process is very concrete in nature but can be complex due to the varying data types available in the CGM binary encoding specification.

After all element data has been extracted a somewhat more abstract proccess begins, the task of choosing which SVG elements will be mapped to appropriate CGM elements. In some cases, such as a line, this is straightforward, but with more complex shapes the translation can become cumbersome.

Because of the difficulty in replicating CGM elements in SVG many conversion tools will convert the entire CGM document into bezier curves creating an SVG document with one massive path of curves. Although this may maintain the same look as the cgm when viewed it completely sacrifices the integrity of the data. With this sort of conversion much of the CGM data is lost and a reverse conversion or extraction of any usable data becomes impossible. Here the benefit of Quick.SVG 2005 conversion tool becomes apparent.

Quick.SVG 2005 is the first utility available for converting CGM's into SVG while almost entirely maintaining the integrity of the data. Through the appropriate mathmatical conversions Quick.SVG is able to replicate nearly all CGM data using nearest matching SVG elements. Data is preserved in a way that the SVG could be converted back to an almost identical CGM. More importantly with all elements preserved the SVG could be used for searching, analysis, and processing of data in addition to standard viewing.

Example GIS SVG workflow

An example workflow pertaining to GIS/Meteorology will be demonstrated during the presentation. Use of the example will be demonstrated, pointing out advantages due to SVG . This will be followed by a technical breakdown of the example applications and overview of the development process.

The GIS example can be broken down as follows:

The presentation will reach the conclusion that SVG provides large benefits in many technical graphics workflows

XHTML rendition created by gcapaper Web Publisher v2.0, © 2001-3 Schema Software Inc.