Trying to work with image arrays to store images for temporary use

So I have been trying to work a lot with playing animations in Processing and I am currently working on a program that has a starting screen which the player can see after loading but will probably click away fairly quikly, however in the case they don’t I wanted to make a little easter egg in which the characters on screen perform a little animation. The total of images for this come to about 250 and because of this I have run into a memory out of bounds exeption as I already have about 150 images loaded for the rest of the program. What I am thus trying to do is load the images for the starting screen and unload them after the “start” button is hit. The problem is I am hitting the maximum of images when loading the rest of the program and I don’t want there to be a loading screen between the start and the actual program.

So I am currently a bit stuck and don’t really know how to approach this problem.

If the images are in sequence, would you be able to create a movie and just play it?

You could use VideoExport from the library contribution to create the video or any other third party software. Or do you prefer to manage each image in your sequence?


It’s not necessary but it would be nice, otherwise I would have to ask my animator to redo the video as it was made so that different parts could be played at different speeds. But we will try making it a video first, thanks for the feedback.

You can check these next resources. The first one loads an unknown number of images from a specific folder. The second one is more relevant to you as it demonstrate how to load per batches but I have not tested its performance.

As mentioned there, there seems to be an issue with memory re-claiming. A quick search (many images memory issue returned some interesting posts for you to review:

This is to say that you might be having a challenge to do what you are trying to do. If you test any of these solutions or you are having any difficulties, please share it with the community with some minimum code to reproduce the issue.


1 Like

Turns out I could indeed just use video files and after figuring things out with my animator it all turned out well, thank you for the other sources nontheless as they do seem quite usefull indeed.