pnmflip

Updated: 06 August 2002
Index  

NAME

pnmflip - flip or rotate a PNM image  

SYNOPSIS

pnmflip { -leftright | -lr | -topbottom | -tb | -transpose | -xy | -rotate90 | -r90 | -ccw | -rotate270 | -r270 | -cw | -rotate180 | -r180 } [-memsize=mebibytes] [-pagesize=bytes] [pnmfile]

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.  

DESCRIPTION

pnmflip flips a PNM image top for bottom or left for right, or transposes it horizontal for vertical, or rotates it 1, 2, or 3 quarter turns.

To rotate at other angles, use pnmrotate. It is much slower, though.

The input image is pnmfile, or Standard Input if pnmfile is not specified.  

OPTIONS

You must supply exactly one of the following options:

Before Netpbm 10.7 (August 2002), you could specify any number of these options, including zero. pnmflip would apply all the indicated transformations, in the order given. If you specified none, pnmflip would copy the input unchanged to the output. (Reason for the change: this kind of interpretation of options is inconsistent with the rest of Netpbm and most of the Unix world, and unlikely to have been exploited.)

-leftright
-lr
Flip left for right.
-topbottom
-tb
Flip top for bottom.
-transpose
-xy
Transpose horizontal for vertical. I.e. make the pixel at (x,y) be at (y,x).
-rot90
-ccw
Rotate clockwise 90 degrees.
-rot180
Rotate 180 degrees.
-rot270
-cw
Rotate clockwise 270 degrees.

The following options help pnmflip use memory efficiently. Some flipping operations on very large images can cause pnmflip 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 pnmflip approaches it, you're invited to read a complete explanation in the source code.

-memsize=mebibytes
mebibytes is the size in mebibytes (aka megabytes) of real memory (not virtual) available for pnmflip. pnmflip 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 pnmflip 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.

When you specify -memsize and are doing a row for column type of transformation, pnmflip does the transformation in multiple passes, each one with a working set size less than the specified value.

If your estimate is even slightly too large, it's the same as infinity. If you estimate too small, pnmflip will use more passes than it needs to, and thus will slow down proportional to the underestimate.

If you do not specify -memsize, pnmflip assumes infinite real memory and does the entire transformation in one pass.

This option did not exist before Netpbm 10.7 (August 2002).

-pagesizebytes
bytes 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.

This option did not exist before Netpbm 10.7 (August 2002).

Miscellaneous options:
-verbose
This option causes pnmflip to issue messages to Standard Error about its progress.
 

SEE ALSO

pnmrotate, pnm  

AUTHOR

Copyright (C) 1989 by Jef Poskanzer.
 

Index

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
SEE ALSO
AUTHOR