Playing with Smoke

A Ball of Fire
OK enough of the fractals; they still take a long time to generate even with today's PC's. But I'm still in an abstract frame of mind, so I thought I'd have a go at playing with smoke.

Smoke Cocktail
The set up is really quite simple:
  1. A Black background - I used an A2 piece of black mounting board (about £2.00 from your local craft shop),
  2. Incense sticks - I used mellow vanilla incense (about 0.75p from your local 'Hippy' shop), the smell hangs around for ages so make sure it's something you can live with. I don't know of anything else that gives off such a consistent plume of smoke.
  3. A flash gun will help give definition to the smoke. I have to admit I didn't try shooting without flash. I wish I had because getting the right level of flash was tricky - I wanted to bring out the detail in the smoke while leaving the background an intense black. The flash was placed to the side of the incense stick, in front of the camera, and fired remotely by the D80's onboard flash. 
  4. Tripod, and finally
  5. Nikon Infrared Remote Control (ML-L3 RC - about £16.50 from any Nikon supplier).
One that got away - spoilt by light spillage
The most critical aspect of the setup was making sure that light didn't spill onto either the lens or the black board background. Initial efforts had light spillage on the background and no matter what I did in post processing I couldn't eliminate the glare on the card.

I overcame the problem by increasing the distance between the burning incense stick and the background card and then by using another piece of card and tape to fashion a gobo to stop stray light hitting the card.

Focusing and Exposure:  I set the camera to manual focus (it's difficult for any auto focusing system to cope with smoke as there is little contrast between it and the background) but ensured that the lens aperture was set to give a reasonable depth of field. All of the photos were taken at ISO 100, F/8 and 1/125sec (giving a 1 stop underexposure). It wasn't necessary to allow for any flash compensation.

Post Processing: In Nikon Capture NX2 (although if you just want to apply a nice colour gradient to the smoke it might be quicker in Photoshop).

Step1: Brighten the smoke using a combination of Curves, Exposure, and Shadow Protection.

Step2: fine tune the contrast and brightness. The Hue slider selects the targeted colour range to apply contrast to. The colour selected is lightened by the image, while the complementary colour is darkened.
Step3: adjust the saturation and warmth
Step4: (Optional) Invert the colours. This changes the background to white. It also inverts the colour of the smoke - if you don't like the new colour then open the adjustment layers created in steps 2 & 3 to readjust the colour; or adjust Hue and Chroma by switching from Master Lightness (in this adjustment) to Hue and/or Chroma

Step5a: I wanted to apply different colours to different parts of the smoke - starting with the bottom left corner. I first created an oval selection using the Oval Marquee Selection Tool. Then I applied a Circular Gradient to the selection.

Step5b: I then used a (red) colorize adjustment to apply to the selection layer I'd just created. This colours everything in the selection, red - to colorize selectively choose an appropriate blending mode. Here I used the Screen blending mode, but usually I would have used Overlay which would apply the colour to the (darker) smoke leaving the white areas white.

I created several colorize adjustment steps and where necessary used the Minus Selection Brush to remove unwanted areas of colour. Other fine tuning included feathering each selection.

As a final piece of fine tuning I applied Color Booster and Color Balance adjustment steps.

Note: for the "Ball of Fire" image above I rotated the example image and omitted the Colour Inversion Step4.

Man Smoking

The Mandelbrot Set

I couldn't post an article on the Julia sets without also posting an article on the Mandelbrot set. The first image below shows the overall form of the set; subsequent images show successive magnification of the the regions indicated. 

The Mandelbrot Set - showing zoom area

Zoomed in to the 'Seahorse Valley'
With the Julia sets we kept c constant, in the polynomial z2 + c, and iterated on z. For the Mandelbrot set we keep z(=0) constant and iterate on c (= p + iq). Here I iterated p and q over the range (-2.25 to 0.75) and (-1.5 to 1.5) resp.

Interpretation of the image is exactly as for the Julia set, although I've changed the colour palette (red has changed to black - all prisoner's are coloured black while all other colours represent the escapee's).
Zoomed in to the 'Seahorse Valley'

and the final zoom - although clearly you could go on zooming in forever

Generating Julia Sets

Retired for over 2 years, I've devoted most of my time to photography, fell walking, and renovating my long neglected home. It's now time to pay some attention to my other passions: mathematics and computing.

I decided to indulge myself with the visual side of mathematics by generating some fractal images. This was something I'd tried to do back in the 1980's, but the speed of PC's in those days made the exercise prohibitive.

Although these images are complex, the maths and programming isn't. ( I can only assume that those people who choose to use ready written program like Apophysis, either don't understand the maths or can't program - I'm for doing it all myself).

