P_4_3_1_02 Image

please format code with </> button * homework policy * asking questions

Hi Processing community!

I would like to upload a photograph from my computer to interact with the code that is provided for P_4_3_1_02. How would I go about doing so? I tried simply replacing the following code, but it does not work. Do I need to download the processing program in order do this action?

var img;

function preload() {
img = loadImage(‘tumblr_o9wzlmSkbU1v49mloo1_1280.jpg’);
}

Thank you! I look forward to learning from you all!

Hi @asymmetric,

Welcome to the forum! :wink:

Can you explain what P_4_3_1_02 is? I saw that it was a generative piece of code but you can give a link or say what it does.

Which code are you talking about?

A Processing program is simply text since it’s code. You can just copy it and paste it in the Processing editor to run it.

And I think that you are mixing things up, the code you provided is using JavaScript and therefore it’s using the web version of Processing which is p5.js