int[] value, opacity;
int threshold;
size(720,720);
value = new int[width];
opacity = new int[height];
threshold = 153;
background(255);
translate(width/2,height/2);
for (int i=1; i<width; i++){
for (int j=1; j<height; j++){
pushMatrix();
value[i] = int(map(i,1,width,0,255));
opacity[j] = int(map(j,1,height,0,255));
if (opacity[j] < threshold){
stroke(value[int(abs(cos(i)*j))],opacity[int(abs(cos(j)*i))]);
} else {
stroke(value[j],opacity[i]);
}
translate(cos(i)*i/3,cos(j)*j/3);
point(0,0);
popMatrix();
}
}
(via wowgreat)
//blueLeaves_130611a
float rColor,gColor,bColor;
int threshold, pDirection, pModifier;
void setup(){
size(1280,720);
frameRate(12);
background(255);
translate(width/2,height/2);
for (int i=1; i<width; i++){
for (int j=1; j<height; j++){
rColor = map(i,0,width,0,200);
gColor = map(i*j,0,width*height,135,255);
bColor = map(j,0,height,135,255);
pushMatrix();
rotate(radians(i/j));
translate(sin(i)*width/4,sin(j)*height/4);
stroke(rColor,gColor,bColor);
point(0,0);
popMatrix();
}
}
}
void draw(){
loadPixels();
for (int k=width+1; k<width*height-width-1; k = k+1){
pDirection = int(random(8));
switch(pDirection) {
//UP & LEFT
case 0:
pModifier = (width*-1)-1;
break;
//UP
case 1:
pModifier = width*-1;
break;
//UP & RIGHT
case 2:
pModifier = (width*-1)+1;
break;
//RIGHT
case 3:
pModifier = 1;
break;
//DOWN & RIGHT
case 4:
pModifier = width+1;
break;
//DOWN
case 5:
pModifier = width;
break;
//DOWN & LEFT
case 6:
pModifier = width-1;
break;
//LEFT
case 7:
pModifier = -1;
break;
}
if (threshold < 255) {
if (brightness(pixels[k]) < threshold) {
pixels[k] = pixels[k-width];
} else {
pixels[k] = pixels[k+pModifier];
}
threshold = threshold+1;
} else {
threshold = 0;
}
}
updatePixels();
}
//brownParticles_130612a
float rColor,gColor,bColor;
int threshold, pDirection, pModifier;
void setup(){
size(720,720);
frameRate(12);
background(255);
translate(width/2,height/2);
for (int i=1; i<width; i++){
for (int j=1; j<height; j++){
rColor = map(i,0,width,0,255);
gColor = map(i+j,0,width+height,0,255);
bColor = map(j,0,height,0,255);
pushMatrix();
rotate(radians(i%j));
translate(sin(i)*width/3.5,cos(j)*height/3.5);
stroke(rColor,gColor,bColor);
point(0,0);
popMatrix();
}
}
}
void draw(){
loadPixels();
for (int k=width+1; k<width*height-width-1; k = k+1){
if (pDirection < 4) {
switch(pDirection) {
//UP & LEFT
case 0:
pModifier = (width*-1)-1;
break;
//UP & RIGHT
case 1:
pModifier = (width*-1)+1;
break;
//DOWN & RIGHT
case 2:
pModifier = width+1;
break;
//DOWN & LEFT
case 3:
pModifier = width-1;
break;
}
pDirection = pDirection+1;
} else {
pDirection = 0;
}
if (threshold < 255) {
pixels[k] = pixels[k+pModifier];
pixels[k+pModifier] = pixels[k+1];
threshold = threshold+1;
} else {
threshold = 0;
}
}
updatePixels();
}
//CMYKsinSplit
//Steup Code is from CMYKsin sketch
float rColor, gColor, bColor, aColor;
int threshold;
void setup() {
size(720, 720);
translate(width/2, height/3*2);
threshold = 135;
for (int i=0; i<width; i++) {
for (int j=0; j<height; j++) {
rColor = abs(cos(i)*width/2);
gColor = abs(sin(j)*height/2);
bColor = abs(cos(i+j)*width/2);
aColor = 255;
stroke(rColor, gColor, bColor, aColor);
pushMatrix();
translate((sin(i))*width/5*2, (sin(j))*height/5*2);
rotate(i);
rotate(j);
point(0, 0);
popMatrix();
}
}
}
void draw() {
loadPixels();
if (threshold < 255) {
for (int k=width; k<width*height-width; k++) {
if (brightness(pixels[k]) > threshold) {
pixels[k-1] = color(
int(red(pixels[k+1])),
int(green(pixels[k+1])),
int(blue(pixels[k+1])),
int(brightness(pixels[k+1]))
);
}
else {
pixels[k-width] = color(
int(red(pixels[k+1])),
int(green(pixels[k+1])),
int(blue(pixels[k+1])),
int(brightness(pixels[k+1]))
);
}
}
threshold = threshold+1;
}
else {
threshold = 100;
}
updatePixels();
}
(via wowgreat)
//gridCrusher2
int[][] index, value, opacity;
int threshold;
void setup(){
size(720,720);
threshold = 135;
index = new int[width][height];
value = new int[width][height];
opacity = new int[width][height];
for (int i=0; i<width; i++){
for (int j=0; j<height; j++){
index[i][j] = (width*i)+j;
value[i][j] = int(map(cos(index[i][j]),abs(sin(i))*-1,abs(cos(j)),0,255));
opacity[i][j] = int(map(sin(index[i][j]),abs(sin(j))*-1,abs(cos(i)),0,255));
stroke(value[i][j],opacity[i][j]);
point(i,j);
}
}
}
void draw(){
loadPixels();
if (threshold < 255) {
for (int k=width; k<width*height-width; k++){
if (brightness(pixels[k]) > threshold){
pixels[k-1] = color(
int(red(pixels[k+1])),
int(green(pixels[k+1])),
int(blue(pixels[k+1])),
int(brightness(pixels[k+1]))
);
} else if (brightness(pixels[k]) == threshold) {
pixels[k+width] = color(
int(red(pixels[k-width])),
int(green(pixels[k-width])),
int(blue(pixels[k-width])),
int(brightness(pixels[k-width]))
);
} else {
pixels[k-width] = color(
int(red(pixels[k+1])),
int(green(pixels[k+1])),
int(blue(pixels[k+1])),
int(brightness(pixels[k+1]))
);
}
}
threshold = threshold+1;
} else {
threshold = 153;
}
updatePixels();
}
(via wowgreat)
//Building a Grid - v2
int[][] index, value, opacity;
void setup(){
size(720,720);
frameRate(12);
index = new int[width][height];
value = new int[width][height];
opacity = new int[width][height];
for (int i=0; i<width; i++){
for (int j=0; j<height; j++){
index[i][j] = (width*i)+j;
value[i][j] = int(map(index[i][j],0,width*height,0,255));
opacity[i][j] = int(map(index[i][j],0,width*height,0,255));
stroke(value[i][j],opacity[i][j]);
point(i,j);
}
}
}
void draw(){
for (int i=1; i<width-1; i++){
for (int j=1; j<height-1; j++){
//if(i%2 == 0) {
value[i][j] = value[int(abs(sin(j)*j))][int(abs(sin(i)*i))];
opacity[j][i] = value[int(abs(cos(j)*i))][int(abs(cos(i)*j))];;
//}
stroke(value[i][j],opacity[i][j]);
pushMatrix();
translate(i,j);
point(0,0);
popMatrix();
}
}
}
(via wowgreat)
//ivy
int threshold;
void setup(){
size(500,500);
frameRate(12);
threshold = 135;
loadPixels();
for (int k=0; k<width*height; k++){
pixels[k] = color(int(random(255)));
}
updatePixels();
}
void draw(){
loadPixels();
if (threshold < 153) {
for (int k=width; k<width*height-1; k++){
if (brightness(pixels[k]) > threshold){
pixels[k] = color(int(brightness(pixels[k-width])));
} else {
pixels[k] = color(int(brightness(pixels[k+1])));
}
}
threshold = threshold+1;
} else {
threshold = 135;
}
updatePixels();
}
(via wowgreat)