# Anaglyph 3D
## Introduction

This page about Anaglyph 3D can be displayed as Wiki2Reveal slides.
Single sections are regarded as slides and modifications on the slides will immediately affect the content of the slides. The following aspects of Anaglyph 3D are considered in detail:
* (1) How do color filters work for anaglyph?
* (2) How to send two different image information to the right and left eye in an anaglyph image?
* (3) How to create an anaglyph-3D image yourself with a camera?

## Objective

This learning resource for Anaglyph 3D in the Wikiversity aims to learn the basic principle of anaglyph 3D images and to create own Red-Green 3D images.

## Learning Requirements

The learning resource on the subject of Anaglyph 3D' has the following learning requirements which are helpful for understanding the following:
* Left and Right Eye - Demo Images
* Overlapping area for left and right eye images
* Stereoscopy
* Perspective drawing on mirror
* 3D Modelling

## Overview - Creation process

The following diagram gives an overview over the basic steps to create an Anaglyph-3D image, which you will get to know as a workflow in this learning unit. The Open Source software GIMP can be used for generation of anaglyph image. Used transparency of layers in GIMP for the left and right eye images to position the images in the plane. Select on object in the center, that should match in the image of the left and right eye. This assignment of an object in the center in needed to create the illusion of depth. The red-green filter for glasses decomposes the visual information for the left and right eye. The red color is almost invisible in the red filter and the green color is almost invisible in the green filter. This principle is used to provide different image for the left and right eye.

## Basic principle of color filters

Anaglyph 3D (also Anaglyphe or Anaglyph picture) from the Greek language ἀνά = aná - on, on, on top of each other) and {{lang|grc|γλύφω}glýphō} 'meißeln', 'engrave', also 'represent'

### Stereogram

A color analyph image is a stereogram in which the two stereoscopic half images are shown with transparency superimposed instead of showing images next to one another like for VR headsets. The term anaglyph image is usually used for monochrome or color analogs in which the half images are colored in complementary colors. There are different methods to assign different images to the left and right eye by application if color filters. Color analyphs in 3D have the advantage that the can be created with two camera image shift horizontally with the eye distance of humans. 3D perception cmethod to be implemented.

## Learning Activities - single images with camera

* Select a three-dimensional object of your choice and use a camera (e.g. from your mobile phone) and photograph this object with your camera.
* Position the camera so that the object can be seen in the center of the shot and not on the edge.
* Now move the camera horizontally approximately with the distance of your two eyes. Try to keep the object of interest in center of the image while moving the camera to the to the right. Vertical shifts between to two images destroy the perception three-dimensional object.

## Learning Activity - Transparent alignment of left/right images

As a next step we need to align the images for the left and right eye image due to the fact that images may not be taken from the same height with your camera. The alignment is used create the overlapping position for colored single images for the left and right eye in GIMP as transparent layers. The transparency allows to shift the top image over the second image. The focused object in the center should be almost matching for the left and right eye image. The transparency of a layers is used as a core principle to create a 3D perception of the object of interest. The following animation shows the principle of transparent positioning of the left/right eye images.

## Overlap Area

Due to shift of one image up an down we have reduced overlap area. The following image shows the overlapping area for the left an right image. Depending of the horizontal and vertical shift the generated anaglyph image is smaller in size in comparison to the source images for the left and right eye.
* Left and Right Eye - Demo Images
* Example images with overlapping area and left and right eye images

## Spatial Perception

Humans have a spatial perception due to the fact that eyes have a horizontally slightly offset and so the retina gets slightly different image information. In the shift animation above you can identify the difference in the images for the left and right eye in the background with the tree and transparent overlap. These difference leads to a 3D perception of the space. The difference in the projection can also be explored by holding a finger upright in front of you face and you close and open left and right eye one after the other.

### Task - Touching the finger tips with a closed eye

Close one eye and try to move the fingertips of your two index fingers so that the fingertips touch. Non retry that task once again with both eyes open. Does that task was a bit more difficult before with just one eye open?
In the anaglyphic method is an image separation approach by application of color filters. The right and left half-images are colored in complementary colors.

### Task - Greyscale images

Load the two individual images from the previous task in GIMP] in two separate layers with transparency of layers on. This allows the positioning of images and convert them to grayscale images.

### Perception of the anaglyph image

The two half-images are separated with special anaglyphic glasses with correspondingly colored glasses or color films. In the past, red was usually used with green or blue. When looking at the anaglyph image, the red filter deletes the red image and the green image becomes black – the green filter clears the green color image and the red becomes black. Since both eyes now see different images, a spatial image is created in the brain.

## Anglyph 3D Results

The following section shows two different results of anaglyph 3D image generated from given left and right images. You can use your own two images to create your own or the demo images in the learning resource about Stereoscopy.

### Result 1 - Cable roller on a field

Use the
* the green filter in front of the left eye and
* the red filter in front of the right eye

### Result 2 - Cable roller on a field

The following anaglyph-3D image of two cable reels on a field is formed from two individual images. Use the
* the green filter in front of the left eye and
* the red filter in front of the right eye

#### Foreground Image Match of Left/Right Eye

In the following image matched object in the foreground. The following image uses the same image with a background image match.

#### Background Image Match of Left/Right Eye

Compare the spatial perception of the cable reels in both images. What are the differences in the perception? Explain how the differences depend on the matching of objects in the foreground in comparison to the background.

### Result 3 - Fallen Tree with Roots

The following anaglyph-3D image of a fallen tree encodes the left eye image and the right eye image with changed colors for the two individual images. Due to the different colors use the
* the red filter in front of the left eye and
* the green filter in front of the right eye
Remark: Check the spatial perception of the anaglyph image also with the swapped color filters for your eyes for the same image.

### red-cyan method

The method of producing a three-dimensional image is explained with the aid of the red-cyano method with the aid of the following schemes:
* In the first line you can see the two colored images for the left and right eye (in this illustration also with Parallel View).
* The second line illustrates that only the red channel of the left image, as well as blue and green channels of the right image, are used for the calculation.
* The finished, colored anaglyphe in line three is created by the combination of red channel of the left and blue-green values of the right image.

### Limitation in use

This method is not perfect. The two left balls are problematic when viewed by a red-cyano glasses, because they have the filter colors red and cyano, which leads to disturbing effects when viewed.
While red-green and red-blue-brills each use only two color channels of the available red, green, blue channels], cyano consists of a mixture of green and blue, which brings all three colors into play together with the red filter (in the case of blue-yellow-brills the same applies as yellow is produced from red and' green light).

## Anaglyph images for use in education

Special Anaglyph Maps were also used in geography. For example, a variety of three-dimensional maps have been developed in the Geography at the Pädagogische Hochschule Potsdam by the anaglyph method and successfully tested in science education and geography education.