A digital photo camera register the red, green and blue values (RGB) of each pixel in the view angle, but a human does not have such a precise way of perceive ligth. A human sees colors in relation to its surroundings. As a painter, I assume this premise as a matter of fact.
When I am starting a new painting, I think is very interesting to change the color of the primer. The background color is crucial to determine the color gamma the painting is going to have. In my case, the starting point of a painting can be a ocre, red, or a fluorescent green surface, for example.
On this interactive piece, i wanted to give the spectator the chance of play a little bit with some elements from my paintings and its background.
Code example to archieve a Parallax effect on P5.js:
let image1, image2;
function preload(){
image1 = loadImage("assets/image1.png");
image2 = loadImage("assets/image2.png");
}
function setup() {
canvas = createCanvas(windowWidth, windowHeight);
}
function draw() {
front = map(mouseX, 0, width, width / 2 - 400, width / 2 + 200);
back = map(mouseX, 0, width, width / 2 - 150, width / 2 + 150);
image(image1, back, windowHeight-image1.height);
mage(image2, front, windowHeight-image2.height);
}