《Processing 番外編》 制作例2
May 13, 2021
Processing 制作例/点描

画像のピクセルデータを取得し、点描画と同じやり方で描画してみます。
用意するもの:静止画像(jpg,png,gifのいずれか)
PImage img;
img = loadImage("banana.png");
size(500,500);
imageMode(CENTER);
noStroke();
background(255);
for ( int x = 0; x < img.height; x=x+4 ) {//★
for ( int y = 0; y < img.width; y=y+4 ) {//★
color c = img.get(x, y);
stroke(red(c), green(c), blue(c));
fill(red(c),green(c),blue(c));
strokeWeight(5);//★
point(x, y);
}
}

「★」部分の数値を変えることで、表現もかわります。


元画像(さくら)





