-
Notifications
You must be signed in to change notification settings - Fork 101
FAQ
Michael Sanders edited this page Mar 22, 2023
·
3 revisions
See also: the autopilot-rs FAQ.
autopy.bitmap.Bitmap
includes an implementation of the bytes
function for access to the RGBA buffer. E.g., to convert a bitmap to a PIL image you can use the following:
import autopy
import PIL.Image
bmp = autopy.bitmap.capture_screen()
width, height = int(round(bmp.width * bmp.scale)), int(round(bmp.height * bmp.scale))
img = PIL.Image.frombytes('RGB', (width, height), bytes(bmp))