/*Drew Cogbill ex40.14 [computation08]*/ // Convert pixel values into a circle's diameter PImage trista; int index; float x = 0.0; float y = 0.0; void setup() { smooth(); fill(0); trista = loadImage("trista.jpg"); trista.loadPixels(); size(400, 400); background(204); } void draw() { color c = trista.pixels[index]; float r = red(c); stroke(c*2); float mappedr = map(r, 0, 255, 4, 15); if (x > 400) { x = mappedr; } if (y > 400) { y = mappedr; } line(x, y, mappedr, y+mappedr); index++; x += mappedr; y += mappedr; if (index == width*height) { index = 0; // Return to the first pixel } }