You are trying the new MyGeodata Cloud. Send feedback Back to the previous version

Raster · Image & imagery

PNM — Netpbm Portable Any Map (PNM/PPM/PGM)

Simple uncompressed bitmap family of the Netpbm toolkit covering PBM, PGM and PPM images without georeferencing.

Type
Raster · Image & imagery
Extension
.pnm, .ppm, .pgm, .pbm
Converter
Read & write
Coordinate system
Sidecar file (world file / .aux.xml)
Bands
1 (PBM/PGM) or 3 (PPM).

What is a PNM file?

PNM (Portable Any Map) is the collective name for the simple image formats of the Netpbm toolkit, which grew out of Jef Poskanzer's Pbmplus package. It covers PBM for bilevel images, PGM for grayscale and PPM for RGB colour. Each file starts with a magic number from P1 to P6, followed by the image width, height and, for PGM and PPM, a maximum sample value. P1 to P3 store pixel values as ASCII text, while P4 to P6 store them in binary.

The formats are used mainly as an interchange and intermediate format in image processing pipelines because they are trivial to read and write. Data is always uncompressed, so files are large. PGM and PPM support 8-bit samples and, with a maximum value above 255, 16-bit samples. The format has no notion of coordinates or projections, so in GIS workflows georeferencing must be supplied through world files and .prj sidecars.

PNM files usually come from command-line image tools, scientific or academic software, and scripts that need a format with no library dependencies. Check the magic number first: P1–P3 are plain text, P4–P6 are binary, and the extension (pbm, pgm, ppm) tells you whether the data is bilevel, grayscale or colour. Files are uncompressed and can be very large. They carry no coordinates, so keep any world file or .prj sidecar with the image.

Typical uses

  • Passing images between steps of a command-line image processing pipeline.
  • Exporting raster data from custom scripts without needing an image library.
  • Teaching image processing and testing readers, because the format is so simple.
  • Handing off grayscale or RGB rasters that GIS software later georeferences with a world file.
Files: Single .pbm, .pgm, .ppm or .pnm file; georeferencing needs a world file next to it.

Sample PNM files — free download

Small, real datasets of the island of Saint Helena (OpenStreetMap, Copernicus DEM, Sentinel-2). Download them, open them in your software, or convert them in one click.

Preview of the sample data: Saint Helena shaded relief st-helena-relief-pnm.zip

Shaded relief (PPM)

Colour shaded relief of Saint Helena (hypsometric tint × multidirectional hillshade) from Copernicus DEM, 20 m, 8-bit RGB, UTM zone 30S. Binary PPM; georeferenced by a world file and .aux.xml (crs).

  • 3 bands · Byte
  • 906 × 762 px
  • 20 m
  • EPSG:32730
  • 772.7 kB

Inside: README.txt, st-helena-relief.pnm, st-helena-relief.pnm.aux.xml

Copernicus DEM © DLR e.V. 2010-2014 and © Airbus Defence and Space GmbH 2014-2018 provided under COPERNICUS by the European Union and ESA · © OpenStreetMap contributors, ODbL 1.0

Frequently asked questions

They differ in sample type. PBM stores 1-bit black and white pixels, PGM stores grayscale values and PPM stores RGB colour. PNM is the collective name for all three.

Ready to convert your data?

Drop the files and the Converter does the rest — no install, no account needed for your first conversions.