while it does create autostereograms the algorithm used is not physically accurate. This results in some artefacts and a non-linear depth representation. There are a lot of good papers on this topic and i plan to reimplement the program, using a better algorithem.
standalone js autostereogram generator with demo webpage.
for more informations about autostereograms refer to the wikipedia page: https://en.wikipedia.org/wiki/Autostereogram
to use the autostereogram.js in your own Projekts, simply tweak the settings in autostereogram_settings and call create_stereogram(depth,pattern) using a grayscale image as depth Map and a Vivid image as Pattern. If no pattern is given, the script will switch to random dot mode.
create_stereogram(depth,pattern) will return a canvas element with the "stereoimage" id.
- colum_width: defines the amount of pixels, each row will have
- max_shift: defines the maximum "shift" of a white depth map Pixel. Thus, higer values will give a greater 3d effekt
- rmin...bmin: for random dot pictures only, defines the minimum ramdom color of the colorchannel (i know that this isn't optimal. A hsv representation would be a better approach)
- rmax...bmax: for random dot pictures only, defines the maximum ramdom color of the colorchannel (i know that this isn't optimal. A hsv representation would be a better approach)
- filter_linear: interpolates between pixels, thus creating smooth height gradient
- upscale: scales the depth map before calculating the 3d image 2 = 200% 0,5 = 50%
- downscale: scales the finished stereogram. 2 = 50%, 0.5 = 200%
- pattern_scale : scaling of the pattern image. 2 = 200%, 0,5 = 50%
- pattern_shift : negative amount pattern will be shiftet, if the pattern is smaller than the colum width. May be used to avoid alialising
- remove_hidden_surface : tries to remove "unseen" areas of the image, mostly eliminating image artifacts