In the 1990s, amidst the culture of hyper color t-shirts and alternative rock, magic eye pictures became popular. To create an autostereogram, you need a color image and a depth image. By modifying the algorithm, you can create a 3D effect by looking at the output image at an offset location. However, there are some problems, such as holes and misalignment. These can be fixed by adjusting the algorithm and adding an extra “empty color tile” on the left. The author found it useful to normalize the greyscale depth maps and binarize the masks. Larger, coarse features work better than fine details. The author also shares their code for making these autostereograms and suggests that this technique could be used in a 3D game.
https://blog.demofox.org/2023/10/22/how-to-make-your-own-spooky-magic-eye-pictures-autostereograms/