Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python pil bytes to image

import io
from PIL import Image

imageFileObj = open(imageFilename, "rb")
imageBinaryBytes = imageFileObj.read()
imageStream = io.BytesIO(imageBinaryBytes)
imageFile = Image.open(imageStream)
print("imageFile.size=%s" % imageFile.size)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #pil #bytes #image
ADD COMMENT
Topic
Name
4+7 =