Creating anaglyphs from left/right image pairs
This describes how to create anaglyph images from left/right image pairs.
Joining grayscale images
Assume, we have just created a stereoscopic image pair, e.g. using POVRay as described here and we want to make an anaglyph from it.
First of all, it is advisable to start with grascale images because they work best and independent of the image content. What has to be done is really simple:
Convert left and right image to grayscale. Assume we have red-blue glasses, with red being left, then the right image is put into the blue channel and the left image into the red channel of the composed anaglyph image. That's all.
There is an example image at the bottom of the page.
Creating colored anaglyphs
Colored anaglyphs, you may ask, how is that supposed to work?
Actually, colored anaglyphs only work with red/cyan glasses. The reason is that cyan is effectively green and blue and hence, red and cyan together transmit the complete color spectrum. The left eye will only see the red channel while the right one sees the green and blue channel. It turns out that the brain will still get the impression of the colors.
However, this is not always possible. One requirement is that the left and right eye get balanced overall brightness; hence it works best with brown to yellow colors.
See the image below if you have red/cyan glasses at hand.
AnaglyphJoin is a program written by me to atomatically convert a left/right image pair into an anaglyph. It supports any color combination (red/cyan (default), red/green, red/blue) and can create colored as well as grayscale anaglyphs. Grayscale conversion (with tunable weights and optional gamma correction) is done on-the-fly. Actually, all anaglyphs on these pages were joined using AnaglyphJoin.
Anaglyph glasses and visual perception
In order to view anaglyphs, you need special colored anaglyph glasses, usually red/cyan or red/green ones. The simple theory behind the filters is explained on the methods page.
Obviously, the quality of the percepted image depends on the spectral color distribution of the projection device and the quality of the filters. The major visual distortions are "shadows" and right/left brightness imbalance.
One day, I spent hours on experimenting if there is a way to mix colors so that we can prevent the "shadows" caused by the filters in the glasses not being perfect, but without acceptable result. The best way is to use glasses which work well with the screen colors, everything else tends to end up in a waste of time. Later, when measuring the spectra of the filters and looking at screen spectra, I realized that it is not even theoretically much one can do to get rid of the shadows.
So, how good are the glasses and which ones are the best? Well, I measured those I have laying around using a spectrometer. Read more about my goggles.
Using a 17inch monitor, I recommend viewing the following anaglyphs fullscreen at 60cm distance through red/cyan glasses (with red being left). Read more about goggles.
Why are the images so large?