Generating images from procedural noise

Posted: August 5, 2012 in Uncategorized

Procedural noise, as exemplified by Perlin Noise, is a fundamental primitive used for computer generated images. I recently implemented a Perlin-style noise function in my Clojure image snthesis library clisk, and here are some of the early results (with clisk 0.3.0 as available on clojars).

The pure noise function itself looks like this:

(show (scale 0.2 noise))

Image

This pure noise is a function that produces scalar values in the range [0..1] (i.e. black to white) for every point in space. Directly showing this function reveals random lumpy features which are spaced roughly every one unit (hence scale 0.2 to allows us to see approx 5*5 features).

Pure noise itself isn’t so interesting – what makes it powerful is the ability to combine it in different ways in order to make other patterns. For example, using noise to drive the hue and lightness of the image gives us an interesting coloured pattern:

(show (scale 0.2 (rgb-from-hsl [noise 0.8 noise])))

Image

Using noise to offset another pattern creates random curvy distortions:

 (show (offset (scale 0.2 noise) (checker black white)))

Image

Adding noise at different scales can create a cloud-like random pattern – actually a form of fractal noise. This is such a common pattern that clisk provides a special primitive for this: plasma.

 (show (scale 0.2 plasma))

Image

Using noise or plasma as a height-map can create some rough rock-like features. Combine this with some colouring and you can make some visually interesting rock textures:

(show (scale 0.2 
  (render-lit
    (rgb-from-hsl [noise 0.8 0.8])
    (v* 6 plasma))))

Image

My early conclusion is that the different types of noise are an extremely versatile and powerful part of the image synthesis toolkit. I’ll be experimenting with more different ways of generating and using noise functions as I get time over the next few weeks.

Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s