{"id":9235,"library":"pyscreenshot","title":"Pyscreenshot","description":"Pyscreenshot is a Python library (version 3.1) designed for taking screenshots across various operating systems. It acts as a pure Python wrapper around existing backend tools. While often considered 'obsolete' in favor of Pillow's native ImageGrab on Linux/macOS, it remains useful for its flexible backend support, Wayland compatibility, and optional subprocess handling. The library's release cadence is irregular, with the latest major update in March 2023.","status":"active","version":"3.1","language":"python","source_language":"en","source_url":"https://github.com/ponty/pyscreenshot","tags":["screenshot","image-processing","cross-platform","wrapper","gui-automation"],"install":[{"cmd":"pip install pyscreenshot Pillow","lang":"bash","label":"Install Pyscreenshot and Pillow"}],"dependencies":[{"reason":"Required for handling the captured image in memory (e.g., saving to file, displaying).","package":"Pillow","optional":false},{"reason":"Used internally by pyscreenshot for calling external programs.","package":"EasyProcess","optional":true},{"reason":"Used internally for generating command-line interfaces.","package":"entrypoint2","optional":true},{"reason":"A fast, pure Python, multiplatform backend.","package":"MSS","optional":true},{"reason":"Used for D-Bus calls, relevant for some Wayland backends.","package":"jeepney","optional":true}],"imports":[{"symbol":"ImageGrab","correct":"import pyscreenshot as ImageGrab"}],"quickstart":{"code":"import pyscreenshot as ImageGrab\nimport os\n\n# Grab the entire screen\nim = ImageGrab.grab()\n\n# Save image to a file\nfile_path = \"screenshot.png\"\nim.save(file_path)\nprint(f\"Screenshot saved to {file_path}\")\n\n# Optionally grab a specific region (bbox = (left, top, right, bottom))\n# im_region = ImageGrab.grab(bbox=(10, 10, 510, 510))\n# im_region.save(\"screenshot_region.png\")\n# print(\"Region screenshot saved to screenshot_region.png\")\n\n# To display the image (requires an image viewer configured for .show())\n# im.show()","lang":"python","description":"Captures the entire screen and saves it as a PNG file. You can also specify a bounding box for partial screen captures. Ensure Pillow is installed to save and display images."},"warnings":[{"fix":"Consider using `from PIL import ImageGrab` directly if Pillow meets your needs.","message":"Pyscreenshot is often considered obsolete as Pillow's native ImageGrab module now supports Linux and macOS. Use Pillow directly unless you need pyscreenshot's specific backend flexibility or Wayland support.","severity":"deprecated","affected_versions":"All versions"},{"fix":"Experiment with different backends (e.g., `ImageGrab.grab(backend='grim')` on Sway) or be aware of desktop environment behaviors. Check `xdg-desktop-portal` settings for confirmation dialogs.","message":"On Wayland, certain desktop environments (KDE, GNOME) might display on-screen notifications or flash effects during a screenshot, or `xdg-desktop-portal` might trigger a confirmation dialog. Not all Wayland compositors are equally supported by all backends.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Adjust OS display scaling to 100% if encountering this issue, or explore alternative screenshot tools if this is a persistent problem in your environment.","message":"If the operating system's display zoom factor is applied, `ImageGrab.grab()` may not capture the full screen correctly, resulting in black borders or incomplete images.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Run your Python script from a command-line terminal instead of IDLE. If hanging persists, try `im = ImageGrab.grab(childprocess=False)` to disable subprocess isolation for the backend.","message":"Running `pyscreenshot` commands directly in IDEs like IDLE can cause the application to hang or freeze.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Use `ImageGrab.grab()` to get an `Image` object and then `im.save()` for more reliable control over saving, format, and region.","message":"The `grab_to_file` function (if used) might ignore the `bbox` parameter, always capturing the entire screen, and may struggle with image formats other than PNG.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"search_vec":"'2023':69 '3.1':8 'across':13 'act':18 'around':24 'autom':80 'backend':26,47 'cadenc':59 'compat':50 'consid':30 'cross':75 'cross-platform':74 'design':9 'exist':25 'favor':33 'flexibl':46 'gui':79 'gui-autom':78 'handl':54 'imag':72 'image-process':71 'imagegrab':38 'irregular':61 'latest':64 'librari':6,56 'linux/macos':40 'major':65 'march':68 'nativ':37 'obsolet':31 'often':29 'oper':15 'option':52 'pillow':35 'platform':76 'process':73 'pure':21 'pyscreenshot':1,2 'python':5,22 'releas':58 'remain':42 'screenshot':12,70 'subprocess':53 'support':48 'system':16 'take':11 'tool':27 'updat':66 'use':43 'various':14 'version':7 'wayland':49 'wrapper':23,77","created_at":"2026-04-16T18:49:09.648017+00:00","updated_at":"2026-04-16T18:49:09.648017+00:00","problems":{"verify_error":"error: Failed to parse: `pyscreenshot Pillow`\n  Caused by: Expected one of `@`, `(`, `<`, `=`, `>`, `~`, `!`, `;`, found `P`\npyscreenshot Pillow\n             ^"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"3.1","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/ponty/pyscreenshot","docs":null,"changelog":null,"pypi":"https://pypi.org/project/pyscreenshot/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"install_fail","verified_at":"2026-06-28","last_verified":"2026-06-28","next_check":"2026-07-05","install_tag":null}}