1Pnmshear User Manual(0) Pnmshear User Manual(0)
2
3
4
6 pnmshear - shear a PNM image by a specified angle
7
8
10 pnmshear
11
12 [-noantialias] [-background=color] angle [pnmfile]
13
14 All options can be abbreviated to their shortest unique prefix. You
15 may use two hyphens instead of one to designate an option. You may use
16 either white space or equals signs between an option name and its
17 value.
18
19
21 This program is part of Netpbm(1).
22
23 pnmshear reads a PNM image as input and shears it by the specified
24 angle and produce a PNM image as output. If the input file is in
25 color, the output will be too, otherwise it will be grayscale. The
26 angle is in degrees (floating point), and measures this:
27
28 +-------+ +-------+
29 | | |\ \
30 | OLD | | \ NEW \
31 | | |an\ \
32 +-------+ |gle+-------+
33
34 If the angle is negative, it shears the other way:
35 +-------+ |-an+-------+
36 | | |gl/ /
37 | OLD | |e/ NEW /
38 | | |/ /
39 +-------+ +-------+
40
41 The angle should not get too close to 90 or -90, or the resulting image
42 will be unreasonably wide. In fact, if it gets too close, the width
43 will be so large that pnmshear cannot do computations in the word sizes
44 it uses, and the program detects this and fails.
45
46 pnmshear does the shearing by looping over the source pixels and dis‐
47 tributing fractions to each of the destination pixels. This has an
48 "anti-aliasing" effect - it avoids jagged edges and similar artifacts.
49 However, it also means that the original colors in the image are modi‐
50 fied and there are typically more of them than you started with. If
51 you need to keep precisely the same set of colors, see the -noantialias
52 option. If the expanded palette is a problem, you can run the result
53 through pnmquant.
54
55
57 -background=color
58 This determines the color of the background on which the sheared
59 image sits.
60
61 Specify the color (color) as described for the argument of the
62 pnm_parsecolor() library routine
63 ⟨libnetpbm_image.html#colorname⟩ .
64
65 By default, if you don't specify this option, pnmshear selects
66 what appears to it to be the background color of the original
67 image. It determines this color rather simplistically, by tak‐
68 ing an average of the colors of the two top corners of the
69 image.
70
71 This option was new in Netpbm 10.37 (December 2006). Before
72 that, pnmshear always behaved as is the default now.
73
74
75 -noantialias
76 This option forces pnmshear to simply move pixels around instead
77 of synthesizing output pixels from multiple input pixels. The
78 latter could cause the output to contain colors that are not in
79 the input, which may not be desirable. It also probably makes
80 the output contain a large number of colors. If you need a
81 small number of colors, but it doesn't matter if they are the
82 exact ones from the input, consider using pnmquant on the output
83 instead of using -noantialias.
84
85 Note that to ensure the output does not contain colors that are
86 not in the input, you also must consider the background color.
87 See the -background option.
88
89
90
91
93 pnmrotate(1), pamflip(1), pnmquant(1), pnm(1)
94
95
96
98 Copyright (C) 1989, 1991 by Jef Poskanzer.
99
101 This manual page was generated by the Netpbm tool 'makeman' from HTML
102 source. The master documentation is at
103
104 http://netpbm.sourceforge.net/doc/pnmshear.html
105
106netpbm documentation 22 March 2020 Pnmshear User Manual(0)