| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.3//EN"> |
| 2 | <html><head><title>Pamaddnoise User Manual</title></head> |
| 3 | <body> |
| 4 | <h1>pamaddnoise</h1> |
| 5 | Updated: 21 August 2023 |
| 6 | <br> |
| 7 | <a href="#index">Table Of Contents</a> |
| 8 | |
| 9 | <h2>NAME</h2> |
| 10 | |
| 11 | pamaddnoise - add noise to a Netpbm image |
| 12 | |
| 13 | <h2 id="synopsis">SYNOPSIS</h2> |
| 14 | |
| 15 | <b>pamaddnoise</b> |
| 16 | |
| 17 | <br> |
| 18 | { |
| 19 | <br> |
| 20 | |
| 21 | [<b>-type</b> <b>gaussian</b>] |
| 22 | |
| 23 | [<b>-sigma1</b> <i>value</i>] |
| 24 | |
| 25 | [<b>-sigma2</b> <i>value</i>] |
| 26 | |
| 27 | <br> |
| 28 | | |
| 29 | <br> |
| 30 | |
| 31 | |
| 32 | <b>-type </b> <b>multiplicative_gaussian</b> |
| 33 | |
| 34 | [<b>-mgsigma</b> <i>value</i>] |
| 35 | |
| 36 | <br> |
| 37 | | |
| 38 | <br> |
| 39 | |
| 40 | <b>-type</b> <b>impulse</b> |
| 41 | |
| 42 | [<b>-tolerance</b> <i>ratio</i>] |
| 43 | |
| 44 | <br> |
| 45 | | |
| 46 | <br> |
| 47 | |
| 48 | <b>-type </b> <b>laplacian</b> |
| 49 | |
| 50 | [<b>-lsigma</b> <i>value</i>] |
| 51 | |
| 52 | <br> |
| 53 | | |
| 54 | <br> |
| 55 | |
| 56 | <b>-type </b> <b>poisson</b> |
| 57 | |
| 58 | [<b>-lambda</b> <i>value</i>] |
| 59 | |
| 60 | <br> |
| 61 | } |
| 62 | <br> |
| 63 | |
| 64 | [<b>-seed</b> <i>int</i>] |
| 65 | |
| 66 | [<i>netpbmfile</i>] |
| 67 | |
| 68 | <h2 id="description">DESCRIPTION</h2> |
| 69 | |
| 70 | <p>This program is part of <a href="index.html">Netpbm</a>. |
| 71 | |
| 72 | <p><b>pamaddnoise</b> adds the specified noise type to a Netpbm image. |
| 73 | <b>pamaddnoise</b> treats a PPM image as 3 independent planes, not as |
| 74 | a plane of colors in a color space. |
| 75 | |
| 76 | <h2 id="options">OPTIONS</h2> |
| 77 | |
| 78 | <p>In addition to the options common to all programs based on libnetpbm |
| 79 | (most notably <b>-quiet</b>, see <a href="index.html#commonoptions"> |
| 80 | Common Options</a>), <b>pamaddnoise</b> recognizes the following |
| 81 | command line options: |
| 82 | |
| 83 | <dl compact> |
| 84 | <dt><b>-type</b> <i>noise_type</i> |
| 85 | |
| 86 | <dd> |
| 87 | Select type of noise by name. The following noise types are |
| 88 | available: gaussian, multiplicative_gaussian, impulse, laplacian, |
| 89 | poisson. Only enough letters to be unique are required for the noise |
| 90 | type option. The default noise type is <b>gaussian</b>. |
| 91 | |
| 92 | <dl> |
| 93 | <dt><b>gaussian</b> |
| 94 | <dd>To each sample value is added the value of a two Gaussian random variables. |
| 95 | The variance of one is independent of the sample value, while the variance |
| 96 | of the other is proportional to the sample value. You control these |
| 97 | variances with options <b>-sigma1</b> and <b>-sigma2</b> (and can eliminate |
| 98 | either by setting the variance to 0). The mean of the Gaussian |
| 99 | distributions is 0. |
| 100 | |
| 101 | <dt><b>multiplicative_gaussian</b> |
| 102 | <dt><b>impulse</b> |
| 103 | <dd>This is "salt and pepper" noise. Samples are changed randomly |
| 104 | to zero or full brightness or left alone. This is also know as salt and |
| 105 | pepper noise, as in a grayscale picture, it adds white pixels and black |
| 106 | pixels, which look like salt and pepper, respectively. Control this with |
| 107 | options <b>-tolerance</b> and <b>-salt</b>. |
| 108 | |
| 109 | <dt><b>laplacian</b> |
| 110 | |
| 111 | <dt><b>poisson</b> |
| 112 | </dl> |
| 113 | |
| 114 | <dt><b>-lambda</b> <i>value</i> |
| 115 | |
| 116 | <dd> |
| 117 | This is valid only with <b>-type=poisson</b>. It is the expected value |
| 118 | of the Poisson distribution for a sample value of maximum intensity. The |
| 119 | expected value for other intensities is proportional; e.g. for half intensity, |
| 120 | it is half this value. |
| 121 | |
| 122 | <p>The default value is 12. |
| 123 | |
| 124 | <dt><b>-lsigma</b> <i>value</i> |
| 125 | |
| 126 | <dd>This is meaningful only for laplacian noise. |
| 127 | |
| 128 | <p>The default value is 10.0. |
| 129 | |
| 130 | <dt><b>-mgsigma</b> <i>value</i> |
| 131 | |
| 132 | <dd>This is valid only for multiplicative gaussian noise. |
| 133 | |
| 134 | <p>The default value is 0.5. |
| 135 | |
| 136 | <dt><b>-seed</b> <i>int</i> |
| 137 | |
| 138 | <dd>This is the random number generator seed value. Use this to get |
| 139 | repeatable results. |
| 140 | |
| 141 | <dt><b>-sigma1</b> <i>value</i> |
| 142 | |
| 143 | <dd>This is valid only for gaussian noise. It is the standard deviation |
| 144 | of the Gaussian random variable that is multiplied by the square root of |
| 145 | each sample value and added to that sample value. |
| 146 | <p> |
| 147 | The default value is 4.0. |
| 148 | |
| 149 | <dt><b>-sigma2</b> <i>value</i> |
| 150 | |
| 151 | <dd>This is valid only for gaussian noise. |
| 152 | It is the standard deviation of the Gaussian random variable that is |
| 153 | added directly to each sample value. |
| 154 | <p> |
| 155 | The default value is 20.0. |
| 156 | |
| 157 | <dt><b>-tolerance</b> <i>fraction</i> |
| 158 | |
| 159 | <dd>This is valid only for impulse noise. |
| 160 | <i>fraction</i> is the fraction of samples that are changed |
| 161 | in the output. Whether each is changed to salt or pepper is controlled by |
| 162 | <b>-salt</b>. |
| 163 | |
| 164 | <p>The default value is 0.10. |
| 165 | |
| 166 | <dt><b>-salt=<i>fraction</i></b> |
| 167 | <dd>This is valid only for impulse noise. <i>fraction</i> is the |
| 168 | fraction of the pixels that are changed that are changed to salt (maxval); |
| 169 | the rest are changed to pepper (0). |
| 170 | |
| 171 | <p>The default is 0.5 (half salt, half pepper). |
| 172 | |
| 173 | <p>This option was new in Netpbm 11.04 (September 2023). Before that, the |
| 174 | noise is always half salt and half pepper. |
| 175 | |
| 176 | </dl> |
| 177 | |
| 178 | <h2 id="references">REFERENCES</h2> |
| 179 | |
| 180 | <ul> |
| 181 | <li>"Adaptive Image Restoration in Signal-Dependent Noise" |
| 182 | by R. Kasturi Institute for Electronic Science, Texas Tech University, |
| 183 | 1982 |
| 184 | |
| 185 | <li>"Digital Image Processing Algorithms" by Ioannis Pitas, |
| 186 | Prentice Hall, 1993 ISBN 0-13-145814-0 |
| 187 | |
| 188 | </ul> |
| 189 | |
| 190 | <h2 id="seealso">SEE ALSO</h2> |
| 191 | |
| 192 | <a href="pgmnoise.html">pgmnoise</a>, |
| 193 | <a href="pgmmedian.html">pgmmedian</a>, |
| 194 | <a href="pnm.html">pnm</a>, |
| 195 | <a href="pam.html">pam</a>, |
| 196 | |
| 197 | <h2 id="history">HISTORY</h2> |
| 198 | |
| 199 | <p><b>pamaddnoise</b> was added to Netpbm in Version 10.29 (August 2005). |
| 200 | It had been distributed by Mike Burns via his own web site before that |
| 201 | (and continued to be so). |
| 202 | |
| 203 | <p>Burns' version, and the one in Netpbm 10.29, was called <b>pnmaddnoise</b> |
| 204 | and worked only on PNM images. In Netpbm 10.30, it was converted to handle |
| 205 | PAM images and renamed to <b>pamaddnoise</b>. |
| 206 | |
| 207 | <h2 id="author">AUTHOR</h2> |
| 208 | |
| 209 | Copyright (C) 1995 by Mike Burns <<a |
| 210 | href="mailto:[email protected]">[email protected]</a>> |
| 211 | |
| 212 | <hr> |
| 213 | <h2 id="index">Table Of Contents</h2> |
| 214 | <ul> |
| 215 | <li><a href="#synopsis">SYNOPSIS</a> |
| 216 | <li><a href="#description">DESCRIPTION</a> |
| 217 | <li><a href="#options">OPTIONS</a> |
| 218 | <li><a href="#references">REFERENCES</a> |
| 219 | <li><a href="#seealso">SEE ALSO</a> |
| 220 | <li><a href="#history">HISTORY</a> |
| 221 | <li><a href="#author">AUTHOR</a> |
| 222 | </ul> |
| 223 | </body> |
| 224 | </html> |