Hi I'm trying to load my image from Pillow into Pygame using BytesIO.
from PIL import Image
import io
pilImage = Image.open('AgV6E.png')
temp_io = io.BytesIO()
pilImage.save(temp_io, format='PNG')
pygame.image.load(temp_io)
I get the following error:
pygame.image.load(temp_io) pygame.error: Unsupported image format
Strangely enough though simply saving to png works.
from PIL import Image
import io
pilImage = Image.open('AgV6E.png')
pilImage.save("test.png", format='PNG')
pygame.image.load("test.png")
Anybody know how to fix this?