PGM
A simple Netpbm raster format for grayscale images, with plain-text and binary representations designed to be easy for programs to read and write.
General information
- Format name
- Portable Graymap
- Extension
.pgm- MIME type
image/x-portable-graymap- Category
- image
- Data type
- Binary And Text
Image properties
- Structure
- Raster
- Compression
- Uncompressed
- Transparency
- No
- Animation
- No
File signatures
| Offset | Hexadecimal | ASCII | Description |
|---|---|---|---|
| 0 | 50 32 | P2 | Magic number for the plain-text PGM representation. |
| 0 | 50 35 | P5 | Magic number for the binary PGM representation. |
Common uses
Grayscale images
Image-processing pipelines
Scientific image data
Format conversion
Simple test images
Related formats
Technical resources
| Resource | Publisher | Link |
|---|---|---|
| PGM Format Specification | Netpbm | Open resource ↗ |
Record information
- Verified
- October 4, 2026
- Last updated
- October 4, 2026