How do I process my image with this code and save the result?

edited December 2016 in JavaScript Mode

Hi, how do I process my images with this code? https://www.openprocessing.org/sketch/158305

I downloaded Processing, opened the code, put my image in the sketch's "data" folder and added the img = loadImage("img0.jpg"); line to the code under void setup(), but the program reterns an error:

"The file "img0.jpg" is missing or inaccessible, make sure the URL is valid or that the file has been added to your sketch and is readable. Could not run the sketch (Target VM failed to initialize). "

Thank you

Tagged:

Answers

  • It run fine on my machine. If you hit ctrl+k in your sketch, do you see the data folder in the new browser?

    Have you run Processing before or is this your first try? Try running the provided examples under the File menu.

    Kf

  • I suppose it is also possible that you have somehow created a data folder or image file with file permissions that Processing does not have access too.

  • Answer ✓

    Also, double and triple check your image name. Case may be important. And that's a zero not a capital O.

    The code is picking a random image out of 4 possibles, img0.jpg to img3.jpg, make sure you have them all (or change the code to suit your setup)

Sign In or Register to comment.