OutOfMemory Error when animating with PGraphic images

So the reason why this solution isn’t working for me is that I have PGraphic images with specific drawings on them and I need to animate them. So I would need to copy the current frame’s pixel array to the active/animating frame. In order to do that I need to have the pixel array of each frame loaded and that causes a memory overload as well.

Could there be a solution in writing the pixel arrays into a temporary file on the hard drive and calling them for the animation?