Anaglyphs: 3D Images


How to See in 3D.


Most people that have good vision can see in 3 dimensions (3D). What does this mean? This means having the ability to sense that objects can be closer or farther away, usually knows as depth perception. What do you need to be able to see in 3D? You need

a. Two working eyes with properly-operating eye muscles for steering the eyes.
b. A brain for processing the signals from your eyes.

In many respects, your eyes are just an extension of nerves from the brain. Your brain directs your eyes to point in the direction of an object that you are looking at. But because your eyes are separated on either side of your head, each eye "sees" a slightly different image. Your brain assembles these images and allows you to sense the distance to objects and their depth.


How to Use Flat Pictures to Make a 3D Image.

a. Get a camera.
b. Place the camera where each eye is. Point the camera toward the object being viewed, much as your eyes focus toward an object.
c. Take a picture at each eye.
d. Print the two pictures.
e. Figure out some way to let your right eye see only the right picture, and the left eye to see only the left picture.

One fun way to do this is to create the two pictures in two different colors and then overlap them with a slight offset. The end result is a picture called an anaglyph. Then we wear special glasses with color filters that pass each colored image to the corresponding eye.


Creating a Stereo Image Pair.


You'll need images that can be digitized into files that can be manipulated by an image-processing program such as Adobe Photoshop. The easiest way is to start with images from a digital camera, but digitized images from conventional color film are just as good. You will want to pretend that you have created images "photographed" by each of your two eyes. Your eyes are separated by about 3", so this will be the distance between two camera positions. One approach is to simply shift the camera sideways by 3" between each photograph while maintaining the orientation. For most objects at a reasonable distance, this approach is just fine. Effectively, the reorientation of the camera is performed from within Photoshop when the images are overlapped.

