I want to rotate this image.
I have it as bytes with:
img = Image.open(image_path)
img.tobytes()
But when I decode it:
image = Image.frombytes('P', (width, height), image_data)
I get a black square.
How can I read the image from bytes and keep the colors? This is happening for PNG images.
The farthest I've got is getting a black background with a barely noticeable shape of the original image in white. With
image = Image.frombytes('P', (width, height), image_data).convert('L')
I'm using Pillow. I'm open to use anything.