What is a .ppm file?
Portable Pixmap Image · Image · Jef Poskanzer (Netpbm) · 1988
PPM and its relatives PGM and PBM are the Netpbm image formats: deliberately simple, uncompressed images that are easy for programs to read and write. They are common as an intermediate format in image processing.
What is a .ppm file used for?
Each format starts with a two-byte magic like P6 (binary colour PPM), P5 (grayscale PGM) or P4 (bitmap PBM), then the width, height and pixel data. There is no compression, so files are large but trivial to parse.
Because they are so simple, these formats are a favourite output for graphics code and command-line tools. Convert to PNG for anything you need to store or share.
How to open a .ppm file
The .ppm format opens in the following apps, grouped by operating system. If one app does not work, try another from the same list. For a step-by-step walkthrough, see how to open a .ppm file.
Windows
- GIMP
- IrfanView
- XnView MP
macOS
- GIMP
- Preview
- XnView MP
Linux
- GIMP
- ImageMagick
- feh
How to convert a .ppm file
You can convert a .ppm file to png, jpg, bmp using a conversion tool or the export menu of an app that opens it.
.ppm file signature (magic bytes)
Programs recognise a .ppm file by the bytes at the start of the file, not by its name. These are the signatures for Netpbm (PPM/PGM/PBM). For a full breakdown, see the Netpbm (PPM/PGM/PBM) file signature page.
| Hex signature | Offset | Note |
|---|---|---|
| 50 36 | 0 | 'P6' binary PPM; P1-P5 are the other Netpbm types |
See the full magic-numbers reference for every format.
Frequently asked questions
What is a .ppm file?
PPM and its relatives PGM and PBM are the Netpbm image formats: deliberately simple, uncompressed images that are easy for programs to read and write. They are common as an intermediate format in image processing.
What is the difference between PPM, PGM and PBM?
They are the same Netpbm family at different colour depths: PPM is full colour, PGM is grayscale and PBM is black and white. PNM is the umbrella term for all three.
How do I open a PPM file?
GIMP, IrfanView and most image tools open it. To convert, use ImageMagick: convert image.ppm image.png.
Why are Netpbm files so large?
They store pixels uncompressed for simplicity, so a program can read them with almost no code. That makes them handy as an intermediate but poor for storage.
Related formats
Sources
Details on this page were checked against authoritative references: