PAMADDNOISE(1)

πŸ’– PAMADDNOISE(1) β€” the Pamaddnoise User Manual, but make it make sense πŸ’–

okay bestie, this is a General Commands Manual page, and it's the Pamaddnoise User Manual. It's all about sprinkling noise on your images, and honestly? It ate. Let's get into it. πŸŽ€


✨ NAME ✨

pamaddnoise β€” add noise to a Netpbm image πŸ¦‹


✨ SYNOPSIS ✨

pamaddnoise { [-type gaussian]

[-sigma1 value]

[-sigma2 value] | -type  multiplicative_gaussian

[-mgsigma value] | -type impulse

[-tolerance ratio] | -type  laplacian

[-lsigma value] | -type  poisson

[-lambda value] } [-seed int]

[netpbmfile]

like, read it slowly, it's a whole choose-your-own-adventure of noise types πŸ’…


✨ DESCRIPTION ✨

So this program is part of Netpbm(1). 🌸

pamaddnoise adds the noise type you asked for to a Netpbm image. That's it. That's the gig.

Important vibe check: pamaddnoise treats a PPM image as 3 independent planes, not as a plane of colors in a color space. That's the whole energy of this tool, no cap.

✨ OPTIONS ✨

On top of the options that every libnetpbm-based program has (most notably -quiet, see Common Options), pamaddnoise is obsessed with these bad boys:

  • -type noise_type β€” pick your noise by name. Your options are: gaussian, multiplicative_gaussian, impulse, laplacian, poisson. You only need to type enough letters for it to be unique, bestie β€” no need to spell out the whole thing. The default noise type is gaussian.

and now, the noise types themselves, in order:

  • gaussian β€” to each sample value gets added the value of a two Gaussian random variables. 😭 The variance of one of them doesn't care about the sample value at all (it's independent), while the other one's variance is proportional to the sample value. You control these two variances with the options -sigma1 and -sigma2 (and yeah, you can eliminate either one by setting its variance to 0). The mean of the Gaussian distributions is 0. periodt.
  • multiplicative_gaussian β€” (the page gives this one no extra blurb of its own β€” the option list below is where it spills the tea) 🫢
  • impulse β€” this is your classic 'salt and pepper' noise. Samples get randomly changed to zero or full brightness, or just left alone. It's also known as salt and pepper noise, because in a grayscale picture it adds white pixels and black pixels, which look like salt and pepper, respectively. πŸ§‚ You control this with the options -tolerance and -salt.
  • laplacian β€” (no extra blurb on this one either, the -lsigma option below has you covered) πŸ’œ
  • poisson β€” (also blurb-less on the page β€” see -lambda below) ⭐

and here come the tuning knobs, in the exact order the page gives them:

  • -lambda value β€” this is valid only with -type=poisson. It's the expected value of the Poisson distribution for a sample value of maximum intensity. For other intensities the expected value is proportional; e.g. for half intensity, it's half this value. ✨ The default value is 12.
  • -lsigma value β€” meaningful only for laplacian noise. πŸ’… The default value is 10.0.
  • -mgsigma value β€” valid only for multiplicative gaussian noise. 🌈 The default value is 0.5.
  • -seed int β€” this is the random number generator seed value. Use this to get repeatable results. πŸŽ€
  • -sigma1 value β€” valid only for gaussian noise. It's the standard deviation of the Gaussian random variable that gets multiplied by the square root of each sample value and added to that sample value. 😌 The default value is 4.0.
  • -sigma2 value β€” valid only for gaussian noise. It's the standard deviation of the Gaussian random variable that gets added directly to each sample value. πŸ¦‹ The default value is 20.0.
  • -tolerance fraction β€” valid only for impulse noise. fraction is the fraction of samples that get changed in the output. Whether each changed sample becomes salt or pepper is controlled by -salt. πŸ’€ The default value is 0.10.
  • -salt=fraction β€” valid only for impulse noise. fraction is the fraction of the pixels that are changed that get changed to salt (maxval); the rest get changed to pepper (0). πŸ§‚ The default is 0.5 (half salt, half pepper). This option was new in Netpbm 11.04 (September 2023). Before that, the noise was always half salt and half pepper.

✨ REFERENCES ✨

the receipts, bestie, we cite our sources πŸ“š

  • "Adaptive Image Restoration in Signal-Dependent Noise" by R. Kasturi Institute for Electronic Science, Texas Tech University, 1982
  • "Digital Image Processing Algorithms" by Ioannis Pitas, Prentice Hall, 1993 ISBN 0-13-145814-0

✨ SEE ALSO ✨

go read these too, they're iconic πŸ‘‘

pgmnoise(1), pgmmedian(1), pnm(1), pam(1),


✨ HISTORY ✨

lore time πŸ•°οΈ

pamaddnoise was added to Netpbm in Version 10.29 (August 2005). Before that it had been distributed by Mike Burns via his own web site (and continued to be so, fr fr).

Burns' version β€” and the one that landed in Netpbm 10.29 β€” was called pnmaddnoise and worked only on PNM images. In Netpbm 10.30, it got converted to handle PAM images and renamed to pamaddnoise. glow-up of the century honestly πŸ’–


✨ AUTHOR ✨

Copyright (C) 1995 by Mike Burns <burns@cac.psu.edu> 🌸


✨ 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/pamaddnoise.html

and that's the whole page, bestie!! πŸ₯³ no cap, every flag survived the rewrite.

signing off β€” netpbm documentation, dated 21 August 2023. mwah πŸ’‹ πŸŽ€ ✨ πŸ¦‹

πŸ“¦ where this page comes from