-->

Previous | Table of Contents | Next

Page 375

Options

-lr A left to right ramp
-tb A top to bottom ramp
-rectangle A rectangular ramp
-ellipse An elliptical ramp

All flags can be abbreviated to their shortest unique prefix.

SEE ALSO

pnmarith(1), pgm(5)

AUTHOR

Copyright " 1989 by Jef Poskanzer.

24 November 1989

pgmtexture

pgmtexture—Calculate textural features on a portable graymap

SYNOPSIS


pgmtexture [-d d][pgmfile]

DESCRIPTION

pgmtexture reads a portable graymap as input. Calculates textural features based on spatial dependence matrices at 0, 45, 90, and 135 degrees for a distance d (default = 1). Textural features include

(1) Angular Second Moment (2)
Contrast
(3) Correlation
(4) Variance
(5) Inverse Difference Moment
(6) Sum Average
(7) Sum Variance
(8) Sum Entropy
(9) Entropy
(10) Difference Variance
(11) Difference Entropy
(12, 13) Information Measures of Correlation
(14) Maximal Correlation Coefficient

Algorithm taken from "Textural Features for Image Classification," IEEE Transactions on Systems, Man, and Cybertinetics, R.M. Haralick, K. Shanmugam, and I. Dinstein, 1973. SMC-3(6):610_621.

BUGS

The program can run incredibly slowly for large images (larger than 64¥64) and command-line options are limited. The method for finding the maximal correlation coefficient, which requires finding the second largest eigenvalue of a matrix Q, does not always converge.

REFERENCES

IEEE Transactions on Systems, Man, and Cybertinetics, SMC-3(6):610_621.

Page 376

SEE ALSO

pgm(5), pnmcut(1)

AUTHOR

Copyright " 1991 by Texas Agricultural Experiment Station, employer-for-hire of James Darrell McCauley.

22 August 1991

pgmtofs

pgmtofs—Convert portable graymap to Usenix FaceSaver format

SYNOPSIS


pgmtofs [pgmfile]

DESCRIPTION

pgmtofs reads a portable graymap as input. Produces Usenix FaceSaver format as output.

FaceSaver is a registered trademark of Metron Computerware Ltd. of Oakland, CA.

SEE ALSO


fstopgm(1), pgm(5)

AUTHOR

Copyright" 1991 by Jef Poskanzer.

18 May 1990

pgmtolispm

pgmtolispm—Convert a portable graymap into Lisp machine format

SYNOPSIS


pgmtolispm [pgmfile]

DESCRIPTION

pgmtolispm reads a portable graymap as input and produces a Lisp machine bitmap as output.

This is the file format read by the tv:read-bit-array-file function on TI Explorer and Symbolics Lisp machines.

Given a PGM (instead of a PBM), a multiplane image will be output. This is probably not useful unless you have a color Lisp machine.

Multiplane bitmaps on Lisp machines are color; but the lispm image file format does not include a colormap, so it must be treated as a graymap instead. This is unfortunate.

SEE ALSO


lispmtopgm(1), pgm(5)

BUGS

Output width is always rounded up to the nearest multiple of 32; this might not always be what you want, but it probably is (arrays that are not modulo 32 cannot be passed to the lispm BITBLT function, and thus cannot easily be displayed on the screen).

No color.

Page 377

Author

Copyright " 1991 by Jamie Zawinski and Jef Poskanzer.

6 March 1990

pgmtopbm

pgmtopbm—Convert a portable graymap into a portable bitmap

SYNOPSIS


pgmtopbm [-floyd|-fs|-threshold |-hilbert |-dither8|-d8|-cluster3

|-c3|-cluster4|-c4 |-cluster8|-c8][-value val][-clump size][pgmfile]

DESCRIPTION

pgmtopbm reads a portable graymap as input and produces a portable bitmap as output.

Note that there is no pbmtopgm converter because any pgm program can read PBM files automagically.

OPTIONS

The default quantization method is boustrophedonic Floyd-Steinberg error diffusion (-floyd or -fs). Also available are simple thresholding (-threshold); Bayer's ordered dither (-dither8) with a 16¥16 matrix; and three different sizes of 45-degree clustered-dot dither (-cluster3, -cluster4, -cluster8). A space-filling curve halftoning method using the Hilbert curve is also available. (-hilbert).

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 pnmconvol tool, for tasks like edge and peak detection. And clustered-dot dithering gives a newspaper-like look, a useful special effect. The -value 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.

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 -clump 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 grayscale linearity. Typically, a PGM image will have to be scaled to fit on a laser printer page (2400 ¥ 3000 pixels for an A4 300dpi page), and then dithered to a PBM image before being converted to a PostScript file. A printing pipeline might look something like this:


pnmscale -xysize 2400 3000 image.pgm | pgmtopbm -hil | pnmtops -scale 0.25 image.ps

All flags can be abbreviated to their shortest unique prefix.

REFERENCES

The only reference you need for this stuff is Digital Halftoning by Robert Ulichney, MIT Press, ISBN 0-262-21009-6.

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

SEE ALSO


pbmreduce(1), pgm(5), pbm(5), pnmconvol(1),

pnmscale(1), pnmtops(1)

AUTHOR

Copyright " 1989 by Jef Poskanzer.

26 July 1988

Previous | Table of Contents | Next