Blend mode with moving images?
in
Programming Questions
•
3 years ago
Hello programmers,
I'm a complete beginner with Processing and have managed to find my way pretty far but this last problem seems just impossible to find a solution for.
I'm working with three separate monochrome images (one in cyan, one in magenta and one in yellow - all with white backgrounds) that I want to layer on top of each other in different positions and use something like a MULTIPLY blend mode to be able to see them all at the same time. I've found a way to move them in relation to each other but when I try to combine it with
blend (0, 0, 600, 424, 0, 0, 600, 424, MULTIPLY);
it doesn't work any more.
As you can see in my code below I've also found the option to reduce the tint but it makes the images extremely pale.
I hope somebody can help me!!
Thank you,
Emma
float diameter = 15;
PImage C;
PImage M;
PImage Y;
void setup() {
size(600, 424);
background(255);
frameRate(5);
}
void draw() {
int stepC = int(frameCount);
int stepM = int(frameCount/10);
int stepY = int(frameCount/100);
println(stepC);
println(stepM);println(stepY);
C = loadImage("C.gif");
M = loadImage("M.gif");
Y = loadImage("Y.gif");
// tint(255,100);
float CAngle = map(stepC, 0, 9, 0, TWO_PI);
float Cx = cos(CAngle) * diameter;
float Cy = sin(CAngle) * diameter;
image(C, Cx, Cy);
// blend(C, 0, 0, 600, 424, 0, 0, 600, 424, MULTIPLY);
float MAngle = map(stepM, 0, 9, 0, TWO_PI);
float Mx = cos(MAngle) * diameter;
float My = sin(MAngle) * diameter;
image(M, Mx, My);
// blend(M, 0, 0, 600, 424, 0, 0, 600, 424, MULTIPLY);
float YAngle = map(stepY, 0, 9, 0, TWO_PI);
float Yx = cos(YAngle) * diameter;
float Yy = sin(YAngle) * diameter;
image(Y, Yx, Yy);
// blend(Y, 0, 0, 600, 424, 0, 0, 600, 424, MULTIPLY);
}
1
