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...)
Add a comment
|
1 Answer
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:
-
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...– ClaudiuAug 14, 2009 at 15:25
-
Check this out, it has most of the alternatives... stackoverflow.com/questions/69645/…– Vinko Vrsalovic ♦Aug 14, 2009 at 21:01
-
-
3A good alternative that is quicker and Python 3 compliant: stackoverflow.com/a/44925891/1117028 Jun 23, 2018 at 8:12