xxxxxxxxxx
65
let img;
let cnv;
function preload()
{
img = loadImage ('f.jpg');
}
function setup() {
cnv=createCanvas(img.width, img.height);
print(img.width,img.height);
let newCanvasX = img.width;
let newCanvasY = img.height;
background(20);
//cnv.position(newCanvasX,newCanvasY);
for (let c=0; c <img.width; c+=10)
{ for (let r=0; r <img.height; r+=10)
{
let xPos =c;
let yPos=r;
let a = img.get(c,r);
push();
translate (xPos,yPos);
rotate(radians(random(360)));
noFill();
stroke(color(0,0,0));
strokeWeight(random(5));
point(c,r);
strokeWeight(random(2));
point(c-width,r-height);
strokeWeight(random(1));
stroke(color(a));
curve(xPos, yPos, sin(xPos)*random(5), cos(yPos)*sin(xPos)*random(7), random(5), random(30),cos(yPos)*sin(xPos)*random(9), cos(yPos)*sin(xPos)*50)
pop();
// stroke(color(a));
// strokeWeight(random(30))
// point(c,r);
// strokeWeight(0.5)
// stroke(color(255));
// curve (c,r,c,r,c,r+30,c,r+30)
// //curve (c,r+15,c,r+15,c+30,r,c+30,r)
// fill(color(255));
// noFill();
// noStroke();
// rect(c,r,5,5)
}
}
}
// function draw() {
// background(220);
// }
//https://www.youtube.com/watch?v=me04ZrTJqWA