I want to take a screenshot and read the bytes of it. This is doing what I need:
from PIL import ImageGrab
img = ImageGrab.grab((0, 0, 1920, 1080))
img.save("tmp.jpg")
with open("tmp.jpg", "rb") as reader:
image = reader.read() # image is the needed output
As you can see I first have to save it before I can use it in the way I want to. Please show me a better way for this problem because saving it before the use takes to much time.