1Pamflip User Manual(0) Pamflip User Manual(0)
2
3
4
6 pamflip - flip or rotate a PAM or PNM image
7
8
10 pamflip { -leftright | -lr | -topbottom | -tb | -transpose | -xy |
11 -rotate90 | -r90 | -cw | -rotate270 | -r270 | -ccw | -rotate180 | -r180
12 -null | -xform=xform1,xform2... } [-memsize=mebibytes] [-page‐
13 size=bytes] [pamfile]
14
15 All options can be abbreviated to their shortest unique prefix. You
16 may use two hyphens instead of one to designate an option. You may use
17 either white space or an equals sign between an option name and its
18 value.
19
20
21
23 This program is part of Netpbm(1).
24
25 pamflip flips a PAM or PNM image top for bottom or left for right, or
26 transposes it horizontal for vertical, or rotates it 1, 2, or 3 quarter
27 turns.
28
29 To rotate at other angles, use pnmrotate. It is much slower, though.
30
31 The input image is pamfile, or Standard Input if pamfile is not speci‐
32 fied.
33
34 To flip/rotate a JFIF (JPEG) image losslessly, use jpegtran. jpegtran
35 is part of the Independent Jpeg Group's compression library package,
36 not part of Netpbm. The normal Netpbm way to flip a JFIF file would be
37 to convert it to PNM, use pamflip, and convert back to JFIF. But since
38 JPEG compression is lossy, the resulting image would have less quality
39 than the original. jpegtran, on the other hand, can do this particular
40 transformation directly on the compressed data without loss.
41
42
43
45 In addition to the options common to all programs based on libnetpbm
46 (most notably -quiet, see
47 Common Options ⟨index.html#commonoptions⟩ ), pamflip recognizes the
48 following command line options:
49
50
51 Specifying the Transformation
52 You must supply exactly one of the following options:
53
54 pamflip's predecessor (before Netpbm 10.7 - August 2002) pnmflip did
55 not have the -xform option and instead allowed you to specify any num‐
56 ber of the other options, including zero. It applied all the indicated
57 transformations, in the order given, just like with pamflip's -xform
58 option. (Reason for the change: this kind of interpretation of options
59 is inconsistent with the rest of Netpbm and most of the Unix world, and
60 thus hard to understand and to implement).
61
62
63
64 -leftright
65
66 -lr Flip left for right.
67
68
69 -topbottom
70
71 -tb Flip top for bottom.
72
73
74 -transpose
75
76 -xy Transpose horizontal for vertical. I.e. make the pixel at (x,y)
77 be at (y,x).
78
79
80 -rotate90
81
82 -r90
83
84 -ccw Rotate counterclockwise 90 degrees.
85
86
87 -rotate180
88
89 -r180 Rotate 180 degrees.
90
91
92 -rotate270
93
94 -r270
95
96 -cw Rotate counterclockwise 270 degrees (clockwise 90 degrees)
97
98
99 -null No change. (The purpose of this option is the convenience of
100 programs that invoke pamflip after computing the kind of trans‐
101 formation desired, including none at all).
102
103 This option was new in Netpbm 10.13 (December 2002).
104
105
106 -xform=xform1,xform2...
107 Apply all the transforms listed, in order. The valid values for
108 the transforms are as follows and have the same meanings as the
109 identically named options above.
110
111
112 · leftright
113
114 · topbottom
115
116 · transpose
117
118
119 This option was new in Netpbm 10.13 (December 2002).
120
121
122
123
124 Memory Management
125 The following options help pamflip use memory efficiently. Some flip‐
126 ping operations on very large images can cause pamflip to have a very
127 large working set, which means if you don't have enough real memory,
128 the program can page thrash, which means it takes a ridiculous amount
129 time to run. If your entire image fits in real memory, you don't have
130 a problem. If you're just flipping top for bottom or left for right,
131 you don't have a problem. Otherwise, pay attention. If you're inter‐
132 ested in the details of the thrashing problem and how pamflip
133 approaches it, you're invited to read a complete explanation in com‐
134 ments in the source code.
135
136
137
138 -memsize=mebibytes
139 mebibytes is the size in mebibytes (aka megabytes) of memory
140 available for pamflip. It is the lesser of the amount of real
141 or virtual memory available.
142
143 pamflip does nothing special to allocate real memory or control
144 it's allocation -- it gets whatever it gets just by referencing
145 virtual memory normally. The real memory figure in question is
146 the maximum amount that pamflip can be expected to end up with
147 by doing that. This is just about impossible for you to know,
148 of course, but you can estimate. The total real memory in your
149 system should be a major factor in your estimate.
150
151 If pamflip cannot fit the entire image in the amount of memory
152 you specify, it does the transformation in chunks, using tempo‐
153 rary files for intermediate results.
154
155 In strict horizontal transformations (left for right) or the
156 null transformation, pamflip never keeps more than one row in
157 memory, so the memory size is irrelevant and pamflip doesn't use
158 temporary files.
159
160 In strict vertical transformations (top for bottom), even when
161 you allow pamflip enough memory to keep the entire image in vir‐
162 tual memory, it accesses it in a single pass, which does not
163 cause any thrashing; the chunks in temporary files thus don't
164 help.
165
166 The real memory is important when you do a column for row type
167 of transformation (e.g. -rotate90). In that case, even if pam‐
168 flip can fit the entire image in virtual memory at once, if it
169 does not also fit in real memory, the program will thrash like
170 crazy because of the order in which pamflip accesses the pixels,
171 and that means it will take a ridiculously long time to run. A
172 proper -memsize drastically reduces the paging.
173
174 If you specify -memsize too large, pamflip may attempt to get
175 more virtual memory than the system allows it and fail. If it
176 can get the virtual memory, but -memsize is larger than the
177 amount of real memory the system allows it and the transforma‐
178 tion is row for column, it will page thrash and run very slowly.
179 A value even slightly too high is the same as infinity.
180
181 If you specify -memsize too small, the program will run slightly
182 more slowly because of extra overhead in manipulating temporary
183 files. Also, if your environment isn't set up to make temporary
184 files possible, pamflip will fail.
185
186 Doing the entire transformation "in memory" doesn't speed things
187 up as much as you might think, because even with the temporary
188 files, the data is just as likely to be in memory. Virtual mem‐
189 ory gets paged to disk and disk files get cached in memory. In
190 fact, the pixels fit much more compactly into memory when stored
191 in a temporary file than when stored "in memory" because pamflip
192 uses a more efficient format. So you're likely to have less
193 disk I/O when you allow pamflip less memory.
194
195 If you do not specify -memsize, pamflip assumes infinity.
196
197 This option did not exist before Netpbm 10.7 (August 2002).
198
199 Before Netpbm 10.42 (March 2008), this option applied only to
200 real memory. pamflip would always keep the entire image in vir‐
201 tual memory and if it could not get enough virtual memory, it
202 failed. pamflip accessed the pixels in an order designed to
203 keep real memory use within the specified amount.
204
205
206 -pagesize=bytes
207 bytes is the size in bytes of a paging unit -- the amount of
208 memory that gets paged in or out as an indivisible unit -- in
209 your system. The default is 4KiB.
210
211 This option has no effect.
212
213 Before Netpbm 10.42 (March 2008), pamflip used it to control its
214 use of real memory.
215
216 This option did not exist before Netpbm 10.7 (August 2002).
217
218
219
220
221 Miscellaneous
222 -verbose
223 This option causes pamflip to issue messages to Standard Error
224 about its progress.
225
226
227
229 pnmrotate(1), pnm(1), pam(1), jpegtran manual
230
231
233 pamflip replaced pnmflip in Netpbm 10.13 (December 2002). pamflip is
234 backward compatible, but also works on PAM images.
235
236
237
239 Copyright (C) 1989 by Jef Poskanzer.
240
242 This manual page was generated by the Netpbm tool 'makeman' from HTML
243 source. The master documentation is at
244
245 http://netpbm.sourceforge.net/doc/pamflip.html
246
247netpbm documentation 20 January 2008 Pamflip User Manual(0)