Alice F
Alice F

Reputation: 485

Is there a way to load a pyautogui screenshot into a PIL image?

Is there a way to load a pyautogui screenshot into PIL for further use? Please see code:

screenshot = pyautogui.screenshot()

pil_img = PIL.Image(???).load()

I have searched for an answer to this question, to no avail. Thanks.

Upvotes: 1

Views: 966

Answers (1)

luuk
luuk

Reputation: 1855

The pyautogui.screenshot() function automatically returns a PIL Image object if you do not pass a filename argument to it, as per the documentation.

Upvotes: 2

Related Questions