size(200, 200); colorMode(RGB, width); int[] hist = new int[width]; // Load an image from the data directory // Load a different image by modifying the comments PImage a; a = loadImage("data/cdi01_g.jpg", null, function(){ image(a, 0, 0); // Calculate the histogram for (int i=0; i maxval) { maxval = hist[i]; } } // Normalize the histogram to values between 0 and "height" for (int i=0; i