PNM Toolbox 3.0


As of MATLAB 6.1 (Release 13), the MATLAB functions imread, imwrite, and imfinfo, support PPM, PGM, PBM, and RAS images. There is still no support for SGI and XBM images, though.



The PNM Toolbox is a collection of MATLAB programs for reading and writing image files. The supported formats are PPM (portable pixelmap), PGM (portable graymap), PBM (portable bitmap), RAS (Sun raster file), SGI/RGBA/RGB/BW (Silicon Graphics image files) and XBM (X11 bitmap) image files.

For more details see the file Readme.m or type info pnm at the MATLAB prompt when the toolbox is installed.

What’s New

The following changes have been made since the previous release.

Download the files

For the latest version, get pnm-3.0.tar.gz or

For the latest version that is compatible with MATLAB 4.2, get pnm-1.002.tar.gz or

All releases are available in the archive directory.

Extract the files

How to extract the files depends on the type of archive. In the description below, VERSION must be replaced with the appropriate version number.

Gzip-compressed tar file

The files are extracted with, for instance

gunzip -c pnm-VERSION.tar.gz | tar xvf -


gzip -cd pnm-VERSION.tar.gz | tar xvf -

Zip-compressed file

The files are extracted with, for instance


If you don’t have unzip, go to InfoZip’s home page and get it. It’s free and available for numerous platforms.

Installing the toolbox

See the file install.txt in the distribution.

Image format specifications

Utilities supporting the formats

Several utilities support the PNM file formats. For instance, the UNIX utilities XV and Gimp and the Windows utility Paint Shop Pro. Some utilities exist for several platforms, for instance ImageMagick.

A good image conversion toolkit is NetPBM for UNIX and NetPBM for Win32.

Valid XHTML 1.0! Valid CSS! Most recently modified 2010-01-21 17:34:10 +01:00
Peter John Acklam (