| 1 |
\ |
| 2 |
.\" This man page was generated by the Netpbm tool 'makeman' from HTML source. |
| 3 |
.\" Do not hand-hack it! If you have bug fixes or improvements, please find |
| 4 |
.\" the corresponding HTML page on the Netpbm website, generate a patch |
| 5 |
.\" against that, and send it to the Netpbm maintainer. |
| 6 |
.TH "Pnmshear User Manual" 1 "22 March 2020" "netpbm documentation" |
| 7 |
|
| 8 |
.SH NAME |
| 9 |
pnmshear - shear a PNM image by a specified angle |
| 10 |
|
| 11 |
.UN synopsis |
| 12 |
.SH SYNOPSIS |
| 13 |
|
| 14 |
\fBpnmshear\fP |
| 15 |
|
| 16 |
[\fB-noantialias\fP] [\fB-background=\fP\fIcolor\fP] |
| 17 |
\fIangle\fP [\fIpnmfile\fP] |
| 18 |
.PP |
| 19 |
All options can be abbreviated to their shortest unique prefix. |
| 20 |
You may use two hyphens instead of one to designate an option. You |
| 21 |
may use either white space or equals signs between an option name and |
| 22 |
its value. |
| 23 |
|
| 24 |
.UN description |
| 25 |
.SH DESCRIPTION |
| 26 |
.PP |
| 27 |
This program is part of |
| 28 |
.BR "Netpbm" (1)\c |
| 29 |
\&. |
| 30 |
.PP |
| 31 |
\fBpnmshear\fP reads a PNM image as input and shears it by the |
| 32 |
specified angle and produce a PNM image as output. If the input file |
| 33 |
is in color, the output will be too, otherwise it will be grayscale. |
| 34 |
The angle is in degrees (floating point), and measures this: |
| 35 |
|
| 36 |
.nf |
| 37 |
+-------+ +-------+ |
| 38 |
| | |\e \e |
| 39 |
| OLD | | \e NEW \e |
| 40 |
| | |an\e \e |
| 41 |
+-------+ |gle+-------+ |
| 42 |
|
| 43 |
.fi |
| 44 |
|
| 45 |
If the angle is negative, it shears the other way: |
| 46 |
.nf |
| 47 |
+-------+ |-an+-------+ |
| 48 |
| | |gl/ / |
| 49 |
| OLD | |e/ NEW / |
| 50 |
| | |/ / |
| 51 |
+-------+ +-------+ |
| 52 |
|
| 53 |
.fi |
| 54 |
|
| 55 |
The angle should not get too close to 90 or -90, or the resulting image will |
| 56 |
be unreasonably wide. In fact, if it gets too close, the width will be so |
| 57 |
large that \fBpnmshear\fP cannot do computations in the word sizes it uses, |
| 58 |
and the program detects this and fails. |
| 59 |
.PP |
| 60 |
\fBpnmshear\fP does the shearing by looping over the source pixels |
| 61 |
and distributing fractions to each of the destination pixels. This |
| 62 |
has an "anti-aliasing" effect - it avoids jagged edges and |
| 63 |
similar artifacts. However, it also means that the original colors in |
| 64 |
the image are modified and there are typically more of them than you |
| 65 |
started with. If you need to keep precisely the same set of colors, |
| 66 |
see the \fB-noantialias\fP option. If the expanded palette is a |
| 67 |
problem, you can run the result through \fBpnmquant\fP. |
| 68 |
|
| 69 |
.UN options |
| 70 |
.SH OPTIONS |
| 71 |
.PP |
| 72 |
In addition to the options common to all programs based on libnetpbm |
| 73 |
(most notably \fB-quiet\fP, see |
| 74 |
.UR index.html#commonoptions |
| 75 |
Common Options |
| 76 |
.UE |
| 77 |
\&), \fBpnmshear\fP recognizes the following |
| 78 |
command line options: |
| 79 |
|
| 80 |
|
| 81 |
.TP |
| 82 |
\fB-background=\fP\fIcolor\fP |
| 83 |
This determines the color of the background on which the sheared image |
| 84 |
sits. |
| 85 |
.sp |
| 86 |
Specify the color (\fIcolor\fP) as described for the |
| 87 |
.UR libnetpbm_image.html#colorname |
| 88 |
argument of the \fBpnm_parsecolor()\fP library routine |
| 89 |
.UE |
| 90 |
\&. |
| 91 |
.sp |
| 92 |
By default, if you don't specify this option, \fBpnmshear\fP selects |
| 93 |
what appears to it to be the background color of the original image. It |
| 94 |
determines this color rather simplistically, by taking an average of the colors |
| 95 |
of the two top corners of the image. |
| 96 |
.sp |
| 97 |
This option was new in Netpbm 10.37 (December 2006). Before that, |
| 98 |
\fBpnmshear\fP always behaved as is the default now. |
| 99 |
|
| 100 |
.TP |
| 101 |
\fB-noantialias\fP |
| 102 |
This option forces \fBpnmshear\fP to simply move pixels around instead |
| 103 |
of synthesizing output pixels from multiple input pixels. The latter could |
| 104 |
cause the output to contain colors that are not in the input, which may not |
| 105 |
be desirable. It also probably makes the output contain a large number of |
| 106 |
colors. If you need a small number of colors, but it doesn't matter if they |
| 107 |
are the exact ones from the input, consider using \fBpnmquant\fP on the |
| 108 |
output instead of using \fB-noantialias\fP. |
| 109 |
.sp |
| 110 |
Note that to ensure the output does not contain colors that are not |
| 111 |
in the input, you also must consider the background color. See the |
| 112 |
\fB-background\fP option. |
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
.UN seealso |
| 117 |
.SH SEE ALSO |
| 118 |
.BR "pnmrotate" (1)\c |
| 119 |
\&, |
| 120 |
.BR "pamflip" (1)\c |
| 121 |
\&, |
| 122 |
.BR "pamhomography" (1)\c |
| 123 |
\&, |
| 124 |
.BR "pnmquant" (1)\c |
| 125 |
\&, |
| 126 |
.BR "pamrestack" (1)\c |
| 127 |
\&, |
| 128 |
.BR "pnm" (1)\c |
| 129 |
\& |
| 130 |
|
| 131 |
|
| 132 |
.UN author |
| 133 |
.SH AUTHOR |
| 134 |
|
| 135 |
Copyright (C) 1989, 1991 by Jef Poskanzer. |
| 136 |
.SH DOCUMENT SOURCE |
| 137 |
This manual page was generated by the Netpbm tool 'makeman' from HTML |
| 138 |
source. The master documentation is at |
| 139 |
.IP |
| 140 |
.B http://netpbm.sourceforge.net/doc/pnmshear.html |
| 141 |
.PP |