if region is None:
subprocess.call(['scrot', '-z', tmpFilename])
else:
str_region = ','.join([str(x) for x in region])
subprocess.call(['scrot', '-a', str_region, '-z', tmpFilename])
I tested the difference between two versions use this code snippet:
for i in range(100):
screenshot = pyscreeze.screenshot(region=(0, 0, 300, 600))
The -a version only took 3s while the default version took 33s. (I have two monitors :)
Thanks for providing such an interesting tool!
If on Linux, when passing
region
into thescreenshot()
, it will be faster to utilize the-a
option forscrot
.Basically, we can change this line https://github.com/asweigart/pyscreeze/blob/master/pyscreeze/__init__.py#L475 to something like:
I tested the difference between two versions use this code snippet:
The
-a
version only took 3s while the default version took 33s. (I have two monitors :)Thanks again!