この記事を書いた人

- クリエイティブコーディングで制作した作品と、上達のためにやったこと・学習過程を発信
- コンセプトは「クリエイティブコーディング1万時間の歩き方」
- 2024年にProcessingの構文のアウトプットを終え、2025年から作品制作開始(クリエイティブコーディングで作成した作品集)
目次
作品の画像とコード

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() {
}
作った感想
ピクセルの読み込み方の知識が深まった作品。

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