xxxxxxxxxx
42
/*
image source = https://pixabay.com/fr/photos/mode-femme-portrait-maquette-fille-3080644/
pour en trouver d'autres taper femme, homme ou visage ou portrait dans la recherche de pixabay
source du programme de découpe https://www.youtube.com/watch?v=-YS5t1R-GO8
*/
let img ;
function preload() {
img = loadImage("assets/femme1.jpg") ;
}
function setup() {
createCanvas(600, 400);
noLoop() ;
}
function draw() {
background(220);
img.resize(height,0) ;
image (img, 0, 0 ) ;
/*
let leftCorner = img.get(0, 0, img.width/2, img.height/2 ) ;
image( leftCorner, width/2, height/2 ) ;
*/
for ( let y = 0; y < img.height; y += 10 ) {
// casting
let stripYPosition = int( random( 0, img.height - 10 )) ;
let strip = img.get(0, stripYPosition, img.width, 10) ;
image(strip, 0, y ) ;
}
}