Ben Chuanlong Du's Blog

It is never too late to learn.

Tips on Pillow

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

PIL.Image.Image.crop

Notice that the bounding box is inclusive/EXCLUSIVE like the range function. PIL.Image.Image.crop does not accept a bounding box of zero size!

PIL.Image …

Computer Vision Tools

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

OpenCV | OpenCV for Python

Pillow

moviepy

moviepy is a Python library for video editing: cutting, concatenations, title insertions, video compositing (a.k.a. non-linear editing), video processing, and creation of custom …

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