この記事を書いた人

- クリエイティブコーダー / アーティスト
- 「人の心に寄り添う、機能するアート」を探究しています
- アートとテクノロジーが、社会や個人のウェルビーイングにどう貢献できるかに、関心があります
目次
作品の画像とコード

PImage img;
void setup() {
size(800, 600);
img = loadImage("7, Window, Slovenia, Ljubljana.jpg");
img.loadPixels();
int leftTopIndex = 0;
int rightTopIndex = img.width - 1;
int leftBottomIndex = img.width * (img.height - 1);
int rightBottomIndex = img.width * img.height - 1;
color leftTopColor = img.pixels[leftTopIndex];
color rightTopColor = img.pixels[rightTopIndex];
color leftBottomColor = img.pixels[leftBottomIndex];
color rightBottomColor = img.pixels[rightBottomIndex];
color middleColorTop = lerpColor(leftTopColor, rightTopColor, 0.5);
color middleColorBottom = lerpColor(leftBottomColor, rightBottomColor, 0.5);
color middleColor = lerpColor(middleColorTop, middleColorBottom, 0.5);
tint(255, 127);
image(img, 0, 0, width, height);
fill(leftTopColor);
ellipse(width / 4, height / 4, 100, 100);
fill(rightTopColor);
ellipse(3 * width / 4, height / 4, 100, 100);
fill(leftBottomColor);
ellipse(width / 4, 3 * height / 4, 100, 100);
fill(rightBottomColor);
ellipse(3 * width / 4, 3 * height / 4, 100, 100);
fill(middleColor);
ellipse(width / 2, height / 2, 100, 100);
}
void draw() {
}
作った感想
ピクセルの読み込み方の知識が深まった作品。

それでは今日もレッツワクワクコーディング。