179 lines
4.8 KiB
HTML
179 lines
4.8 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of pgmtopbm</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>pgmtopbm</H1>
|
|
Section: User Commands (1)<BR>Updated: 26 July 1988<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="ixAAB"></A>
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
pgmtopbm - convert a portable graymap into a portable bitmap
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<B>pgmtopbm</B>
|
|
|
|
[<B>-floyd</B>|<B>-fs</B>|<B>-threshold</B>
|
|
|
|
|<B>-hilbert</B>
|
|
|
|
|<B>-dither8</B>|<B>-d8</B>|<B>-cluster3</B>
|
|
|
|
|<B>-c3</B>|<B>-cluster4</B>|<B>-c4</B>
|
|
|
|
|<B>-cluster8</B>|<B>-c8</B>]
|
|
|
|
[<B>-value</B>
|
|
|
|
<I>val</I>]
|
|
|
|
[<B>-clump</B>
|
|
|
|
<I>size</I>]
|
|
|
|
[<I>pgmfile</I>]
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
Reads a portable graymap as input.
|
|
Produces a portable bitmap as output.
|
|
<A NAME="ixAAC"></A>
|
|
<P>
|
|
|
|
Note that there is no pbmtopgm converter. Any program that uses the Netpbm
|
|
libraries to read PGM files, including virtually all programs in the Netpbm
|
|
package, will read a PBM file automatically as if it were a PGM file.
|
|
<P>
|
|
If you are using a less intelligent program that expects PGM input,
|
|
use
|
|
<B>pnmdepth</B>
|
|
|
|
to convert the PBM file to PGM. As long as the depth is greater than 1,
|
|
<B>pnmdepth</B>
|
|
|
|
will generate PGM. This less intelligent program quite probably is also
|
|
not intelligent enough to deal with general maxvals, so you should specify
|
|
a depth of 255.
|
|
<P>
|
|
<A NAME="lbAE"> </A>
|
|
<H2>OPTIONS</H2>
|
|
|
|
<P>
|
|
|
|
The default quantization method is boustrophedonic Floyd-Steinberg error
|
|
diffusion
|
|
(<B>-floyd</B>
|
|
|
|
or
|
|
<B>-fs</B>).
|
|
|
|
<A NAME="ixAAD"></A>
|
|
<A NAME="ixAAE"></A>
|
|
Also available are simple thresholding
|
|
(<B>-threshold</B>);
|
|
|
|
<A NAME="ixAAF"></A>
|
|
Bayer's ordered dither
|
|
(<B>-dither8</B>)
|
|
|
|
with a 16x16 matrix; and three different sizes of 45-degree clustered-dot dither
|
|
(<B>-cluster3</B>,
|
|
|
|
<B>-cluster4</B>,
|
|
|
|
<B>-cluster8</B>).
|
|
|
|
A space filling curve halftoning method using the Hilbert curve is also
|
|
available.
|
|
(<B>-hilbert</B>);
|
|
|
|
<A NAME="ixAAG"></A>
|
|
<P>
|
|
|
|
Floyd-Steinberg will almost always give the best looking results; however,
|
|
looking good is not always what you want.
|
|
For instance, thresholding can be used in a pipeline with the
|
|
<I>pnmconvol</I>
|
|
|
|
<A NAME="ixAAH"></A>
|
|
tool, for tasks like edge and peak detection.
|
|
And clustered-dot dithering gives a newspaper-ish look, a useful special effect.
|
|
<P>
|
|
|
|
The
|
|
<B>-value</B>
|
|
|
|
flag alters the thresholding value for Floyd-Steinberg and
|
|
simple thresholding.
|
|
It should be a real number between 0 and 1.
|
|
Above 0.5 means darker images; below 0.5 means lighter.
|
|
<P>
|
|
|
|
The Hilbert curve method is useful for processing images before display
|
|
on devices that do not render individual pixels distinctly (like laser
|
|
printers). This dithering method can give better results than the
|
|
dithering usually done by the laser printers themselves.
|
|
The
|
|
<B>-clump</B>
|
|
|
|
flag alters the number of pixels in a clump. This is usually an
|
|
integer between 2 and 100 (default 5). Smaller clump sizes smear the
|
|
image less and are less grainy, but seem to loose some grey scale
|
|
linearity. Typically a PGM image will have to be scaled to fit on a
|
|
laser printer page (2400 x 3000 pixels for an A4 300 dpi page), and
|
|
then dithered to a PBM image before being converted to a postscript file.
|
|
A printing pipeline might look something like:
|
|
pnmscale -xysize 2400 3000 image.pgm | pgmtopbm -hil | pnmtops -scale 0.25 > image.ps
|
|
<P>
|
|
|
|
All flags can be abbreviated to their shortest unique prefix.
|
|
<A NAME="lbAF"> </A>
|
|
<H2>REFERENCES</H2>
|
|
|
|
The only reference you need for this stuff is "Digital Halftoning" by
|
|
Robert Ulichney, MIT Press, ISBN 0-262-21009-6.
|
|
<P>
|
|
|
|
The Hilbert curve space filling method is taken from
|
|
"Digital Halftoning with Space Filling Curves" by Luiz Velho,
|
|
Computer Graphics Volume 25, Number 4, proceedings of SIGRAPH '91,
|
|
page 81. ISBN 0-89791-436-8
|
|
<A NAME="lbAG"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<A HREF="/cgi-bin/man/man2html?1+pbmreduce">pbmreduce</A>(1), <A HREF="/cgi-bin/man/man2html?5+pgm">pgm</A>(5), <A HREF="/cgi-bin/man/man2html?5+pbm">pbm</A>(5), <A HREF="/cgi-bin/man/man2html?1+pnmconvol">pnmconvol</A>(1), <A HREF="/cgi-bin/man/man2html?1+pnmscale">pnmscale</A>(1), <A HREF="/cgi-bin/man/man2html?1+pnmtops">pnmtops</A>(1)
|
|
<A NAME="lbAH"> </A>
|
|
<H2>AUTHOR</H2>
|
|
|
|
Copyright (C) 1989 by Jef Poskanzer.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="1"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="2"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="3"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="4"><A HREF="#lbAE">OPTIONS</A><DD>
|
|
<DT id="5"><A HREF="#lbAF">REFERENCES</A><DD>
|
|
<DT id="6"><A HREF="#lbAG">SEE ALSO</A><DD>
|
|
<DT id="7"><A HREF="#lbAH">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:23 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|