1Pamcut User Manual(0) Pamcut User Manual(0)
2
3
4
6 pamcut - cut a rectangle out of a PAM, PBM, PGM, or PPM image
7
8
10 pamcut
11
12 [-left colnum]
13
14 [-right colnum]
15
16 [-top rownum]
17
18 [-bottom rownum]
19
20 [-width cols]
21
22 [-height rows]
23
24 [-pad]
25
26 [-cropleft numcols]
27
28 [-cropright numcols]
29
30 [-croptop numrows]
31
32 [-cropbottom numrows]
33
34 [-verbose]
35
36 [left top width height]
37
38 [pnmfile]
39
40 Minimum unique abbreviations of option are acceptable. You may use
41 double hyphens instead of single hyphen to denote options. You may use
42 white space in place of the equals sign to separate an option name from
43 its value.
44
45
47 This program is part of Netpbm(1).
48
49 pamcut reads a PAM, PBM, PGM, or PPM image as input and extracts the
50 specified rectangle, and produces the same kind of image as output.
51
52 You can specify either the rectangle to cut out and keep or specify the
53 edges to crop off and discard, or a combination.
54
55 To request edges be cropped off, use options -cropleft, -cropright,
56 -croptop, and -cropbottom to indicate how many rows or columns to dis‐
57 card.
58
59 For example, -cropleft=50 -cropright=200 means to discard the leftmost
60 50 and rightmost 200 columns.
61
62 To specify the rectangle to keep, use -left, -right, -top, -bottom,
63 -width, -height, and -pad options.
64
65 For example, -left=50 -right=200 means to keep the 150 columns between
66 Columns 50 and 200 inclusive.
67
68 You can code any mixture of the options. What you don't specify de‐
69 faults. Those defaults are in favor of minimal cutting and in favor of
70 cutting the right and bottom edges off. It is an error to overspecify,
71 i.e. to specify all three of -left, -right, and -width or -top, -bot‐
72 tom, and -height or right as well as -cropright.
73
74 There is an older way to specify the rectangle to keep: positional ar‐
75 guments. Arguments were the only way available before July 2000, but
76 you should not use them in new applications. Options are easier to re‐
77 member and read, more expressive, and allow you to use defaults.
78
79 If you use both options and arguments, the two specifications get mixed
80 in an unspecified way.
81
82 To use arguments, specify all four of the left, top, width, and height
83 arguments. left and top have the same effect as specifying them as the
84 argument of a -left or -top option, respectively. width and height
85 have the same effect as specifying them as the argument of a -width or
86 -height option, respectively, where they are positive. Where they are
87 not positive, they have the same effect as specifying one less than the
88 value as the argument to a -right or -bottom option, respectively.
89 (E.g. width = 0 makes the cut go all the way to the right edge). Be‐
90 fore July 2000, negative numbers were not allowed for width and height.
91
92 Input is from Standard Input if you don't specify the input file pnm‐
93 file.
94
95 Output is to Standard Output.
96
97 pamcut works on a multi-image stream. It cuts each image in the stream
98 independently and produces a multi-image stream output. Before Netpbm
99 10.32 (March 2006), it ignored all but the first image in the stream.
100
101 If you are splitting a single image into multiple same-size images,
102 pamdice is faster and easier than running pamcut multiple times.
103
104 pamcomp is also useful for cutting and padding an image to a certain
105 size. You create a background image of the desired frame dimensions
106 and overlay the subject image on it.
107
108
110 In addition to the options common to all programs based on libnetpbm
111 (most notably -quiet, see
112 Common Options ⟨index.html#commonoptions⟩ ), pamcut recognizes the
113 following command line options:
114
115
116
117 -left=colnum
118 The column number of the leftmost column to be in the output.
119 Columns left of this get cut out. If a nonnegative number, it
120 refers to columns numbered from 0 at the left, increasing to the
121 right. If negative, it refers to columns numbered -1 at the
122 right, decreasing to the left.
123
124
125 -right=colnum
126 The column number of the rightmost column to be in the output,
127 numbered the same as for -left. Columns to the right of this
128 get cut out.
129
130
131 -top=rownum
132 The row number of the topmost row to be in the output. Rows
133 above this get cut out. If a nonnegative number it refers to
134 rows numbered from 0 at the top, increasing downward. If nega‐
135 tive, it refers to columns numbered -1 at the bottom, decreasing
136 upward.
137
138
139 -bottom=rownum
140 The row number of the bottom-most row to be in the output, num‐
141 bered the same as for -top. Rows below this get cut out.
142
143
144 -width=cols
145 The number of columns to be in the output. Must be positive.
146
147
148 -height=rows
149 The number of rows to be in the output. Must be positive.
150
151
152 -cropleft
153
154 -cropright
155
156 -croptop
157
158 -cropbottom
159 These options tell how many rows or columns to crop from the
160 left, right, top, or bottom edges, respectively.
161
162 The value must not be negative.
163
164 These option were new in Netpbm 10.85 (December 2018). Before
165 that, you can achieve the same thing with -left, top, and nega‐
166 tive values for -right and -bottom. Remember to subtract one in
167 the latter case; e.g. the equivalent of -cropright=1 is
168 -right=-2.
169
170
171 -pad If the rectangle you specify is not entirely within the input
172 image, pamcut fails unless you also specify -pad. In that case,
173 it pads the output with black up to the edges you specify. You
174 can use this option if you need to have an image of certain di‐
175 mensions and have an image of arbitrary dimensions.
176
177 pnmpad also adds borders to an image, but you specify their
178 width directly.
179
180 pamcomp does a more general form of this padding. Create a
181 background image of the frame dimensions and overlay the subject
182 image on it. You can use options to have the subject image in
183 the center of the frame or against any edge and make the padding
184 any color (the padding color is the color of the background im‐
185 age).
186
187
188 -verbose
189 Print information about the processing to Standard Error.
190
191
192
194 pnmcrop(1), pamdice(1), pamcomp(1), pnmpad(1), pamcat(1), pgmslice(1),
195 pnm(1)
196
197
199 pamcut was derived from pnmcut in Netpbm 9.20 (May 2001). It was the
200 first Netpbm program adapted to the new PAM format and programming li‐
201 brary.
202
203 The predecessor pnmcut was one of the oldest tools in the Netpbm pack‐
204 age.
205
206
207
209 Copyright (C) 1989 by Jef Poskanzer.
210
212 This manual page was generated by the Netpbm tool 'makeman' from HTML
213 source. The master documentation is at
214
215 http://netpbm.sourceforge.net/doc/pamcut.html
216
217netpbm documentation 04 October 2019 Pamcut User Manual(0)