3d Diablerie
Anaglyph of a 19th Century stereo Diablerie — small clay sculptures of the devil and his minions.
Produced as paired photographs set in cards for stereoscopes in France between the 1860 and 1900.

About Anaglyphs

An anaglyph is a type of stereoscopic 3D image created with two images superimposed on top of each other, each image corresponding to the view that would be seen by the right and left eyes. The left eye image is rendered in shades of cyan, and the right eye in shades of red. When the images overlap, the cyan and red colors are added together, as if they were on sheets of clear film printed with clear cyan and red and overplayed on top of each other.

Viewing the superimposed images requires tinted lenses, a red tinted lens for the left eye and a cyan tinted lens for the right. The red tinted lens in the left eye sees the cyan in the image as black, and the red in the image as white, and vice versa for the cyan lens. When there's a point in the superimposed images that are both dark with cyan and red, they appear black or gray to the naked eye as well as to both tinted lenses.

When viewed through Anaglyphic glasses, this square should be filled with black (or at least dark gray) when viewed with the left (red lensed) eye and filled with white when viewed with the right (cyan lensed) eye. Without glasses, it should appear as cyan.

When viewed through Anaglyphic glasses, this square should be filled with white when viewed with the left (red lensed) eye, and filled with black when viewed with the right (cyan lensed) eye. Without glasses, it should appear as red.

The sense of depth when viewing anaglyphs is given by the superimposed images corresponding to what the right and left eyes would see if the objects in the image were distributed in three-dimensional space. By shifting the left eye cyan image to the right and the right eye red image to the left, the placement of the superimposed object seems to be closer in space, where as the opposite (left eye cyan to the left and right eye red to the right) seems further away.

When viewed through Anaglyphic glasses, this square should appear in front of the square frame.

When viewed through Anaglyphic glasses, this square should appear behind the frame.

Digital images are generated with each color in the image stored as a set of three colors of light: red, green, and blue (RGB). For example, the color white is 100% red, 100% green, and 100% blue added together. Black is 0% red, 0% green, and 0% blue. Yellow is a combination of RGB values: 100% red, 100% green, and 0% blue. Grays have all three RGB values as equal, so light gray can be 80% red, green, and blue, while dark gray can be 20% red, green, and blue. Each RGB value for the colors in an image is stored in its own "channel".

Using a digital image editing tool that allows access to each of the red, green, and blue channels separately makes it possible to turn any black and white (or “grayscale”) image into a pure red or pure cyan image, and therefore makes it possible to create and overlay a separate image for each eye when viewed with anaglyphic glasses. To turn a grayscale image into shades of pure red, simply go to the red channel and fill the entire channel with white. The remaining green and blue channels will add together to create only red values. To get a cyan image, fill the green and blue channels entirely with white.

Channels for grayscale image

Channels for red image

Channels for cyan image

This may seem counterintuitive, but when you clear a channel entirely to white, the dark values in the other channels reduce the amount of lightness of that channels color. Take this range of red values:

Color Red Value Green Value Blue Value RGB Value Hexadecimal Value
White 100% (255) 100% (255) 100% (255) 255,255,255 # FF FF FF
Very light red 100% (255) 80% (204) 80% (204) 255,204,204 # FF CC CC
Medium light red 100% (255) 20% (51) 20% (51) 255,51,51 # FF 33 33
Solid red 100% (255) 0% (0) 0% (0) 255,0,0 # FF 00 00

Notice that red is always 100% because its been filled with white. Notice too, that the green and blue values are equal. As green and blue get darker (approach 0) red becomes less pale, finally becoming completely red when green and blue are set to 0.

A similar case is true for tints of cyan. A range of cyan colors means that red is always at 100%, but green and blue are always equal:

Color Red Value Green Value Blue Value RGB Value Hexadecimal Value
White 100% (255) 100% (255) 100% (255) 255,255,255 # FF FF FF
Very light cyan 80% (204) 100% (255) 100% (255) 204,255,255 # CC FF FF
Medium light cyan 20% (51) 100% (255) 100% (255) 51,255,255 # 33 FF FF
Solid cyan 0% (0) 100% (255) 100% (255) 0,255,255 # 00 FF FF

Creating a 3D anaglyph, then, requires a right and left eye image in grayscale:

Left eye image

Right eye image

Left eye in cyan

Right eye in red

Right and left eye views overlayed with Multiply blending mode

Layers set to Multiply