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
69 defaults. Those defaults are in favor of minimal cutting and in favor
70 of cutting the right and bottom edges off. It is an error to overspec‐
71 ify, i.e. to specify all three of -left, -right, and -width or -top,
72 -bottom, and -height or right as well as -cropright.
73
74 There is an older way to specify the rectangle to keep: positional
75 arguments. Arguments were the only way available before July 2000, but
76 you should not use them in new applications. Options are easier to
77 remember 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).
90 Before July 2000, negative numbers were not allowed for width and
91 height.
92
93 Input is from Standard Input if you don't specify the input file pnm‐
94 file.
95
96 Output is to Standard Output.
97
98 pamcut works on a multi-image stream. It cuts each image in the stream
99 independently and produces a multi-image stream output. Before Netpbm
100 10.32 (March 2006), it ignored all but the first image in the stream.
101
102 If you are splitting a single image into multiple same-size images,
103 pamdice is faster and easier than running pamcut multiple times.
104
105 pamcomp is also useful for cutting and padding an image to a certain
106 size. You create a background image of the desired frame dimensions
107 and overlay the subject image on it.
108
109
111 In addition to the options common to all programs based on libnetpbm
112 (most notably -quiet, see
113 Common Options ⟨index.html#commonoptions⟩ ), pamcut recognizes the
114 following command line options:
115
116
117
118 -left=colnum
119 The column number of the leftmost column to be in the output.
120 Columns left of this get cut out. If a nonnegative number, it
121 refers to columns numbered from 0 at the left, increasing to the
122 right. If negative, it refers to columns numbered -1 at the
123 right, decreasing to the left.
124
125
126 -right=colnum
127 The column number of the rightmost column to be in the output,
128 numbered the same as for -left. Columns to the right of this
129 get cut out.
130
131
132 -top=rownum
133 The row number of the topmost row to be in the output. Rows
134 above this get cut out. If a nonnegative number it refers to
135 rows numbered from 0 at the top, increasing downward. If nega‐
136 tive, it refers to columns numbered -1 at the bottom, decreasing
137 upward.
138
139
140 -bottom=rownum
141 The row number of the bottom-most row to be in the output, num‐
142 bered the same as for -top. Rows below this get cut out.
143
144
145 -width=cols
146 The number of columns to be in the output. Must be positive.
147
148
149 -height=rows
150 The number of rows to be in the output. Must be positive.
151
152
153 -cropleft
154
155 -cropright
156
157 -croptop
158
159 -cropbottom
160 These options tell how many rows or columns to crop from the
161 left, right, top, or bottom edges, respectively.
162
163 The value must not be negative.
164
165 These option were new in Netpbm 10.85 (December 2018). Before
166 that, you can achieve the same thing with -left, top, and nega‐
167 tive values for -right and -bottom. Remember to subtract one in
168 the latter case; e.g. the equivalent of -cropright=1 is
169 -right=-2.
170
171
172 -pad If the rectangle you specify is not entirely within the input
173 image, pamcut fails unless you also specify -pad. In that case,
174 it pads the output with black up to the edges you specify. You
175 can use this option if you need to have an image of certain
176 dimensions and have an image of arbitrary dimensions.
177
178 pnmpad also adds borders to an image, but you specify their
179 width directly.
180
181 pamcomp does a more general form of this padding. Create a
182 background image of the frame dimensions and overlay the subject
183 image on it. You can use options to have the subject image in
184 the center of the frame or against any edge and make the padding
185 any color (the padding color is the color of the background
186 image).
187
188
189 -verbose
190 Print information about the processing to Standard Error.
191
192
193
195 pnmcrop(1), pamdice(1), pamcomp(1), pnmpad(1), pnmcat(1), pgmslice(1),
196 pnm(1)
197
198
200 pamcut was derived from pnmcut in Netpbm 9.20 (May 2001). It was the
201 first Netpbm program adapted to the new PAM format and programming
202 library.
203
204 The predecessor pnmcut was one of the oldest tools in the Netpbm pack‐
205 age.
206
207
208
210 Copyright (C) 1989 by Jef Poskanzer.
211
213 This manual page was generated by the Netpbm tool 'makeman' from HTML
214 source. The master documentation is at
215
216 http://netpbm.sourceforge.net/doc/pamcut.html
217
218netpbm documentation 04 October 2019 Pamcut User Manual(0)