I am writing a Python script where I want to do bulk photo upload. I want to read an Image and convert it into a byte array. Any suggestions would be greatly appreciated.
with BytesIO() as output: from PIL import Image with Image.open(filename) as img: img.convert('RGB').save(output, 'BMP') data = output.getvalue()[14:]
I just use this for add a image to clipboard in windows.