Reputation: 91
I am working on a simple program that will draw your computer screen as ASCII art, live, and am having some performance issues. The problem is that my computer's screen is very high resolution, so it takes a while for the screenshot to be created. Currently I take a full-res screenshot, then lower the resolution so that it can fit into ASCII art. Rather than lowering the resolution afterwards, is it possible to take a screenshot in a lowered resolution? I am currently using the PIL library, using ImageGrab.grab() to take the screenshot.
I am using OSX.
Thanks for any help you can give!
Upvotes: 0
Views: 547
Reputation: 9377
From the docs of PIL.ImageGrab.grab()
:
bbox
– What region to copy. Default is the entire screen. Note that on Windows OS, the top-left point may be negative if all_screens=True is used.
xdisplay
– X11 Display address. PassNone
to grab the default system screen. Pass""
to grab the default X11 screen on Windows or macOS.
Thus for a reduced dimension of the screenshot, you can
bbox
)xdisplay
)See also:
XRANDR
man page for creating a virtual screen with lower resolution in X11Upvotes: 2