Image MIME Reference
CGM
Computer Graphics Metafile
image/cgm
VS
JPEG-LS
image/jls
JPEG-LS
A complete technical comparison of Computer Graphics Metafile and JPEG-LS — covering compression, feature support, browser compatibility, magic bytes, and when to choose each format.
Equal browser support
Feature Support
| Feature | CGM | JPEG-LS |
|---|---|---|
| Transparency (Alpha) | Yes | ✕ No |
| Animation Support | ✕ No | ✕ No |
| Progressive Loading | ✕ No | ✕ No |
| HDR Support | ✕ No | Yes |
| EXIF Metadata | ✕ No | ✕ No |
| ICC Color Profile | Yes | ✕ No |
Computer Graphics Metafile
image/cgm
Extension
.cgm
Container
CGM
Compression
Uncompressed / Binary / Character / Clear Text
Algorithm
Deflate (in some WebCGM profiles)
Color Depth
8-bit, 16-bit, 24-bit, 32-bit
Developed by
ISO / IEC
Released
1987
Magic Bytes
00 20 (Binary) / 42 45 47 49 4E 20 4D 45 54 41 46 49 4C 45 (Clear Text)
JPEG-LS
image/jls
Extension
.jls.jl
Container
JPEG Bitstream
Compression
Lossless / Near-Lossless (Predictive Coding)
Algorithm
LOCO-I (Low Complexity Lossless Compression for Images)Golomb-Rice Coding
Color Depth
8-bit, 12-bit, 16-bit (Per Channel)
Developed by
Joint Photographic Experts Group (ISO/ITU-T) & HP Labs
Released
1999
Magic Bytes
FF D8 FF F7
Browser Support Comparison
| Browser | CGM | JPEG-LS |
|---|---|---|
|
|
✕ | ✕ |
|
|
✕ | ✕ |
|
|
✕ | ✕ |
|
|
✕ | ✕ |
|
|
✕ | ✕ |
CGM
CGM Strengths
- 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
JPEG-LS
JPEG-LS Strengths
- Provides state-of-the-art lossless compression ratios for continuous-tone images, often outperforming Lossless JPEG and JPEG 2000
- Extremely fast and computationally inexpensive to encode/decode, requiring no complex floating-point math or DCTs
- Highly resilient in constrained hardware environments, making it ideal for medical equipment and deep-space probes (e.g., Mars rovers)
Limitations
- Zero native support in web browsers or standard consumer operating systems
- Lacks the advanced resolution scalability and progressive decoding features found in JPEG 2000
- Primarily relegated to niche enterprise sectors (healthcare/DICOM and aerospace) rather than consumer adoption
When to choose which format
CGM
Use CGM when…
- Technical Illustrations
- Aerospace & Defense (S1000D)
- CAD/CAM
- Geophysics
JPEG-LS
Use JPEG-LS when…
- Medical Imaging (DICOM Encapsulation)
- Space and Planetary Imaging (NASA/ESA)
- Industrial Machine Vision
- Scientific Archival Storage