A nearby photography club has annual county wide competitions. The judges select their favorite photos and display them in a mall for a month.

Several years ago, I took a friend to the mall to show him the photos. We had only a few minutes until closing time, and they had already dimmed the lights in the arcade where the photos were hanging.

So I took out my cell phone, which had a mini-flashlight (this was before the days of smartphones). The beam was not wide enough to illuminate the whole photo, forcing me to move the light around so that we could get a fuller view of the photo.

The results were magic. These still photos became animated, as the amount of light kept changing. I think we both enjoyed it more than we would have had the arcade been fully lit.

I decided to see if I could simulate the “spotlight” effect on digital images. Some results are below. You really should watch them on full screen.

How did I make these videos? I’ve posted the script over at Bitbucket. To download it, click on the Downloads link on the left.

The overall steps in the script are:

  1. Darken the whole image.
  2. Calculate the trajectory for the spotlight.
  3. For each frame, create a B/W mask for the spotlight. It is completely white at the center of the spotlight, and gets progressively darker as you move outwards.
    • The initial mask is just a white circle with everything outside of it black.
    • Blur the mask.
  4. Combine the original image with the darkened one using this mask. The “lower” image is the original one. So the center of the spotlight reveals the original image, and as you move out, the darkened image begins to dominate.

The effect seems to work better on some photos than on others.