xxxxxxxxxx
34
let c;
function preload() {
img = loadImage("https://loremflickr.com/g/600/800/woman/all");
}
function setup() {
c = createCanvas (1080, 1080)
background(0)
noLoop();
for(let col = 0; col< img.width; col+=1){
for(let row = 0; row <img.height; row+=1){
let xPos = col;
let yPos = row;
let c = img.get(xPos, yPos);
push();
translate(xPos, yPos);
noFill();
strokeWeight(random(5));
stroke(color(c))
curve(xPos, yPos, sin(xPos) * random(10), cos(xPos) * sin(xPos) * 40, 0, 0, cos(yPos) * sin(xPos) * random(140), cos(xPos) * sin(xPos) * 10)
pop();
}
}
}
function keyTyped() {
if(key === '7')
saveCanvas(c, 'mySketch', 'png');
}