Hi. I am getting this error message every time I run a code. I put jpg file in the sketch file folder in ‘data’ folder, and already tried several times. Here is a code:
PImage img;
void setup() {
size(640, 360);
frameRate(30);
img = loadImage(“rock.jpg”);
img.loadPixels();
loadPixels();
}
void draw() {
for (int x = 0; x < img.width; x++) {
for (int y = 0; y < img.height; y++ ) {
int loc = x + yimg.width;
float r,g,b;
r = red (img.pixels[loc]);
float maxdist = 50;
float d = dist(x, y, mouseX, mouseY);
float adjustbrightness = 255(maxdist-d)/maxdist;
r += adjustbrightness;
r = constrain(r, 0, 255);
color c = color®;
pixels[y*width + x] = c;
}
}
updatePixels();
}