-->
Page 394
DESCRIPTION
pnmscale reads a portable anymap as input, scales it by the specified factor or factors, and produces a portable anymap as output. If the input file is in color, the output will be, too; otherwise, it will be grayscale. You can both enlarge (scale factor > 1) and reduce (scale factor < 1).
You can specify one dimension as a pixel size, and the other dimension will be scaled correspondingly.
You can specify one dimension as a scale, and the other dimension will not be scaled.
You can specify different sizes or scales for each axis.
You can use the special -xysize flag, which fits the image into the specified size without changing the aspect ratio.
Or, you can use the _pixels flag, which fits the image into the specified number of pixels without changing the aspect ratio.
All flags can be abbreviated to their shortest unique prefix.
If you enlarge by a factor of three or more, you should probably add a pnmsmooth step; otherwise, you can see the original pixels in the resulting image.
SEE ALSO
pbmreduce(1), pnmenlarge(1), pnmsmooth(1), pnm(5)
AUTHOR
Copyright " 1989, 1991 by Jef Poskanzer.
12 January 1991
pnmshearShear a portable anymap by some angle
SYNOPSIS
pnmshear [-noantialias] angle [pnmfile]
DESCRIPTION
pnmshear reads a portable anymap as input, shears it by the specified angle, and produces a portable anymap as output. If the input file is in color, the output will be too; otherwise, it will be grayscale. The angle is in degrees (floating-point), and measures this:
+----+ +----+ |||\\ | OLD||\NEW \ |||an\\ +----+ |gle+----+
If the angle is negative, it shears the other way:
+----+ |-an+----+ |||gl// | OLD ||e/ NEW / |||// +----+ +----+
The angle should not get too close to 90 or -90, or the resulting anymap will be unreasonably wide.
The shearing is implemented by looping over the source pixels and distributing fractions to each of the destination pixels. This has an antialiasing effectit avoids jagged edges and similar artifacts. However, it also means that the original colors or gray levels in the image are modified. If you need to keep precisely the same set of colors, you can use the -noantialias flag.
Page 395
This does the shearing by moving pixels without changing their values. If you want antialiasing and don't care about the precise colors, but still need a limited *number* of colors, you can run the result through ppmquant.
All flags can be abbreviated to their shortest unique prefix.
SEE ALSO
pnmrotate(1), pnmflip(1), pnm(5), ppmquant(1)
AUTHOR
Copyright " 1989, 1991 by Jef Poskanzer.
12 January 1991
pnmsmoothSmooth out an image
SYNOPSIS
pnmsmooth [pnmfile]
DESCRIPTION
pnmsmooth smooths out an image by replacing each pixel with the average of its nine immediate neighbors. It is implemented as a simple script using pnmconvol.
SEE ALSO
pnmconvol(1), pnm(5)
BUGS
It's a script. Scripts are not portable to non-UNIX environments.
AUTHOR
Copyright " 1989, 1991 by Jef Poskanzer
13 January 1991
pnmtileReplicate a portable anymap into a specified size
SYNOPSIS
pnmtile width height [pnmfile]
DESCRIPTION
pnmtile reads a portable anymap as input, replicates it until it is the specified size, and produces a portable anymap as output.
SEE ALSO
pnm(5)
AUTHOR
Copyright " 1989 by Jef Poskanzer.
13 May 1989
Page 396
pnmtoddifConvert a portable anymap to DDIF format
SYNTAX
pnmtoddif pnmtoddif [-resolution x y] [pnmfile [ddiffile]]
OPTIONS
resolution x y | The horizontal and vertical resolution of the output image in dots per inch. Defaults to 78dpi. |
pnmfile | The filename for the image file in PNM format. If this argument is omitted, input is read from stdin. |
ddiffile | The filename for the image file to be created in DDIF format. If this argument is omitted, the ddiffile is written to standard output. It can only specified if a pnmfile is also specified. |
DESCRIPTION
pnmtoddif takes a portable anymap from standard input and converts it into a DDIF image file on standard output or the specified DDIF file.
PBM format (bitmap) data is written as 1-bit DDIF, PGM format data (grayscale) as 8-bit grayscale DDIF, and PPM format data is written as 8,8,8-bit color DDIF. All DDIF image files are written as uncompressed. The data plane organization is interleaved by pixel.
In addition to the number of pixels in the width and height dimension, DDIF images also carry information about the size that the image should have, that is, the physical space that a pixel occupies. PBMPLUS images do not carry this information, hence it has to be externally supplied. The default of 78dpi has the beneficial property of not causing a resize on most Digital Equipment Corporation color monitors.
AUTHOR
Burkhard Neidecker-Lutz
Digital Equipment Corporation, CEC Karlsruhe
neideck@nestvx.enet.dec.com
pnmtofitsConvert a portable anymap into FITS format
SYNOPSIS
pnmtofits [_max f][_min f][pnmfile]
DESCRIPTION
pnmtofits reads a portable anymap as input and produces a FITS (Flexible Image Transport System) file as output. The resolution of the output file is either 8 bits/pixel, or 16 bits/pixel, depending on the value of maxval in the input file. If the input file is a portable bitmap or a portable graymap, the output file consists of a single plane image (NAXIS = 2). If instead the input file is a portable pixmap, the output file will consist of a three-plane image (NAXIS = 3, NAXIS3 = 3). A full description of the FITS format can be found in Astronomy & Astrophysics Supplement Series 44 (1981), page 363.
OPTIONS
Flags _min and _max can be used to set DATAMAX, DATAMIN, BSCALE, and BZERO in the FITS header, but do not cause the data to be rescaled.
SEE ALSO
fitstopnm(1), pgm(5)