Stereograms (Magic Eye Pictures)
Stereograms (also called Magic Eye pics) are pictures that when you
stare at them, something will pop out in 3D. No special glasses needed :).
The trick to these images is to slightly cross your eyes while staring at
the image, or to focus your eye on something that would be closer than
the image (or is it futher away.. hmmm). It might take some practice to
be able to see these.
Anyway, to use this program, you give it a normal image (2 or more colors)
and the program will create a stereogram based on this. The program will
scan from left to right and if it sees a new color it will raise that
part of the image forward until it sees the previous color. In other
words, on the sample picture below, the program will always see the
color white first (the background color). If the program is working
on the center of the screen, as the program scans right, it will see the
color black. At that point it will pull the image forward. When it
sees red it will pull the image forward again. When it sees black again,
it will push the image back in, etc. etc. The two pictures below show
a before and after:
The image before running through the stereogram program
The image after running through the stereogram program
The way this program works is, for every line of the image it creates
a random pattern of colored dots (with a default length of 30 dots)
and repeats this pattern across the image. Any place that you want
to pop forward, you add an extra dot to the pattern and anywhere you
want to appear further away from the viewer, you remove a dot from the
pattern. Note that the pattern of dots keep the same colors, there's
just one more dot (of a random color) or one less. Sorry for the bad
explanation :(. Anyway, the stereogram program has 2 options:
Usage: stereogram [ -options ] <image.bmp> <output image.bmp>
-width <pattern width (default 30) >
-delta <num pixel change (default 3) >
So to make the image above I just typed:
./stereogram mike3.bmp stereo3.bmp
Note that the input and output files must be BMP's. If you wanted the
pattern of pixels to be 40 instead of 30 and you wanted to remove/add
7 pixels from the image in a depth change, you could type:
./stereogram -width 40 -delta 7 mike3.bmp stereo3.bmp
Note: The version from February 2005 had a bug where it was
creating the bmp images wrong, especially if the input image wasn't
a multiple of 4. This should be fixed in the November 2, 2005 version.
Anyway, you can download the program here: