Take Screenshots in Python
Comments¶
- PIL.ImageGrab works on macOS and Windows only.
PIL.ImageGrab
is relatively slow.python-mss
andPyQt5
are better alternatives if performance of screenshot is critical. Notice that saving an (e.g., PNG) image can take significant time (might take up to 0.5 seconds) too, this is often due to image compression is slow. Lower the compression level can significant reduce the time needed to save an image. Please refer to Saving a PNG file is slow
Convert an Image to Differnt Modes Using Pillow in Python
Hands-on the ImageChops class in Pillow in Python
Image Filters in Pillow
Comments¶
PIL.ImageGrab works on macOS and Windows only.
You can further crop a screenshot image using the method
Image.crop
.