PPMB Files
Portable Pixel Map (binary)
PPMB is the binary version of the PPM portable pixel map format.
It is a simple RGB color image description. The definition is as follows:
-
the typical file extension is ".ppm", but an extension of
".pnm" is also occasionally used.
-
A "magic number" for identifying the file type. A
binary PPMB file's magic
number is the two characters "P6".
-
Whitespace (blanks, TABs, CRs, LFs).
-
A width, formatted as ASCII characters in decimal.
-
Whitespace.
-
A height, again in ASCII decimal.
-
Whitespace.
-
The maximum color-component value MAXVAL, again in ASCII decimal.
For the binary format, MAXVAL cannot be any greater than 255.
-
a single charcter of "whitespace", usually a new line.
-
Width * height pixels, each pixel being described by 3 bytes, each
between 0 and the specified maximum value, starting at the top-left
corner of the pixmap, proceeding in normal English reading order.
The three values for each pixel represent red, green, and blue,
respectively; a value of 0 means that color is off, and the maximum
value means that color is maxed out.
PPMB File Characteristics:
-
binary
-
RGB color
-
2D
-
No compression
-
1 image
Licensing:
The computer code and data files described and made available on this web page
are distributed under
the GNU LGPL license.
Related Data and Programs:
The PBMB data directory
describes binary Portable Bit Map files.
The PGMB data directory
describes binary Portable Gray Map files.
The PPMA data directory
describes ASCII Portable Pixel Map files.
Reference:
-
the NETPBM homepage.
Programs and routines to read a PPMB file:
-
MATLAB can read a PPMB
file with a command like A=imread('file','PPM').
-
pbmlib,
is a FORTRAN90 library of routines which can read binary PPM files.
-
ppmb_io,
is a C++ library of routines which can read binary PPM files.
-
The Visual Toolkit
routine vtkPNMReader can read a binary
PPM file into VTK.
Programs and routines to write a PPMB file:
-
gnuplot can create
graphical images, and write them to a binary PPM file via the
command "set terminal pbm color".
-
MATHEMATICA
includes an Export[filename,object] command
that can save a graphics object as a binary PPM file.
-
MATLAB can write a PPMB
file with a command like imwrite(a,'filename','PPM').
-
pbmlib,
is a FORTRAN90 library of routines which can write binary PPM files.
-
ppmb_io,
is a C++ library of routines which can write binary PPM files.
-
The Visual Toolkit
routine vtkPNMWriter can write a VTK
image to a binary PPM file.
Programs to display a PPMB file:
-
The
AVS
module read_any_image can read a PPMB file.
-
GIMP,
the GNU Image Manipulation Program, can read and display a PPMB file.
-
The
ImageVision
program imgview can display a PPMB file.
-
MATLAB can display a PPMB
file, once it is read in, with a command like image(A).
-
xv
can display a PPMB file.
Programs to convert a PPMB file to another format:
-
cjpeg converts a
PPMB file to JPEG format.
-
The
ImageMagick,
program convert can convert a PPMB file to
BMP, CGM, EPS, FIG, FITS, GIF, JPG, PBM, PDF, PGM, PNG, PNM,
PPM, PS, RGB, TIF, XBM or XPM format.
-
GIMP,
the GNU Image Manipulation Program,
can read a PPMB file and write out a copy in a variety of formats.
-
ppmb_2_bmp is an executable C++ program which
converts a PPMB file to BMP format.
-
ppmb_2_ppma is an executable C++ program which
converts a PPMB file to PPMA format.
-
The NETPBM program
ppmtojpeg
can convert a PPMB file to a JPEG file.
-
xv can read a PPMB file
and write out a copy in BMP, FIT, GIF, JPG, PBM, PGM, RGB or
TIF format.
Programs to convert a file to PPMB format:
Sample PPMB Files:
You can go up one level to
the DATA page.
Last revised on 26 February 2005.