1
$\begingroup$

I am interested in creating an interactive dynamic on a webpage where I will create a Manipulate window that will accept a user's image input on a website. Can this be done with CDF? If so, how? Thank you!

$\endgroup$
  • 1
    $\begingroup$ Not an answer, but CDF files can no longer be reliably embedded in web pages because all browsers have either dropped plugin support already, or will drop it before the end of the year. You can use Wolfram Cloud as an alternative (and people can upload images), but it is not a free service. $\endgroup$ – Szabolcs Apr 11 '17 at 18:01
1
$\begingroup$

As far as I'm concerned the only viable option is to create FormFunction which can upload a file, then it need to create a cdf/manipulate based on that file input, deploy it and redirect to that deployed cdf.

Here's a small example:

CloudDeploy[
  FormFunction[
    {"x" -> "Image"}
  , HTTPRedirect @ With[
      {img = #x}
    , CloudDeploy[ Manipulate[Binarize[img, t], {t, 0, 1}] ]
    ] &
  ]
]

The problem is that it is detached from the importing interface. You can add a button to redirect to the original form using this trick: Cloud CDF and HTTPRedirect

Using this trick you could also prompt a file uploading dialog but I don't see any way to handle this file and link it to variables in Manipulate.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.