# pamshuffle - Shuffle pixels of a Netpbm image - man - [phpMan]

_Pamshuffle_ _User_ [_Manual_(1)](https://www.chedong.com/phpMan.php/man/Manual/1/markdown)              General Commands Manual             _Pamshuffle_ _User_ [_Manual_(1)](https://www.chedong.com/phpMan.php/man/Manual/1/markdown)

Updated:

## NAME
       pamshuffle - Shuffle pixels of a Netpbm image


## SYNOPSIS
       **pamshuffle **[**-column **[**-randomseed _**integer_]] [_pamfile_]

       Minimum unique abbreviations of option are acceptable.  You may use double hyphens instead of
       single hyphen to denote options.  You may use white space in place of the equals sign to sep‐
       arate an option name from its value.


## DESCRIPTION
       This program is part of [**Netpbm**(1)](https://www.chedong.com/phpMan.php/man/Netpbm/1/markdown).

       **pamshuffle  **reads  a  Netpbm image as input and produces an output file with the pixels shuf‐
       fled.  The operation only changes the location of existing pixels; nothing  is  discarded  or
       added.

       By default, pixels change location within rows independently, but it is also possible to per‐
       form the same shuffle on every row, meaning the program is shuffling vertical columns of pix‐
       els.   Either  way, there is no vertical rearrangement; this means images consisting entirely
       of horizontal stripes, such as the national banners of Germany, Thailand and Ukraine, will be
       unchanged.

       To shuffle vertically, or to perform a complete scramble, use **pamshuffle **together  with  **pam‐**
       **flip**.  See examples below.

       Input is from Standard Input if you don't specify the input file _pamfile_.

       Output is to Standard Output.

       **pamshuffle  **works  on a multi-image stream.  It operates on each image in the stream indepen‐
       dently and produces a multi-image stream output.

       The shuffling algorithm is the widely known [ Fisher-Yates method](<https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle>) .



## OPTIONS
       In addition to the options common to all programs based on libnetpbm  (most  notably  **-quiet**,
       see [ Common Options](index.html#commonoptions) ), **pamshuffle **recognizes the following command line options:



### -column
              Shuffle  vertical  columns,  i.e. perform the same movement on all rows.  Without this
              option, the program shuffles each row independently.


### -randomseed
              This is the seed for the random number generator that generates the pixels.

              Use this to ensure you get the same image on separate invocations.

              By default, **pamshuffle **uses a seed derived from the time of day and process ID,  which
              gives you quite uncorrelated results in multiple invocations.




## EXAMPLES
       In  the following example, output is to Standard Output.  You will probably want to add redi‐
       rection to somewhere useful.



       •


              **pamshuffle **is useful when you want to randomize the orderly output of image generators
              such as **pamseq **and **pgmramp**.

              Produce five permutations of integers 0 to 15:

              pgmramp -lr -maxval=15 16 5 | pamshuffle -plain



       •      Shuffle columns:

              pamshuffle -column image.ppm




       •      Shuffle rows:

              pamflip -cw image.ppm | pamshuffle | pamflip -ccw



       •      Perform complete shuffle:

              pamflip -cw image.ppm | pamshuffle | pamflip -ccw | pamshuffle






## SEE ALSO
       [**pamseq**(1)](https://www.chedong.com/phpMan.php/man/pamseq/1/markdown), [**pgmramp**(1)](https://www.chedong.com/phpMan.php/man/pgmramp/1/markdown), [**pamflip**(1)](https://www.chedong.com/phpMan.php/man/pamflip/1/markdown), [**ppmshift**(1)](https://www.chedong.com/phpMan.php/man/ppmshift/1/markdown), [**ppmspread**(1)](https://www.chedong.com/phpMan.php/man/ppmspread/1/markdown), [**pam**(1)](https://www.chedong.com/phpMan.php/man/pam/1/markdown)



## HISTORY
       **pamshuffle **was new in Netpbm 10.99 (June 2022).



## AUTHOR
       By Akira F. Urushibata.  Contributed to the public domain by the author.

## DOCUMENT SOURCE
       This manual page was generated by the Netpbm tool 'makeman' from  HTML  source.   The  master
       documentation is at

              **<http://netpbm.sourceforge.net/doc/pamshuffle.html>**

netpbm documentation                                                       _Pamshuffle_ _User_ [_Manual_(1)](https://www.chedong.com/phpMan.php/man/Manual/1/markdown)
