.pgm PGM image
Images
| MIME type | image/x-portable-graymap |
|---|---|
| Description | PGM image |
| Acronym | PGM – Portable GrayMap |
| Category | Images |
| Signature (magic bytes) | 50 32 (P2)50 35 (P5) |
| Based on | image/x-portable-anymap |
Frequently asked questions
What is a .pgm file?
A .pgm file is a “PGM image” (MIME type image/x-portable-graymap). PGM stands for Portable GrayMap.
How do I open a .pgm file?
With any image viewer that supports the format – the Photos app on Windows, Preview on macOS, Eye of GNOME or GIMP on Linux. For unusual formats a converter such as ImageMagick helps.
How can you tell a genuine .pgm file?
By the bytes at the start of the file, the signature (magic bytes): 50 32 (P2) and 50 35 (P5). On Linux and macOS, file --mime-type example.pgm checks the real type regardless of the extension.
Which format is .pgm based on?
Technically a .pgm file is a subtype of “PNM image” (image/x-portable-anymap), so programs for that base format can often read it too.
Which MIME type belongs to .pgm?
The MIME type is image/x-portable-graymap. In the Apache web server: AddType image/x-portable-graymap .pgm; in nginx: types { image/x-portable-graymap pgm; }.