Files
p5js/sketches/imageNoice.js
Jürg Hallenbarter f13cc6b27d added loader file
2026-04-14 11:23:15 +00:00

38 lines
600 B
JavaScript

function preload() {
img1 = loadImage('assets/wallpaper/Space-Nebula.png');
}
function setup() {
createCanvas(img1.width, img1.height);
background(255, 255, 55)
//image(img1, 0, 0);
for (let col = 0; col < img1.width; col += 1) {
for (let row = 0; row < img1.height; row += 1) {
let c = img1.get(col, row);
if (c[0] + c[1] + c[2] < random(0, 255) * 3) {
c[0] = 0;
c[1] = 0;
c[2] = 0;
} else {
c[0] = 255;
c[1] = 255;
c[2] = 255;
}
stroke(color(c));
strokeWeight(1);
point(col, row);
}
}
}
function draw() {
}
function mousePressed() {
}