Image MIME Reference
PGM
Portable Graymap
image/x-portable-graymap
VS
Sony Alpha Raw Image
image/x-sony-arw
Sony-ARW
A complete technical comparison of Portable Graymap and Sony Alpha Raw Image — covering compression, feature support, browser compatibility, magic bytes, and when to choose each format.
Equal browser support
Feature Support
| Feature | PGM | Sony-ARW |
|---|---|---|
| Transparency (Alpha) | ✕ No | ✕ No |
| Animation Support | ✕ No | ✕ No |
| Progressive Loading | ✕ No | ✕ No |
| HDR Support | Yes | Yes |
| EXIF Metadata | ✕ No | Yes |
| ICC Color Profile | ✕ No | Yes |
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)
Sony Alpha Raw Image
image/x-sony-arw
Extension
.arw
Container
TIFF-based (Proprietary)
Compression
Uncompressed / Lossless Compressed / Lossy Compressed
Algorithm
NoneSony Proprietary LosslessSony Proprietary Lossy
Color Depth
12-bit (Per Channel), 14-bit (Per Channel)
Developed by
Sony Corporation
Released
2006
Magic Bytes
49 49 2A 00
Browser Support Comparison
| Browser | PGM | Sony-ARW |
|---|---|---|
|
|
✕ | ✕ |
|
|
✕ | ✕ |
|
|
✕ | ✕ |
|
|
✕ | ✕ |
|
|
✕ | ✕ |
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
Sony-ARW
Sony-ARW Strengths
- Retains absolute maximum sensor data, enabling massive shadow recovery and highlight protection compared to compressed in-camera JPEGs
- Embeds high-quality JPEG previews and robust metadata, allowing photographers to match in-camera color science (like Creative Looks) perfectly during raw processing
- Utilizes the standard TIFF container structure, ensuring broad compatibility with open-source decoding libraries (like LibRaw)
Limitations
- Proprietary format means it requires constant updates to raw processing engines every time Sony releases a new camera model
- Sony's historically controversial lossy compression algorithm (often called 'star eater' due to spatial filtering artifacts) was a drawback for astrophotography in older ARW versions, though largely resolved in newer models with uncompressed/lossless options
- Cannot be directly embedded into web pages or used in standard HTML/CSS contexts
When to choose which format
PGM
Use PGM when…
- Computer Vision and Machine Learning Pre-processing
- Scientific and Medical Image Processing
- Unix/Linux Command-Line Image Pipelines
Sony-ARW
Use Sony-ARW when…
- Professional Digital Photography
- Non-destructive Image Post-Processing
- High Dynamic Range (HDR) Imaging Archival