Cameras sold in the U.S. have a mounting screw on the bottom (a ¼"-20 thread) and this can be used to fasten the base of the camera to a long stick. This, in turn, can be used as a reference to insure that the camera can be moved sideways, but otherwise not changed in orientation. Many cameras have flat backs. This means that the camera itself may be used as a reference plane. Use a heavy book, board or box to align your camera, taking two pictures 3" apart.  Do not worry too much if the camera is  not perfectly oriented between pictures; Photoshop will allow you to move the images.


Hints for Optimizing the 3D Effect.

a. Select objects for your image pair that have a lot of depth (stuff in the foreground and background).
b. Similarly, use an object that is "deep" in comparison to it's distance from the camera. In other words. an object that is 12" deep (perhaps a sculpture) and only 60" away will show a strong 3D effect.
c. Take your photo on a bright, sunny day so that the camera may be used with as large an "F-stop" as possible and little need for flash. This will increase the "depth of field" (make both near and far objects in focus) by "stopping down" the camera iris.


Processing Your Stereo Image Pair in Adobe Photoshop.


We'll assume that you are using red-cyan glasses, and have created a left and right jpeg image.  You may find red-cyan glasses at http://www.berezin.com/3D/3dglasses.htm.  Get the cheap ones; #544C if you only need a couple or #5450C if you have a big group.
 
1. Start Adobe Photoshop.


2. Open the Images.
We're using a sample image from our simple video "3D Creature From Outer Space" where we discuss the physiology of 3D viewing. Open the two images and place them side-by-side on your desktop. I recommend specifically naming them "left" and "right".  Practice by getting these separate left and right images.


3. Remove Red from the Right Image.

            a. Click on the title bar of the right image to make it active.
            b. From the menu bar, select "Image" > "Adjust" > "Levels".
            c. From the "Channel" menu, select "Red".
            d. Look to the bottom of this dialog box at "Output Levels" and set the value in both 
                boxes to "0" (zero) and click "OK".

4. Remove Cyan from the Left Image.
            a. Click on the title bar of the left image to make it active.
            b.  From the menu bar, select "Image">"Adjust">"Levels".
            c.  From the "Channel" menu, select "Green"
            d.  Look to the bottom of this dialog box to "Output Levels" and set the value in both
                 boxes to "0" (zero).
            e.  From the "Channel" menu, select "Blue".
            f.  Look to the bottom of this dialog box at "Output Levels" and set the value in both
                 boxes to "0" (zero) and click "OK".



5. Prepare to Place the Images into a New Window.
            a.  Click on the title bar of the left image to make it active.
            b.  From the menu bar, select "Image" > "Image Size".
            c.  Note the image width and height in pixels.  Add 200 to the height and width and
                 record this information somewhere temporarily.

6. Open a New Window.
           a. From the menu bar, choose "File" > "New".
           b. Select "Preset": Custom
           c. Set the Width and Height of the new image to the numbers (in pixels) you recorded in
               step 5c (this will allow room to move the images).
           d. Select "Color Mode": RGB Color
           e. Select "Background Contents": Transparent
           f.  Click "OK" and locate the new window toward the bottom of your desktop so that
               the title bars of the left and right images are visible.

7. Copy the Left and Right Images into the New Window.
           a. Click on the left image title bar to activate it.
           b. From the menu bar, choose "Select" >  "All".
           c. From the menu bar, choose "Edit" > "Copy".
           d. Click the New window title bar to activate it.
           e. From the menu bar, choose "Edit" > "Paste".  The left image should appear
                in the new window.
           f.  Repeat steps a - e for the right image.
           g. If the "Layers" window is not yet visible, go to the menu bar and select
                "Window" > "Layers".  The Layers dialog box should be visible to one
                side, and should indicate that there are two layers, containing the left and
                right images respectively.

8.  Lock Layer 2.
            a.  Locate the "Layers" window.
            b.  Click on "Layer2" within this window.  The words "Layer 2" should
                 highlight in blue.
            c.  Lock the position of the layer by clicking on the button with the
                 overlapping, corssed arrows (the 'lock position' button).
            d.  Within the "Layers" window, locate the menu that says "Normal".  Select
                 "Screen" from this menu.

 9.  Offset Layer 1.
            a.  Locate the "Layers" window.
            b.  Click on "Layer 1" within this window.  The words "Layer 1" should
                 highlight in blue.
            c.  Within the "Layers" window, locate the menu that says "Normal".  Select
                 "Screen" from this menu.
            d.  From the tool palette, select the "Move" tool (upper right corner of the
                 tool palette).
            e.  Use the tool to move the image in Layer 1 slightly to the left (a few
                  millimeters will do as a start).
            f.  The images have changed into a blended overlay.


10. Optimize the 3D Effect.
            a.  With red-cyan glasses on, manually move the image in Layer 1 until you
                 see optimal 3D.
            b.  When you are satisfied, go to the menu bar and select "Layers">
                  "Flatten Image".  This pushes the left and right images into one layer.
            c.  From the tool palette, select the "Rectangular Marquis Tool" (upper left
                 corner of the tool palette) and use it to select the portion of the image that
                 you wish to keep.  You will want to discard the thin, asymmetric borders
                 on the left and right sides that are only cyan or red.
            d.  When you have enclosed the portion of the image you wish to retain,
                 select "Edit" > "Crop".
            e.  "Save" your anaglyph to a directory of your choice.



11. Speed Tricks

After you have practiced this technique, you can speed up the process just a bit. The first thing to do is to compress the image manipulation steps by immediately importing the original left and right images into separate layers. The color correction can be performed in the individual layers, eliminating the separate setups of color correction, followed by layer insertion. The second time-saving step is to build an attachment for your camera that allows the recording of the left and right images on the same picture. Soon we'll provide drawings of such a device that you can construct for your own camera.

12. Color Accuracy

The 3D effect can be rather weak if either the colors in the image or the plastic film in the 3D glasses are not quite correct. Transferring files from one format to another can dramatically alter the color accuracy of the images and render them useless for 3D viewing. To test both an image and glasses, one can usually find some portion of an anaglyph image that is all cyan or all red. Verify that red portions of the image are purely black when viewed with the cyan glasses and vice versa. Line images that are computer generated are often not color correct. They can be color corrected by the process described above: duplicate the image into Photoshop onto two overlapping layers and apply red removal and cyan removal from the images and then recombine them.

When displayed for large groups, anaglyphs can be projected onto a movie screen with one of the many "video projectors" which may be attached to a computer. But be aware that inexpensive projectors may produce inaccurate color balance, severely limiting the quality of the 3D effect.

13. A Few Thoughts on Classroom Use

Unless students are active participants in making an anaglyph, the exercise is somewhat like watching a music video. Some very basic aspects of 3D imagery and color vision are described in our video which can serve as a starting point for actually making an anaglyph as a class exercise or science fair project. Several possible projects might include

a) making and printing anaglyphs of a still life or class picture,
b) making an anaglyph with other complementary color pairs, such as green-magenta or blue-yellow (which requires these same colors of plastic filter film), or
c) making a 3D animation or film.