📄 0394-0396.html
字号:
<HTML>
<HEAD>
<TITLE>Linux Complete Command Reference:User Commands:EarthWeb Inc.-</TITLE>
</HEAD>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>
-->
<!-- ISBN=0672311046 //-->
<!-- TITLE=Linux Complete Command Reference//-->
<!-- AUTHOR=Red Hat//-->
<!-- PUBLISHER=Macmillan Computer Publishing//-->
<!-- IMPRINT=Sams//-->
<!-- CHAPTER=01 //-->
<!-- PAGES=0001-0736 //-->
<!-- UNASSIGNED1 //-->
<!-- UNASSIGNED2 //-->
<P><CENTER>
<a href="0391-0393.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0397-0399.html">Next</A></CENTER></P>
<A NAME="PAGENUM-394"><P>Page 394</P></A>
<P><B>
DESCRIPTION
</B>
</P>
<P>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).
</P>
<P>You can specify one dimension as a pixel size, and the other dimension will be scaled correspondingly.
</P>
<P>You can specify one dimension as a scale, and the other dimension will not be scaled.
</P>
<P>You can specify different sizes or scales for each axis.
</P>
<P>You can use the special -xysize flag, which fits the image into the specified size without changing the aspect ratio.
</P>
<P>Or, you can use the _pixels flag, which fits the image into the specified number of pixels without changing the aspect ratio.
</P>
<P>All flags can be abbreviated to their shortest unique prefix.
</P>
<P>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.
</P>
<P><B>
SEE ALSO
</B>
</P>
<!-- CODE SNIP //-->
<PRE>pbmreduce(1), pnmenlarge(1), pnmsmooth(1), pnm(5)
</PRE>
<!-- END CODE SNIP //-->
<P><B>
AUTHOR
</B>
</P>
<P>Copyright " 1989, 1991 by Jef Poskanzer.
</P>
<P>12 January 1991
</P>
<H3><A NAME="ch01_ 281">
pnmshear
</A></H3>
<P>pnmshear—Shear a portable anymap by some angle
</P>
<P><B>
SYNOPSIS
</B>
</P>
<!-- CODE SNIP //-->
<PRE>
pnmshear [-noantialias] angle [pnmfile]
</PRE>
<!-- END CODE SNIP //-->
<P><B>
DESCRIPTION
</B>
</P>
<P>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:
</P>
<!-- CODE SNIP //-->
<PRE>
+----+ +----+
|||\\
| OLD||\NEW \
|||an\\
+----+ |gle+----+
</PRE>
<!-- END CODE SNIP //-->
<P>If the angle is negative, it shears the other way:
</P>
<!-- CODE SNIP //-->
<PRE>
+----+ |-an+----+
|||gl//
| OLD ||e/ NEW /
|||//
+----+ +----+
</PRE>
<!-- END CODE SNIP //-->
<P>The angle should not get too close to 90 or -90, or the resulting anymap will be unreasonably wide.
</P>
<P>The shearing is implemented by looping over the source pixels and distributing fractions to each of the destination
pixels. This has an antialiasing effect—it 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.
</P>
<A NAME="PAGENUM-395"><P>Page 395</P></A>
<P>
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.
</P>
<P>All flags can be abbreviated to their shortest unique prefix.
</P>
<P><B>
SEE ALSO
</B>
</P>
<!-- CODE SNIP //-->
<PRE>
pnmrotate(1), pnmflip(1), pnm(5), ppmquant(1)
</PRE>
<!-- END CODE SNIP //-->
<P><B>
AUTHOR
</B>
</P>
<P>Copyright " 1989, 1991 by Jef Poskanzer.
</P>
<P>12 January 1991
</P>
<H3><A NAME="ch01_ 282">
pnmsmooth
</A></H3>
<P>pnmsmooth—Smooth out an image
</P>
<P><B>
SYNOPSIS
</B>
</P>
<!-- CODE SNIP //-->
<PRE>
pnmsmooth [pnmfile]
</PRE>
<!-- END CODE SNIP //-->
<P><B>
DESCRIPTION
</B>
</P>
<P>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.
</P>
<P><B>
SEE ALSO
</B>
</P>
<!-- CODE SNIP //-->
<PRE>pnmconvol(1), pnm(5)
</PRE>
<!-- END CODE SNIP //-->
<P><B>
BUGS
</B>
</P>
<P>It's a script. Scripts are not portable to non-UNIX environments.
</P>
<P><B>
AUTHOR
</B>
</P>
<P>Copyright " 1989, 1991 by Jef Poskanzer
</P>
<P>13 January 1991
</P>
<H3><A NAME="ch01_ 283">
pnmtile
</A></H3>
<P>pnmtile—Replicate a portable anymap into a specified size
</P>
<P><B>
SYNOPSIS
</B>
</P>
<!-- CODE SNIP //-->
<PRE>
pnmtile width height [pnmfile]
</PRE>
<!-- END CODE SNIP //-->
<P><B>
DESCRIPTION
</B>
</P>
<P>pnmtile reads a portable anymap as input, replicates it until it is the specified size, and produces a portable anymap as output.
</P>
<P><B>
SEE ALSO
</B>
</P>
<!-- CODE SNIP //-->
<PRE>
pnm(5)
</PRE>
<!-- END CODE SNIP //-->
<P><B>
AUTHOR
</B>
</P>
<P>Copyright " 1989 by Jef Poskanzer.
</P>
<P>13 May 1989
</P>
<A NAME="PAGENUM-396"><P>Page 396</P></A>
<H3><A NAME="ch01_ 284">
pnmtoddif
</A></H3>
<P>pnmtoddif—Convert a portable anymap to DDIF format
</P>
<P><B>
SYNTAX
</B></P>
<!-- CODE SNIP //-->
<PRE>
pnmtoddif pnmtoddif [-resolution x y] [pnmfile [ddiffile]]
</PRE>
<!-- END CODE SNIP //-->
<P><B>
OPTIONS
</B>
</P>
<TABLE>
<TR><TD>
resolution x y
</TD><TD>
The horizontal and vertical resolution of the output image in dots per inch. Defaults to
78dpi.
</TD></TR><TR><TD>
pnmfile
</TD><TD>
The filename for the image file in PNM format. If this argument is omitted, input is read from
stdin.
</TD></TR><TR><TD>
ddiffile
</TD><TD>
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.
</TD></TR></TABLE>
<P><B>
DESCRIPTION
</B>
</P>
<P>pnmtoddif takes a portable anymap from standard input and converts it into a DDIF image file on standard output or
the specified DDIF file.
</P>
<P>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.
</P>
<P>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.
</P>
<P><B>
AUTHOR
</B>
</P>
<P>Burkhard Neidecker-Lutz<BR>
Digital Equipment Corporation, CEC Karlsruhe<BR>
neideck@nestvx.enet.dec.com
</P>
<H3><A NAME="ch01_ 285">
pnmtofits
</A></H3>
<P>pnmtofits—Convert a portable anymap into FITS format
</P>
<P><B>
SYNOPSIS
</B>
</P>
<!-- CODE SNIP //-->
<PRE>
pnmtofits [_max f][_min f][pnmfile]
</PRE>
<!-- END CODE SNIP //-->
<P><B>
DESCRIPTION
</B>
</P>
<P>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.
</P>
<P><B>
OPTIONS
</B>
</P>
<P>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.
</P>
<P><B>
SEE ALSO
</B>
</P>
<P>fitstopnm(1), pgm(5)
</P>
<P><CENTER>
<a href="0391-0393.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0397-0399.html">Next</A></CENTER></P>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -