We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi all,
I have a video that is 1920x1080 that I brought into Processing, which I then modified. When I saveFrame####.tga, there is a pretty big lag and my export is not an accurate output of the original video.
I thought if I made the video smaller, this would solve my issue. However, I am having trouble doing this.
I can resize the video by doing something like this:
image(img,0,0,smallerWidth,smallerHeight);
But when I try to loop through the pixel data, it is still grabbing the original video size.
for (int x = 0; x < img.width; x++) {
for (int y = 0; y < img.height; y++) {
int loc = x+y*img.width;
}
}
What can I do?
Answers
Hi,
with
image(img, 0, 0, smallerWidth, smallerHeight);
you are simply placing your original image in the windows with a new size. This doesn't affect the original image.To achieve something like that you could use
PGraphics
: