fading pixel between images with a one frame buffer
in
Programming Questions
•
8 months ago
hello all ;
I would like to do some fading effect with processing…
I want to load a lot of images but one by one.
which means:
load image1.
Access pixel of image1
display image1.
and then replace this path with image 2 in a smooth transition of pixels fading.
load image2
acess pixel of image 2
SMOOTH TRANSITION FROM 1 TO 2
and then go for image2.
I would like a buffer of just one image, to "interpolate" in a smooth transition with the second image.
Because I have to deal with a lot of pictures, this should be so much simpler than load large array of pictures, and re-alocate them to picture1 which is the first to be displayed, then load picture 2, but make picture 1 disappear.
here's a little code which go to one picture to another one.
I hope I'm (a little bit) clear
thanks
I would like to do some fading effect with processing…
I want to load a lot of images but one by one.
which means:
load image1.
Access pixel of image1
display image1.
and then replace this path with image 2 in a smooth transition of pixels fading.
load image2
acess pixel of image 2
SMOOTH TRANSITION FROM 1 TO 2
and then go for image2.
I would like a buffer of just one image, to "interpolate" in a smooth transition with the second image.
Because I have to deal with a lot of pictures, this should be so much simpler than load large array of pictures, and re-alocate them to picture1 which is the first to be displayed, then load picture 2, but make picture 1 disappear.
here's a little code which go to one picture to another one.
I hope I'm (a little bit) clear
thanks
- PImage img1;
PImage img2;
int counter = 0;
void setup()
{
size(400, 400);
img1= loadImage("1.JPG");
img2= loadImage("3.JPG");
}
void draw()
{
if (counter==0)
{
image(img1, 0, 0);
}
else {
image(img2, 0, 0);
}
}
void mousePressed()
{
if (counter==0)
{
counter =1;
}
else {
counter = 0;
}
println(counter);
}
1