This article demonstrates how to make visual
illusions with R. A visual illusion is a distortion
of form, size or color in the visual field. In the animation
be used to produce visual illusions.
vi.grid.illusion() function provides illustrations for the Scintillating grid illusion and
Hermann grid illusion. They are two most common types of grid
You can see dark dots appear and disappear rapidly at random intersections.
From Hermann grid illusion picture, you can see grey blobs disappear when looking directly at an intersection.
vi.grid.illusion(type = "h", lwd = 22, nrow = 5, ncol = 5, col = "white")
We can draw a Lilac chaser with the function
Stare at the center cross for a few (say 30) seconds to experience the illusion.
ani.options(nmax = 20) par(mar = c(1, 1, 1, 1)) vi.lilac.chaser()
Don’t worry if you can’t see all the phenomena described. For many illusions, there is a percentage of people with perfectly normal vision who just don’t see it, often for reasons currently unknown.
You can see more illusions created by Kohske in R, which also illustrated the power of the grid package.