All Projects → ludios → Desktopmagic

ludios / Desktopmagic

Licence: other
Robust multi-monitor screenshot grabbing library for Python 2.x/3.x on Windows

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Desktopmagic

Python Mss
An ultra fast cross-platform multiple screenshots module in pure Python using ctypes.
Stars: ✭ 582 (+1019.23%)
Mutual labels:  screenshot, monitor
ArcoLinux-dotfiles
ArcoLinux dotfiles for 2bwm / i3wm
Stars: ✭ 24 (-53.85%)
Mutual labels:  screenshot, monitor
screenie-server
A Node server with a pool of Puppeteer (Chrome headless) instances for scalable screenshot generation.
Stars: ✭ 19 (-63.46%)
Mutual labels:  screenshot
Net-Mon
Get notified for new devices on your network
Stars: ✭ 22 (-57.69%)
Mutual labels:  monitor
winddcutil
Windows implementation of the ddcutil Linux program for querying and changing monitor settings, such as brightness and color levels.
Stars: ✭ 39 (-25%)
Mutual labels:  monitor
monitor system docs
No description or website provided.
Stars: ✭ 30 (-42.31%)
Mutual labels:  monitor
Limg
An image hosting service powered by Laravel
Stars: ✭ 41 (-21.15%)
Mutual labels:  screenshot
ScreenshotPlugin
A simple Screenshot plugin for Xamarin and Windows to get and save screenshot in yours apps.
Stars: ✭ 32 (-38.46%)
Mutual labels:  screenshot
web-companion
Browser extension to browse bookmarks and create notes in QOwnNotes
Stars: ✭ 53 (+1.92%)
Mutual labels:  screenshot
Capturable
🚀Jetpack Compose utility library for capturing Composable content and transforming it into Bitmap Image🖼️
Stars: ✭ 365 (+601.92%)
Mutual labels:  screenshot
pm2-server-monitor
The monitor for pm2 node.js servers, with nice web UI.
Stars: ✭ 34 (-34.62%)
Mutual labels:  monitor
fastlane-framer-plugin
A plugin for fastlane that frames your raw screenshots into the beautiful templates you made!
Stars: ✭ 31 (-40.38%)
Mutual labels:  screenshot
host-stat-go
Go module for collecting host stat
Stars: ✭ 28 (-46.15%)
Mutual labels:  monitor
pageshot
Pageshot as a service.
Stars: ✭ 45 (-13.46%)
Mutual labels:  screenshot
poster
浏览器端video视频截图,视频封面获取
Stars: ✭ 42 (-19.23%)
Mutual labels:  screenshot
fake-tweet-generator
Generate convincing fake tweet images
Stars: ✭ 20 (-61.54%)
Mutual labels:  screenshot
performance monitor
Monitor Linux system
Stars: ✭ 30 (-42.31%)
Mutual labels:  monitor
termshot
Creates screenshots based on terminal command output
Stars: ✭ 114 (+119.23%)
Mutual labels:  screenshot
pappet
A command-line tool to crawl websites using puppeteer.
Stars: ✭ 95 (+82.69%)
Mutual labels:  screenshot
zabbix-monitor
monitor system based on zabbix API pyzaabix grafana
Stars: ✭ 70 (+34.62%)
Mutual labels:  monitor

Desktopmagic

Desktopmagic takes screenshots on Windows. It supports any arrangement of multiple monitors, and does not leak memory in any failure mode (locked workstation, no monitor attached, etc). If you wish, it can be used continuously to take millions of screenshots.

You may want this instead of PIL's ImageGrab because:

  • Desktopmagic can take a screenshot of all monitors. You can:

    • Take a screenshot of the entire virtual screen.

    • Take a screenshot of the entire virtual screen, split into one PIL Image per display.

    • Take a screenshot of just one display.

    • Take a screenshot of an arbitrary region of the virtual screen.

    (See below for usage)

  • ImageGrab leaks memory if you try to take a screenshot when the workstation is locked (as of 2011-01).

Requirements

Installation

pip install --user Desktopmagic

or:

git clone https://github.com/ludios/Desktopmagic
cd Desktopmagic
pip install --user .

or without pip:

python setup.py install --user

This installs the module desktopmagic and the script screengrab_torture_test.

Examples

from __future__ import print_function

from desktopmagic.screengrab_win32 import (
	getDisplayRects, saveScreenToBmp, saveRectToBmp, getScreenAsImage,
	getRectAsImage, getDisplaysAsImages)

# Save the entire virtual screen as a BMP (no PIL required)
saveScreenToBmp('screencapture_entire.bmp')

# Save an arbitrary rectangle of the virtual screen as a BMP (no PIL required)
saveRectToBmp('screencapture_256_256.bmp', rect=(0, 0, 256, 256))

# Save the entire virtual screen as a PNG
entireScreen = getScreenAsImage()
entireScreen.save('screencapture_entire.png', format='png')

# Get bounding rectangles for all displays, in display order
print("Display rects are:", getDisplayRects())
# -> something like [(0, 0, 1280, 1024), (-1280, 0, 0, 1024), (1280, -176, 3200, 1024)]

# Capture an arbitrary rectangle of the virtual screen: (left, top, right, bottom)
rect256 = getRectAsImage((0, 0, 256, 256))
rect256.save('screencapture_256_256.png', format='png')

# Unsynchronized capture, one display at a time.
# If you need all displays, use getDisplaysAsImages() instead.
for displayNumber, rect in enumerate(getDisplayRects(), 1):
	imDisplay = getRectAsImage(rect)
	imDisplay.save('screencapture_unsync_display_%d.png' % (displayNumber,), format='png')

# Synchronized capture, entire virtual screen at once, cropped to one Image per display.
for displayNumber, im in enumerate(getDisplaysAsImages(), 1):
	im.save('screencapture_sync_display_%d.png' % (displayNumber,), format='png')

For more information, see the docstrings in https://github.com/ludios/Desktopmagic/blob/master/desktopmagic/screengrab_win32.py

Known issues

  • Screenshots are incorrectly cropped on high-DPI displays. Windows returns display geometry data scaled for the DPI, while the actual screenshots are unscaled. Workaround: Right-click on python.exe, Properties, Compatibility tab, check 'Disable display scaling on high DPI settings'. Repeat for pythonw.exe.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].