看看图片处理效果:
代码:
PImage origin, pic;
int diamt;
int spacing;
void setup()
{
size(960, 540, P2D);
origin=loadImage("C:\\helecopter.jpg");
pic= loadImage("C:\\helecopter.jpg");
pic.filter(THRESHOLD,0.8);
pic.resize(pic.width*2,pic.height*2);
origin.resize(origin.width*2,origin.height*2);
diamt=8;
spacing = 10;
}
void draw(){
for(int i=spacing/2;i<pic.width;i+=spacing){
for(int j=spacing/2;j<pic.height;j+=spacing){