//Iryna Andryianets //Assignment 6 'Image Processing' //Oct 27,2009 //The program changes the color of the pixels of two images //If the mouse is being dragged the color of pixels will change depending on the mouse position //If key 'p' is pressed the new image will be displayed, every forth pixel will be change to the gray value PImage flo,man; int floDimension,manDimension; void setup() { size(300,300); flo=loadImage("flower1.jpg"); floDimension=flo.height * flo.width; man=loadImage("man1.jpg"); manDimension=man.height*man.width; image(flo,0,0); } void draw() { //Empty draw function keeps the program running continiously } void mouseDragged() { image(flo,0,0); loadPixels(); //Loads the pixel data for the image into its pixels array //In the following for loop the program reads red, green, and blue components from each pixel //These components are being changed, depending on the mouse position //And then they are returned to the pixels array for (int i=0;i