.ppm

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.

Category
Image
Type
Binary
Also seen as
.pgm, .pbm, .pnm
Is a .ppm file safe to open? Safe. Netpbm images are plain uncompressed raster data read by image software.

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.

What opens 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.

Windows

  • GIMP
  • IrfanView
  • XnView MP

macOS

  • GIMP
  • Preview
  • XnView MP

Linux

  • GIMP
  • ImageMagick
  • feh

Open a .ppm file step by step

  1. Confirm the file really is a .ppm. Drop it into the WhatFileType identifier, which reads its signature in your browser without uploading anything.
  2. On Windows, open it with GIMP or IrfanView.
  3. On Mac, use GIMP or Preview.
  4. On Linux, try GIMP or ImageMagick.
  5. Still stuck? Convert the .ppm to png, which opens more widely.

Why can't I open my .ppm file?

Almost always because no installed app understands Netpbm (PPM/PGM/PBM). Install one of the apps above, or convert the file to a format your existing software already reads. If double-clicking opens the wrong program instead of nothing at all, the file association is set to the wrong app rather than the file being broken.

The other possibility is that the file is not really a .ppm at all. Drop it into the file identifier to check it by its bytes instead of its name. Nothing is uploaded.

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.

What is the .ppm file signature (magic bytes)?

A .ppm file starts with the hex bytes 50 36, which read as P6 in ASCII. Programs identify Netpbm (PPM/PGM/PBM) by those bytes, not by the filename, so a renamed file still gives itself away.

These are the documented signatures for Netpbm (PPM/PGM/PBM). For a full breakdown, see the Netpbm (PPM/PGM/PBM) file signature page.

Documented magic-byte signatures for the .ppm format
Hex signatureOffsetASCIINote
50 360P6'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. How sources are ranked and what is deliberately left out is set out in the methodology.