DissolveToColorStochastically
Returns a pixmap with each pixel unchanged or set to a given colour with a given probability.
Syntax
-
DissolveToColorStochastically(pm, c[, p])-
pmis a pixmap -
cis a colour -
pis a number in [0, 1]
-
-
DissolveToColorRegularly(pm, f[, p])-
pmis a pixmap -
fis a colour function in two integer variables -
pis a number in [0, 1]
-
Description
DissolveToColorStochastically(pm, c, p) returns pm with each pixel either unaltered or set to c with the probability of the latter being p. If omitted, p defaults to 0.5.
The overload with a function instead of a colour will use f(x, y) as the colour at pixel (x, y).
Examples
DissolveToColorStochastically(ExampleData("rabbit"), (x, y) ↦ hsv(x + y, 1, 1), 0.25)
