An autostereogram (MagicEye) image generator written in Python
Python Shell
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
sample Added sample gifs Apr 26, 2013
README.md Updated README Nov 18, 2012
example.sh
glmagic.py Added OpenGL movie maker Nov 18, 2012
magic-shark.png
magic-teapot.png Adding sample images Nov 18, 2012
magicpy.py Fixed indentation Feb 11, 2013
make_movie.sh Added OpenGL movie maker Nov 18, 2012
shark.png
teapot.gif Adding sample images Nov 18, 2012
teapot.png Adding sample images Nov 18, 2012

README.md

magicpy

An autostereogram (MagicEye) image generator written in Python.

Description

Takes a grayscale depthmap (where white is closest, black is farthest), and generates a random dot autostereogram (MagicEye) image of the same size.

By default, a random pattern 1/8 the size of the depthmap is repeated and offset to create the effect. There seems to be an art to choosing the right pattern size.

If you string together multiple stereograms, you can make cool "MagicEye" movies!

Examples

# Use default settings (1/8 sized pattern)
$ python magicpy.py shark.png -o magic-shark.png

# Make random pattern 1/10 of the depthmap size
$ python magicpy.py -p 10 shark.png -o magic-shark.png

shark.png magic-shark.png

glmagic

An OpenGL-based depth map generator (used to make frames for a stereogram movie).

Description

Renders frames from an OpenGL scene to a series of depthmaps that can be converted and combined into a stereogram movie. You can make your own movies by modifying the render function inside glmagic.py.

Examples

# Make depthmap frames with the GLUT teapot
$ python glmagic.py

# Generate an animated GIF of the teapot
$ ./make-movie.sh

teapot.png magic-teapot.png