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 completely different sizes!
I also checked this on my second monitor, and the size is correct.
These are my display settings:
I got the screenshots with the following code:
import mss
sct = mss.mss()
for x in sct.save(0):
print(x)
TL;DR: You use 4K displays, and you have a Retina/Hi-DPI mode enabled for both of these displays in macOS. It's alright for mss to show the resolutions as 1920x1080 for each of your 4K display. It's because the usable resolution you have on each screen is, indeed, 1920x1080. However, when macOS renders the screen, it does it with a 2x scaling of the interface, so the actual images will be 3840x2160 for each of those displays. The grabbed images (used by
sct.grab()
orsct.save()
) should be at their actual display resolution (which is 3840x2160 for both of them).The whole Retina/Hi-DPI thing can seem pretty tricky.
The usable resolution in macOS for both of your displays are, indeed, 1920x1080. Let's simplify and imagine you got only one 4K display.
If you move the mouse cursor to the upper right corner, its coordinates will be (0, 0). If you move the cursor to the bottom right corner of the screen, its coordinates will be (1919, 1079). The whole software (like, browsers etc) will think that you have 1920px screen width.
However!
Since you got a 4K display (which has a resolution of 3840x2160) and the macOS settings have a 1920x1080 (but Hi-DPI/Retina) resolution for both of them, the macOS renders the interface on the actual display with 2x scale.
Since the OS interface is kinda locked to 1920x1080, but the actual display resolution is 3840x2160, it makes things look much sharper and neat.
If you actually grab the image, you will get the actual rendered image.
You may provide a screen area for mss.grab() function to see that.
So, in short, don't mind the resolution mss shows you in the
.monitors
property. When you actually use it to pass to sct.grab(), you will get the actual image shown on your display(s), which will be 2x of what you provided to mss.grab() if you use Hi-DPI/Retina mode.