NETPBM Image Conversion Routines

The NETPBM package contains routines which can be used to convert between image formats. You usually convert from your original format to a standard intermediate format, then from the intermediate format to the desired result. The three intermediate formats are:

  • pbm (portable bitmap): black and white
  • pgm (portable graymap): shades of gray
  • ppm (portable pixmap): color

The initials "pnm" are used to refer to any of the three intermediate formats. A program that can use a pgm can also use a pbm, and a program for ppm files can use either of the other two. However, a program written to use pbm files will not be able to use pgm or ppm files.

The table below lists a variety of image formats and the conversion programs needed to convert (1) from those formats to intermediate pnm formats and (2) from intermediate pnm formats to those formats. To convert a file:

  1. Find the file format you have now in the first column.
  2. Get the name of the program in the second column for that row. Let that be program1.
  3. Find the file format you want to have in the first column.
  4. Get the name of the program in the third column for that row. Let that be program2.
  5. Make sure you know the path and name of both the current image (image1) and the image you want to create (image2).
  6. Issue the command in the following format:
    program1 image1 | program2 > image2

For example, to convert the TIFF file "image.tiff" into a PC Windows bitmap file called "image.bmp," you would type:
tifftopnm image.tiff | ppmtobmp > image.bmp

Format

To pnm

From pnm

ASCII graphics

asciitopgm

pbmtoascii

AT&T 4425 terminal (132 col mode)

 

pbmto4425

Abekas YUV bytes

yuvtoppm

ppmtoyuv

Abekas YUV triplets (MPEG/JGEP)

yuvsplittoppm

ppmtoyuvsplit

Andrew Toolkit raster object

atktopbm

pbmtoatk

Atari Degas .pi1

pi1toppm

ppmtopi1

Atari Degas .pi3

pi3toppm

ppmtopi3

Atari compressed Spectrum file

spctoppm

 

Atari uncompressed Spectrum file

sputoppm

 

AutoCAD database or slide

sldtoppm

ppmtoacad

BBm BitGraph graphics

 

pbmtobbnbg

Bennet Yee "face" file

ybmtopbm

pbmtoybm

Biorad confocal microscope files

bioradtopgm

 

CMU window manger bitmap

cmuwmtopbm

pbmtocmuwm

DEC LN03+

 

pbmtoln03

DEC sixel format

 

ppmtosixel

DDIF format

 

pnmtoddif

Encapsulated PostScript preview bitmap

 

pbmtoepsi

Epson printer graphics

 

pbmtoepson

FITS

fitstopnm

pnmtofits

GEM .img file

gemtopbm

pbmtogem

GIF

giftopnm

ppmtogif

Gemini 10X printer graphics

 

pbmto10x

Gould scanner file

gouldtoppm

 

GraphOn graphics (compressed)

 

pbmtogo

Group 3 fax file

g3topbm

pbmtog3

HIPS

hipstopgm

 

HP LaserJet format

 

pbmtolj

HP PaintJet

pjtoppm

ppmtopj

HP PaintJet XL PCL file

 

ppmtopjxl

IFF ILBM

ilbmtoppm

ppmtoilbm

Img-whatnot

imgtoppm

 

Lisp machine bitmap

lispmtopgm

pgmtolispm

MGR bitmap

mgrtopbm

pbmtomgr

MacPaint

macptopbm

pbmtomacp

Macintosh PICT

picttoppm

ppmtopict

Mitsubishi S340-10 printer format

 

ppmtomistsu

Motif UIL icon file

 

ppmtouil

NCSA ICR format

 

ppmtoicr

PCX

pcxtoppm

ppmtopcx

Packed (PK) format font

pktopbm

pbmtopk

Photo-CD file

hpcdtoppm

 

PostScript "image" data

psidtopgm

 

PostScript

pstopnm
(uses ghostscript)

pnmtops

Fast PostScript creator

 

pbmtolps

Printronix printer graphics

 

pbmtoptx

SGI image file

sgitopnm

pnmtosgi

Solitaire image recorder format

sirtopnm

pnmtosir

SPOT satellite images

spottopgm

 

Sun icon

icontopbm

pbmtoicon

Sun rasterfile

rasttopnm

pnmtorast

TIFF file

tifftopnm

pnmtotiff

TrueVision Targa file

tgatoppm

ppmtotga

Unix plot(5) file

 

pbmtoplot

Usenix FaceSaver

fstopgm

pgmtofs

Windows (PC) bitmap

bmptoppm

ppmtobmp

X10 bitmap

xbmtopbm

pbmtox10bm

X10 window dump

xwdtopnm

 

X11 "puzzle" file

 

ppmtopuzz

X11 bitmap

xbmtopbm

pbmtoxbm

X11 pixmap

xpmtoppm

ppmtoxpm

X11 window dump

xwdtopnm

pnmtoxwd

Xim file

ximtoppm

 

XV "thumbmail" picture

xvminitoppm

 

Zeiss confocal microscopes

zeisstopnm

 

Zinc bitmap

 

pbmtozinc

Doodle brush

brushtopbm

 

Output from MTV or PRT ray tracers

mtvtoppm

 

Output from the QRT ray tracer

qrttoppm

 

Portable bitmap

 

pgmtopbm

Portable graymap

 

pbmtopgm

Portable pixmap

 

pgmtoppm

Raw RGB bytes

rawtoppm

 

Raw grayscale bytes

rawtopgm

 

Text

pbmtext

 

Three portable graymaps

rgb3toppm

ppmtorgb3

unknown

anytopnm