2017년 4월 26일 수요일

수업자료_blend() function using SUBTRACT argument in loops sketch

size(832,624);

background(loadImage("01.jpg"));
PImage img=loadImage("02.jpg");

int w=width/6;
int h=height/8;


for(int i=0; i<width; i+=w){
  for(int j=0; j<height; j+=h){
    blend(img,0,0,width,height,i,j,w,h,SUBTRACT);
  }
}

수업자료_image tiling

size(650,450);

PImage img=loadImage("02.jpg");
int cols=8;
int rows=8;
int w=width/cols;
int h=h=height/rows;
for(int i=0; i<height; i+=h){
  for(int j=0; j<width; j+=w){
    image(img,j,i,w,h);
  }
}



수업자료_filter_dart,lighr,sub

size(832,624);
background(loadImage("01.jpg"));
PImage img=loadImage("02.jpg");


blend(img,0,0,832,624,0,0,832,624,DARKEST);
blend(img,0,0,832,624,0,0,832,624,LIGHTEST);
blend(img,0,0,832,624,0,0,832,624,SUBTRACT);





수업자료_filter_posterize

size(1500,300);
background(255);
PImage img=loadImage("01.jpg");
image(img,0,0);

int cols=5;
int w=width/cols;
int h=height;

int[]vals={2,4,8,16,32};

for(int i=0; i<cols; i++){
  image(img,i*w,0,w,h);

  filter(POSTERIZE,vals[i]);

}

수업자료_filter(BLUR)

size(500,500);
background(255);
PImage img=loadImage("01.jpg");
image(img,0,0);
filter(BLUR,10);




수업자료_filter_threshold


size(800,200);

PImage img=loadImage("01.jpg");
float thresholdLevel=1.0;

for(int i=0; i<4; i++){
  image(img,200*i,0,200,200);
  filter(THRESHOLD,thresholdLevel);
  thresholdLevel-=0.25;
}
 
 
 

수업자료_filter(INVERT)

size(600,400);
background(255);
PImage img=loadImage("01.jpg");
image(img,0,0);
filter(INVERT);

아두이노와 프로세싱 연동: 가변저항으로 프로세싱 색상제어

아두이노와 프로세싱을 연동하는 프로젝트로서, 아두이노의 가변저항을 조절하여 프로세싱의 rect의 색상을 조절해봅니다. 과정은 간단합니다.  1. 아두이노보드에 가변저항을 연결합니다. 가변저항의 세 단자에 GND, 5V, 그리고 A0(아날로...