You can read as binary, aka using the rb flags. in order to transmit the raw image data to another program via python. Python itself would need an image viewer to present that data as visual non-binary content.
- NuclearPeon
1 Answers
53
votes
The word "read" is vague, but here is an example which reads a jpeg file using the Image class, and prints information about it.
from PIL import Image
jpgfile = Image.open("picture.jpg")
print(jpgfile.bits, jpgfile.size, jpgfile.format)
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more
readas binary, aka using therbflags. in order to transmit the raw image data to another program via python. Python itself would need an image viewer to present that data as visual non-binary content. - NuclearPeon