Optimize performance by disabling subprocesses
masterBy default, pyscreenshot starts backends in a subprocess for safety and isolation. For significantly better performance, you can set childprocess=False. Combining this with the mss backend often yields the best results.
import pyscreenshot as ImageGrab
# best performance
im = ImageGrab.grab(backend="mss", childprocess=False)