2012-02-05

Slit Scan Animation

Everyone who knows me knows that I am a Doctor Who fan. They also know that I am inquisitive to the point of annoyance. So when, in 1994, I read about the techniques used to produce the Doctor Who title sequences I decided to try them out. Unfortunately, I was 14 and had only my dad's camcorder to play with - so whilst I managed to recreate the method used for the earliest sequences, the dominant 1970s "slit scan" sequences elluded me.

Not only did they ellude me in terms of being able to make my own, they elluded me in understanding how they even worked. I understood the basic principle, but not how a working animation could be produced this way.

The basic principle is both neat and simple - it relies on the fundamental property of good old fashioned film: if you only expose part of the frame to light, the rest of the frame can be exposed later on. How this is applied in the slit scan process used in Doctor Who is that a piece of artwork would be placed on a moving platform and backlit, and above it a rostrum camera was mounted in such a way that it could be tracked in and out from the artwork.

Between the camera and the artwork, a black piece of card or acetate would be fixed in position, with a pattern cut out of it so that only a small piece of the artwork could be seen from the camera. The cut out pattern is the 'slit' that gets 'scanned' - hence the name of the process.

And this is where the clever bit comes in - the shutter of the camera is then opened and kept open. At the same time, the camera is then tracked towards (or away) from the artwork, at the same time as the artwork is moved along under the the slit. The outcome of this is that the frame of film is gradually exposed in a different place to a different piece of the artwork.

A simplified example is shown below...

Background artwork to be slit scanned
This rainbow artwork is to be slit scanned, and so is fixed onto a moving plate.

Artwork with black card / acetate in front, with slits cut out.
Here, the blackened piece of card or acetate with the patterned slit is fixed in front of the artwork. Exposure of the single frame of film begins.

Artwork is moved along beneath the black card.
The artwork is moved along beneath the black card, so that different parts of the artwork are exposed onto the frame of film. Simultaneously, the camera is being moved away from the artwork. This means that as the artwork moves along, the slits get smaller and smaller, exposing towards the centre of the frame.

End result - the artwork has been slit-scanned.
The end result is shown above - the effect produced here is similar to the first few seconds of the 1974 Doctor Who title sequence.

All this produces just a single frame of the animation, and everything must be reset to produce the next frame. In order to produce motion, however, the artwork starts from a slightly different position for each frame. As you can probably tell, this made producing such an animation a long and tedious process, and I never had the equipment in order to try it out myself.

Then a few days ago, I realised that I've been a computer programmer for over 25 years, and that last year I wrote my own image manipulation library in C++. I decided to write a program that would reproduce the slit scan process, as close as possible to analogue process, in the digital domain.

The method I adopted is essentially the same as the analogue way. The program loads an 'artwork' bitmap and a 'slit' bitmap. However, instead of exposing film, the 'slit' picture is applied to the 'artwork' as a luminance map. This produces a single sample.

This is then repeated, and then the second sample is downsized a fraction to simulate the camera moving away from the artwork. Next, the second sample is merged with the first sample. This is repeated a predetermined number of times (I've found that between 100 and 200 times, depending on how much I resize the samples, works best), until finally the full frame has been composed.

Background artwork chosen for experiments.
The background artwork I chose for these experiments is a time-lapse photo of a light fitting - the exposure was about 4 seconds, while I wiggled the camera around. It's actually an old photo, but I thought it was appropriate! I stretched it to 8000 x 960 pixels.



One of the slit patterns chosen - rotoscoped from a photo I took of the real police box at Crich tram museum.
A single frame produced by the program.
The results of running the program are by no means perfect. In an ideal world, many thousands of samples would be taken per frame, using a luminance map where the 'slit' is quite dark and no more than a pixel thick. Another of the limitations is that, with already over 100 samples per frame, that's a lot of luminance mapping, resizing and merging to do. As such, fast rather than high-quality algorithms have been used (for instance, the resizing is 'nearest pixel' rather than bicubic or even just bilinear resampling).

In a way, though, the crudeness of the program gives the results a similar feel to the 1970s Doctor Who animations that I'm trying to simulate. Refinements to the software will continue!

The end result!