Ben Chuanlong Du's Blog

It is never too late to learn.

Take Screenshots in Python

Comments

  1. PIL.ImageGrab works on macOS and Windows only.
  1. PIL.ImageGrab is relatively slow. python-mss and PyQt5 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