PGM (Portable Graymap) is an open-source, plain text image file format designed for grayscale images. Part of the Netpbm family, it represents pixel intensity values in a simple, human-readable ASCII or binary encoding. Each PGM file contains a header with metadata like width, height, and maximum grayscale value, followed by pixel intensity data ranging from 0 (black) to the specified maximum (white).
Advantages include human-readable format, simple structure, cross-platform compatibility, lossless compression, and excellent for scientific and technical image processing. Supports both ASCII and binary encodings for flexibility.
Large file sizes compared to compressed formats, limited color depth, slower processing for complex images, and less efficient for photographic or color image storage. Not suitable for web graphics or high-performance image rendering.
PGM is widely used in scientific imaging, medical diagnostics, computer vision, and image processing applications. Common scenarios include medical scan analysis, satellite imagery processing, machine learning training datasets, microscopy research, and academic image representation where precise grayscale information is critical.