Anaglyph images are used to provide a stereoscopic 3D effect, when viewed with 2 color glasses (each lens a chromatically opposite color, usually red and cyan). Images are made up of two color layers, superimposed, but offset with respect to each other to produce a depth effect. Usually the main subject is in the center, while the foreground and background are shifted laterally in opposite directions. The picture contains two differently filtered colored images, one for each eye. When viewed through the "color coded" "3D glasses", they reveal an integrated stereoscopic image. The visual cortex of the brain fuses this into perception of a three dimensional scene or composition.
Not to be confused with the much more common chromatic aberration, which is visually similar to anaglyph, but is not intended to create a stereoscopic image. Chromatic aberration typically offsets color layers of the entire image uniformly, whereas true anaglyph offsets foreground and background differently to create the 3D effect. In real life photography, chromatic aberration is naturally caused by lens problems.