PGM
Also known as: Portable Graymap, .pgm file, Netpbm grayscale
PGM (Portable Graymap) is the grayscale member of the Netpbm family. It stores an image as gray levels per pixel in a simple, easy-to-parse layout, making it a common intermediate format in image processing.
- Netpbm grayscale image format
- One gray value per pixel, 8- or 16-bit
- Common in computer vision and scripting
How PGM works
PGM records a single gray value per pixel, typically 8-bit (0–255) or 16-bit for finer tones. Like its siblings it has a readable ASCII form and a compact binary form.
It sits between PBM (pure black and white) and PPM (full color) in the Netpbm trio, and is widely used in computer vision and scientific imaging.
Using PGM files
PGM is an uncompressed working format, so files can be large. Netpbm tools and most editors open it; convert to PNG for a smaller, shareable grayscale image.