1Pamcut User Manual(0)                                    Pamcut User Manual(0)
2
3
4

NAME

6       pamcut - cut a rectangle out of a PAM, PBM, PGM, or PPM image
7
8

SYNOPSIS

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

DESCRIPTION

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

OPTIONS

111       -left=colnum
112              The column number of the leftmost column to be  in  the  output.
113              Columns  left  of this get cut out.  If a nonnegative number, it
114              refers to columns numbered from 0 at the left, increasing to the
115              right.   If  negative,  it  refers to columns numbered -1 at the
116              right, decreasing to the left.
117
118
119       -right=colnum
120              The column number of the rightmost column to be in  the  output,
121              numbered  the  same  as for -left.  Columns to the right of this
122              get cut out.
123
124
125       -top=rownum
126              The row number of the topmost row to be  in  the  output.   Rows
127              above  this  get  cut out.  If a nonnegative number it refers to
128              rows numbered from 0 at the top, increasing downward.  If  nega‐
129              tive, it refers to columns numbered -1 at the bottom, decreasing
130              upward.
131
132
133       -bottom=rownum
134              The row number of the bottom-most row to be in the output,  num‐
135              bered the same as for -top.  Rows below this get cut out.
136
137
138       -width=cols
139              The number of columns to be in the output.  Must be positive.
140
141
142       -height=rows
143              The number of rows to be in the output.  Must be positive.
144
145
146       -cropleft
147
148       -cropright
149
150       -croptop
151
152       -cropbottom
153              These  options  tell  how  many rows or columns to crop from the
154              left, right, top, or bottom edges, respectively.
155
156              The value must not be negative.
157
158              These option were new in Netpbm 10.85 (December  2018).   Before
159              that,  you can achieve the same thing with -left, top, and nega‐
160              tive values for -right and -bottom.  Remember to subtract one in
161              the   latter  case;  e.g.  the  equivalent  of  -cropright=1  is
162              -right=-2.
163
164
165       -pad   If the rectangle you specify is not entirely  within  the  input
166              image, pamcut fails unless you also specify -pad.  In that case,
167              it pads the output with black up to the edges you specify.   You
168              can  use  this  option  if  you need to have an image of certain
169              dimensions and have an image of arbitrary dimensions.
170
171              pnmpad also adds borders to an  image,  but  you  specify  their
172              width directly.
173
174              pamcomp  does  a  more  general  form of this padding.  Create a
175              background image of the frame dimensions and overlay the subject
176              image  on  it.  You can use options to have the subject image in
177              the center of the frame or against any edge and make the padding
178              any  color  (the  padding  color  is the color of the background
179              image).
180
181
182       -verbose
183              Print information about the processing to Standard Error.
184
185
186

SEE ALSO

188       pnmcrop(1), pamdice(1), pamcomp(1), pnmpad(1), pnmcat(1),  pgmslice(1),
189       pnm(1)
190
191

HISTORY

193       pamcut  was  derived from pnmcut in Netpbm 9.20 (May 2001).  It was the
194       first Netpbm program adapted to the  new  PAM  format  and  programming
195       library.
196
197       The  predecessor pnmcut was one of the oldest tools in the Netpbm pack‐
198       age.
199
200
201

AUTHOR

203       Copyright (C) 1989 by Jef Poskanzer.
204

DOCUMENT SOURCE

206       This manual page was generated by the Netpbm tool 'makeman'  from  HTML
207       source.  The master documentation is at
208
209              http://netpbm.sourceforge.net/doc/pamcut.html
210
211netpbm documentation            04 October 2019          Pamcut User Manual(0)
Impressum