this is the usual code.
get_screen = SCREEN.subsurface(0, 0, SCREENW, SCREENH)
pygame.image.save(get_screen, image_filename) # save the file as jpeg
## reopen image and base64 encode
with open(image_filename, "rb") as imageFile:
imagestr = base64.b64encode(imageFile.read())
## save imagestr(image as a textfle) to disk
with open(text_filename, "wb") as f:
f.write(imagestr)
what I would like to do is to convert get_screen into a jpeg image WITHOUT first writing it to disk as in the second line. Some kind of conversion in MEMORY. Is there a way to do that?