1Pnmrotate User Manual(0) Pnmrotate User Manual(0)
2
3
4
6 pnmrotate - rotate a PNM image by some angle
7
8
10 pnmrotate [-noantialias] [-background=color] angle [pnmfile]
11
12
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
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 pnm_parsecolor() library routine
74 ⟨libnetpbm_image.html#colorname⟩ .
75
76 By default, if you don't specify this option, pnmrotate selects
77 what appears to it to be the background color of the original
78 image. It determines this color rather simplistically, by tak‐
79 ing an average of the colors of the two top corners of the
80 image.
81
82 This option was new in Netpbm 10.15. Before that, pnmrotate
83 always behaved as is the default now.
84
85
86 -noantialias
87 This option forces pnmrotate to simply move pixels around
88 instead of synthesizing output pixels from multiple input pix‐
89 els. The latter could cause the output to contain colors that
90 are not in the input, which may not be desirable. It also prob‐
91 ably makes the output contain a large number of colors. If you
92 need a small number of colors, but it doesn't matter if they are
93 the exact ones from the input, consider using pnmquant on the
94 output instead of using -noantialias.
95
96 Note that to ensure the output does not contain colors that are
97 not in the input, you also must consider the background color.
98 See the -background option.
99
100
101
102
104 "A Fast Algorithm for General Raster Rotation" by Alan Paeth, Graphics
105 Interface '86, pp. 77-81.
106
107
109 pnmshear(1), pamflip(1), pnmquant(1), pnm(1)
110
111
113 Copyright (C) 1989, 1991 by Jef Poskanzer.
114
116 This manual page was generated by the Netpbm tool 'makeman' from HTML
117 source. The master documentation is at
118
119 http://netpbm.sourceforge.net/doc/pnmrotate.html
120
121netpbm documentation 30 August 2002 Pnmrotate User Manual(0)