Take for instance the Julia sets (one example is given below).
Julia Set for z2+ 0.32 + 0.043i

The Julia sets live in the complex plane and are crucial to the understanding of iterations of polynomials like z2 + c.

For the construction of Julia sets we fix c, and choose some initial value for z = z0, say. Then we repeat the process and calculate z1 = z02 + c, z2 = z12 + c, and so on.

In other words, for an arbitrary but fixed value of c, we generate a sequence of complex numbers {z0, z1, z2,......, zn, zn + 1, ......} for each pixel. That's 16002 = 2,560,000 pixels in the images shown here.

Each sequence has one of two properties, either:
  1. the sequence remains bounded, i.e. you can draw a circle of (predefined), radius M around z0, and all members of the sequence will lie within its boundary, or
  2. the sequence becomes unbounded, i.e. after a number of iterations the members of the sequence move outside the boundary of the circle.
The collection of points which lead to the first kind of behaviour is called the prisoner set for c, while the sequence of points which lead to the second kind of behaviour is called the escape set for c.

By writing a simple program we can investigate the behaviour of a whole range of starting values for z, and determine which starting values belong to the prisoner and escape sets.

In order to illustrate graphically if a point is in an escape or prisoner set we need to assign a colour to each point. Now if we define K to be the number of colours we can use, we can assign a colour number, that lies in the range 0 to K-1, to each starting point. That is, for each starting value, if the kth iteration (k < K), escapes the circle then assign the starting value the colour k. But if after K iterations all members of the sequence are still within the circle then assign the starting value the colour 0. Thus all prisoner values will have colour 0 and all escape values will have a colour in the range 1 to K-1.

