color white, black; int[] base_color=new int[2]; int col_index; int[] buf; int circ_x, circ_y, circ_r; void setup() { white=color(255,255,255); black=color(0,0,0); base_color[0]=12<<16|12<<8|255; base_color[1]=255<<16|255<<8|255; col_index=0; // screen setup: size(600,400,P3D); background(white); buf=new int[width*height]; circleSetup(); } void mousePressed() { setup(); } void circleSetup() { circ_x = int(0.5*width+random(-0.1,0.1)*width); circ_y = int(0.5*height+random(-0.1,0.1)*height); circ_r = int(random(0.15,0.3)*(width+height)/2.0); } void draw() { if (random(1)<0.002) {circleSetup();} if (col_index==0) {if (random(1)<0.01) {col_index=1;}} else {if (random(1)<0.04) {col_index=0;}} drawCircle(); loadPixels(); if (random(1)<0.05) { buf=moveBuf(4,4); buf=blurBuf(buf); drawBuf(buf); } } void drawCircle() { float xo=random(0.025)*width; float yo=random(0.025)*height; for (float rd=0.0;rd=ym&&x>=xm) { int si=(y-ym)*width+(x-xm); o[i]=pixels[si]; } else { o[i]=base_color[1]; } } } return o; } int[] blurBuf(int[] b_in) { int[] b_out=new int[width*height]; float v=1/9.0; float[][] k={ {v,v,v}, {v,v,v}, {v,v,v} }; for (int y=0;y=0&&xp=0&&yp>16&255); gg+=v*(b_in[i]>>8&255); bb+=v*(b_in[i]&255); } else { rr+=v*255.0; gg+=v*255.0; bb+=v*255.0; } } } b_out[y*width+x]=int(rr)<<16|int(gg)<<8|int(bb); } } return b_out; } void drawBuf(int[] b) { for (int y=0;y>16&255, gg=inC>>8&255, bb=inC&255; int off; do {off=(int)random(-q,q);} while (rr+off<0||rr+off>255); rr+=off; do {off=(int)random(-q,q);} while (gg+off<0||gg+off>255); gg+=off; do {off=(int)random(-q,q);} while (bb+off<0||bb+off>255); bb+=off; return (rr<<16|gg<<8|bb); } void softset(int x, int y, int c1, float p1) { if (x>=0&&x=0&&y>16&255)+p2*(c2>>16&255)); int g=int(p1*(c1>>8&255)+p2*(c2>>8&255)); int b=int(p1*(c1&255)+p2*(c2&255)); set(x,y,(r<<16|g<<8|b)); } }