Blob Blame History Raw
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML><HEAD><TITLE>Pnmshear User Manual</TITLE></HEAD>
<BODY>
<H1>pnmshear</H1>
Updated: 27 November 2006
<BR>
<A HREF="#index">Table Of Contents</A>

<H2>NAME</H2>

pnmshear - shear a PNM image by a specified angle

<H2 id="synopsis">SYNOPSIS</H2>

<B>pnmshear</B>

[<B>-noantialias</B>] [<B>-background=</B><I>color</I>]
<I>angle</I> [<I>pnmfile</I>]

<P>All options can be abbreviated to their shortest unique prefix.
You may use two hyphens instead of one to designate an option.  You
may use either white space or equals signs between an option name and
its value.

<H2 id="description">DESCRIPTION</H2>

<p>This program is part of <a href="index.html">Netpbm</a>.

<p><b>pnmshear</b> reads a PNM image as input and shears it by the
specified angle and produce a PNM image 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:

<PRE>
    +-------+  +-------+
    |       |  |\       \
    |  OLD  |  | \  NEW  \
    |       |  |an\       \
    +-------+  |gle+-------+
</PRE>

If the angle is negative, it shears the other way:
<PRE>
    +-------+  |-an+-------+
    |       |  |gl/       /
    |  OLD  |  |e/  NEW  /
    |       |  |/       /
    +-------+  +-------+
</PRE>

The angle should not get too close to 90 or -90, or the resulting
image will be unreasonably wide.

<P><b>pnmshear</b> does the shearing by looping over the source pixels
and distributing fractions to each of the destination pixels.  This
has an "anti-aliasing" effect - it avoids jagged edges and
similar artifacts.  However, it also means that the original colors in
the image are modified and there are typically more of them than you
started with.  If you need to keep precisely the same set of colors,
see the <B>-noantialias</B> option.  If the expanded palette is a
problem, you can run the result through <b>pnmquant</b>.

<H2 id="options">OPTIONS</H2>

<DL COMPACT>
<DT><b>-background=</b><i>color</i>

<DD>This determines the color of the background on which the sheared image
sits.

<P>Specify the color (<i>color</i>) as described for the <a
href="libppm.html#colorname">argument of the <b>ppm_parsecolor()</b>
library routine</a>.

<p>By default, if you don't specify this option, <b>pnmshear</b> selects
what appears to it to be the background color of the original image.  It 
determines this color rather simplistically, by taking an average of the colors
of the two top corners of the image.

<p>This option was new in Netpbm 10.37 (December 2006).  Before that,
<b>pnmshear</b> always behaved as is the default now.

<dt><b>-noantialias</b>

<dd>This option forces <b>pnmshear</b> to simply move pixels around instead 
of synthesizing output pixels from multiple input pixels.  The latter could
cause the output to contain colors that are not in the input, which may not
be desirable.  It also probably makes the output contain a large number of
colors.  If you need a small number of colors, but it doesn't matter if they
are the exact ones from the input, consider using <b>pnmquant</B> on the 
output instead of using <b>-noantialias</b>.

<p>Note that to ensure the output does not contain colors that are not
in the input, you also must consider the background color.  See the
<b>-background</b> option.

</dl>

<H2 id="seealso">SEE ALSO</H2>

<A HREF="pnmrotate.html">pnmrotate</A>,
<A HREF="pamflip.html">pamflip</A>,
<A HREF="pnmquant.html">pnmquant</A>,
<A HREF="pnm.html">pnm</A>


<H2 id="author">AUTHOR</H2>

Copyright (C) 1989, 1991 by Jef Poskanzer.

<HR>
<A NAME="index">&nbsp;</A>
<H2>Table Of Contents</H2>
<UL>
<LI><A HREF="#synopsis">SYNOPSIS</A>
<LI><A HREF="#description">DESCRIPTION</A>
<LI><A HREF="#options">OPTIONS</A>
<LI><A HREF="#seealso">SEE ALSO</A>
<LI><A HREF="#author">AUTHOR</A>
</UL>
</BODY>
</HTML>