0

I have read this post and tried to open an image from bytes and actually i made it. but the problem is the image is not showing correctly. i don't know what is the original format of image but i know this is an dental X-Ray image. i`m asking if someone knows where is the problem and how can i fix it.

enter image description here


from PIL import Image
import io

image_data = ... #bytes
image = Image.open(io.BytesIO(image_data))
image.show()

Sina
  • 21
  • 4

1 Answers1

0

I saved the above image in my pc and then opened it with the python with your code and its opening perfectly.

from PIL import Image
import io

image_data = open('CdRVp.jpg', 'rb+').read()
image = Image.open(io.BytesIO(image_data))
image.show()
Deepak Tripathi
  • 3,175
  • 1
  • 8
  • 21