"Image Magic" autostereogram generator.
import (
"github.com/cartland/imagic"
)
Try it online at https://imagic-golang.appspot.com.
Or try this curl request from a directory with Chefchaouen.jpg and borrodepth.png:
curl -F "background=@Chefchaouen.jpg" -F "depth=@borrodepth.png" https://imagic-golang.appspot.com/generate -o file_output.png
curl "https://imagic-golang.appspot.com/generate?background=http%3A%2F%2Fwww.chriscartland.com%2Fstatic%2FChefchaouen.jpg&depth=http%3A%2F%2Fwww.imsc.res.in%2F~kapil%2Fgeometry%2Fborr%2Fborrodepth.png" -o url_output.png
Source in /appengine.
To install the command-line tool, use the following command:
go install github.com/cartland/imagic/cmd/imagic@latest
Then, you can run the tool from anywhere:
imagic -d examples/inputs/depthmaps/borrodepth.png -b examples/inputs/backgrounds/Chefchaouen.jpg -o examples/outputs/output.png
You can also use the optional -c flag for cross-eyed viewing and -i to invert the depth map.
Source in /cmd/imagic.
Depth map image borrowed from http://www.imsc.res.in/~kapil/geometry/borr/borrodepth.png.


