PImage danimage; void setup() { size (400,400); danimage = loadImage("danimage.jpg"); } void draw() { background(danimage); loadPixels(); for (int i = 0; i < width*height; i++) { color p = pixels[i]; //read color from screen float r = red(p); //change value of red float g = green(p); //change value of green float b = blue(p); //change value of blue float bw = (r+g+b) / 3.0; bw = constrain(bw + mouseX, 0,255); pixels[i] = color(bw); //assign modified value } updatePixels(); line(mouseX,0,mouseX,height); }