In the fractals shown here, all pixels coloured Red represent prisoner values and all the other pixels (including those coloured a lighter shade of red, represent escape values.

zoomed in at 3 times magnification
So how do we plot the values? Well if you remember we said that z is a complex number, i.e. z is of the form z = x + iy, where the numbers x and y are real numbers and i is the special number equal to the square root of -1, (so i2 = 1).
We call x the Real part of z and y the imaginary part of z.
i is called an imaginary number. Like infinity it cannot be calculated it is a mathematical definition, a convenience that enables mathematicians to investigate complex mathematical problems - like fractals.

This means we can represent any value z as a pixel in the (x,y) plane with a colour k. Here is the Algorithm I used:

Decompose the complex numbers z and c into their real and imaginary parts,
i.e. z = x + iy and c = p + iq, then (using the definition i2 = 1)
z2 + c = (x+iy)2 + p + iq
= x2 + 2ixy + i2y2 +p + iq
(but i2 = -1, so substituting -1 for i2 and rearranging we have)
=x2 - y2 + p + i(2xy + q).
In other words the real part of z2 + c is x2 - y2 + p, and the imaginary part (the bit multiplied by i )is 2xy + q.
So in order to evaluate the sequence of complex values zk = zk-12 + c we evaluate:
xk = xk-12 - yk-12 + p, 
yk = 2xk-1yk-1 + q 
........... Eqns 1

Now; assume the image we are going to produce has a graphical resolution of a times b pixels, (1600 x 1600 say). Let there be K+1 colours that can be displayed simultaneously, numbered 0 through K, (K = 512 say).
Step 0:
Choose a parameter c = p + iq, (0.32 + 0.043i say)
Choose xmin = ymin = -1.5, xmax = ymax = 1.5 say,
and define M (=100, say. i.e. our boundary circle will have a radius of 10).
Set dx = (xmax - xmin)/(a-1), and
dy = (ymax - ymin)/(b-1).
Then for all pixels (nx, ny) with nx = 0, ....., a-1 and
ny = 0, ......, b-1
we go through the following routine:
Step 1: Set 
x0 = xmin + nxdx
y0 = ymin + nydy
k = 0
Step 2: (iteration step):
Calculate (xk + 1, yk + 1) from (xk, yk) using Eqns 1.
Increase the counter k by 1 (k = k + 1).

Step 3: (evaluation step):
Calculate r = xk2 + yk2
  1. If r > M then choose colour k and go to Step 4.
  2. If k = K then choose colour 0 and go to Step 4.
  3. r ≤ M and k < K. Go back to Step 2.
Step 4:  Assign colour k to the pixel (nx, ny) and go to the next pixel, starting with Step 1.

Remarks: Varying the values of xmin, xmax, ... in Step 0 you may produce blow ups. For example: the first image was produced using values -1.5 to 1.5, while the second image was produced by substituting values -0.5 to 0.5.

You can experiment by programming this algorithm in any language, Basic, Java, C, etc. but I used a favourite package of many mathematical programmers called Mathematica. Below is the actual code I used.

The boundary of the prisoner set is simultaneously the boundary of the escape set, and that joint boundary is the Julia set for the given c (and M).

It's Snowing on Stanage Edge

All alone on Stanage Edge - It's FREEZING!!!!

Location: I can't believe that its only my second visit to Stanage Edge and if I'm not careful it'll be my last. The photo above doesn't do justice to the weather conditions up here. The snow is actually about a foot deep and covers gaps between the rock slabs on the edge. One misjudged step and at worst I'd be over the edge, and at best I'd have a badly twisted ankle. Furthermore the wind and wind chill were far from pleasant.

Barbara and I had just fancied a walk so we parked the car, grabbed the camera (nothing else - no backpack with food and additional clothing) and made straight for the edge. No sooner than we arrived on top did the wind hit me and I started to feel exposed and just a little bit stupid - at least Barbara had her mobile in her handbag (yes you read correctly - dressed for the North Pole and all Barbara had was a walking pole and her Handbag!!).

Are these a Hare's footprints?
We walked a couple of hundred yards, enjoyed the view, took a couple of photographs, speculated about these strange footprints and then; although the probability of having an accident or succumbing to  the cold was low - in my minds eye I could see the disapproving looks of Andrew, Hannah and the whole of the Edale Mountain Rescue Team. So I suggested to Barbara that we turn back and enjoy the view from the car.

Inspiration: the colours. The buds are forming on the trees in the distance - the wet bracken contrasting against the snow, and the orange sandstone breaking through a century of industrial grime on the black rocks of the edge. The whole scene has an orange glow despite the almost total lack of sun.

Technique: This was going to be another difficult exposure. I wanted to expose for detail in the snow. Now I could have used the spot meter but instead continued with the matrix meter and, in Manual mode, underexposed by about 1.3ev.

Camera Work: RAW(12bit); Focal Length 24mm; Exposure (Manual) F/14 @ 1/200sec., ISO 100.

Post Processing: The snow detail was exposed perfectly and the all important colour was good too, but the rock face was massively underexposed (I'd expected some loss of shadow detail but not quite that much). Oh well the joys of shooting in RAW meant more processing in Nikon Capture NX2:
  • applied Landscape Picture Control (sharpening increased to +8, Brightness reduced to -1, and Saturation increased to +2),
  • exposure increased to +0.8ev (to just retain snow detail)
  • increased shadow protection 46% (to bring out further detail in the rock face)
  • applied curves mask over the sky, to bring out cloud detail, esp. in the midtones.
Location on Google Maps

View Larger Map


© All rights reserved

Search This Blog