I want to capture a screenshot of an application’s window from a Python script using ImageMagick, as I would with ImageMagick’s “import” command from a shell. An API call or a system call from Python (as in “subprocess.Popen([“import”…”) will suffice, but I don’t want to create a file on the hard drive. My OS is Linux.
Share
Execute the command:
This will cause
importto output to stdout.You can also change
pngto one of the type tags shown here.