Professional Documents
Culture Documents
Wednesday Addams
Wednesday Addams
clear();
ctx.globalAlpha = 1;
noLoop();
image(img, 0, 0, width, height);
loadPixels();
noStroke();
for (let y = 0; y < height; y+=detail) {
for (let x = 0; x < width; x+=detail) {
const r = pixels[(y * width + x) * 4];
const g = pixels[(y * width + x) * 4 + 1];
const b = pixels[(y * width + x) * 4 + 2];
const _color = color(r, g, b);
const _brightness = floor(brightness(_color) / 100 * 255);
fill(_brightness);
rect(x, y, detail, detail);
}
}
}
Loading...
Wednesday Addams
Developer
1.0× Rahul
Fork Export
Share
Run
CodePen: Unlock all of CodePen