Second image not fading completly
in
Programming Questions
•
1 year ago
Hi guys,
I've having a problem with fading one picture over the other. It stops in about 50% of opacity. (Btw. The image fades completely when on a black or white background).
I played with all the values with no result.. Can I please borrow fresh pairs of eyes? ;))
Thanks you very much!
-----------------------------------------
PImage img;
PImage bg;
float opacity = 300; // Set opacity to the max
void setup() {
size(300, 300);
bg = loadImage("bg.jpg");
img = loadImage("drugs.jpg");
}
void draw() {
image(bg,0,0);
if (opacity > 0) { // When more than the minimum,
opacity -= 0.5;
}
tint(255, opacity);
image(img, 0, 0);
}
I've having a problem with fading one picture over the other. It stops in about 50% of opacity. (Btw. The image fades completely when on a black or white background).
I played with all the values with no result.. Can I please borrow fresh pairs of eyes? ;))
Thanks you very much!
-----------------------------------------
PImage img;
PImage bg;
float opacity = 300; // Set opacity to the max
void setup() {
size(300, 300);
bg = loadImage("bg.jpg");
img = loadImage("drugs.jpg");
}
void draw() {
image(bg,0,0);
if (opacity > 0) { // When more than the minimum,
opacity -= 0.5;
}
tint(255, opacity);
image(img, 0, 0);
}
1