Debian Codegraph @

upstream/debian-unstable/man1/pamshuffle.1

raw
1 \
2 .\" This man page was generated by the Netpbm tool 'makeman' from HTML source.
3 .\" Do not hand-hack it! If you have bug fixes or improvements, please find
4 .\" the corresponding HTML page on the Netpbm website, generate a patch
5 .\" against that, and send it to the Netpbm maintainer.
6 .TH "Pamshuffle User Manual" 1 "" "netpbm documentation"
7
8 Updated:
9 .SH NAME
10 pamshuffle - Shuffle pixels of a Netpbm image
11
12 .UN synopsis
13 .SH SYNOPSIS
14
15 \fBpamshuffle\fP
16 [\fB-column\fP
17 [\fB-randomseed\fP \fIinteger\fP]]
18 [\fIpamfile\fP]
19 .PP
20 Minimum unique abbreviations of option are acceptable. You may use
21 double hyphens instead of single hyphen to denote options. You may use
22 white space in place of the equals sign to separate an option name
23 from its value.
24
25 .UN description
26 .SH DESCRIPTION
27 .PP
28 This program is part of
29 .BR "Netpbm" (1)\c
30 \&.
31 .PP
32 \fBpamshuffle\fP reads a Netpbm image as input and produces an output file
33 with the pixels shuffled. The operation only changes the location of existing
34 pixels; nothing is discarded or added.
35 .PP
36 By default, pixels change location within rows independently, but it is
37 also possible to perform the same shuffle on every row, meaning the program is
38 shuffling vertical columns of pixels. Either way, there is no vertical
39 rearrangement; this means images consisting entirely of horizontal stripes,
40 such as the national banners of Germany, Thailand and Ukraine, will be
41 unchanged.
42 .PP
43 To shuffle vertically, or to perform a complete scramble, use
44 \fBpamshuffle\fP together with \fBpamflip\fP. See examples below.
45 .PP
46 Input is from Standard Input if you don't specify the input file
47 \fIpamfile\fP.
48 .PP
49 Output is to Standard Output.
50 .PP
51 \fBpamshuffle\fP works on a multi-image stream. It operates on
52 each image in the stream independently and produces a multi-image
53 stream output.
54 .PP
55 The shuffling algorithm is the widely known
56 .UR https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle
57 Fisher-Yates method
58 .UE
59 \&.
60
61
62 .UN options
63 .SH OPTIONS
64 .PP
65 In addition to the options common to all programs based on libnetpbm
66 (most notably \fB-quiet\fP, see
67 .UR index.html#commonoptions
68 Common Options
69 .UE
70 \&), \fBpamshuffle\fP recognizes the following
71 command line options:
72
73
74 .TP
75 \fB-column\fP
76 Shuffle vertical columns, i.e. perform the same movement on all rows.
77 Without this option, the program shuffles each row independently.
78
79 .TP
80 \fB-randomseed\fP= \fIinteger\fP
81 This is the seed for the random number generator that generates the
82 pixels.
83 .sp
84 Use this to ensure you get the same image on separate invocations.
85 .sp
86 By default, \fBpamshuffle\fP uses a seed derived from the time of day
87 and process ID, which gives you quite uncorrelated results in multiple
88 invocations.
89
90
91
92 .UN examples
93 .SH EXAMPLES
94 .PP
95 In the following example, output is to Standard Output. You will probably
96 want to add redirection to somewhere useful.
97
98
99 .IP \(bu
100 .sp
101 \fBpamshuffle\fP is useful when you want to randomize the orderly
102 output of image generators such as \fBpamseq\fP and \fBpgmramp\fP.
103 .sp
104 Produce five permutations of integers 0 to 15:
105
106 .nf
107 \f(CW
108 pgmramp -lr -maxval=15 16 5 | pamshuffle -plain
109 \fP
110
111 .fi
112
113 .IP \(bu
114 Shuffle columns:
115
116 .nf
117 \f(CW
118 pamshuffle -column image.ppm
119 \fP
120
121 .fi
122
123
124 .IP \(bu
125 Shuffle rows:
126
127 .nf
128 \f(CW
129 pamflip -cw image.ppm | pamshuffle | pamflip -ccw
130 \fP
131
132 .fi
133
134 .IP \(bu
135 Perform complete shuffle:
136
137 .nf
138 \f(CW
139 pamflip -cw image.ppm | pamshuffle | pamflip -ccw | pamshuffle
140 \fP
141
142 .fi
143
144
145
146
147 .UN seealso
148 .SH SEE ALSO
149 .BR "pamseq" (1)\c
150 \&,
151 .BR "pgmramp" (1)\c
152 \&,
153 .BR "pamflip" (1)\c
154 \&,
155 .BR "ppmshift" (1)\c
156 \&,
157 .BR "ppmspread" (1)\c
158 \&,
159 .BR "pam" (1)\c
160 \&
161
162
163 .UN history
164 .SH HISTORY
165 .PP
166 \fBpamshuffle\fP was new in Netpbm 10.99 (June 2022).
167
168
169 .UN author
170 .SH AUTHOR
171
172 By Akira F. Urushibata. Contributed to the public domain by the author.
173 .SH DOCUMENT SOURCE
174 This manual page was generated by the Netpbm tool 'makeman' from HTML
175 source. The master documentation is at
176 .IP
177 .B http://netpbm.sourceforge.net/doc/pamshuffle.html
178 .PP