ropensci/magick

how to read the image when call pyautogui by reticulate?

leechaowen opened this issue · 2 comments

I need to take screen. run below code is ok. but how to read the fullscreen by R? i do not want to save to harddisk the read again.

library(reticulate)

library(magick)

pyautogui<-import("pyautogui")

fullscreen=pyautogui$screenshot()

fullscreen$show()
> image_read(fullscreen)
Error in image_read(fullscreen) : 
  path must be URL, filename or raw vector
> image_read(py$fullscreen)
Error in py_get_attr_impl(x, name, silent) : 
  AttributeError: module '__main__' has no attribute 'fullscreen'

Do someone know how to take screen by R not depend on python?