To understand how Anaglyph 3D works, we must firstly understand how our human vision works. Basically, our eyes! Well, our heads are equiped with these two super lenses, located at the front of our faces, with a distance of approximatelly 8cm from one another. This distance is the key to understand our vision.
Our eyes don’t see the exact same thing at the same time. Everytime we focus on an object our left eye sees a little more of the left side of that object and, at the same moment, our right eye sees more of the right side of the very same object.
Try this experiment, to focus on any object you may find near you, now. Close your right eye and try to observe as thoroughly as you can that object with the left eye alone. Then, close your left eye and focus on the object with the right eye. You should see a slightly different aspect of it.
Thankfully, our eyes are connected with our brain! Our brain collects both images (one from each eye) and composes them, with the speed of light! Then it interpets this composite image in one meaningful three-dimensional perspective image.
Stereo-photography actually cheets our brain. And so does the Anaglyph 3D. It’s all about producing two slightly different images of the same object (or view) and then composing them together in a way that our brain interpets them as one, when seen together.
Stereo-photography uses a pair of images seen side by side, like the classic View Master toy (which I love)! Here is a 3D Brain Hack blog post by John Nelson which illustrates how to produce such a pair in ArcGIS Pro.
Anaglyph 3D uses the same two images, but places the one on top of the other. Then, one image is shown in cyan while the other is shown in red. When these overlapping images blend, the result is this nonsense mess of cyans and reds. But when I see this with a pair of cyan/red glasses all of a sudden it appears in 3D. The reason will be meticulously explained at the following paragraphs!
So far, in my workflow to produce an Anaglyph 3D image, I had to recruit Adobe Photoshop, only because I needed somehow to blend the two images. The Anaglyph 3D images shown on this Story Map, I made a couple of years ago, have been produced partly in ArcGIS Pro and partly in Adobe Photoshop. But since blend modes are now available in ArcGIS Pro 2.7, I can complete the overall process without leaving Pro!
In ArcGIS Pro I begin with a new Global Scene, which I rename to Preparation. In my Scene I add the World Imagery service and I navigate to the Volcano of Santorini, which will be the case study for this blog post. Of course, I could have used any other place in the whole World!
For Elevation Surface I can use the default service or add my own. For my case study I will use a high resolution DEM of the volcano (Picture 1).
I will use the Preparation Scene to produce two slightly different aspects of the volcano. To do this with precision I will use the handy Go To XY tool, which allows me to define the coordinates of the center of the current Scene display.
So I go to the Navigate group at the Map contextual tab and I click on the Go To XY tool. The coordinates input appears at the bottom of the Scene, where I type the longitude (25.390) and the latitude (36.401) of the center. I also define the scale of the Scene to be 1:5,000 (Picture 2).
At the same time, I open the Export pane. For File Type I select JPEG and for Image Size I define 6000 pixels for width and 4000 pixels for height (Picture 2). It is important to explicitly define the image size in order to have the two images, which I will export at the next step, correctly aligned.
Time for action!
When I look at the top-view of the volcano on my screen, my left eye sees more of its left part in a very subtle oblique view. It is that subtle that I dont’t even realise it. At the same moment, my right eye sees more of its right side in also a very subtle oblique view.
To simulate these two different aspects, I will nudge the Scene a little towards East for the left eye and a little towards West for the right eye, by changing the longitude of the center.
For the left eye, I type 25.389 for longitude at the coordinates input and I hit enter. The Scene moves towards East and reveals more of the left side of the volcano. It is important to make sure that the scale of the Scene remains the same (Picture 3).
When ready, I export the Scene in JPEG format with the name LEFT and I save it in a folder in my workspace.
Then I nudge the Scene a little towards West, by typing 25.391 for longitude at the coordinates input. Again, I have to make sure that the scale remains 1:5,000 (Picture 4).
When ready, I export the Scene in JPEG format with the name RIGHT and I save it in a folder in my workspace.
It is crucial to produce the two images in a Scene and not in a Map view. And this is a common (and fatal) mistake most people do, to actually nudge a top-view map.
Nudging the Scene actually produces a very subtle oblique view because of the underlying Elevation Surface. It realistically imitates how the human eyes work.
So the Left and Right images I produced earlier imitate what my left and right eye should see, respectively, if I could fly over the volcano and see it myself (and not the fellow satellite)!
Normally, at this point I would shut Pro down and introduce the two images in Adobe Photoshop for the final blending. But this is no longer needed, since I may perform the same steps directly in Pro.
So in the same project in ArcGIS Pro I create a new map, which I rename to Production. Then I add the two images on the map, with the Left being on top of the Right (Picture 5).
Order matters. According to which blend mode I will use later in the process, I have to decide which image will be on top. For my example I select the Left to be on top.
Note also that the two images have not any associated coordinate system. When added to the map, ArcGIS Pro complained for the missing spatial information. But, since I only want to produce a composite Anaglyph 3D image out of these two images, having them georeferenced is not necessary.
If I want the outcome Anaglyph 3D to be georeferenced then I should have produced at least an associated World file for each of the two input images. I am about to demonstrate this in a forthcoming blog post, because it is out of the scope of that one here.
Okay, let’s be creative now!
I select the Left image and I open the Symbology pane. I prefer to have a grayscale image (a personal taste) so at the Primary symbology section I assign Band_3 for all three bands (a small hack) as shown in Picture 6. The image turns grayscale.
At the Appearance contextual tab I change the Brightness, Contrast and Gamma parameters until I make the grayscale image highly legible (Picture 6).
Back to the Symbology pane I select Minimum – Maximum for Stretch type and then I click on the histogram button to open the RGB histograms (Picture 7).
Since this is the Left image, I want it to be the red part of the Anaglyph 3D. The reason is that the left lens of the cyan/red glasses is red!
To do this, simply I drag the histograms of the green and blue bands of the image out of their range. I also change the red histogram a little until I end with a clear and highly contrasted red Left image (Picture 7).
I follow the exact same process for the Right image. At the Primary symbology section, of the Symbology pane, I assign Band_3 for all three bands to turn grayscale and at the Appearance contextual tab I change the Brightness, Contrast and Gamma parameters (Picture 8).
Since this is the Right image, I want it to be the cyan part of the Anaglyph 3D. The reason is that the right lens of the cyan/red glasses is cyan! To do this, I simply drag the histogram of the red band of the Right image out of its range and I also change the green and blue bands histograms a little until I end with a clear and highly contrasted cyan Right image (Picture 9).
And now for the actual magic!
I select the Left image, since this is the one on top at the Contents pane, and at its Layer Blend option, at the Effects group at the Appearance contextual tab, I select Screen (Picture 10).
And I am done! I just created an Anaglyph 3D image of the Volcano of Santorini! To interpret this color mess, all I have to do is put on my red/cyan glasses. The image is shown in 3D and looks like popping out of my screen.
How does this work? The red lens of my glasses allows only the reds of the Anaglyph to be seen, while blocking the cyans. At the same moment, the cyan lens of my glasses allows only the cyans of the Anaglyph to be seen, while blocking the reds. This forces my left eye to only see the left image and my right eye to only see the right image simultaneously. And since both images show a different aspect of the volcano, my brain composes these aspects in a single three-dimensional image!
Finally, I export the map in JPEG format to save the final Anaglyph 3D as a single image (Picture 11).
I have exported my Anaglyph 3D image of the Volcano of Santorini and I have uploaded a very high resolution version of it on my online directory of resources and maps, from where you may download it and explore it under a CC BY-NC-ND 4.0 licence.
There a few things to consider for a successful production of an Anaglyph 3D. The first is the vertical exaggeration of the Elevation Surface. To find the best value for the vertical exaggeration I always need a little of trial-and-error to avoid over-exaggerated results, but at the same time, to assure that the third dimension of the Anaglyph 3D will be satisfying.
The second thing I have to consider is the horizontal distance of the center of the two different aspects. In my example here, the center of the Left image has a longitude of 25.389, while the center of the Right image has a longitude of 25.391. Their distance is 0.002 degrees (I worked in a Global Scene which supports only Geographical regerence system, hence the degrees). The more I increase this distance the more I provoke a more exaggerated 3D, but also the more difficult for my eyes to see it. On the contrary, the more I decrease that distance the less prominent the final Anaglyph will be. So again, trial-and-error is necessary to find the optimal distance.
Finally, I have to consider the scale of the Scene. I always have to make sure that it remains constant as I nudge the Scene towards West or East. In addition, as the scale decreases more area is visible in the Scene, therefore more distortions I am about to expect at the edges of the Scene as I increase the vertical exaggeration of the Elevation Surface or the distance of the center of the two aspects.
Of course, there are numerous other methods to produce an Anaglyph 3D and, most probably, better and more effective than the one I present here.
It is worth to mention that ArcGIS Pro already supports Stereoscopic mode as a setting on the Display tab on the Options dialog box and that Stereo mapping in ArcGIS Pro is also available with the Image Analyst extension. Thank you Jeremy Wright for taking the time to mention these amazing options in your tweet!
And thank you all readers for reaching the end of this post. I hope you enjoyed reading it as much as I enjoyed making it.
Kindest regards from Crete, Greece.