1Pnmrotate User Manual(0)                              Pnmrotate User Manual(0)
2
3
4

NAME

6       pnmrotate - rotate a PNM image by some angle
7
8

SYNOPSIS

10       pnmrotate [-noantialias] [-background=color] angle [pnmfile]
11
12

DESCRIPTION

14       This program is part of Netpbm(1).
15
16       pnmrotate  reads  a PNM image as input.  It rotates it by the specified
17       angle and produces the same kind of PNM image as output.
18
19       The input is the file named by pnmfile or Standard Input if  you  don't
20       specify pnmfile.  The output goes to Standard Output.
21
22       The  resulting  image  is  a  rectangle that contains the (rectangular)
23       input image within it, rotated with respect to its  bottom  edge.   The
24       containing  rectangle  is  as  small as possible to contain the rotated
25       image.  The background of the containing image is a single  color  that
26       pnmrotate  determines to be the background color of the original image,
27       or that you specify explicitly.
28
29       angle is in decimal degrees (floating point),  measured  counter-clock‐
30       wise.  It can be negative, but it should be between -90 and 90.
31
32       You  should  use pamflip instead for rotations that are a multiple of a
33       quarter turn.  It is faster and more accurate.
34
35       For rotations greater than 45 degrees you may get better results if you
36       first  use  pamflip  to do a 90 degree rotation and then pnmrotate less
37       than 45 degrees back the other direction.
38
39       The rotation algorithm is Alan Paeth's three-shear method.  Each  shear
40       is implemented by looping over the source pixels and distributing frac‐
41       tions to each of the destination pixels.  This has  an  "anti-aliasing"
42       effect  -  it  avoids  jagged edges and similar artifacts.  However, it
43       also means that the original colors or gray levels  in  the  image  are
44       modified.   If  you  need to keep precisely the same set of colors, you
45       can use the -noantialias option.
46
47       The program runs faster and uses less real memory with the -noantialias
48       option.   It  uses  a  large amount of virtual memory either way, as it
49       keeps a copy of the input image and a copy of the output image in  mem‐
50       ory,  using  12  bytes  per  pixel for each.  But with -noantialias, it
51       accesses this memory sequentially in half a dozen passes, with  only  a
52       few pages of memory at a time required in real memory.
53
54       In  contrast,  without  -noantialias, the program's real memory working
55       set size is one page per input image row plus one page per output image
56       row.  Before Netpbm 10.16 (June 2003), -noantialias had the same memory
57       requirement.
58
59

OPTIONS

61       All options can be abbreviated to their shortest  unique  prefix.   You
62       may use two hyphens instead of one to designate an option.  You may use
63       either white space or equals signs  between  an  option  name  and  its
64       value.
65
66
67
68       -background=color
69              This determines the color of the background on which the rotated
70              image sits.
71
72              Specify the color (color) as described for the argument  of  the
73              ppm_parsecolor() library routine ⟨libppm.html#colorname⟩ .
74
75              By  default, if you don't specify this option, pnmrotate selects
76              what appears to it to be the background color  of  the  original
77              image.   It determines this color rather simplistically, by tak‐
78              ing an average of the colors of  the  two  top  corners  of  the
79              image.
80
81              This  option  was  new  in Netpbm 10.15.  Before that, pnmrotate
82              always behaved as is the default now.
83
84
85       -noantialias
86              This option  forces  pnmrotate  to  simply  move  pixels  around
87              instead  of  synthesizing output pixels from multiple input pix‐
88              els.  The latter could cause the output to contain  colors  that
89              are not in the input, which may not be desirable.  It also prob‐
90              ably makes the output contain a large number of colors.  If  you
91              need a small number of colors, but it doesn't matter if they are
92              the exact ones from the input, consider using  pnmquant  on  the
93              output instead of using -noantialias.
94
95              Note  that to ensure the output does not contain colors that are
96              not in the input, you also must consider the  background  color.
97              See the -background option.
98
99
100
101

REFERENCES

103       "A  Fast Algorithm for General Raster Rotation" by Alan Paeth, Graphics
104       Interface '86, pp. 77-81.
105
106

SEE ALSO

108       pnmshear(1), pamflip(1), pnmquant(1), pnm(1)
109
110

AUTHOR

112       Copyright (C) 1989, 1991 by Jef Poskanzer.
113

DOCUMENT SOURCE

115       This manual page was generated by the Netpbm tool 'makeman'  from  HTML
116       source.  The master documentation is at
117
118              http://netpbm.sourceforge.net/doc/pnmrotate.html
119
120netpbm documentation            30 August 2002        Pnmrotate User Manual(0)
Impressum