.TL Pnmrotate User Manual .SH 1 pnmrotate .LP Updated: 30 August 2002 .br Table Of Contents .SH 2 NAME .LP pnmrotate - rotate a PNM image by some angle .SH 2 SYNOPSIS .LP \fBpnmrotate\fR [\fB-noantialias\fR] [\fB-background=\fR\fIcolor\fR] \fIangle\fR [\fIpnmfile\fR] .LP 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. .SH 2 DESCRIPTION .LP .LP This program is part of Netpbm. \fBpnmrotate\fR reads a PNM image as input. It rotates it by the specified angle and produces the same kind of PNM image as output. .LP The input is the file named by \fIpnmfile\fR or Standard Input if you don't specify \fIpnmfile\fR. The output goes to Standard Output. .LP The resulting image is a rectangle that contains the (rectangular) input image within it, rotated with respect to its bottom edge. The containing rectangle is as small as possible to contain the rotated image. The background of the containing image is a single color that \fBpnmrotate\fR determines to be the background color of the original image, or that you specify explicitly. .LP \fIangle\fR is in decimal degrees (floating point), measured counter-clockwise. It can be negative, but it should be between -90 and 90. .LP You should use \fBpamflip\fR instead for rotations that are a multiple of a quarter turn. It is faster and more accurate. .LP For rotations greater than 45 degrees you may get better results if you first use \fIpamflip\fR to do a 90 degree rotation and then \fIpnmrotate\fR less than 45 degrees back the other direction. .LP The rotation algorithm is Alan Paeth's three-shear method. Each shear is implemented 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 or gray levels in the image are modified. If you need to keep precisely the same set of colors, you can use the \fB-noantialias\fR option. .LP The program runs faster and uses less real memory with the \fB-noantialias\fR option. It uses a large amount of virtual memory either way, as it keeps a copy of the input image and a copy of the output image in memory, using 12 bytes per pixel for each. But with \fB-noantialias\fR, it accesses this memory sequentially in half a dozen passes, with only a few pages of memory at a time required in real memory. .LP In contrast, without \fB-noantialias\fR, the program's real memory working set size is one page per input image row plus one page per output image row. Before Netpbm 10.16 (June 2003), \fB-noantialias\fR had the same memory requirement. .SH 2 OPTIONS .LP .RS .IP "\fB-background=\fR\fIcolor\fR" This determines the color of the background on which the rotated image sits. .LP Specify the color (\fIcolor\fR) as described for the argument of the \fBppm_parsecolor()\fR library routine. .LP By default, if you don't specify this option, \fBpnmrotate\fR selects what appears to it to be the background color of the original image. It determines this color rather simplisticly, by taking an average of the colors of the two top corners of the image. .LP This option was new in Netpbm 10.l5. Before that, \fBpnmrotate\fR always behaved as is the default now. .IP "\fB-noantialias\fR" This option forces \fBpnmrotate\fR 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 \fBpnmquant\fR on the output instead of using \fB-noantialias\fR. .LP 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 \fB-background\fR option. .RE .SH 2 REFERENCES .LP "A Fast Algorithm for General Raster Rotation" by Alan Paeth, Graphics Interface '86, pp. 77-81. .SH 2 SEE ALSO .LP pnmshear, pamflip, pnmquant, pnm .SH 2 AUTHOR .LP Copyright (C) 1989, 1991 by Jef Poskanzer. .br \l'5i' .SH 2 Table Of Contents .LP .IP \(bu NAME .IP \(bu SYNOPSIS .IP \(bu DESCRIPTION .IP \(bu REFERENCES .IP \(bu SEE ALSO .IP \(bu AUTHOR .LP