xxxxxxxxxx
37
let img;
let step;
function preload() {
img = loadImage('/image/hybridity_smalls.jpg');
}
function setup() {
createCanvas(img.width, img.height);
ellipseMode(CENTER);
rectMode(CENTER)
step = createSlider(3, 10, 5, 1);
step.position(25, height + 20);
}
function draw() {
let stepSlider = step.value();
for(let x = 0; x < img.width-1; x+=stepSlider){
for(let y = 0; y < img.height-1; y+=stepSlider){
let c = img.get(x, y);
// noStroke();
strokeWeight(stepSlider);
stroke(color(c));
point(x, y);
}
}
}