This project involves using an algorithm to generate “Magic Eye” images from grayscale depth-mappings of photographs. These images are also known as Single Image Random Dot Stereograms (SIRDS) and were popularized by the Magic Eye books in the 1990s.
To create these Magic Eye images, the original algorithm required significant computational resources that made the process time-consuming. In this project, I have rewritten the original algorithm to be more efficient, using Node.js, while still producing the same high-quality images.
I started by taking JPEG images from a trip to Hawaii and converted them to grayscale depth-mappings using Photoshop. I then used the optimized algorithm, which was originally translated from C code by Harold W. Thimbleby, Stuart Inglis, and Ian H. Witten, to generate the Magic Eye images.
The new algorithm works by taking the depth-mapping image and using it to generate a new image that can be viewed as a 3D image with the help of stereoscopic viewing. The resulting image appears to be a pattern of random dots, but when viewed with a special technique (e.g., crossing your eyes or focusing behind the image), the viewer can see a 3D scene.
The project includes several Magic Eye images, including a tropical fish, a person snorkeling, a beach scene, and more. I wrote the code for this project using Node.js and added detailed comments to make it easier to understand.
The resulting Magic Eye images are fascinating to look at and can be a fun addition to any website. The project highlights my skills in image processing and computer graphics, as well as my ability to understand and optimize complex algorithms for faster processing times.
My Implementation of Algorithm