I am currently doing reinforcement learning research based on Pygame where I need to pass images of Pygame(screenshots) to my CNN neural network. I searched on google but pygame.image.save is for saving it to a file. Is there a memory-efficient method to save the screenshot to a variable?
(Please don't act smart closing my post, the question you linked to is for saving to a file, NOT saving to a variable which I have stated in my original post!)