class BackgroundImage { PImage img; int[] colorValues= new int[(width*height)]; // array holding color values loaded from image //Constructor: BackgroundImage() { } // end of constructor void init() { img = loadImage("leaves.jpg"); for (int x = 0; x < width; x++) { for (int y = 0; y < height; y++) { colorValues[x+y*width] = int( img.pixels[x+y*width] ); } } } // end loadimage method void display() { loadPixels(); for (int x = 0; x < width; x++) { for (int y = 0; y < height; y++) { int bright = colorValues[x+y*width]; pixels[x+y*width] = color(bright); } } updatePixels(); } // end display method void increment(int incrementValue){ int[] tempValue = new int[width*height]; // temporary array for folding color array over // Increments above zero (movement to the right): if (incrementValue > 0) { // deal with pixel columns above increment value: for(int i=incrementValue;i