有没有办法将 pyautogui 屏幕截图加载到 PIL 图像中?

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

有没有办法将 pyautogui 屏幕截图加载到 PIL 中以供进一步使用?请看代码:

screenshot = pyautogui.screenshot()

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

我已经搜索了这个问题的答案,但没有找到。谢谢

pyautogui.screenshot() 函数自动 returns 一个 PIL Image 对象,如果你不传递文件名参数给它,按照 the documentation.