| 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 "Pnmrotate User Manual" 1 "30 August 2002" "netpbm documentation" |
| 7 |
|
| 8 |
.SH NAME |
| 9 |
pnmrotate - rotate a PNM image by some angle |
| 10 |
|
| 11 |
.UN synopsis |
| 12 |
.SH SYNOPSIS |
| 13 |
|
| 14 |
\fBpnmrotate\fP |
| 15 |
[\fB-noantialias\fP] [\fB-background=\fP\fIcolor\fP] \fIangle\fP |
| 16 |
[\fIpnmfile\fP] |
| 17 |
|
| 18 |
.UN description |
| 19 |
.SH DESCRIPTION |
| 20 |
.PP |
| 21 |
This program is part of |
| 22 |
.BR "Netpbm" (1)\c |
| 23 |
\&. |
| 24 |
|
| 25 |
\fBpnmrotate\fP reads a PNM image as input. It rotates it by the |
| 26 |
specified angle and produces the same kind of PNM image as output. |
| 27 |
.PP |
| 28 |
The input is the file named by \fIpnmfile\fP or Standard Input if you |
| 29 |
don't specify \fIpnmfile\fP. The output goes to Standard Output. |
| 30 |
.PP |
| 31 |
The resulting image is a rectangle that contains the (rectangular) |
| 32 |
input image within it, rotated with respect to its bottom edge. The |
| 33 |
containing rectangle is as small as possible to contain the rotated |
| 34 |
image. The background of the containing image is a single color that |
| 35 |
\fBpnmrotate\fP determines to be the background color of the original |
| 36 |
image, or that you specify explicitly. |
| 37 |
.PP |
| 38 |
\fIangle\fP is in decimal degrees (floating point), measured |
| 39 |
counter-clockwise. It can be negative, but it should be between -90 |
| 40 |
and 90. |
| 41 |
.PP |
| 42 |
You should use \fBpamflip\fP instead for rotations that are a |
| 43 |
multiple of a quarter turn. It is faster and more accurate. |
| 44 |
.PP |
| 45 |
For rotations greater than 45 degrees you may get better results if |
| 46 |
you first use \fIpamflip\fP to do a 90 degree rotation and then |
| 47 |
\fIpnmrotate\fP less than 45 degrees back the other direction. |
| 48 |
.PP |
| 49 |
The rotation algorithm is Alan Paeth's three-shear method. Each |
| 50 |
shear is implemented by looping over the source pixels and |
| 51 |
distributing fractions to each of the destination pixels. This has an |
| 52 |
"anti-aliasing" effect - it avoids jagged edges and similar |
| 53 |
artifacts. However, it also means that the original colors or gray |
| 54 |
levels in the image are modified. If you need to keep precisely the |
| 55 |
same set of colors, you can use the \fB-noantialias\fP option. |
| 56 |
.PP |
| 57 |
The program runs faster and uses less real memory with the |
| 58 |
\fB-noantialias\fP option. It uses a large amount of virtual memory |
| 59 |
either way, as it keeps a copy of the input image and a copy of the |
| 60 |
output image in memory, using 12 bytes per pixel for each. But with |
| 61 |
\fB-noantialias\fP, it accesses this memory sequentially in half a |
| 62 |
dozen passes, with only a few pages of memory at a time required in |
| 63 |
real memory. |
| 64 |
.PP |
| 65 |
In contrast, without \fB-noantialias\fP, the program's real memory |
| 66 |
working set size is one page per input image row plus one page per output |
| 67 |
image row. Before Netpbm 10.16 (June 2003), \fB-noantialias\fP had the |
| 68 |
same memory requirement. |
| 69 |
|
| 70 |
.UN options |
| 71 |
.SH OPTIONS |
| 72 |
.PP |
| 73 |
In addition to the options common to all programs based on libnetpbm |
| 74 |
(most notably \fB-quiet\fP, see |
| 75 |
.UR index.html#commonoptions |
| 76 |
Common Options |
| 77 |
.UE |
| 78 |
\&), \fBpnmrotate\fP recognizes the following |
| 79 |
command line options: |
| 80 |
.PP |
| 81 |
All options can be abbreviated to their shortest unique prefix. You |
| 82 |
may use two hyphens instead of one to designate an option. You may |
| 83 |
use either white space or equals signs between an option name and its |
| 84 |
value. |
| 85 |
|
| 86 |
|
| 87 |
.TP |
| 88 |
\fB-background=\fP\fIcolor\fP |
| 89 |
This determines the color of the background on which the rotated image |
| 90 |
sits. |
| 91 |
.sp |
| 92 |
Specify the color (\fIcolor\fP) as described for the |
| 93 |
.UR libnetpbm_image.html#colorname |
| 94 |
argument of the \fBpnm_parsecolor()\fP library routine |
| 95 |
.UE |
| 96 |
\&. |
| 97 |
.sp |
| 98 |
By default, if you don't specify this option, \fBpnmrotate\fP selects |
| 99 |
what appears to it to be the background color of the original image. It |
| 100 |
determines this color rather simplistically, by taking an average of the colors |
| 101 |
of the two top corners of the image. |
| 102 |
.sp |
| 103 |
This option was new in Netpbm 10.15. Before that, \fBpnmrotate\fP |
| 104 |
always behaved as is the default now. |
| 105 |
|
| 106 |
.TP |
| 107 |
\fB-noantialias\fP |
| 108 |
This option forces \fBpnmrotate\fP to simply move pixels around instead |
| 109 |
of synthesizing output pixels from multiple input pixels. The latter could |
| 110 |
cause the output to contain colors that are not in the input, which may not |
| 111 |
be desirable. It also probably makes the output contain a large number of |
| 112 |
colors. If you need a small number of colors, but it doesn't matter if they |
| 113 |
are the exact ones from the input, consider using \fBpnmquant\fP on the |
| 114 |
output instead of using \fB-noantialias\fP. |
| 115 |
.sp |
| 116 |
Note that to ensure the output does not contain colors that are not |
| 117 |
in the input, you also must consider the background color. See the |
| 118 |
\fB-background\fP option. |
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
.UN references |
| 123 |
.SH REFERENCES |
| 124 |
|
| 125 |
"A Fast Algorithm for General Raster Rotation" by Alan Paeth, |
| 126 |
Graphics Interface '86, pp. 77-81. |
| 127 |
|
| 128 |
.UN seealso |
| 129 |
.SH SEE ALSO |
| 130 |
.BR "pnmshear" (1)\c |
| 131 |
\&, |
| 132 |
.BR "pamflip" (1)\c |
| 133 |
\&, |
| 134 |
.BR "pnmquant" (1)\c |
| 135 |
\&, |
| 136 |
.BR "pnm" (1)\c |
| 137 |
\& |
| 138 |
|
| 139 |
.UN author |
| 140 |
.SH AUTHOR |
| 141 |
|
| 142 |
Copyright (C) 1989, 1991 by Jef Poskanzer. |
| 143 |
.SH DOCUMENT SOURCE |
| 144 |
This manual page was generated by the Netpbm tool 'makeman' from HTML |
| 145 |
source. The master documentation is at |
| 146 |
.IP |
| 147 |
.B http://netpbm.sourceforge.net/doc/pnmrotate.html |
| 148 |
.PP |