library(magiceyer)

You could use this package to generate autostereograms.

How

  • You need an image as the shape hidden in the magic eye

  • Convert the image into the depthmap

  • You need to define shift. 0.1-0.2 should be fine.

  • Generate the autostereograms

image <- getdepthmap("https://cran.r-project.org/Rlogo.jpg")
plot(image)

me <- getme(image,len = 10)
plot(me)

You could also generate text as hidden information in the autostereograms

met <- getmet(text = "Don't Panic",cex = 15)
me <- getme(met)
plot(me)