I am trying to create a bot for a game. Therefore I need to capture the screen however the Pyautogui's screenshot function is too slow for a game. How can I capture the screen directly without using the module. I tried looking for answer but the only thing I found were answers for mac or windows. Now I know there are many ways to capture a X window but which of them are actually fast enough for getting at least 30 FPS.
None of them.  A full HD screen is about 8 MB.  GPUs are optimized for getting data INTO memory, not getting data OUT of memory.  The read path is always lower priority.  When you add the overhead of Python, you are never going to get 30 FPS.
How can I capture the screen fast using Pyautogui in Linux