Study – Long Exposure-Like Visual Effect
One of my professions is a professional photographer. Of many techniques,
I love to take long exposure photos and often like to light-paint within them.

This is a real photo taken with a Nikon DSLR, 30secs, drawn with two LED penlights (blue/white) for a new year's card in 2006.
Usually, you would take a long exposure photo, by controlling the contrast between light sources.
First, you set your camera to take time – let’s say 10 secs – to produce a composition. You seek the best aperture to give you the most ‘working time’, that means a long enough shutter speed to let you draw whatever you want within the frame, with a penlight or fire from a lighter, cars’ head/rear lights drifting on a highway, etc. While the surrounding environment slowly burns into the film, the strong light sources would be able to burn instantly, and give you a nice line of light at your control.
But, if you were to do this with a USB camera input, there are several issues to be considered.
Firstly, since you can only access the bitmapData that comes into Flash as an image. This means you don’t know whether the white pixels are strong light, or just a white background. So, let’s say you blend each frame with a slight alpha. Since you can’t properly divide the strong light and weak light, the strong light would become as black as your white background, which will not produce the proper result.
Your face will be as bright as the penlight, making a big, white, blob – a disaster.
Even more, each pixel has only 256 levels of data, so if you want to blend 256 frames (just about 8.5 secs), the data will be all black, since the levels will be shut down to zero. Even if you darken it a bit lighter, you will only have several levels to work with, leading to a posterized, contrasty failure.
So, even if it is not logically correct, we will make a long exposure ‘like’ effect this time, using the ‘lighten’ blend mode rather than the ‘add’ mode. Brighter pixels will be recorded. So, if you do this in a bright room, the results would look like this left image.
But, if you turn off the lights, you will be able to successfully draw your laser-lines.

This is done with a MacBook Pro/iSight and Flash CS3, in a dark room, and a small flashlight.
If you are satisfied with this, you are already at your finish line, but I would like to add what photographers call a ‘fill-in flash’, to give you more nice image. Please note that this is a digital version, so it will not be pixel-perfect.
A ‘fill-in flash’ with a real camera gives a dark foreground some light to brighten up the area after you record all the light drawings. Usually, this technique is used to take nice night photos of let’s say a cityscape. You would set the camera to take several seconds to burn the city lights into the film in the darkness, then flash the person in the foreground to finalize the composition.
To mimick this effect, we will ‘burn’ the video input into the bitmapData with the ‘add’ blendmode. But the problem still remains – it is still a digital effect, so you need the proper preparation to give you nice results.
My solution is quite analog. I used a ND8 filter that I use for my cameras, and attached it to my iSight camera. It depends on your USB camera’s specs, but my iSight had neat results with the ND8 filter, with 2 flashes – meaning burning two frames with additive mode digitally. ND8 filters are like sunglasses to the USB cam.
The point to this digital long exposure-like effect is, that since it is tweaked to show light-drawings mainly, the blurring of normal recordings are not correct. On the other hand, since it is NOT using the additive mode (which would burn up to 0xFF white), you can set the ’shutter’ to 8 secs or 8 mins, and it will not over-expose (this is quite handy compared to an analog camera).

JAPAN ActionScripters !!!

Love Flash. Love you all.

left : Waving a flashlight in the dark. Red is actually my blood in my hand lit up.
right : Flashing my face with a flashlight in the dark several times to simulate multiple exposures (even though it's me, it's SCARY)
The parameters in this project are set to a ND8 filter covered camera, and setting default to my environment. Play around with the setting to get similar results.
Here is the working project (new window).
Additive Composition : this checkbox will enable additive blending, so you can see that the levels are not enough, and the composition is HORRIBLE ;D
Capture Button : use this button to start recording.
Seconds : set this to how long you want to record. 5s to 30s, defalt 15s.
Flash : this is how many times you want to use the 'fill-in flash'
What do you think about this study ? If the lights are not drawing as a line, and becoming a dotted-line, draw slower, as the USB camera only records 30 frames per second, compared to a seamless recording of a camera.
I think fladdict will make us an iPhone version of this toy. Of course he will
Here are the files : long_exposure.zip (772KB)
Just an idea that came to me about 6 hours ago, and took me about two to experiment, and write this post. Hope you enjoyed it !!!
2 Comments
Nice effect! I have been working on something similar, but in Processing instead of Actionscript. I have an external iSight in a darkened box with glass and sheets of paper over one end – I then draw on the paper with a marker with a penlight attached. My results aren’t as nice as yours. :/
thx curious – I’d like to see what you project looks like ;D