Free webp to jpg
Image MIME Reference
DXF

Drawing Exchange Format

image/vnd.dxf
VS

Portable Graymap

image/x-portable-graymap
PGM

A complete technical comparison of Drawing Exchange Format and Portable Graymap — covering compression, feature support, browser compatibility, magic bytes, and when to choose each format.

Equal browser support

Feature Support

Feature DXF PGM
Transparency (Alpha) Yes ✕ No
Animation Support ✕ No ✕ No
Progressive Loading ✕ No ✕ No
HDR Support ✕ No Yes
EXIF Metadata ✕ No ✕ No
ICC Color Profile ✕ No ✕ No
Drawing Exchange Format
image/vnd.dxf
Extension
.dxf
Container Text / Binary Container
Compression Uncompressed (ASCII) / Uncompressed (Binary)
Algorithm
None
Color Depth Vector (Indexed AutoCAD Colors / True Color)
Developed by Autodesk
Released 1982
Magic Bytes
30 0D 0A 53 45 43 54 49 4F 4E (ASCII) / 41 75 74 6F 43 41 44 20 42 69 6E 61 72 79 20 44 58 46 0D 0A 1A 00 (Binary)
Full DXF reference →
Portable Graymap
image/x-portable-graymap
Extension
.pgm
Container Netpbm
Compression Uncompressed
Algorithm
None
Color Depth 8-bit (Grayscale), 16-bit (Grayscale)
Developed by Jef Poskanzer (Netpbm Project)
Released 1988
Magic Bytes
50 32 (ASCII) or 50 35 (Binary)
Full PGM reference →

Browser Support Comparison

Browser DXF PGM
Chrome Chrome
Firefox Firefox
Safari Safari
Edge Edge
IE IE (Legacy)
DXF

DXF Strengths

  • Universally supported by almost every CAD program, 3D modeler, and vector graphics editor in existence
  • ASCII structure is human-readable and can be parsed or generated programmatically with relative ease
  • The de facto standard for sending 2D cutting paths to CNC routers, plasma cutters, and laser engravers
Limitations
  • ASCII DXF files can be enormously large and inefficient compared to binary DWG files
  • The format relies heavily on legacy AutoCAD data structures, making complex 3D entity parsing extremely difficult for third-party developers
  • Lacks native web browser rendering capabilities
PGM

PGM Strengths

  • Extremely simple format allows custom parsers to be written from scratch in minimal time
  • Supports 16-bit precision, making it highly valuable for scientific, medical, and height-map data where 8-bit precision is insufficient
  • ASCII encoding ('P2') allows manual editing and visual inspection of pixel values directly within a text editor
Limitations
  • Strictly limited to grayscale; cannot display color
  • Lack of compression results in massive file sizes, making it entirely impractical for web delivery or consumer storage
  • Does not support alpha transparency or modern metadata structures

When to choose which format

DXF
Use DXF when…
  • Cross-Platform CAD Data Exchange
  • CNC Machining and Laser Cutting Paths
  • PCB Design Outlines
  • Architectural 2D Layouts
PGM
Use PGM when…
  • Computer Vision and Machine Learning Pre-processing
  • Scientific and Medical Image Processing
  • Unix/Linux Command-Line Image Pipelines
Share this comparison