ponty / pyscreenshot

Python screenshot library, replacement for the Pillow ImageGrab module on Linux.
BSD 2-Clause "Simplified" License
499 stars 89 forks source link

Saving only parts of the screen to disk #12

Closed d6e closed 10 years ago

d6e commented 10 years ago

Pyscreenshot allows you to either take a screenshot of a part of the screen and immediately view it or take a screenshot of the entire screen and save it to disk, but you can't save a screenshot of only part of the screen to disk. Such a feature would be nice.

ponty commented 10 years ago

You can always use the PIL interface. Pyscreenshot is only a replacement for Image.grab Maybe I remove grab_to_file from the Pyscreenshot interface because it doesn't make much sense. If you want to save part of the screen to disk, do this:

import pyscreenshot as ImageGrab
im=ImageGrab.grab(bbox=(10,10,510,510)) # X1,Y1,X2,Y2
#im.show()
im.save('/tmp/grab.png')
d6e commented 10 years ago

Ah yeah, you should emphasize the save() method in your readme. That's really useful.