ⓘ This web page is about the old AlgoSim 2 software. Perhaps you are looking for the new Algosim 3 application?
AlgoSim
Homepage | Screenshots | Gallery of Visualisation | User's Guide | Function Reference | Download | FAQ | Support | Bugs and Solutions | Donate

Reference: pmNoise

pmNoise(pm) returns the pixmap pm with white random pixel noise. Specifically, each pixel in the result has a 50 % chance of being replaced with rgb(1, 1, 1).

pmNoise(pm, P) returns the pixmap pm with white random pixel noise. Specifically, each pixel in the result has a P ∈ [0, 1] chance of being replaced with rgb(1, 1, 1).

pmNoise(pm, P, c) returns the pixmap pm with coloured pixel noise. Specifically, each pixel in the result has a P ∈ [0, 1] chance of being replaced with c, a colour code.

Example:

  pmNoise(pm, 0.3, rgb(1, 0, 0))

pmNoise(pm, P, 30000000#16) returns the pixmap pm with coloured pixel noise. Specifically, each pixel in the result has a P ∈ [0, 1] chance of being replaced with a random colour.

Example:

  pmNoise(pm, 0.3, 30000000#16)

Hint: You might want to declare a global constant

  randomColour ≔ 30000000#16

in startup.prg.