Free webp to jpg
CGM

Computer Graphics Metafile

image/cgm Released 1987 · by ISO / IEC

CGM (Computer Graphics Metafile) is a free and open ISO standard file format for 2D vector graphics, raster graphics, and text. It is heavily utilized in technical illustration, CAD, aerospace, and defense industries for its precision and standardized profiles (like WebCGM).

Vector & Engineering Transparency Production Ready

Technical Specifications

MIME Type
image/cgm
Extensions
.cgm
Container
CGM
Compression
Uncompressed & Binary & Character & Clear Text
Algorithms
Deflate (in some WebCGM profiles)
Color Depth
8-bit, 16-bit, 24-bit, 32-bit
Metadata
XMP ICC
Capabilities
Transparency
Animation
Progressive Loading
Alpha Channel
HDR Support
Official Specification
Aliases: application/cgm

Magic Bytes & HTTP Headers

File Signature (Magic Bytes)
00 20 (Binary) / 42 45 47 49 4E 20 4D 45 54 41 46 49 4C 45 (Clear Text)
ASCII: . / BEGIN METAFILE
HTTP Headers
Content-Type: image/cgm
HTML Accept Attribute
accept="image/cgm, .cgm"

Browser Support Matrix

Browser Status Min Version
Chrome Chrome
Not Supported
Firefox Firefox
Not Supported
Safari Safari
Not Supported
Edge Edge
Not Supported
Internet Explorer Internet Explorer
Not Supported Legacy

Advantages & Limitations

Advantages
  • Strictly standardized by ISO, ensuring long-term archiving and cross-platform compatibility in engineering
  • Excellent support for rich metadata, hyperlinks, and technical hotspots via the WebCGM profile
  • Can store complex 2D geometry, rasters, and text in a single lightweight file
Limitations
  • Multiple encoding schemes (Binary, Character, Clear Text) make parser development difficult
  • Zero native support in modern web browsers without third-party plugins
  • Largely replaced by SVG for general-purpose 2D vector graphics on the web

Developer Code Snippets

import magic
print(magic.from_file('diagram.cgm', mime=True)) # May output 'image/cgm' for binary profiles
const FileType = require('file-type');
const type = await FileType.fromFile('diagram.cgm');
console.log(type?.mime); // Custom parsing usually required; file-type support varies
// Go standard library does not natively detect CGM.
// Custom parsing required to read the BEGIN METAFILE hex or text markers.
$mime = mime_content_type('diagram.cgm');
echo $mime; // May return 'image/cgm' or fallback to 'application/octet-stream'

File Detection Steps

How to programmatically detect a image/cgm file by reading its raw bytes:

  1. 1 Check for 'BEGIN METAFILE' string in clear-text encoded files
  2. 2 Check for 0x0020 (Element Class 0, ID 1) in binary encoded files

Software Support

C
Canvas X
C
CorelDRAW
P
PTC Creo
O
Oracle AutoVue
A
Adobe Illustrator (via Plugins)

Conversion Tools

Share & Embed

Markdown Badge
CGM Format Badge
[![CGM Format](https://freewebptojpg.com/mime/image/cgm/badge.svg)](https://freewebptojpg.com/mime/image/cgm)
Interactive iframe Widget
<iframe src="https://freewebptojpg.com/mime/image/cgm/embed" width="100%" height="280" style="border:1px solid #cbd5e1;border-radius:8px;" title="CGM Specs"></iframe>

JSON API

All data on this page is available as a free, open JSON API. Use it in your project, documentation, or tooling.

GET https://freewebptojpg.com/mime/image/cgm.json Open JSON
Free to use
No auth required
CORS enabled
Use from any domain
Cached 24h
Cache-Control headers set

Frequently Asked Questions

What is a CGM file?

A Computer Graphics Metafile (CGM) is an international standard format for 2D vector and composite graphics. It is commonly used for technical documentation, engineering diagrams, and aerospace manuals (e.g., ATA iSpec 2200 and S1000D standards).

Are CGM files supported in modern web browsers?

No, standard web browsers do not natively support CGM. While the WebCGM profile was designed for web use, it traditionally required specialized viewer plugins. For modern web display, CGM files are usually converted to SVG.

Is CGM a vector or raster format?

CGM is a metafile format, meaning it can contain both infinitely scalable 2D vector graphics and embedded raster images, as well as text and metadata.

Related Formats

Share this format