{"id":"image-cgm","mimeType":"image/cgm","name":"Computer Graphics Metafile","shortName":"CGM","category":"Vector \u0026 Engineering","extensions":[".cgm"],"description":"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).","seo":{"title":"image/cgm MIME Type | Complete Developer Reference \u0026 Magic Bytes","description":"Complete reference for the image/cgm MIME type: magic bytes, software support, HTTP headers, developer snippets, and technical specifications for Computer Graphics Metafile.","faqs":[{"question":"What is a CGM file?","answer":"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)."},{"question":"Are CGM files supported in modern web browsers?","answer":"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."},{"question":"Is CGM a vector or raster format?","answer":"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."}]},"index":{"compression":["Uncompressed","Binary","Character","Clear Text"],"browserSupport":{"score":1,"label":"None"},"commonUses":["Technical Illustrations","Aerospace \u0026 Defense (S1000D)","CAD/CAM","Geophysics"]},"technical":{"magicBytes":{"hex":"00 20 (Binary) / 42 45 47 49 4E 20 4D 45 54 41 46 49 4C 45 (Clear Text)","ascii":".  / BEGIN METAFILE"},"container":"CGM","compressionAlgorithm":["Deflate (in some WebCGM profiles)"],"colorDepth":["8-bit","16-bit","24-bit","32-bit"],"transparency":true,"animation":false,"metadata":{"exif":false,"xmp":true,"iccProfile":true},"alphaChannel":true,"progressiveLoading":false,"hdrSupport":false},"history":{"developer":"ISO / IEC","released":"1987","specification":"ISO/IEC 8632"},"browserSupport":{"chrome":false,"chromeVersion":"None","firefox":false,"firefoxVersion":"None","safari":false,"safariVersion":"None","edge":false,"edgeVersion":"None","internetExplorer":false},"softwareSupport":[{"name":"Canvas X","logo":""},{"name":"CorelDRAW","logo":""},{"name":"PTC Creo","logo":""},{"name":"Oracle AutoVue","logo":""},{"name":"Adobe Illustrator (via Plugins)","logo":""}],"conversion":{"convertTo":["svg","png","dxf"],"convertFrom":["svg","dxf","dwg"]},"developer":{"httpHeaders":[{"header":"Content-Type","value":"image/cgm"}],"htmlAccept":"image/cgm, .cgm","fileDetection":["Check for 'BEGIN METAFILE' string in clear-text encoded files","Check for 0x0020 (Element Class 0, ID 1) in binary encoded files"]},"prosCons":{"pros":["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"],"cons":["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"]},"specifications":{"url":"https://www.w3.org/Graphics/WebCGM/","rfc":"","mimeAliases":["application/cgm"]},"developerSnippets":{"python":"import magic\nprint(magic.from_file('diagram.cgm', mime=True)) # May output 'image/cgm' for binary profiles","nodejs":"const FileType = require('file-type');\nconst type = await FileType.fromFile('diagram.cgm');\nconsole.log(type?.mime); // Custom parsing usually required; file-type support varies","go":"// Go standard library does not natively detect CGM.\n// Custom parsing required to read the BEGIN METAFILE hex or text markers.","php":"$mime = mime_content_type('diagram.cgm');\necho $mime; // May return 'image/cgm' or fallback to 'application/octet-stream'"},"relatedFormats":["svg","dxf"]}
