I am trying to load an image using from a base64 string using pygame with pygame.image.load but I am getting this error: TypeError: load_extended() takes no keyword arguments. Here is my code (I haven't included the whole string because it's like 10k characters):
photo = """R0lGODlhRgBGAPZUAAAAAAAAMwAAzAArAAArMwArzAAr/wBVm..."""
pepeImg = pygame.image.load(data=photo)
This is the error I am getting with pygame.image.fromstring:
Traceback (most recent call last):
File "C:/Users/mikur/PycharmProjects/timer/dodge.py", line 25, in <module>
pepeImg = pygame.image.fromstring(base64.b64decode(photo, 'UTF-8'), (70, 70), 'RGBA')
File "C:\Users\mikur\AppData\Local\Programs\Python\Python37-32\lib\base64.py", line 83, in b64decode
assert len(altchars) == 2, repr(altchars)
AssertionError: b'UTF-8'
Here's the code:
photo = 'R0utCnHtEERJ3qQo960xPQgArITgK1l.....33sYy+72+NudrGfXe1inzveVVABFSQBYIgIBAA7'
pepeImg = pygame.image.fromstring(base64.b64decode(photo, 'UTF-8'), (70, 70), 'RGBA')
This is the image im trying to load (its beatiful):
I used this webisite to convert it to base64: https://www.askapache.com/online-tools/base64-image-converter/
