mss
An ultra fast cross-platform multiple screenshots module in pure python using ctypes.
What it is and what it does
MSS is a pure-Python screenshot capture library that grabs images from one or multiple monitors and saves them as PNG files or returns pixel data for programmatic use. It uses ctypes to call platform-native APIs (BitBlt on Windows, CGGetActiveDisplayList on macOS, XGetImage on Linux) without requiring compiled dependencies, making it lightweight and fast across operating systems.
The library is designed for scenarios where speed and simplicity matter: embedding screenshot functionality into games, computer vision pipelines, AI applications, or automation tools. It integrates cleanly with PIL for format conversion and with NumPy and OpenCV for image processing, and it's thread-safe for concurrent use.
Use it for:
- Capture screenshots in automated testing or monitoring scripts that need to verify UI state or record visual logs
- Grab display frames for computer vision or AI model input without external dependencies
- Build screen recording or streaming applications that need fast, cross-platform pixel access
- Embed screenshot functionality in games or interactive software requiring platform-optimized capture
- Monitor multiple displays in a single operation for multi-screen environments or headless setups
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Captures screenshots from one or all monitors on Windows, macOS, and Linux, saving them as PNG files or returning raw pixel data for further processing.
Yes. MSS is production-stable, actively maintained, has zero security vulnerabilities, no runtime dependencies, and installs with minimal friction. It's the right choice if you need fast, simple cross-platform screenshot capture without heavyweight dependencies. Only skip it if you need advanced image manipulation (use PIL/Pillow alongside it) or if your use case requires features beyond basic capture.
Install
mss on PyPI
pip
pip install mssuv
uv add msspoetry
poetry add mssInstalling mss
Before you install
Low friction: pure Python with no runtime dependencies, distributed as a wheel, and actively maintained with recent releases. Supports Python 3.9+ across CPython and PyPy.
License in practice
MIT License permits unrestricted use, modification, and distribution in both open-source and proprietary projects, with only attribution and license inclusion required.
Quickstart
pip install mss
from mss import MSS
with MSS() as sct:
sct.shot()
Requires Python 3.9 or later. On systems with external monitors and DPI scaling, import mss before other packages like mouseinfo or pyautogui to avoid conflicts with SetProcessDpiAware().
Verify before relying
- Performance characteristics compared to other screenshot libraries on specific hardware configurations
- Behavior with multi-GPU setups or virtual displays
- Interaction with DPI-aware applications beyond the documented mouseinfo/pyautogui caveat
Package facts
| License | MIT License Copyright (c) 2013-2026, Mickaël 'Tiger-222' Schoentgen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 113 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 3,170,879/month — #2,714 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: mss-10.2.0-py3-none-any.whl
Keywords: BitBlt, CGGetActiveDisplayList, CGImageGetBitsPerPixel, EnumDisplayMonitors, XGetImage, XGetWindowAttributes, XRRGetScreenResourcesCurrent, ctypes, monitor, screen, screencapture, screengrab, screenshot
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
dxcamDXcam captures screen frames on Windows at high…
permissive · top 15,000 on PyPI
pyscreenshotCaptures screenshots to Pillow images using…
permissive · top 15,000 on PyPI
PyScreezePyScreeze captures screenshots and locates…
permissive · top 5,000 on PyPI
screeninfoDetects and reports the location, dimensions,…
permissive · top 5,000 on PyPI
screenshotoneA Python SDK for the ScreenshotOne.com API that…
permissive · top 15,000 on PyPI
pyobjc-framework-ScreenCaptureKitProvides Python bindings to macOS's…
permissive · top 15,000 on PyPI
Selenium-ScreenshotCaptures full-page or element-level screenshots…
permissive · top 15,000 on PyPI
PyMonCtlPyMonCtl provides cross-platform Python access…
permissive · top 15,000 on PyPI
nokapnokap captures screenshots and PDFs from web…
permissive · top 15,000 on PyPI
wakepyWakepy prevents a system from sleeping or…
permissive · top 15,000 on PyPI