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

REFERENCES

109       "A Fast Algorithm for General Raster Rotation" by Alan Paeth,  Graphics
110       Interface '86, pp. 77-81.
111
112

SEE ALSO

114       pnmshear(1), pamflip(1), pnmquant(1), pnm(1)
115
116

AUTHOR

118       Copyright (C) 1989, 1991 by Jef Poskanzer.
119

DOCUMENT SOURCE

121       This  manual  page was generated by the Netpbm tool 'makeman' from HTML
122       source.  The master documentation is at
123
124              http://netpbm.sourceforge.net/doc/pnmrotate.html
125
126netpbm documentation            30 August 2002        Pnmrotate User Manual(0)
Impressum