A PIL.Image.grab()
takes about 0.5 seconds. That's just to get data from the screen to my app, without any processing on my part. FRAPS, on the other hand, can take screenshots up to 30 FPS. Is there any way for me to do the same from a Python program? If not, how about from a C program? (I could interface it w/ the Python program, potentially...)
Asked
Active
Viewed 1.4k times
9

Claudiu
- 224,032
- 165
- 485
- 680
1 Answers
7
If you want fast screenshots, you must use a lower level API, like DirectX or GTK. There are Python wrappers for those, like DirectPython and PyGTK. Some samples I've found follow:

Vinko Vrsalovic
- 330,807
- 53
- 334
- 373
-
thanks for the start! so PIL takes 0.35 seconds (I timed it). The GTK sample in the 1st one is the same - 0.35. But the GTK without converting to PIL is 0.11, so that's a start... – Claudiu Aug 14 '09 at 15:25
-
Check this out, it has most of the alternatives... http://stackoverflow.com/questions/69645/take-a-screenshot-via-a-python-script-linux – Vinko Vrsalovic Aug 14 '09 at 21:01
-
Great tool, but unfortunately not working with Python 3 – Franz Deschler Feb 08 '18 at 21:19
-
3A good alternative that is quicker and Python 3 compliant: https://stackoverflow.com/a/44925891/1117028 – Tiger-222 Jun 23 '18 at 08:12