OutOfMemory Error when animating with PGraphic images

Ok, so I solved this by storing the pixel color information in a 2D array and copying back and forth with 2 PGraphics images rather than having each frame be a separate PGraphics image.