I have a Mathematica program that modifies images that I would like to make available for other people to use through the web. The input is only one parameter. So, for example, I could run it as a command line action which takes an argument, then returns the image which pops up as a download from the web page.
What is a way to structure this functionality?
So, just to be clear I could have a function like
makeDecloudedImage[ image_, x_ : 0 < RationalQ < 1 ]
or whatever which returns a PNG. I want to know how to hook up a function like this (or another equivalent mechanism) to a web page. In one approach Mathematica itself would run as the web server; another idea would be to have the web server call Mathematica somehow (through shared memory maybe?). This would probably be running on a Linux box.
One approach might be to use CGI. The web page makes a CGI call to Mathematica, executes the function to create the file, returns the path to the file and quits. The problem with this approach is that the whole program has to load which takes a relatively long time. It would be better to have mathematica in memory and just call it like a server somehow from the web server OR have Mathematica be the web server itself.