Monday, January 23, 2012

How I Make Stripes To Reflect The Natural World

... or "Multidimensional Mathematical Noise In Nature, As Reflected In Woven Thread Ordering"

Caution: Math! Skip to the final image if math is boring to you.

In a previous life I worked in digital special effects. I got into the studios because of the skill I developed as a 3D graphics software developer. In that world, my specialty was the mathematical modeling of natural surface textures like clouds, stone, wood, and dirt.

Back in those days, computer memory was extremely expensive. Capturing and storing high-resolution images and using them to "paint" the surface of digital objects was often cost-prohibitive. What we needed was the ability to create mathematical formulas that could generate natural-looking surfaces without using photographs.

One of the tricks we used was called "fBm noise." fBm means "fractional Brownian motion". It's what you get when you take regular noise (like TV static), scale it to several different sizes, and combine those different-dimensioned noises together.

This is one of the algorithms that's still used to create all kinds of stuff like digital landscapes because of its uncanny ability to mimic nature.

For each of the following images, I've scaled the noise, stretched the last row of pixels so we can visualize the thread pattern, and drawn a graph based on the brightness of each column of pixels.

The thing to notice is how each of the single-dimension images just looks like TV static. The one called 1+8 is made by combining scale 1 and scale 8. There is so much scale difference between the two that they don't blend.

But look at that final image. Doesn't it look like an aerial photo of trees? Or a closeup photo of polar fleece? Maybe a microscope image of mold? The point is that it looks like something more than just static. It looks "natural".

There are two tricks to making it look exactly like a particular item from nature. The first comes in choosing the scales. Doubling is easy, but nature doesn't usually do that. The second is choosing how strongly each layer contributes to the final image.

You might wonder the point of all this. Well, believe it or not, this concept of scales of noise has a large bearing on how I choose the order of the threads in my warp. Right now I'm winding a beam based on exposed, weathered sedimentary rock. When I'm choosing where to place the threads within a section, I'm continually comparing the contrast to the value graph that would come from real stone. I want the color gradients to match what real stone does, between individual threads, between sections, and across the whole beam.

These colors are nothing like the colors of thread that I have, but I'm not looking at the colors. I'm looking at the transitions between the colors. That little graph shows me how fast the colors are changing in various parts of the photograph. If I change my threads with a similar speed, I should get a similar feel in the finished warp. And the multi-dimensional noise stuff helps me to figure out how often and how abruptly I should change the speed.

The plain-english bottom line is that I need the transitions to be smooth, but not too smooth. There is some "up and down", but not too much. It's mostly an uphill climb. Shades from other sections do appear, but not frequently.

So I'm keeping all that in mind as I wind. As always, fingers crossed!

1 comment:

Andrew Kieran said...

this is excellent stuff mate. funny coincidence maybe, but i've been getting interested in the concept of using maths and pattern generation to create cloth. Don't really have the maths to deal with fractals, but this is very interesting stuff anyway.

wee side note, for some reason the body of the post didn't seem to start until after the text on the left hand navigation bar finished. which is odd, but maybe just down to my browser.