Skip to content

Latest commit

 

History

History
51 lines (31 loc) · 1.76 KB

README.md

File metadata and controls

51 lines (31 loc) · 1.76 KB

This is a small python3 script to create an autostereogram.

As a child I was fascinated from the Magic Eye Book and much later I was eager to figure out how this depth perception actually works. The result was this small script, which I used to "impress" my co-workers and my girlfriend in a nerdy way. ;-)

Requirements

python3 with pip

Install

  1. Set up a python virtual environment

      python3 -m venv env
  2. Start the virtual environment

    source env/bin/activate
  3. Install the python dependencies

    pip install -r requirements.txt

(To terminate the virtual environment afterward, use the command: deactivate)

Usage

  1. Create a small 80x80 image that is used a repeated tile and store it as tile.png in the main directory. For a good effect, the tile should be contrast rich.

  2. Create holo.png for the 3D effect. It must be in grayscale and of dimension 1120 × 800.

    • black -> background

    • gray -> in the middle

    • white -> foreground

  3. Run python main.py to create the "magic_eye.png".

Depth Perception

To obtain the depth perception, you have to squint your eyes in the "wall-eyed"-way (meaning that you have to focus behind the screen). The easiest way to achieve this is to make the magic_eye picture about 30–40 cm wide on the screen, and then put your face close to it (a distance of 40 cm should work). Try to focus behind the screen to see the effect. If it does not work, get closer to the screen. As soon as you have the depth perception, you can slowly move back to a comfortable position. With a bit of training, it is easy to achieve from depth perception all distances.