Unexpected char error
in
Programming Questions
•
5 months ago
Hello, I am kind of a newbie with processing and have recently encountered an unexpected char "/" while I was reworking and playing around with some codes found online. Below, I have highlighted where the error appears. Can't seem to figure out why I am unable to run it. Just curious do I have to link the image or someway in order for the software to recognize it?
Below are the following codes:
//rajon
int threshold;
String url;
PImage img;
void setup(){
url = “http//:www.keeperofthecourt.com/wp-content/uploads/2012/06/rajon.jpg”;
img = loadImage(url);
size(img.width, img.height);
frameRate(24);
threshold = 135;
}
void draw(){
image(img,0,0);
img.loadPixels();
if (threshold < 255) {
for (int k=width; k<width*height-width; k++){
if (brightness(img.pixels[k]) < threshold){
img.pixels[k-1] = color(
int(red(img.pixels[k+1])),
int(green(img.pixels[k+1])),
int(blue(img.pixels[k+1]))
);
} else if (brightness(img.pixels[k]) == threshold) {
img.pixels[k+width] = color(
int(red(img.pixels[k-width])),
int(green(img.pixels[k-width])),
int(blue(img.pixels[k-width]))
);
} else {
img.pixels[k] = color(
int(red(img.pixels[k])),
int(green(img.pixels[k])),
int(blue(img.pixels[k]))
);
}
}
threshold = threshold+1;
} else {
threshold = 0;
}
img.updatePixels();
}
1