Python MSS
Release latest

Apr 14, 2023

Contents

1Installation

2

2

Usage

2

3Examples24

Support25

MSS API

26Developers

27

Who Uses it?

28Indices and tables

3Python Module Index

5Index7i

ii

from mss import mss# The simplest use, save a screen shot of the 1st monitor
with mss() as sct:sct.shot()An ultra fast cross-platform multiple screenshots module in pure python using ctypes.
• Python 3.8+, PEP 8 compliant, no dependency, thread-safe;• very basic, it will grab one screen shot by monitor or a screen shot of all monitors and save it to a PNG file;• but you can use PIL and benefit from all its formats (or add yours directly);• integrate well with Numpy and OpenCV;• it could be easily embedded into games and other software which require fast and platform optimized methods
to grab screen shots (like AI, Computer Vision);• get the source code on GitHub;• learn with a bunch of examples;• you can report a bug;• need some help? Use the tag python-mss on StackOverflow;• MSS stands for Multiple Screen Shots;1

Python MSS, Release latest

ContentCHAPTER

1

Installation

1.1 Recommended Way
Quite simple:$ python -m pip install -U --user mss

1.1.1 Conda Package
The module is also available from conda:$ conda install -c conda-forge python-mss

1.2 From Sources
Alternatively, you can get a copy of the module from GitHub:$ git clone https://github.com/BoboTiG/python-mss.git$ cd python-mss

And then:$ python setup.py install --userCHAPTER

2

Usage
2Contents

CHAPTER

8Indices and tables• genindex• search3

Python MSS, Release latest

4Chapter 8. Indices and tables

Python Module Index

mmss.base, 2
mss.darwin, 2
mss.exception, 2mss.factory, 2mss.linux, 2mss.tools, 2mss.windows, 25

Python MSS, Release latest

6Python Module Index

IndexSymbolsG

gdi32 (mss.windows.MSS attribute), 2__array_interface__(mss.tools.mss.base.ScreenShotattribute), grab() (mss.base.MSSBase method), 22
H__init__() (mss.base.MSSBase method), 2
height (mss.tools.mss.base.ScreenShot attribute), 2B

bgra (mss.tools.mss.base.ScreenShot attribute), 2
BITMAPINFO (class in mss.windows), 2
BITMAPINFOHEADER (class in mss.windows), 2

Lleft (mss.tools.mss.base.ScreenShot attribute), 2
lock (in module mss.base), 2

CM

CAPTUREBLT (in module mss.windows), 2
CFUNCTIONS (in module mss.darwin), 2
CFUNCTIONS (in module mss.linux), 2
CFUNCTIONS (in module mss.windows), 2
cgfloat() (in module mss.darwin), 2
CGPoint (class in mss.darwin), 2
CGRect (class in mss.darwin), 2
CGSize (class in mss.darwin), 2close() (mss.base.MSSBase method), 2close() (mss.linux.MSS method), 2
cls_image (mss.base.MSSBase attribute), 2
compression_level (mss.base.MSSBase attribute),2core (mss.darwin.MSS attribute), 2

max_displays (mss.darwin.MSS attribute), 2
MONITORNUMPROC (in module mss.windows), 2
monitors (mss.tools.mss.base.MSSBase attribute), 2
MSS (class in mss.darwin), 2
MSS (class in mss.linux), 2
MSS (class in mss.windows), 2mss() (in module mss.factory), 2
mss.base (module), 2
mss.base.MSSBase (class in mss.tools), 2mss.base.ScreenShot (class in mss.tools), 2
mss.darwin (module), 2
mss.exception (module), 2
mss.factory (module), 2
mss.linux (module), 2
mss.tools (module), 2mss.windows (module), 2
MSSBase (class in mss.base), 2

Ddetails (mss.exception.ScreenShotError attribute), 2
DIB_RGB_COLORS (in module mss.windows), 2
Display (class in mss.linux), 2

E
Event (class in mss.linux), 2

F
from_size() (mss.base.ScreenShot class method), 2

Ppixel() (mss.base.ScreenShot method), 2
pixels (mss.tools.mss.base.ScreenShot attribute), 2
PLAINMASK (in module mss.linux), 2
pos (mss.tools.mss.base.ScreenShot attribute), 2
Python Enhancement Proposals
PEP 8, 1

Rrgb (mss.tools.mss.base.ScreenShot attribute), 2
7

Python MSS, Release latest

Ssave() (mss.base.MSSBase method), 2
ScreenShot (class in mss.base), 2
ScreenShotError, 2shot() (mss.base.MSSBase method), 2
size (mss.tools.mss.base.ScreenShot attribute), 2
SRCCOPY (in module mss.windows), 2T
to_png() (in module mss.tools), 2
top (mss.tools.mss.base.ScreenShot attribute), 2

Uuser32 (mss.windows.MSS attribute), 2

Wwidth (mss.tools.mss.base.ScreenShot attribute), 2
with_cursor (mss.base.MSSBase attribute), 2X
XFixesCursorImage (class in mss.linux), 2
XImage (class in mss.linux), 2
XRRCrtcInfo (class in mss.linux), 2
XRRModeInfo (class in mss.linux), 2
XRRScreenResources (class in mss.linux), 2
XWindowAttributes (class in mss.linux), 2Z
ZPIXMAP (in module mss.linux), 2

8Index