This post shows how a geometrical image is painted with colours taken from random pixels of the webcam image.
I am still not sure about the style I want to use for my piece, but I will start with a technical and geometrical aesthetic. Inspired by geometric art.
“Geometric abstraction is a form of abstract art based on the use of geometric forms sometimes, though not always, placed in non-illusionistic space and combined into non-objective (non-representational) compositions.” (Wikipedia, 2015)
IMAGES::
VIDEO::
CODE::
import processing.video.*; Capture cam; int w = 50; int s = 0; color c; void setup(){ cam = new Capture(this, 640, 480, 20); cam.start(); size(640, 480); background(255); frameRate(4); smooth(); } void draw() { color[] c1 = new color[5]; c1[0] = cam.get(int(random(width)),int(random(height))); c1[1] = cam.get(int(random(width)),int(random(height))); c1[2] = cam.get(int(random(width)),int(random(height))); c1[3] = cam.get(int(random(width)),int(random(height))); c1[4] = #FFFFFF; c = cam.get(width/2,height/2); for(int y=0; y<height; y=y+w){ for(int x=0; x<width; x=x+w){ noStroke(); fill(c1[int(random(1,5))]); rect(x, y, w, w); } } int d = 400; while(d > 0){ for(int n=0; n<80; n=n+1){ fill(c1[int(random(1,5))]); noStroke(); ellipseMode(CENTER); s=(s+1)%d; ellipse(width/2,height/2, s,s); } d= d-50; } } void captureEvent(Capture c){ c.read(); }
______________
Below, I have added the value of brightness which is also used to create the final image. When brightness is less or equal than 100, the central figure is an square, and the background is made by ellipses in squares. Whereas, when brightness is more than 100, the central figure is an ellipse and the background ones are squares.
IMAGES::
VIDEO::
CODE::
import processing.video.*; Capture cam; int w = 50; int s = 0; color c; void setup(){ cam = new Capture(this, 640, 480, 20); cam.start(); size(640, 480); background(255); frameRate(4); smooth(); } void draw() { // image(cam, 0, 0); color[] c1 = new color[5]; c1[0] = cam.get(int(random(width)),int(random(height))); c1[1] = cam.get(int(random(width)),int(random(height))); c1[2] = cam.get(int(random(width)),int(random(height))); c1[3] = cam.get(int(random(width)),int(random(height))); c1[4] = #FFFFFF; color[] c2 = new color[5]; c2[0] = cam.get(2,3); c2[1] = cam.get(4,6); c2[2] = cam.get(200,44); c2[3] = cam.get(300,80); c2[4] = cam.get(40,50); c = cam.get(width/2,height/2); if (brightness(c1[2])<=100){ for(int y=0; y<height; y=y+w){ for(int x=0; x<width; x=x+w){ noStroke(); fill(c1[int(random(1,5))]); rect(x, y, w, w); } } } else{ for(int y=0; y<height; y=y+w){ for(int x=0; x<width; x=x+w){ noStroke(); fill(c1[int(random(1,5))]); ellipse(x, y, w, w); } } } int d = 400; s=(s+1)%d; while(d > 0){ if (brightness(c1[2])<=100){ for(int n=0; n<80; n=n+1){ fill(c1[int(random(1,5))]); noStroke(); ellipseMode(CENTER); ellipse(width/2,height/2, s,s); } }else{ for(int n=0; n<80; n=n+1){ fill(c1[int(random(1,5))]); noStroke(); rectMode(CENTER); rect(width/2,height/2, s,s); } } d= d-50; } } void captureEvent(Capture c){ c.read(); }
REFERENCES::
Wikipedia, 2015. Geometric abstraction. [online] Wikipedia. Available on: http://en.wikipedia.org/wiki/Geometric_abstraction
One comment