Plan 9 from Bell Labs’s /usr/web/sources/contrib/pac/sys/doc/netpbm/ms/pamflip.ms

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


.TL
Pamflip User Manual
.SH 1
pamflip
.LP
Updated: 18 February 2005
.br
Table Of Contents
.SH 2
NAME
.LP
pamflip - flip or rotate a PAM or PNM image
.SH 2
SYNOPSIS
.LP
\fBpamflip\fR
{
\fB-leftright\fR | \fB-lr\fR |
\fB-topbottom\fR | \fB-tb\fR |
\fB-transpose\fR | \fB-xy\fR |
\fB-rotate90\fR | \fB-r90\fR | \fB-cw\fR |
\fB-rotate270\fR | \fB-r270\fR | \fB-ccw\fR |
\fB-rotate180\fR | \fB-r180\fR
\fB-null\fR |
\fB-xform=\fR\fIxform1\fR\fB,\fR\fIxform2\fR...
}
[\fB-memsize=\fR\fImebibytes\fR]
[\fB-pagesize=\fR\fIbytes\fR]
[\fIpamfile\fR]
.LP
All options can be abbreviated to their shortest unique prefix.  You
may use two hyphens instead of one to designate an option.  You may
use either white space or an equals sign between an option name and
its value.
.SH 2
DESCRIPTION
.LP
.LP
This program is part of Netpbm.
.LP
\fBpamflip\fR flips a PAM or PNM image top for bottom or left for right,
or transposes it horizontal for vertical, or rotates it 1, 2, or 3
quarter turns.
.LP
To rotate at other angles, use \fBpnmrotate\fR.  It is much slower,
though.
.LP
The input image is \fIpamfile\fR, or Standard Input if \fIpamfile\fR
is not specified.
.LP
To flip/rotate a JFIF (JPEG) image losslessly, use \fBjpegtran\fR.
\fBjpegtran\fR is part of the Independent Jpeg Group's compression
library package, not part of Netpbm.  The normal Netpbm way to flip a
JFIF file would be to convert it to PNM, use \fBpamflip\fR, and convert
back to JFIF.  But since JPEG compression is lossy, the resulting image
would have less quality than the original.  \fBjpegtran\fR, on the other
hand, can do this particular transformation directly on the compressed
data without loss.
.SH 2
OPTIONS
.LP
.LP
You must supply exactly one of the following options:
.LP
\fBpamflip\fR's predecessor (before Netpbm 10.7 - August 2002)
\fBpnmflip\fR did not have the \fB-xform\fR option and instead
allowed you to specify any number of the other options, including
zero.  It applied all the indicated transformations, in the order
given, just like with \fBpamflip\fR's \fB-xform\fR option.  (Reason
for the change: this kind of interpretation of options is inconsistent
with the rest of Netpbm and most of the Unix world, and thus hard to
understand and to implement).
.RS
.IP "\fB-leftright\fR"
.IP "\fB-lr\fR"
Flip left for right.
.IP "\fB-topbottom\fR"
.IP "\fB-tb\fR"
Flip top for bottom.
.IP "\fB-transpose\fR"
.IP "\fB-xy\fR"
Transpose horizontal for vertical.  I.e. make the pixel at (x,y) be
at (y,x).
.IP "\fB-rotate90\fR"
.IP "\fB-r90\fR"
.IP "\fB-ccw\fR"
Rotate counterclockwise 90 degrees.
.IP "\fB-rotate180\fR"
.IP "\fB-r180\fR"
Rotate 180 degrees.
.IP "\fB-rotate270\fR"
.IP "\fB-r270\fR"
.IP "\fB-cw\fR"
Rotate counterclockwise 270 degrees (clockwise 90 degrees)
.IP "\fB-null\fR "
No change.  (The purpose of this option is the
convenience of programs that invoke \fBpamflip\fR after computing the
kind of transformation desired, including none at all).
.LP
This option was new in Netpbm 10.13 (December 2002).
.IP "\fB-xform=\fR\fIxform1\fR\fB,\fR\fIxform2\fR..."
Apply all the transforms listed, in order.  The valid values for
the transforms are as follows and have the same meanings as the
identically named options above.
.IP \(bu
leftright
.IP \(bu
topbottom
.IP \(bu
transpose
.LP
.LP
This option was new in Netpbm 10.13 (December 2002).
.RE
.LP
The following options help \fBpamflip\fR use memory efficiently.
Some flipping operations on very large images can cause \fBpamflip\fR
to have a very large working set, which means if you don't have enough
real memory, the program can page thrash, which means it takes a
ridiculous amount time to run.  If your entire image fits in real
memory, you don't have a problem.  If you're just flipping top for
bottom or left for right, you don't have a problem.  Otherwise, pay
attention.  If you're interested in the details of the thrashing
problem and how \fBpamflip\fR approaches it, you're invited to read
a complete explanation in comments in the source code.
.RS
.IP "\fB-memsize=\fR\fImebibytes\fR"
\fImebibytes\fR is the size in mebibytes (aka megabytes) of
real memory (not virtual) available for \fBpamflip\fR.
\fBpamflip\fR does nothing special to allocate real memory or control
it's allocation -- it gets whatever it gets just by referencing
virtual memory normally.  This is the maximum amount that
\fBpamflip\fR can be expected to end up with by doing that.  This is
just about impossible for you to know, of course, but you can
estimate.  The total real memory in your system should be a major
factor in your estimate.
.LP
When you specify \fB-memsize\fR and are doing a row for column type
of transformation, \fBpamflip\fR does the transformation in multiple
passes, each one with a working set size less than the specified value.
.LP
If your estimate is even slightly too large, it's the same as
infinity.  If you estimate too small, \fBpamflip\fR will use more
passes than it needs to, and thus will slow down proportional to the
underestimate.
.LP
If you do not specify \fB-memsize\fR, \fBpamflip\fR assumes infinite
real memory and does the entire transformation in one pass.
.LP
This option did not exist before Netpbm 10.7 (August 2002).
.IP "\fB-pagesize=\fR\fIbytes\fR"
\fIbytes\fR is the size in bytes of a paging unit -- the amount of
memory that gets paged in or out as an indivisible unit -- in your system.
The default is 4KiB.
.LP
This option did not exist before Netpbm 10.7 (August 2002).
.RE
Miscellaneous options:
.RS
.IP "\fB-verbose\fR"
This option causes \fBpamflip\fR to issue messages to Standard Error
about its progress.
.RE
.SH 2
SEE ALSO
.LP
pnmrotate, 
pnm,
\fBjpegtran\fR manual
.SH 2
HISTORY
.LP
.LP
\fBpamflip\fR replaced \fBpnmflip\fR in Netpbm 10.13 (December 2002).
\fBpamflip\fR is backward compatible, but also works on PAM images.
.SH 2
AUTHOR
.LP
Copyright (C) 1989 by Jef Poskanzer.
.br
\l'5i'
.SH 2
Table Of Contents
.LP
.IP \(bu
NAME
.IP \(bu
SYNOPSIS
.IP \(bu
DESCRIPTION
.IP \(bu
OPTIONS
.IP \(bu
SEE ALSO
.IP \(bu
HISTORY
.IP \(bu
AUTHOR
.LP

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.