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       [-verbose]
27
28       [left top width height]
29
30       [pnmfile]
31
32       Minimum  unique  abbreviations  of  option are acceptable.  You may use
33       double hyphens instead of single hyphen to denote options.  You may use
34       white space in place of the equals sign to separate an option name from
35       its value.
36
37

DESCRIPTION

39       This program is part of Netpbm(1).
40
41       pamcut reads a PAM, PBM, PGM, or PPM image as input  and  extracts  the
42       specified rectangle, and produces the same kind of image as output.
43
44       There  are  two  ways  to  specify  the rectangle to cut: arguments and
45       options.  Options are easier to remember and read, more expressive, and
46       allow  you  to  use  defaults.   Arguments  were the only way available
47       before July 2000.
48
49       If you use both options and arguments, the two specifications get mixed
50       in an unspecified way.
51
52       In  any  case,  remember that you are specifying the rectangle to keep,
53       not the bits to discard.  Otherwise, you'll be tempted to believe  that
54       -right=9  means  to  delete  the 9 rightmost columns.  (It really means
55       keep the stuff up to Column 9 and delete the rest).
56
57       To use options, just code any mixture of the -left, -right, -top, -bot‐
58       tom,  -width,  and  -height  options.  What you don't specify defaults.
59       Those defaults are in favor of minimal cutting and in favor of  cutting
60       the right and bottom edges off.  It is an error to overspecify, i.e. to
61       specify all three of -left, -right, and -width or  -top,  -bottom,  and
62       -height.
63
64       To  use arguments, specify all four of the left, top, width, and height
65       arguments.  left and top have the same effect as specifying them as the
66       argument  of  a  -left  or -top option, respectively.  width and height
67       have the same effect as specifying them as the argument of a -width  or
68       -height  option, respectively, where they are positive.  Where they are
69       not positive, they have the same effect as specifying one less than the
70       value  as  the  argument  to  a -right or -bottom option, respectively.
71       (E.g.  width = 0 makes the cut go all  the  way  to  the  right  edge).
72       Before  July  2000,  negative  numbers  were  not allowed for width and
73       height.
74
75       Input is from Standard Input if you don't specify the input  file  pnm‐
76       file.
77
78       Output is to Standard Output.
79
80       pamcut works on a multi-image stream.  It cuts each image in the stream
81       independently and produces a multi-image stream output.  Before  Netpbm
82       10.32 (March 2006), it ignored all but the first image in the stream.
83
84       If  you  are  splitting  a single image into multiple same-size images,
85       pamdice is faster and easier than running pamcut multiple times.
86
87       pamcomp is also useful for cutting and padding an image  to  a  certain
88       size.   You  create  a background image of the desired frame dimensions
89       and overlay the subject image on it.
90
91

OPTIONS

93       -left=colnum
94              The column number of the leftmost column to be  in  the  output.
95              Columns  left  of this get cut out.  If a nonnegative number, it
96              refers to columns numbered from 0 at the left, increasing to the
97              right.   If  negative,  it  refers to columns numbered -1 at the
98              right, decreasing to the left.
99
100              To delete N columns at the left edge, specify -left=N.
101
102              To delete N columns at the right edge, specify -left=--(N+1).
103
104
105       -right=colnum
106              The column number of the rightmost column to be in  the  output,
107              numbered  the  same  as for -left.  Columns to the right of this
108              get cut out.
109
110
111       -top=rownum
112              The row number of the topmost row to be  in  the  output.   Rows
113              above  this  get  cut out.  If a nonnegative number it refers to
114              rows numbered from 0 at the top, increasing downward.  If  nega‐
115              tive, it refers to columns numbered -1 at the bottom, decreasing
116              upward.
117
118              To delete N rows at the top, specify -top=N.
119
120              To delete N rows at the bottom, specify -bottom=-(N+1).
121
122
123       -bottom=rownum
124              The row number of the bottom-most row to be in the output,  num‐
125              bered the same as for -top.  Rows below this get cut out.
126
127
128       -width=cols
129              The number of columns to be in the output.  Must be positive.
130
131
132       -height=rows
133              The number of rows to be in the output.  Must be positive.
134
135
136       -pad   If  the  rectangle  you specify is not entirely within the input
137              image, pamcut fails unless you also specify -pad.  In that case,
138              it  pads the output with black up to the edges you specify.  You
139              can use this option if you need to  have  an  image  of  certain
140              dimensions and have an image of arbitrary dimensions.
141
142              pnmpad  also  adds  borders  to  an image, but you specify their
143              width directly.
144
145              pamcomp does a more general form  of  this  padding.   Create  a
146              background image of the frame dimensions and overlay the subject
147              image on it.  You can use options to have the subject  image  in
148              the center of the frame or against any edge and make the padding
149              any color (the padding color is  the  color  of  the  background
150              image).
151
152
153       -verbose
154              Print information about the processing to Standard Error.
155
156
157

SEE ALSO

159       pnmcrop(1),  pamdice(1), pamcomp(1), pnmpad(1), pnmcat(1), pgmslice(1),
160       pnm(1)
161
162

HISTORY

164       pamcut was derived from pnmcut in Netpbm 9.20 (May 2001).  It  was  the
165       first  Netpbm  program  adapted  to  the new PAM format and programming
166       library.
167
168       The predecessor pnmcut was one of the oldest tools in the Netpbm  pack‐
169       age.
170
171
172

AUTHOR

174       Copyright (C) 1989 by Jef Poskanzer.
175
176
177
178netpbm documentation             05 April 2005           Pamcut User Manual(0)
Impressum