is there a way to convert a pygame surface into a png image?
rgb_content = pygame.surfarray.array2d(canvas)
cv2.imwrite(file, rgb_content, [cv2.IMWRITE_PNG_COMPRESSION, 0])
I've tried this but it doesn't work, because it flips the image sideways. Makes it grayscale and doesn't actually save it.