Digital Camera Home > Adding Depth With Anaglyphs

Adding Depth With Anaglyphs

By Mike Pasini, Editor
Imaging Resource Newsletter
"Each eye sees things from a slightly different perspective than the other."

There's no mystery to getting Height and Width in your image. In fact, it's impossible not to get them both. But what about Depth? How can you turn your favorite image into a color 3-D shot?

Very easily, it turns out.

Special Shades

But you will need some special equipment: 3D glasses. Fortunately you can find them very inexpensively at http://www.stereoscopy.com/reel3d/anaglyph-glasses.html, which sells everything from a handheld cardboard pair ($1 for a sample) to aviator frames ($9.95) -- including clip-ons ($8.95) in case you get bored out there in left field.

If you're tempted to improvise, the rules are: the red filter goes over the right eye and the blue (or green) filter goes over the left.

Deep Thoughts

Anaglyph images were invented (we're told) in 1853, and made practical by Ducos du Hauron in 1891. They simulate depth by imaging two slightly different views of the same scene in contrasting colors.

If you look at a red ball in red light, it appears white. But look at it in green light and it's dark. In short, you can make an image disappear by filtering the light in the same color, and make it appear by filtering it in a contrasting color.

The reason we perceive depth at all is because we have two eyes which are not inconveniently located on the sides of our head, but in the front, just a bit apart. (As you may have noticed.)

Each eye sees things from a slightly different perspective than the other. Which is why it's helpful to close one eye when you're composing an image. You'll see the shot the way your one-eyed camera does.

There is no real depth, of course, in a flat picture. Once you've taken the picture, you've only got a one-eyed view to work with. You can't see around the foreground a bit on the left and a bit on the right to reconstruct a real 3-D image.

But an anaglyph can simulate depth.

By filtering what each of your eyes sees, one of the two images in an anaglyph disappears. One eye sees one image, the other eye sees the other, and the brain puts them together as one image with depth.

Let's roll up our image editing sleeves and do one.

 

Step-By-Step

First, pick an image that has something in the foreground. Something that's in front of something else.

Open the image in your image editing program. If it came from your digicam, it's already an RGB (Red, Green, and Blue) image, otherwise change the mode to RGB.

Go ahead and make it look as pretty as you like, then save it with a different name. We'll use an extension of .3d (just to annoy our spellchecker).

That "Save As" is an important moment. Don't do it again until we've finished the process.

Go to the Red channel. This is where the magic is performed. You've been looking at the composite Red, Green, and Blue channels, but now we just want to fool around in the Red channel. Which your image editor may display as black and white, not Red.

We want to offset this channel a few pixels to the left. The more you offset it, the more depth you'll create. In general, softly focused images can use a larger shift than sharp images. Try 6 pixels for now.

If your image editing program has an Offset Filter (look under Filter Other), use that. Make sure you Repeat Edge Pixels or the pixels you move will leave the background color behind.

If you don't have an Offset Filter, try selecting the channel and using an arrow key to move it left. You won't be able to easily repeat the edge pixels, but you can crop the final image.

Go back to the RGB channel. Looks pretty bad, doesn't it? Great! Just what we wanted.

"By filtering what each of your eyes sees . . . one eye sees one image, the other eye sees the other, and the brain puts them together as one image with depth."

We're going to fix that by painting in the foreground. We want to paint using the original image saved to disk as .3d, which your program may call Reverting. Versions of Photoshop prior to 5.0 used the Rubber Stamp to Revert to the saved image. Newer versions use the History Brush, which can refer to any state or snapshot of the image, not just the one disk. Make sure the History Brush refers to the saved image by clicking that line in the History palette.

In any case, set opacity at 100 percent, pick a brush size suitable to the detail in the subject, and start painting what you want to appear in the foreground.

We're really just restoring the Red channel (nothing else changed), but we're using the full color image to guide us. As you paint in your foreground, you'll see that disturbing red-green halo disappear and the normal, full-color, sharply focused image return.

Believe it or not, you're done. You just have to look at the image through your special glasses. (Yes, you can save it when you're happy with the results.)

Mid-ground? No Problem!

What if you want more than just a foreground and background? What if you want a middle ground, too?

Pretty much the same trick, but instead of reverting the foreground, revert the mid-ground with an offset of -6 pixels. To do the foreground, offset the original Red Channel 6 pixels to the right (6). The History Brush helps here, but you can do the same thing by opening a second version of the original file and cloning the foreground from that.

You'll need to offset the original Red Channel to the right (6) to do the foreground, but you'll need either a snapshot or reference to the original. You can't just go back to the Red channel after shifting it for the mid-ground. Then just paint in the foreground.

That's all there is to it.

But be careful. If you start leaving your Vuarnets or Oakleys behind to step out in your 3-D glasses, you've gone to far.

 

This article is reprinted from The Imaging Resource Digital Photography Newsletter,
Features Column, published June 16, 2000

 

Reader Comments!
Questions, comments or controversy on this article? Click this link to see what other Imaging Resource readers have had to say about Adding Depth With Anaglyphs, or add comments of your own!