An ultra fast cross-platform multiple screenshots module in pure Python using ctypes.
Questions tagged [python-mss]
77 questions
1
vote
0 answers
python mss ScreenShotError
So basically I'm just messing around with mss (python2.7 and 3.6), and I have the following code:
import mss
import cv2
import numpy as np
with mss.mss() as sct:
mon = {'top':40,'left':0, 'width': 800, 'height': 750}
try:
img =…

Ervin
- 55
- 1
- 7
1
vote
1 answer
Using python mss to draw bounding box on top of screen record
I have code to screen record and with each frame I have a set of bounding boxes I want to display on each frame. I can do this using matplotlib or something but I mss is working at like 30fps and I need to be able to display the bounding boxes…

conv3d
- 2,668
- 6
- 25
- 45
1
vote
1 answer
convert mss screenshot to pil image
Im using mss to take a screenshot because it apparently can take fast screenshots. So is there a way to convert it into an image without saving it on my computer(its faster) like image.grab() in pillow. This is because i need to perform various…

hpras12
- 43
- 2
- 4
1
vote
1 answer
mss module is installed but program is unable to import it (using single version of python)?
I am making a Python program for converting PDF files into images by taking screenshots.
Am using Anaconda 3 with Python 3.6.5 (running on Windows 10 Enterprise)
There is no other Python version installed on my system so there is no chance of…

Voyno
- 35
- 1
- 5
1
vote
1 answer
Is there a way to use mss and pytesseract witchout saving and open?
Need to use mss witchout saving and open images in order to "optimize" this task here is mine code and sorry my bad english.
from PIL import Image
import pytesseract
import mss
import mss.tools
with mss.mss() as sct:
monitor = {'top': 171,…

Siewdass Sf
- 169
- 1
- 10
1
vote
1 answer
python mss mss.exception.ScreenShotError:
I'm newbie.
I try use mss to screenshot monitor.
My code:
for i in range(1, 20000):
cactus_box = {'left': 508, 'top': 382, 'width': 30, 'height': 33}
sct = mss()
sct_img = sct.grab(cactus_box)
when i run code, this display error:
File…

bav ko ten
- 502
- 7
- 24
1
vote
1 answer
MSS does not take screenshot of entire screen
I'm a beginner programmer and I was trying to write a program to capture screenshots.
I am using MSS to do so.
I can capture screenshots with MSS but only a portion of my screen gets captured.
Please see code attached.
from mss import mss …

Koung Myat Hein
- 25
- 1
- 6
1
vote
2 answers
Use Python to save screen shots in array
How do I use python, mss, and opencv to capture my computer screen and save it as an array of images to form a movie? I am converting to gray-scale so it can be a 3 dimensional array. I would like to store each 2d screen shot in a 3d array for…

mlewk
- 11
- 1
- 6
0
votes
0 answers
True colors with PIL/Pillow on Mac
When I use PIL.ImageGrab.grab() on my Windows 10 PC, I get exactly the RGB colors I expect. For example, (255, 0, 0) for red. On my Mac, PIL.ImageGrab.grab() returns a PIL.PngImagePlugin.PngImageFile which has unexpected RGBA values, e.g. (235,…

Tartuffo
- 1
0
votes
0 answers
What causes an mss.exception.ScreenShotError: gdi32.GetDIBits() failed
I'm trying to write some code to use screencaptures to export the position from a online-go.server. I only got a few lines in, when I got this error from this code
error
c:\Go\sgo>py ogs2kgs.py
top left position : 220 149
bottom right position : …

SlightlyKosumi
- 701
- 2
- 8
- 24
0
votes
1 answer
Python MSS Screenshot monitor sizes different than expected
Using mss, I have taken screenshots of my two monitors: monitor-1 and monitor-2.
When I open up monitor-1, I get the image size of 3840x2160. However, when accessing monitors from mss().monitors[1], I get the size of 1920x1080. They are two…

unfestive chicken
- 313
- 2
- 6
0
votes
2 answers
What is the color space produced by MSS sct.grab()?
Python 3.10,
opencv-python==4.5.4.60
I'm having a hard time understanding the color format of screenshots taken by MSS.
Here is the portion of my screen that I am screenshotting (with correct/expected colors, taken manually):
Here is the screenshot…

ktom
- 125
- 8
0
votes
0 answers
Dont show record screen using mss + cv2
Step-by-step execution:
Closing all active programs
Capturing the Dota 2 for 5 seconds (Size Dota 2 window (16x9, 1176x664)
Transition to pyarm and execution of the code
Code:
import time
import cv2
import mss
import numpy
def…

Vova Snopyk
- 13
- 5
0
votes
1 answer
Emotion Detect on live screen
Trying to build a system to detect emotion in online meeting using python.
I have created a deep learning model to detect emotions.
Using this code to view the screen
import time
import cv2
import mss
import numpy
with mss.mss() as sct:
…

Anim
- 109
- 6
0
votes
1 answer
python opencv2 record screen
I am trying to make a screen recorder using python opencv along with the mss library.
I can not get it to record a video. Whenever I stop the application - the file size becomes static such as sizes as for example 6kB - depending on the codec I…