On faking a speckled paint finish

Perlin color swatches

I’ve been experimenting a lot with Perlin noise recently in Mathematica, thanks to the example implementation given in the documentation for Compile[].

(I must however note that the method implemented in the Mathematica help file is not actually the “classic” Perlin noise. In particular, the compiled fade[] routine is the Hermite quintic produced by InterpolatingPolynomial[{{{0}, 0, 0, 0}, {{1/2}, 1/2}, {{1}, 1, 0, 0}}, x], not the classical one that makes use of InterpolatingPolynomial[{{{0}, 0, 0}, {{1/2}, 1/2}, {{1}, 1, 0}}, x]. The Mathematica code also makes use of the centers of the edges of a cube as the gradients, stored in the grad variable within the function dot[], as proposed in Perlin’s update.)

The grid of swatches depicted above is just one sample of Perlin noise, colored differently with 49 of the gradient color schemes available in ColorData["Gradients"], and rendered with ReliefPlot[]. The choice of coloring scheme makes (at least to me) a heap of difference in the visual effect of Perlin noise. I like how the outputs look like samples of the fancy speckled paint I sometimes see in hardware stores.

I still haven’t fully digested the theory behind Perlin noise (though Gustavson’s notes seem to be one of the better treatments I’ve seen), but my experiments with the routines thus far have been quite encouraging.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: