man-pages/man1/netpbm.1.html
2021-03-31 01:06:50 +01:00

1594 lines
38 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of netpbm</TITLE>
</HEAD><BODY>
<H1>netpbm</H1>
Section: User Commands (1)<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
netpbm - package of graphics manipulation programs and libraries
<P>
<A NAME="lbAC">&nbsp;</A>
<H2>DESCRIPTION</H2>
<B>Netpbm</B>
is a package of graphics programs and programming libraries.
<P>
There are over 220 separate programs in the package, most of which have
&quot;pbm&quot;, &quot;pgm&quot;, &quot;ppm&quot;, or &quot;pnm&quot; in their names. For example,
<B>pnmscale</B>
and
<B>giftopnm</B>.
<P>
For example, you might use
<B>pnmscale</B>
to shrink an image by 10%. Or use
<B>pnmcomp</B>
to overlay one image on top of another. Or use
<B>pbmtext</B>
to create an image of text. Or reduce the number of colors in an image
with
<B>pnmquant</B>.
<P>
<A NAME="lbAD">&nbsp;</A>
<H2>The Netpbm Formats</H2>
<P>
All of the programs work with a set of graphics formats called the
&quot;netpbm&quot; formats. Specifically, these formats are
<B><A HREF="/cgi-bin/man/man2html?5+pbm">pbm</A></B>(5),
<B><A HREF="/cgi-bin/man/man2html?5+pgm">pgm</A></B>(5),
<B><A HREF="/cgi-bin/man/man2html?5+ppm">ppm</A></B>(5),
and
<B><A HREF="/cgi-bin/man/man2html?5+pam">pam</A></B>(5).
The first three of these are sometimes known generically as
<B>pnm</B>.
Many of the Netpbm programs convert from a Netpbm format to another
format or vice versa. This is so you can use the Netpbm programs to
work on graphics of any format. It is also common to use a
combination of Netpbm programs to convert from one non-Netpbm format
to another non-Netpbm format. Netpbm has converters for over 80
graphics formats, and as a package Netpbm lets you do more graphics
format conversions than any other computer graphics facility.
<P>
The Netpbm formats are all raster formats, i.e. they describe an image
as a matrix of rows and columns of pixels. In the PBM format, the
pixels are black and white. In the PGM format, pixels are shades of
gray. In the PPM format, the pixels are in full color. The PAM format
is more sophisticated. A replacement for all three of the other formats,
it can represent matrices of general data including but not limited to
black and white, grayscale, and color images.
<P>
Programs designed to work with PBM images have &quot;pbm&quot; in their names.
Programs designed to work with PGM, PPM, and PAM images similarly have
&quot;pgm&quot;, &quot;ppm&quot;, and &quot;pam&quot; in their names.
<P>
All Netpbm programs designed to read PGM images see PBM images as if
they were PGM too. All Netpbm programs designed to read PPM images
see PGM and PBM images as if they were PPM. See the section
&quot;Implied Format Conversion&quot; below.
<P>
Programs that have &quot;pnm&quot; in their names read PBM, PGM, and PPM but
unlike &quot;ppm&quot; programs, they distinguish between them and their
function depends on the format. For example,
<B>pnmtogif</B>
creates a black and white GIF output image if its input is PBM or
PGM, but a color GIF output image if its input is PPM. And
<B>pnmscale</B>
produces an output image of the same format as the input. A
<B>ppmscale</B>
program would read all three PNM input formats, but would see them all
as PPM and would always generate PPM output.
<P>
If it seems wasteful to you to have three separate PNM formats, be
aware that there is a historical reason for it. In the beginning,
there were only PBMs. PGMs came later, and then PPMs. Much later
came PAM, which realizes the possibility of having just one aggregate
format.
<P>
The formats are described in the man pages
<B><A HREF="/cgi-bin/man/man2html?5+pbm">pbm</A></B>(5),
<B><A HREF="/cgi-bin/man/man2html?5+pgm">pgm</A></B>(5),
<B><A HREF="/cgi-bin/man/man2html?5+ppm">ppm</A></B>(5),
and
<B><A HREF="/cgi-bin/man/man2html?5+pam">pam</A></B>(5),
<P>
<A NAME="lbAE">&nbsp;</A>
<H2>Implied Format Conversion</H2>
<P>
A program that uses the PGM library to read an image can read a PBM image
as well as a PGM image. The program sees the PBM image as if it were the
equivalent PGM image, with a maxval of 255.
<P>
A program that uses the PPM library to read an image can read a PGM
image as well as a PPM image and a PBM image as well as a PGM image.
The program sees the PBM or PGM image as if it were the equivalent PPM
image, with a maxval of 255 in the PBM case and the same maxval as the
PGM in the PGM case.
<P>
<A NAME="lbAF">&nbsp;</A>
<H2>Netpbm and Transparency</H2>
<P>
In many graphics format, there's a means of indicating that certain parts
of the image are wholly or partially transparent, meaning that if it were
displayed &quot;over&quot; another image, the other image would show through there.
Netpbm formats deliberately omit that capability, since their purpose is to
be extremely simple.
<P>
In Netpbm, you handle transparency via a transparency mask in a separate
(slightly redefined) PGM image. In this pseudo-PGM, what would normally be
a pixel's intensity is instead it an opaqueness value. See
<B><A HREF="/cgi-bin/man/man2html?5+pgm">pgm</A></B>(5).
<B>pnmcomp</B>
is an example of a program that uses a PGM transparency mask.
<P>
<A NAME="lbAG">&nbsp;</A>
<H2>The Netpbm Programs</H2>
<P>
The Netpbm programs are generally useful run by a person from a
command shell, but are also designed to be used by programs. A common
characteristic of Netpbm programs is that they are simple, fundamental
building blocks. They are most powerful when stacked in pipelines.
Netpbm programs do not use graphical user interfaces (in fact, none of
them display graphics at all, except for a very simple Linux Svgalib
displayer) and do not seek input from a user.
<P>
Each of these programs has its own man page.
<P>
<A NAME="lbAH">&nbsp;</A>
<H2>Common Options</H2>
<P>
There are a few options that are present on all programs that are based
on the Netpbm libraries, including virtually all Netpbm programs. These
are not mentioned in the individual man pages for the programs.
<P>
<DL COMPACT>
<DT id="1"><B>-quiet</B>
<DD>
Suppress all informational messages that would otherwise be issued to
Standard Error. (To be precise, this only works to the extent that the
program in question implements the Netpbm convention of issuing all
informational messages via the
<B>pm_message()</B>
service of the Netpbm libraries).
<DT id="2"><B>-version</B>
<DD>
Instead of doing anything else, report the version of the
<B>libpbm</B>
library linked with the program (it may have been linked statically
into the program, or dynamically linked at run time). Normally, the
Netpbm programs and the libraries are installed at the same time, so
this tells you the version of the program and all the other Netpbm
libraries and files it uses as well.
<P>
Here is a directory of the Netpbm programs. You can also use
<B>man -k</B>
to search for a program that does what you want.
<P>
</DL>
<A NAME="lbAI">&nbsp;</A>
<H3>Converters</H3>
<P>
<DL COMPACT>
<DT id="3"><B>ppmtompeg </B>
<DD>
convert series of PPM frames to an MPEG movie
<DT id="4"><B>jpegtopnm </B>
<DD>
convert JFIF/JPEG/EXIF file to Netpbm format
<DT id="5"><B>pnmtojpeg </B>
<DD>
convert PPM to JPEG/JFIF/EXIF format
<DT id="6"><B>anytopnm </B>
<DD>
convert any graphics format to Netpbm format
<DT id="7"><B>bmptoppm </B>
<DD>
convert Windows or OS/2 Bitmap file to PPM
<DT id="8"><B>ppmtobmp </B>
<DD>
convert PPM to Windows or OS/2 Bitmap file
<DT id="9"><B>winicontoppm</B>
<DD>
convert Windows icon file to PPM
<DT id="10"><B>ppmtowinicon</B>
<DD>
convert PPM to Windows icon file
<DT id="11"><B>giftopnm </B>
<DD>
convert GIF to portable anymap
<DT id="12"><B>ppmtogif </B>
<DD>
convert PPM to GIF
<DT id="13"><B>pnmtopng </B>
<DD>
convert Netpbm format to Portable Network Graphics
<DT id="14"><B>pngtopnm </B>
<DD>
convert PNG (Portable Network Graphics) to Netpbm formats
<DT id="15"><B>palmtopnm </B>
<DD>
convert Palm pixmap to Netpbm formats
<DT id="16"><B>pnmtopalm </B>
<DD>
convert Netpbm formats to Palm pixmap
<DT id="17"><B>jbigtopbm </B>
<DD>
convert JBIG BIE (compressed bitmap) to PBM
<DT id="18"><B>pamtopnm</B>
<DD>
convert a PAM image to PBM, PGM, or PPM
<DT id="19"><B>pbmtojbig </B>
<DD>
convert PBM to JBIG BIE (compressed bitmap)
<DT id="20"><B>pnmtofiasco </B>
<DD>
convert Netpbm image to Fiasco (wfa) highly compressed format
<DT id="21"><B>fiascotopnm </B>
<DD>
convert Fiasco (wfa) highly compressed format to Netpbm image
<DT id="22"><B>hpcdtoppm </B>
<DD>
convert photo CD to PPM
<DT id="23"><B>pbmtonokia</B>
<DD>
convert PBM to Nokia Smart Messaging Format (SMF)
<DT id="24"><B>pbmtowbmp </B>
<DD>
convert PBM to WAP (Wireless App Protocol) Wireless Bitmap
<DT id="25"><B>wbmptopbm </B>
<DD>
convert WAP (Wireless App Protocol) Wireless Bitmap to PBM
<DT id="26"><B>neotoppm</B>
<DD>
convert Atari Neochrome (.neo) image to PPM
<DT id="27"><B>ppmtoneo</B>
<DD>
convert PPM image to Atari Neochrome (.neo)
<DT id="28"><B>pbmtomda </B>
<DD>
convert from PBM to Microdesign (for Amstrad PCWs)
<DT id="29"><B>mdatopbm </B>
<DD>
convert from Microdesign (for Amstrad PCWs) to PBM
<DT id="30"><B>atktopbm </B>
<DD>
convert Andrew Toolkit raster object to PBM
<DT id="31"><B>pbmtoatk </B>
<DD>
convert PBM to Andrew Toolkit raster object
<DT id="32"><B>brushtopbm </B>
<DD>
convert Xerox doodle brushes to PBM
<DT id="33"><B>cmuwmtopbm </B>
<DD>
convert CMU window manager format to PBM
<DT id="34"><B>g3topbm </B>
<DD>
convert Group 3 FAX to PBM
<DT id="35"><B>pbmtog3 </B>
<DD>
convert PBM to Group 3 FAX
<DT id="36"><B>icontopbm </B>
<DD>
convert Sun icon to PBM
<DT id="37"><B>pbmtoicon </B>
<DD>
convert PBM to Sun icon
<DT id="38"><B>gemtopnm </B>
<DD>
convert GEM .img format to PBM or pixmap
<DT id="39"><B>macptopbm </B>
<DD>
convert MacPaint to PBM
<DT id="40"><B>pbmtomacp </B>
<DD>
convert PBM to MacPaint
<DT id="41"><B>mgrtopbm </B>
<DD>
convert MGR format to PBM
<DT id="42"><B>pbmtomgr </B>
<DD>
convert PBM to MGR format
<DT id="43"><B>pi3topbm </B>
<DD>
convert Atari Degas .pi3 to PBM
<DT id="44"><B>pbmtopi3 </B>
<DD>
convert PBM to Atari Degas .pi3
<DT id="45"><B>xbmtopbm </B>
<DD>
convert X10 or X11 bitmap to PBM
<DT id="46"><B>pbmtoxbm </B>
<DD>
convert PBM to X11 bitmap
<DT id="47"><B>pbmtox10bm </B>
<DD>
convert PBM to X10 bitmap
<DT id="48"><B>ybmtopbm </B>
<DD>
convert Bennet Yee &quot;face&quot; file into PBM
<DT id="49"><B>pbmtoybm </B>
<DD>
convert PBM into Bennet Yee &quot;face&quot; file
<DT id="50"><B>pbmto10x </B>
<DD>
convert PBM to Gemini 10x printer graphics
<DT id="51"><B>pbmtoascii </B>
<DD>
convert PBM to ASCII graphic form
<DT id="52"><B>asciitopgm </B>
<DD>
convert ASCII character graphics to PGM
<DT id="53"><B>pbmtobbnbg </B>
<DD>
convert PBM to BBN BitGraph graphics
<DT id="54"><B>pbmtocmuwm </B>
<DD>
convert PBM to CMU window manager format
<DT id="55"><B>pbmtoepson </B>
<DD>
convert PBM to Epson printer graphics
<DT id="56"><B>pbmtogem </B>
<DD>
convert PBM into GEM .img file
<DT id="57"><B>pbmtogo </B>
<DD>
convert PBM to GraphOn graphics
<DT id="58"><B>pbmtolj </B>
<DD>
convert PBM to HP LaserJet black and white graphics
<DT id="59"><B>ppmtolj </B>
<DD>
convert PPM to HP LaserJet color graphics (PCL)
<DT id="60"><B>pjtoppm </B>
<DD>
convert HP PaintJet file to PPM
<DT id="61"><B>ppmtopj </B>
<DD>
convert PPM to HP PaintJet file
<DT id="62"><B>thinkjettopbm</B>
<DD>
convert HP Thinkjet printer stream to PBM
<DT id="63"><B>pbmtoplot </B>
<DD>
convert PBM into Unix <A HREF="/cgi-bin/man/man2html?5+plot">plot</A>(5) file
<DT id="64"><B>pbmtoptx </B>
<DD>
convert PBM to Printronix graphics
<DT id="65"><B>pbmtozinc </B>
<DD>
convert PBM to Zinc Interface Library icon
<DT id="66"><B>fitstopnm </B>
<DD>
convert FITS format to portable anymap
<DT id="67"><B>pnmtofits </B>
<DD>
convert Netpbm formats to FITS format
<DT id="68"><B>fstopgm </B>
<DD>
convert Usenix FaceSaver(tm) format to PGM
<DT id="69"><B>pgmtofs </B>
<DD>
convert PGM to Usenix FaceSaver(tm) format
<DT id="70"><B>hipstopgm </B>
<DD>
convert HIPS format to PGM
<DT id="71"><B>lispmtopgm </B>
<DD>
convert a Lisp Machine bitmap file into PGM format
<DT id="72"><B>pgmtolispm </B>
<DD>
convert PGM into Lisp Machine format
<DT id="73"><B>pnmtops </B>
<DD>
convert Netpbm formats to Postscript
<DT id="74"><B>pstopnm </B>
<DD>
convert Postscript to Netpbm formats
<DT id="75"><B>psidtopgm </B>
<DD>
convert PostScript &quot;image&quot; data to PGM
<DT id="76"><B>pbmtolps </B>
<DD>
convert PBM image to Postscript using lines
<DT id="77"><B>pbmtoepsi </B>
<DD>
convert a PBM image to encapsulated Postscript preview bitmap
<DT id="78"><B>pbmtopsg3</B>
<DD>
convert PBM images to Postscript using G3 fax compression.
<DT id="79"><B>rawtopgm </B>
<DD>
convert raw grayscale bytes to PGM
<DT id="80"><B>pgmtopbm </B>
<DD>
convert PGM to PBM
<DT id="81"><B>gouldtoppm </B>
<DD>
convert Gould scanner file to PPM
<DT id="82"><B>ilbmtoppm </B>
<DD>
convert IFF ILBM to PPM
<DT id="83"><B>ppmtoilbm </B>
<DD>
convert PPM to IFF ILBM
<DT id="84"><B>imgtoppm </B>
<DD>
convert Img-whatnot to PPM
<DT id="85"><B>mtvtoppm </B>
<DD>
convert MTV ray-tracer output to PPM
<DT id="86"><B>pcxtoppm </B>
<DD>
convert PC Paintbrush format to PPM
<DT id="87"><B>pgmtoppm </B>
<DD>
colorize a portable graymap into a PPM
<DT id="88"><B>pi1toppm </B>
<DD>
convert Atari Degas .pi1 to PPM
<DT id="89"><B>ppmtopi1 </B>
<DD>
convert PPM to Atari Degas .pi1
<DT id="90"><B>picttoppm </B>
<DD>
convert Macintosh PICT to PPM
<DT id="91"><B>ppmtopict </B>
<DD>
convert PPM to Macintosh PICT
<DT id="92"><B>qrttoppm </B>
<DD>
convert QRT ray-tracer output to PPM
<DT id="93"><B>rawtoppm </B>
<DD>
convert raw RGB bytes to PPM
<DT id="94"><B>sldtoppm </B>
<DD>
convert an AutoCAD slide file into a PPM
<DT id="95"><B>spctoppm </B>
<DD>
convert Atari compressed Spectrum to PPM
<DT id="96"><B>sputoppm </B>
<DD>
convert Atari uncompressed Spectrum to PPM
<DT id="97"><B>tgatoppm </B>
<DD>
convert TrueVision Targa file to PPM
<DT id="98"><B>ppmtotga </B>
<DD>
convert PPM to TrueVision Targa file
<DT id="99"><B>ximtoppm </B>
<DD>
convert Xim to PPM
<DT id="100"><B>xpmtoppm </B>
<DD>
convert XPM format to PPM
<DT id="101"><B>ppmtoxpm </B>
<DD>
convert PPM to XPM format
<DT id="102"><B>yuvtoppm </B>
<DD>
convert Abekas YUV format to PPM
<DT id="103"><B>eyuvtoppm </B>
<DD>
convert Encoder/Berkeley YUV format to PPM
<DT id="104"><B>ppmtoeyuv </B>
<DD>
convert PPM to Encoder/Berkeley YUV format
<DT id="105"><B>ppmtoyuv </B>
<DD>
convert PPM to Abekas YUV format
<DT id="106"><B>ppmtoyuvsplit</B>
<DD>
convert PPM to 3 subsampled raw YUV files
<DT id="107"><B>yuvsplittoppm </B>
<DD>
merge 3 subsampled raw YUV files to one PPM
<DT id="108"><B>ppmtoacad </B>
<DD>
convert PPM to AutoCAD database or slide
<DT id="109"><B>ppmtoicr </B>
<DD>
convert PPM to NCSA ICR graphics
<DT id="110"><B>ppmtopcx </B>
<DD>
convert PPM to PC Paintbrush format
<DT id="111"><B>ppmtopgm </B>
<DD>
convert PPM to portable graymap
<DT id="112"><B>ppmtopuzz </B>
<DD>
convert PPM to X11 &quot;puzzle&quot; file
<DT id="113"><B>rasttopnm </B>
<DD>
convert Sun raster file to Netpbm formats
<DT id="114"><B>pnmtorast </B>
<DD>
convert Netpbm formats to Sun raster file
<DT id="115"><B>tifftopnm </B>
<DD>
convert TIFF file to portable anymap
<DT id="116"><B>pnmtotiff </B>
<DD>
convert Netpbm formats to TIFF RGB file
<DT id="117"><B>pnmtotiffcmyk</B>
<DD>
convert Netpbm formats to TIFF CMYK file
<DT id="118"><B>xwdtopnm </B>
<DD>
convert X10 or X11 window dump to Netpbm formats
<DT id="119"><B>pnmtoxwd </B>
<DD>
convert Netpbm formats to X11 window dump
<DT id="120"><B>pnmtoplainpnm</B>
<DD>
convert regular Netpbm format image into plain Netpbm format
<DT id="121"><B>pbmtopgm </B>
<DD>
convert PBM file to PGM by averaging areas
<DT id="122"><B>411toppm </B>
<DD>
convert 411 (Sony Mavica) to PPM
<DT id="123"><B>ppmtosixel </B>
<DD>
convert PPM to DEC sixel format
<DT id="124"><B>ppmtouil </B>
<DD>
convert PPM to Motif UIL icon file
<DT id="125"><B>sbigtopgm </B>
<DD>
convert Santa Barbara Instrument Group CCD file to PGM
<DT id="126"><B>vidtoppm </B>
<DD>
convert Parallax XVideo JPEG to sequence of PPM files
<DT id="127"><B>pnmtorle </B>
<DD>
convert PNM to Utah Raster Toolkit (urt/rle) file
<DT id="128"><B>rletopnm </B>
<DD>
convert Utah Raster Toolkit (urt/rle) file to PNM
<DT id="129"><B>ppmtoleaf </B>
<DD>
convert PPM to Interleaf
<DT id="130"><B>leaftoppm </B>
<DD>
convert Interleaf to PPM
<DT id="131"><B>bioradtopgm </B>
<DD>
convert Biorad confocal image to PGM
<DT id="132"><B>pbmtoln03 </B>
<DD>
convert PGM image to Dec LN03+ Sixel image
<DT id="133"><B>pbmtopk </B>
<DD>
convert PBM image to packed format (PK) font
<DT id="134"><B>pktopbm </B>
<DD>
convert packed format (PK) font to PBM image
<P>
</DL>
<A NAME="lbAJ">&nbsp;</A>
<H3>Image Generators</H3>
<P>
All of these generate Netpbm format output.
<P>
<DL COMPACT>
<DT id="135"><B>pbmmake </B>
<DD>
create a blank PBM image of a specified size
<DT id="136"><B>ppmmake </B>
<DD>
create a PPM image of a specified size and color
<DT id="137"><B>pgmramp </B>
<DD>
generate a grayscale ramp
<DT id="138"><B>ppmpat </B>
<DD>
create a pretty PPM image
<DT id="139"><B>ppmrainbow</B>
<DD>
create a spectrum-like image with colors fading together.
<DT id="140"><B>pgmnoise </B>
<DD>
create a PGM image of white noise
<DT id="141"><B>pbmtext </B>
<DD>
render text into a PBM image
<DT id="142"><B>pbmupc </B>
<DD>
create a Universal Product Code PBM image
<DT id="143"><B>ppmcie </B>
<DD>
generate a CIE color map PPM image
<DT id="144"><B>pbmpage </B>
<DD>
create a printer test pattern page in PBM format
<DT id="145"><B>ppmcolors</B>
<DD>
create a color map (PPM image) containing all possible colors of given maxval
<P>
<P>
</DL>
<A NAME="lbAK">&nbsp;</A>
<H3>Image Editors</H3>
<P>
All of these work on the Netpbm formats
<P>
<DL COMPACT>
<DT id="146"><B>ppmlabel </B>
<DD>
Add text to an image
<DT id="147"><B>pnmshadow </B>
<DD>
add a shadow to an image so it looks like it's floating
<DT id="148"><B>ppmbrighten </B>
<DD>
brighten or dim an image -- change saturation and value
<DT id="149"><B>ppmdim </B>
<DD>
dim an image - different way from ppmbrighten
<DT id="150"><B>pbmreduce </B>
<DD>
reduce a PBM N times, using Floyd-Steinberg
<DT id="151"><B>pgmnorm </B>
<DD>
normalize contrast in a PGM image
<DT id="152"><B>ppmnorm </B>
<DD>
normalize contrast in a PPM image
<DT id="153"><B>pbmpscale </B>
<DD>
enlarge a PBM image with edge smoothing
<DT id="154"><B>pnmscale </B>
<DD>
scale an image with high precision
<DT id="155"><B>pnmscalefixed </B>
<DD>
scale an image quickly with low precision
<DT id="156"><B>pnmenlarge </B>
<DD>
enlarge an image N times
<DT id="157"><B>ppmdither </B>
<DD>
ordered dither for color images
<DT id="158"><B>pnmcolormap</B>
<DD>
Choose the N best colors to represent an image; create a colormap
<DT id="159"><B>pnmremap</B>
<DD>
Replace colors in an image with those from a color map
<DT id="160"><B>ppmquant </B>
<DD>
quantize colors in a color image down to fewer colors
<DT id="161"><B>pnmquant </B>
<DD>
quantize colors/shades in a color or grayscale image down to fewer
<DT id="162"><B>ppmquantall </B>
<DD>
quantize colors on many files
<DT id="163"><B>ppmrelief </B>
<DD>
run a Laplacian Relief filter on a PPM
<DT id="164"><B>pnmarith </B>
<DD>
perform arithmetic on two images
<DT id="165"><B>pnmcat </B>
<DD>
concatenate images
<DT id="166"><B>pnmpad </B>
<DD>
add borders to an image
<DT id="167"><B>pnmcomp </B>
<DD>
create composite (overlay) of images
<DT id="168"><B>ppmmix </B>
<DD>
mix (overlay) two images.
<DT id="169"><B>pnmcrop </B>
<DD>
crop all like-colored borders off an image
<DT id="170"><B>pamcut</B>
<DD>
select a rectangular region from an image
<DT id="171"><B>pnmcut </B>
<DD>
obsolete version of
<B>pamcut</B>
(kept because it may have fewer bugs)
<DT id="172"><B>pamdice</B>
<DD>
slice an image into many horizontally and/or vertically
<DT id="173"><B>pamdeinterlace</B>
<DD>
remove every other row from an image
<DT id="174"><B>pamchannel</B>
<DD>
extract a single plane (channel, e.g. R, G, or B) from an image
<DT id="175"><B>pnmdepth </B>
<DD>
change the maxval in an image
<DT id="176"><B>pnmflip </B>
<DD>
perform one or more flip operations on an image
<DT id="177"><B>pamstretch</B>
<DD>
scale up an image by inserting interpolated pixels
<DT id="178"><B>pamstretch-gen </B>
<DD>
scale by non-integer values using pamstretch and pnmscale
<DT id="179"><B>pnminvert </B>
<DD>
invert an image
<DT id="180"><B>pnmgamma </B>
<DD>
perform gamma correction on an image
<DT id="181"><B>pnmhisteq</B>
<DD>
histogram equalize image to increase contrast
<DT id="182"><B>pnmmargin </B>
<DD>
add a margin to an image
<DT id="183"><B>pnmpaste </B>
<DD>
paste a rectangle into an image
<DT id="184"><B>pnmrotate </B>
<DD>
rotate an image
<DT id="185"><B>pnmshear </B>
<DD>
shear an image
<DT id="186"><B>pnmsmooth </B>
<DD>
smooth am image
<DT id="187"><B>pnmtile </B>
<DD>
replicate an image into a specified size
<DT id="188"><B>pbmclean </B>
<DD>
remove lone pixels (snow) from a PBM image
<DT id="189"><B>pnmalias </B>
<DD>
antialias an image
<DT id="190"><B>ppmchange </B>
<DD>
change all of one color to another in PPM image
<DT id="191"><B>pnmnlfilt</B>
<DD>
filter an image by replacing each pixel with a function of nearby pixels
<DT id="192"><B>ppmshift </B>
<DD>
shift lines of PPM image left or right a random amount
<DT id="193"><B>ppmspread </B>
<DD>
move pixels of PPM image a random amount
<DT id="194"><B>pnmconvol </B>
<DD>
general MxN convolution on an image
<DT id="195"><B>rgb3toppm </B>
<DD>
combine three portable graymaps into one PPM
<DT id="196"><B>ppmtorgb3 </B>
<DD>
separate a PPM into three portable graymaps
<DT id="197"><B>pbmlife </B>
<DD>
apply Conway's rules of Life to a PBM image
<DT id="198"><B>ppmdist </B>
<DD>
map colors to high contrast grayscales arbitrarily
<DT id="199"><B>ppmntsc </B>
<DD>
adjust colors so they are legal for NTSC or PAL television
<P>
<P>
</DL>
<A NAME="lbAL">&nbsp;</A>
<H3>Image Analyzers</H3>
<P>
These all work on the Netpbm formats as input.
<P>
<DL COMPACT>
<DT id="200"><B>pnmfile </B>
<DD>
describe an image's vital characteristics
<DT id="201"><B>pnmpsnr </B>
<DD>
measure difference between two images
<DT id="202"><B>pgmedge </B>
<DD>
edge-detect a PGM image
<DT id="203"><B>pgmenhance </B>
<DD>
edge-enhance a PGM image
<DT id="204"><B>pgmslice </B>
<DD>
print grayscale values for a row or column of a PGM image
<DT id="205"><B>pgmtexture </B>
<DD>
calculate textural features on a PGM image
<DT id="206"><B>pgmhist </B>
<DD>
print a histogram of the values in a PGM image
<DT id="207"><B>ppmhist </B>
<DD>
print a histogram of a PPM
<DT id="208"><B>pnmhistmap</B>
<DD>
draw a histogram of a PGM or PPM
<DT id="209"><B>ppmtomap </B>
<DD>
generate a map of all colors in an image
<DT id="210"><B>ppm3d</B>
<DD>
generate a blue/green 3D glasses image from two images
<P>
</DL>
<A NAME="lbAM">&nbsp;</A>
<H3>Miscellaneous</H3>
<P>
<DL COMPACT>
<DT id="211"><B>ppmsvgalib</B>
<DD>
display a PPM image on a Linux virtual console using Svgalib
<DT id="212"><B>pbmmask </B>
<DD>
create a mask bitmap from a regular bitmap
<DT id="213"><B>ppmcolormask </B>
<DD>
create mask of areas of a certain color in an image
<DT id="214"><B>pnmsplit </B>
<DD>
split a multi-image Netpbm file into multiple 1-image files
<DT id="215"><B>pnmindex </B>
<DD>
build a visual index of a bunch of Netpbm images
<DT id="216"><B>pcdindex </B>
<DD>
build a visual index of a photo CD from PCD overview file
<DT id="217"><B>pnmmontage </B>
<DD>
build multiple Netpbm images into a single montage image
<DT id="218"><B>pgmbentley </B>
<DD>
Bentleyize a PGM image
<DT id="219"><B>pgmcrater </B>
<DD>
create cratered terrain by fractal forgery
<DT id="220"><B>pamoil </B>
<DD>
turn a PNM or PAM image into an oil painting
<DT id="221"><B>ppmforge </B>
<DD>
fractal forgeries of clouds, planets, and starry skies
<DT id="222"><B>pgmkernel </B>
<DD>
generate a convolution kernel
<DT id="223"><B>ppmtv </B>
<DD>
Make an image lined so it looks like an old TV
<DT id="224"><B>pbmto4425 </B>
<DD>
Display PBM image on AT&amp;T 4425 ASCII terminal with gfx chars
<BR>&nbsp;&nbsp;&nbsp;&nbsp;
</DL>
<A NAME="lbAN">&nbsp;</A>
<H3>Uncatalogued As Yet</H3>
<P>
<DL COMPACT>
<DT id="225"><B>pnmtoddif</B>
<DD>
<DT id="226"><B>pnmtosgi</B>
<DD>
<DT id="227"><B>pnmtosir</B>
<DD>
<DT id="228"><B>ppmflash</B>
<DD>
<DT id="229"><B>ppmqvga</B>
<DD>
<DT id="230"><B>ppmtomitsu</B>
<DD>
<DT id="231"><B>ppmtopjxl</B>
<DD>
<DT id="232"><B>sgitopnm</B>
<DD>
<DT id="233"><B>sirtopnm</B>
<DD>
<DT id="234"><B>spottopgm</B>
<DD>
<DT id="235"><B>xvminitoppm</B>
<DD>
<DT id="236"><B>zeisstopnm</B>
<DD>
<P>
<P>
</DL>
<A NAME="lbAO">&nbsp;</A>
<H2>The Netpbm Libraries</H2>
<P>
The Netpbm programming libraries,
<B><A HREF="/cgi-bin/man/man2html?3+libpbm">libpbm</A></B>(3),
<B><A HREF="/cgi-bin/man/man2html?3+libpgm">libpgm</A></B>(3),
<B><A HREF="/cgi-bin/man/man2html?3+libppm">libppm</A></B>(3),
and
<B><A HREF="/cgi-bin/man/man2html?3+libpnm">libpnm</A></B>(3),
make it easy to write programs that manipulate graphic images. Their
main function is to read and write files in the Netpbm format, and
because the Netpbm package contains converters for all the popular
graphics formats, if your program reads and writes the Netpbm formats,
you can use it with any formats.
<P>
But the libraries also contain some utility functions, such as character
drawing and RGB/YCrCb conversion.
<P>
The libraries have the conventional C linkage. Virtually all programs
in the Netpbm package are based on the Netpbm libraries.
<P>
<P>
<A NAME="lbAP">&nbsp;</A>
<H3>Application Notes</H3>
<P>
As a collection of primitive tools, the power of Netpbm is multiplied
by the power of all the other unix tools you can use with them. These
notes remind you of some of the more useful ways to do this. Often,
when people want to add high level functions to the Netpbm tools, they
have overlooked some existing tool that, in combination with Netpbm,
already does it.
<P>
Often, you need to apply some conversion or edit to a whole bunch of files.
<P>
As a rule, Netpbm programs take one input file and produce one output file,
usually on Standard Output. This is for flexibility, since you so often
have to pipeline many tools together.
<P>
Here is an example of a shell command to convert all your of PNG files
(named *.png) to JPEG files named *.jpg:
<P>
<B>for i in *.png; do pngtopnm $i | ppmtojpeg &gt;`basename $i .png`.jpg; done</B>
<P>
Or you might just generate a stream of individual shell commands, one
per file, with awk or perl. Here's how to brighten 30 YUV images that
make up one second of a movie, keeping the images in the same files:
<P>
<B>ls *.yuv <BR>
</B>
<B>| perl -ne 'chomp; </B>
<BR>
<B>print yuvtoppm $_ | ppmbrighten -v 100 | ppmtoyuv &gt;tmp$$.yuv;, </B>
<BR>
<B>mv tmp$$.yuv $_ </B>
<BR>
<B>' <BR>
</B>
<B>| sh </B>
<P>
The tools
<B>find </B>
(with the
<B>-exec </B>
option) and
<B>xargs </B>
are also useful for simple manipulation of groups of files.
<P>
Some shells' &quot;process substitution&quot; facility can help where a
non-Netpbm program expects you to identify a disk file for input and
you want it to use the result of a Netpbm manipulation. Say printcmyk
takes the filename of a Tiff CMYK file as input and what you have is a
PNG file
<B>abc.png</B>.
Try:
<P>
<B>printcmyk &lt;({ pngtopnm abc.png | pnmtotiffcmyk ; })</B>
<P>
It works in the other direction too, if you have a program that makes you
name its output file and you want the output to go through a Netpbm tool.
<P>
<A NAME="lbAQ">&nbsp;</A>
<H3>Other Graphics Software</H3>
<P>
Netpbm contains primitive building blocks. It certainly is not a complete
graphics library.
<P>
The first thing you will need to make use of any of these tools is a viewer.
For the X inclined, there is
<B>xzgv</B>.
See
<B><A HREF="ftp://metalab.unc.edu/pub/Linux/apps/graphics/viewers/X">ftp://metalab.unc.edu/pub/Linux/apps/graphics/viewers/X</A></B>.
<P>
<B>xloadimage</B>
and its extension
<B>xli</B>
are also common ways to display a graphic image in X.
<P>
<B>ImageMagick </B>
is like a visual version of Netpbm. Using the X/Window system on
Unix, you can do basic editing of images and lots of format
conversions. The package does include at least some non-visual tools.
Convert, Mogrify, Montage, and Animate are popular programs from the
<B>ImageMagick </B>
package.
<B>ImageMagick </B>
runs on Unix, Windows, Windows NT, Macintosh, and VMS.
<P>
The Gimp is a visual image editor for Unix and X, in the same category
as the more famous, less capable, and much more expensive Adobe
Photoshop, etc. for Windows. See
<B><A HREF="http://www.gimp.org">http://www.gimp.org</A></B>.
<P>
The
<B>file </B>
program looks at a file and tells you what kind of file it
is. It recognizes most of the graphics formats with which Netpbm
deals, so it is pretty handy for graphics work. Netpbm's
<B>anytopnm</B>
program depends on
<B>file. </B>
See
<B><A HREF="ftp://ftp.astron.com/pub/file">ftp://ftp.astron.com/pub/file</A></B>.
<P>
The Utah Raster Toolkit serves a lot of the same purpose as Netpbm,
but without the emphasis on format conversions. This package is based
on the RLE format, which you can convert to and from the Netpbm
formats.
<B><A HREF="http://www.cs.utah.edu/research/projects/alpha1/urt.html">http://www.cs.utah.edu/research/projects/alpha1/urt.html</A></B>
gives some information on the Utah Raster Toolkit, but does not tell
where to get it.
<P>
<P>
There are some Netpbm-like graphics tools distributed by the Army High
Performance Computing Research Center at
<B><A HREF="http://www.arc.umn.edu/gvl-software/media-tools.html">http://www.arc.umn.edu/gvl-software/media-tools.html</A></B>.
These operate directly on non-Netpbm format images, so they aren't
included in the Netpbm package. However, you can use them with any
image format by using the Netpbm format converters.
<P>
<P>
<B>Ivtools </B>
is a suite of free X Windows drawing editors for Postscript,
Tex, and web graphics production, as well as an embeddable and
extendable vector graphic shell. It uses the Netpbm facilities.
See
<B><A HREF="http://www.ivtools.org">http://www.ivtools.org</A></B>.
<P>
<B>Ilib </B>
is a C subroutine library with functions for adding text to an
image (as you might do at a higher level with
<B>pbmtext</B>, <B>pnmcomp</B>,
etc.).
It works with Netpbm input and output. Find it at
<B><A HREF="http://www.radix.net/~cknudsen/Ilib">http://www.radix.net/~cknudsen/Ilib</A></B>.
Netpbm also includes character drawing functions in the
<B>libppm</B>
library, but they do not have as fancy font capabilities (see
<B>ppmlabel</B>
for an example of use of the Netpbm character drawing functions).
<P>
<B>GD</B>
is a library of graphics routines that is part of PHP. It has a subset of
Netpbm's functions and has been found to resize images more slowly and with
less quality.
<P>
<B>pnm2ppa </B>
converts to HP's &quot;Winprinter&quot; format (for HP 710, 720, 820,
1000, etc). It is a superset of Netpbm's
<B>pbmtoppa </B>
and handles, notably, color. However, it is more of a printer driver
than a Netpbm-style primitive graphics building block. See
<B><A HREF="http://sourceforge.net/project/?group_id=1322">http://sourceforge.net/project/?group_id=1322</A></B>.
<P>
The program
<B>morph </B>
morphs one image into another. It uses Targa format
images, but you can use
<B>tgatoppm </B>
and
<B>ppmtotga </B>
to deal with that format. You have to use the graphical (X/Tk) Xmorph
to create the mesh files that you must feed to
<B>morph</B>.
<B>morph </B>
is part of the Xmorph package. See
<B><A HREF="http://www.colorado-research.com/~gourlay/software/Graphics/Xmorph">http://www.colorado-research.com/~gourlay/software/Graphics/Xmorph</A></B>.
<P>
To create an animated GIF, or extract a frame from one, use
<B>gifsicle</B>.
<B>gifsicle </B>
converts between animated GIF and still GIF, and you can use
<B>ppmtogif </B>
and
<B>giftopnm </B>
to connect up to all the Netpbm utilities. See
<B><A HREF="http://www.lcdf.org/gifsicle">http://www.lcdf.org/gifsicle</A></B>.
<P>
To convert an image of text to text (optical character recongition -
OCR), use
<B>gocr </B>
(think of it as an inverse of
<B>pbmtext</B>).
See
<B><A HREF="http://altmark.nat.uni-magdeburg.de/~jschulen/ocr/">http://altmark.nat.uni-magdeburg.de/~jschulen/ocr/</A></B>.
<P>
<B><A HREF="http://schaik.com/pngsuite">http://schaik.com/pngsuite</A></B>
contains a PNG test suite -- a whole bunch of PNG images exploiting the
various features of the PNG format.
<P>
Another version of
<B>pnmtopng</B>/<B>pngtopnm</B>
is at
<B><A HREF="http://www.schaik.com/png/pnmtopng.html">http://www.schaik.com/png/pnmtopng.html</A></B>.
The version in Netpbm was actually based on that package a long time
ago, and you can expect to find better exploitation of the PNG format,
especially recent enhancements, in that package. It may be a little
less consistent with the Netpbm project and less exploitive of recent
Netpbm format enhancements, though.
<P>
<B>jpegtran</B>
Does some of the same transformations as Netpbm is famous for, but does
them specifically on JPEG files and does them without loss of information.
By contrast, if you were to use Netpbm, you would first decompress the
JPEG image to Netpbm format, then transform the image, then compress it
back to JPEG format. In that recompression, you lose a little image
information because JPEG is a lossy compression.
<B>jpegtran</B>
comes with the Independent Jpeg Group's (<A HREF="http://www.ijg.org)">http://www.ijg.org)</A> JPEG library.
<P>
Some tools to deal with EXIF files (see also Netpbm's
<B>jpegtopnm </B>
and
<B>pnmtojpeg</B>):
To dump (interpret) an EXIF header: Exifdump
((<A HREF="http://topo.math.u-psud.fr/~bousch/exifdump.py)">http://topo.math.u-psud.fr/~bousch/exifdump.py)</A> or Jhead
(<A HREF="http://www.sentex.net/~mwandel/jhead).">http://www.sentex.net/~mwandel/jhead).</A>
<P>
A Python EXIF library and dumper: <A HREF="http://pyexif.sourceforge.net.">http://pyexif.sourceforge.net.</A>
<P>
Latex2html converts Latex document source to HTML document source. Part
of that involves graphics, and Latex2html uses Netpbm tools for some of
that. But Latex2html through its history has had some rather esoteric
codependencies with Netpbm. Older Latex2html doesn't work with current
Netpbm. Latex2html-99.2beta8 works, though.
<P>
<P>
<A NAME="lbAR">&nbsp;</A>
<H3>Other Graphics Formats</H3>
<P>
People never seem to tire of inventing new graphics formats, often
completely redundant with pre-existing ones. Netpbm cannot keep up
with them. Here is a list of a few that we know Netpbm does
<I>not</I>
handle (yet).
<P>
<BR>&nbsp;&nbsp;CAL&nbsp;(originated&nbsp;by&nbsp;US&nbsp;Department&nbsp;Of&nbsp;Defense,&nbsp;favored&nbsp;by&nbsp;architects).
<A HREF="http://www.landfield.com/faqs/graphics/fileformats-faq/part3/section-24.html">http://www.landfield.com/faqs/graphics/fileformats-faq/part3/section-24.html</A>
<P>
<BR>&nbsp;&nbsp;array&nbsp;formats&nbsp;dx,&nbsp;general,&nbsp;netcdf,&nbsp;CDF,&nbsp;hdf,&nbsp;cm
<P>
<BR>&nbsp;&nbsp;CGM+
<P>
<BR>&nbsp;&nbsp;Windows&nbsp;Meta&nbsp;File&nbsp;(.WMF).&nbsp;&nbsp;Libwmf&nbsp;converts&nbsp;from&nbsp;WMF&nbsp;to&nbsp;things&nbsp;like&nbsp;
Latex, PDF, PNG. Some of these can be input to Netpbm.
<P>
<BR>&nbsp;&nbsp;Microsoft&nbsp;Word,&nbsp;RTF.&nbsp;&nbsp;Microsoft&nbsp;keeps&nbsp;a&nbsp;proprietary&nbsp;hold&nbsp;on&nbsp;these&nbsp;formats.
Any software you see that can handle them is likely to cost money.
<P>
<BR>&nbsp;&nbsp;DXF&nbsp;(AutoCAD)
<P>
<A NAME="lbAS">&nbsp;</A>
<H2>HISTORY</H2>
<P>
Netpbm has a long history, starting with Jef Poskanzer's
<B>Pbmplus</B>
package in 1988. The file
<I>HISTORY</I>
in the Netpbm source code contains a historical overview as well as a
detailed history release by release.
<P>
<A NAME="lbAT">&nbsp;</A>
<H2>AUTHOR</H2>
<P>
<B>Netpbm </B>
is based on the
<B>Pbmplus</B>
package by Jef Poskanzer, first distributed in 1988 and maintained by
him until 1991. But the package contains work by countless other
authors, added since Jef's original work. In fact, the name is
derived from the fact that the work was contributed by people all over
the world via the Internet, when such collaboration was still novel
enough to merit naming the package after it.
<P>
Bryan Henderson has been maintaining
<B>Netpbm</B>
since 1999. In addition to packaging work by others, Bryan has also
written a significant amount of new material for the package.
<P>
<P>
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="237"><A HREF="#lbAB">NAME</A><DD>
<DT id="238"><A HREF="#lbAC">DESCRIPTION</A><DD>
<DT id="239"><A HREF="#lbAD">The Netpbm Formats</A><DD>
<DT id="240"><A HREF="#lbAE">Implied Format Conversion</A><DD>
<DT id="241"><A HREF="#lbAF">Netpbm and Transparency</A><DD>
<DT id="242"><A HREF="#lbAG">The Netpbm Programs</A><DD>
<DT id="243"><A HREF="#lbAH">Common Options</A><DD>
<DL>
<DT id="244"><A HREF="#lbAI">Converters</A><DD>
<DT id="245"><A HREF="#lbAJ">Image Generators</A><DD>
<DT id="246"><A HREF="#lbAK">Image Editors</A><DD>
<DT id="247"><A HREF="#lbAL">Image Analyzers</A><DD>
<DT id="248"><A HREF="#lbAM">Miscellaneous</A><DD>
<DT id="249"><A HREF="#lbAN">Uncatalogued As Yet</A><DD>
</DL>
<DT id="250"><A HREF="#lbAO">The Netpbm Libraries</A><DD>
<DL>
<DT id="251"><A HREF="#lbAP">Application Notes</A><DD>
<DT id="252"><A HREF="#lbAQ">Other Graphics Software</A><DD>
<DT id="253"><A HREF="#lbAR">Other Graphics Formats</A><DD>
</DL>
<DT id="254"><A HREF="#lbAS">HISTORY</A><DD>
<DT id="255"><A HREF="#lbAT">AUTHOR</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:20 GMT, March 31, 2021
</BODY>
</HTML>