Skip to content

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

OffsetHexadecimalASCIIDescription
050 32P2Magic number for the plain-text PGM representation.
050 35P5Magic 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

ResourcePublisherLink
PGM Format SpecificationNetpbmOpen resource ↗

Record information

Verified
October 4, 2026
Last updated
October 4, 2026