xxxxxxxxxx
70
let lion;
let w = 261
let hh = 700
function setup() {
createCanvas(windowWidth, windowHeight);
pixelDensity(1);
lion = createVideo("IMG_1992_1.mp4")
lion.loop()
lion.size(w, hh)
lion.hide()
}
function draw() {
background(0);
lion.loadPixels();
loadPixels();
for (let x = 0; x < w; x= x+4) {
for (let y = 0; y < hh; y= y +4) {
let i = (x + y * w) * 4;
let br = (lion.pixels[i + 0] + lion.pixels[i + 1] + lion.pixels[i + 2]) / 3
// if (br < 50) {
// lion.pixels[i + 0] = 0
// lion.pixels[i + 1] = 0
// lion.pixels[i + 2] = 0
if (br > 50) {
noStroke()
if (x < 50 || y < 30){
// stroke(random(100, 255), random(80,100), 0)
// noFill()
fill(random(100, 255), random(30,100), 0)
}
else if (x > w-50){
// noFill()
// stroke(random(180, 210), random(80,100), 0)
fill(random(180, 210), random(30,100), 0)
}
else {
// noFill();
// stroke(random(200, 255), random(80,255), random(0,50))
fill(random(200, 255), random(80,255), random(0,50))
}
// ellipse(x+((width/2)-(w/2)), y, 3, 3)
ellipse(x-1+((width/2)-(w/2)), y-1, 4/(br/100), 4/(br/100))
fill(205, 0 , 0)
ellipse(x-1+((width/2)-(w/2)), y-1, (br/100), (br/100))
// strokeWeight(1.5)
// line(x+((width/2)-(w/2)), y, x+((width/2)-(w/2))+4, y+4)
// line(x+((width/2)-(w/2))+4, y, x+((width/2)-(w/2)), y+4)
}
}
}
}