xxxxxxxxxx
45
let img;
function preload() {
imgs = [
"/assets/test.jpg",
"/assets/temp-1.jpg"
];
img = loadImage(random(imgs));
}
function setup() {
createCanvas(img.width + 100, img.height);
//img.loadPixels();
for (let col = 0; col < img.width; col++) {
//for (let col = img.width - 1; col >= 0; col--) {
for (let row = 0; row < img.height; row++) {
let c = img.get(col, row);
push();
translate(col, row);
rotate(radians(random(90, 360)));
noFill();
stroke(color(c));
strokeWeight(random(1, 3));
curve(
col,
row,
sin(col) * random(4, 10),
cos(col) * sin(col) * random(2, 10),
random(10),
random(2, 10),
col,//cos(row) * sin(row) * random(2, 3),
row//cos(col) * sin(col) * 2
);
pop();
}
}
stroke(color(255, 0, 0));
line(img.width, 0, img.width, img.height);
}