PAMSHUFFLE(1)

πŸ“¦
version 11.13.03 Β· 4 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

✨ pamshuffle ✨

okay bestie, welcome to the Pamshuffle User Manual(1) πŸ’– this one's a General Commands Manual situation, and honestly? it's giving "chaos but make it reversible" πŸŽ€


🌸 NAME 🌸

pamshuffle β€” shuffle pixels of a Netpbm image πŸ¦‹


⭐ SYNOPSIS ⭐

pamshuffle [-column [-randomseed integer]] [pamfile]

okay so before we go any further, some lil' quality-of-life notes ✨: you can totally use the minimum unique abbreviations of any option (shortcuts slay), you may use double hyphens instead of a single hyphen to denote options, and you may use white space in place of the equals sign to separate an option name from its value. flexible queen behavior πŸ’…


πŸ’œ DESCRIPTION πŸ’œ

so this program is part of Netpbm(1), periodt.

pamshuffle reads a Netpbm image as input and spits out an output file with the pixels shuffled. and listen β€” the operation only changes the location of existing pixels; nothing is discarded or added. not one crumb. we don't lose pixels here, we just ✨relocate✨ them 🧚

by default, pixels change location within rows independently. but you can also do the same shuffle on every row, which basically means the program is shuffling vertical columns of pixels. either way, there is no vertical rearrangement β€” which means images consisting entirely of horizontal stripes, like the national banners of Germany, Thailand and Ukraine, will be unchanged 😭 iconic of them honestly.

to shuffle vertically, or to perform a complete scramble, use pamshuffle together with pamflip. see the examples below hun 🫢

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

output is to Standard Output.

also!! pamshuffle works on a multi-image stream. it operates on each image in the stream independently and produces a multi-image stream output. multitasking main character energy πŸ‘‘

the shuffling algorithm is the widely known Fisher-Yates method. no cap, that's the one. πŸ”₯


πŸ’… OPTIONS πŸ’…

on top of the options common to all programs based on libnetpbm (most notably -quiet, see Common Options), 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=integer β€” 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 β€” reproducibility bestie, we love her πŸ’–

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 redirection to somewhere useful. (fr fr, don't just stare at it in your terminal 😭)

  • 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), pgmramp(1), pamflip(1), ppmshift(1), ppmspread(1), pam(1)


πŸ‘‘ HISTORY πŸ‘‘

pamshuffle was new in Netpbm 10.99 (June 2022). a young icon, a fresh face, already slaying πŸ’…


🌸 AUTHOR 🌸

By Akira F. Urushibata. Contributed to the public domain by the author. generous king behavior 🫢


πŸŽ€ 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

and that's a wrap bestie!! πŸ’– this has been the Pamshuffle User Manual(1), brought to you by the netpbm documentation crew, last Updated: whenever they updated it (the page says "Updated:" and then just... leaves it there, mysterious ✨). go shuffle some pixels, you got this πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from