by Yilin Ye & Sofia Pace


For our Pixel project we used createCapture(VIDEO) function to experiment with the use of motion.

WORDS USED TO DESCRIBE PROJECT:

Staring out we set the for variables needed:

let cam;
let ghostImage;

function setup() {
createCanvas(windowWidth, windowHeight);
pixelDensity(1) 
cam = createCapture(VIDEO);
cam.size(width, height);
cam.hide()

ghostImage = createImage(width, height);
}

For this purpose, we used function Lerp for a delayed motion effect. Here, since Lerp uses the 0.0 and 1.0 range to hold values (in this case the rgb 0-255 pixel color value), we experimented with the 0.0 values for archive a delayed color effect.

lerp(start, stop, amt)
start
Number: first value.

stop
Number: second value.

amt
Number: number.

//used in code, in draw function:

    ghostImage.pixels[index] = lerp(rGhost, r, 0.1);
    ghostImage.pixels[index + 1] = lerp(gGhost, g, 0.5);
    ghostImage.pixels[index + 2] = lerp(bGhost, b, 0.9);
    ghostImage.pixels[index + 3] = 255;

To archive a changing effect over time, we created a new image through the variable backImage that was essentially used to modify/overall color of the screen cam capture. This effect was companied with the variable colTime that was placed in backImage index alpha value, in addition to an if statement that increased the opacity of image over time fro visual effect.