/** 'myPointillismSymbol.pde' * How to interact: firstly, click mouse somewhere within the frame. Move move across the area of the frame to find your favorite brush size (the smaller, the sharper of my image). * Leave mouse for a while, the more circles, the sharper of my image. * Parameters used in sourcecode are referenced from my body weight, width and height * on the day i handed in this work. The image is taken from my university id card. */ /* Practice: creates a simple pointillist effect using ellipses colour according to pixels in an image. Variables. Modifiled: from Processing/Library/Pointillism by Daniel Shiffman (2 May 2005 ) */ PImage a; // Declare variable 'a' for holding an image void setup() { a = loadImage("nandaKhaLowRes.jpg"); // Loads image size(238, 300); //noStroke(); background(255); smooth(); } void draw() { // Mouse horizontal location controls size of dots. float pointillize = map(mouseX, 0, width, 156, 32); // 156 cm: body height. //32 inches: body width. // Creates anoter variable to hold the float value of colour weight in the 'fill' method below float myWeight; myWeight = 40.50; // My Weight in kg. // Creates two variables int x = int(random(a.width)); // This one holds random values of X-coordinate int y = int(random(a.height)); // This one holds random values of Y-coordinate // Gets colour pixels color pic = a.get(x, y); //stroke(myWeight, myWeight); stroke(myWeight/4, myWeight); fill(pic, random(myWeight)); ellipse(x, y, pointillize, pointillize); } /* and i will capture my logo at the end of minute 34 (0:34:00) now i'm 34 years old. nandadoes_2007 */