# man > pnmshear(1)

> **TLDR:** Shear a PNM image.
>
- Shear a PNM image by the specified angle:
  `pnmshear {{angle}} {{path/to/input.pnm}} > {{path/to/output.pnm}}`
- Specify the color of the background in the sheared image:
  `pnmshear {{-b|-background}} {{blue}} {{angle}} {{path/to/input.pnm}} > {{path/to/output.pnm}}`
- Do not perform anti-aliasing:
  `pnmshear {{-n|-noantialias}} {{angle}} {{path/to/input.pnm}} > {{path/to/output.pnm}}`

*Source: tldr-pages*

---

_Pnmshear_ _User_ [_Manual_(1)](https://www.chedong.com/phpMan.php/man/Manual/1/markdown)                General Commands Manual               _Pnmshear_ _User_ [_Manual_(1)](https://www.chedong.com/phpMan.php/man/Manual/1/markdown)

## NAME
       pnmshear - shear a PNM image by a specified angle


## SYNOPSIS
### pnmshear

       [**-noantialias**] [**-background=_**color_] _angle_ [_pnmfile_]

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


## DESCRIPTION
       This program is part of [**Netpbm**(1)](https://www.chedong.com/phpMan.php/man/Netpbm/1/markdown).

       **pnmshear  **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:

           +-------+  +-------+
           |       |  |\       \
           |  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 image will be  unreasonably
       wide.  In fact, if it gets too close, the width will be so large that **pnmshear **cannot do com‐
       putations in the word sizes it uses, and the program detects this and fails.

       **pnmshear  **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 mod‐
       ified  and  there are typically more of them than you started with.  If you need to keep pre‐
       cisely the same set of colors, see the **-noantialias **option.  If the  expanded  palette  is  a
       problem, you can run the result through **pnmquant**.


## OPTIONS
       In  addition  to  the options common to all programs based on libnetpbm (most notably **-quiet**,
       see ]8;;index.html#commonoptions\ Common Options]8;;\ ), **pnmshear **recognizes the following command line options:



### -background=_
              This determines the color of the background on which the sheared image sits.

              Specify the color (_color_) as described  for  the  ]8;;libnetpbm_image.html#colorname\argument of the **pnm_parsecolor() **li‐
              brary routine]8;;\ .

              By  default,  if you don't specify this option, **pnmshear **selects what appears to it to
              be the background color of the original image.  It determines this color  rather  sim‐
              plistically, by taking an average of the colors of the two top corners of the image.

              This option was new in Netpbm 10.37 (December 2006).  Before that, **pnmshear **always be‐
              haved as is the default now.


### -noantialias
              This  option forces **pnmshear **to simply move pixels around instead of synthesizing out‐
              put 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 **pn‐**
              **mquant **on the output instead of using **-noantialias**.

              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 **-background **option.




## SEE ALSO
       [**pnmrotate**(1)](https://www.chedong.com/phpMan.php/man/pnmrotate/1/markdown), [**pamflip**(1)](https://www.chedong.com/phpMan.php/man/pamflip/1/markdown), [**pamhomography**(1)](https://www.chedong.com/phpMan.php/man/pamhomography/1/markdown), [**pnmquant**(1)](https://www.chedong.com/phpMan.php/man/pnmquant/1/markdown), [**pamrestack**(1)](https://www.chedong.com/phpMan.php/man/pamrestack/1/markdown), [**pnm**(1)](https://www.chedong.com/phpMan.php/man/pnm/1/markdown)



## AUTHOR
       Copyright (C) 1989, 1991 by Jef Poskanzer.

## DOCUMENT SOURCE
       This  manual  page  was  generated by the Netpbm tool 'makeman' from HTML source.  The master
       documentation is at

              **<http://netpbm.sourceforge.net/doc/pnmshear.html>**

netpbm documentation                        22 March 2020                    _Pnmshear_ _User_ [_Manual_(1)](https://www.chedong.com/phpMan.php/man/Manual/1/markdown)
