pnmscale - scale a PNM image
SYNOPSIS
pnmscale scale_factor [pnmfile]
pnmscale [{-xsize=cols | -width=cols | -xscale=factor}]
[{-ysize=rows | -height=rows | -yscale=factor}] [pnmfile]
pnmscale -xysize cols rows [pnmfile]
pnmscale -pixels n [pnmfile]
Miscellaneous options:
-verbose
Minimum unique abbreviation of option is acceptable.
DESCRIPTION
Reads a PBM, PGM, or PPM image as input, scales it by the
specified factor or factors and produces a PGM or PPM
image as output. If the input file is in color (PPM), the
output will be too, otherwise it will be grayscale (PGM).
This is true even if the input is a black and white bitmap
(PBM), because the process of scaling can turn a combina
tion of black and white pixels into a gray pixel.
If you want PBM output, use pgmtopbm to convert pnmscale's
output to PBM. Also consider pbmreduce.
You can both enlarge (scale factor > 1) and reduce (scale
factor < 1).
When you specify an absolute size or scale factor for both
dimensions, pnmscale scales each dimension independently
without consideration of the aspect ratio.
If you specify one dimension as a pixel size and don't
specify the other dimension, pnmscale scales the unspeci
fied dimension to preserve the aspect ratio.
If you specify one dimension as a scale factor and don't
specify the other dimension, pnmscale leaves the unspeci
fied dimension unchanged from the input.
If you specify the scale_factor parameter instead of
dimension options, that is the scale factor for both
dimensions. It is equivalent to -xscale=scale_factor
-yscale=scale_factor .
-xysize specifies a bounding box. pnmscale scales the
input image to the largest size that fits within the box,
while preserving its aspect ratio.
-pixels specifies a maximum total number of output pixels.
If the input image is already no more than that many pix
els, pnmscale just copies it as output; pnmscale does not
scale up with -pixels.
If you enlarge by a factor of 3 or more, you should proba
bly add a pnmsmooth step; otherwise, you can see the orig
inal pixels in the resulting image.
PRECISION
pnmscale uses floating point arithmetic internally. There
is a speed cost associated with this. For some images,
you can get the acceptable results (in fact, sometimes
identical results) faster with pnmscalefixed, which uses
fixed point arithmetic. pnmscalefixed may, however, dis
tort your image a little. See pnmscalefixed's man page
for a complete discussion of the difference.
SEE ALSO
pnmscalefixed(1), pnminterp(1), pbmreduce(1), pnmen
large(1), pnmsmooth(1), pnmcut(1), pnm(5)
AUTHOR
Copyright (C) 1989, 1991 by Jef Poskanzer.
Man(1) output converted with
man2html