最佳答案
I have an image in PIL Image format. I need to convert it to byte array.
img = Image.open(fh, mode='r')
roiImg = img.crop(box)
Now I need the roiImg
as a byte array.