These formulas provide a simple demonstration of stereogram construction.
The depth map and carrier image here are "self-contained" and do not have to be loaded from files.
(However, they could easily be improved upon.)
More discussion of stereogram construction can be found in the "Stereograms" chapter
of "Pixels, Numbers, and Programs."
-- Steve Tanimoto, 2007.
BEGIN FORMULA BARS
1#|#Sphere depth map#|#512,256#|#*,*#|#if sqr(w/2-x) + sqr(h/2 - y) < sqr(w/8) then 255 - sqrt(sqr(w/8) - sqr(w/2-x) - sqr(h/2 - y)) else 255#|#c#|##|#200,200
2#|#Carrier#|#128,256#|#*,*#|#HSV(((2048*(1+sin(x/20))+sqr(x)+sqr(y))mod 256)/255, 1, 1)#|#c#|##|#
3#|#Stereogram#|#512,256#|#1,2#|#If x