What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

On GNU/Linux, the simplest native method is MSS: create the capture object with with_cursor=True, then grab a monitor or region and save the resulting image. MSS documents this option as GNU/Linux-only and may silently disable it when the current environment cannot provide the pointer, so inspect sct.with_cursor and verify the saved file.

Capture a full monitor with the cursor on GNU/Linux

Install MSS and Pillow in the environment that will run the script:

python -m pip install mss pillow

Then capture the primary monitor:

from mss import MSS

with MSS(with_cursor=True) as sct:
    print("Cursor capture enabled:", sct.with_cursor)
    shot = sct.grab(sct.primary_monitor)
    shot.to_pil().save("screenshot.png")

The important detail is the constructor argument. Set it when creating MSS; the documented property cannot be changed after the object is created. grab() accepts a monitor description or a region dictionary, and to_pil() converts the captured image to a Pillow image for saving or further editing.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A True value is a request, not proof that the pointer was embedded. MSS warns that in some circumstances it cannot include the cursor and turns the setting off during object creation. Check the printed property and open the output image. A test image with the pointer moved to a distinctive location is more reliable than checking the setting alone.

#1 Best Overall
Sale
Logitech M185 Compact Ambidextrous 2.4 GHz Wireless Mouse - Swift Grey
  • Compact Mouse: With a comfortable and contoured shape, this Logitech ambidextrous wireless mouse feels great in either right or left hand and is far superior to a touchpad
  • Durable and Reliable: This USB wireless mouse features a line-by-line scroll wheel, up to 1 year of battery life (2) thanks to a smart sleep mode function, and comes with the included AA battery
  • Universal Compatibility: Your Logitech mouse works with your Windows PC, Mac, or laptop, so no matter what type of computer you own today or buy tomorrow your mouse will be compatible
  • Plug and Play Simplicity: Just plug in the tiny nano USB receiver and start working in seconds with a strong, reliable connection to your wireless computer mouse up to 33 feet / 10 m (5)
  • Better than touchpad: Get more done by adding M185 to your laptop; according to a recent study, laptop users who chose this mouse over a touchpad were 50% more productive (3) and worked 30% faster (4)

Capture a selected region

Use a dictionary with screen coordinates when you do not need the whole monitor:

from mss import MSS

region = {"left": 100, "top": 100, "width": 800, "height": 600}

with MSS(with_cursor=True) as sct:
    print("Cursor capture enabled:", sct.with_cursor)
    image = sct.grab(region).to_pil()
    image.save("region.png")

The region’s left and top values are desktop coordinates. The resulting file starts at (0, 0), so a cursor outside the rectangle cannot appear in the image. If the pointer is near an edge, include enough margin for its hotspot and artwork.

Check whether your environment can provide a cursor

Before relying on this in automation, make a small diagnostic script:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
from pathlib import Path
from mss import MSS

output = Path("cursor-check.png")
with MSS(with_cursor=True) as sct:
    print("Requested: True")
    print("Available: ", sct.with_cursor)
    shot = sct.grab(sct.primary_monitor)
    shot.to_pil().save(output)

print("Wrote", output.resolve())
  • If Available is False, the backend or current desktop circumstances do not support native cursor inclusion. Do not assume the image contains a pointer.
  • If it is True, still inspect the file. API availability does not guarantee that every compositor, display server, remote session or desktop effect will produce the expected pixels.
  • Run the test on each operating system, display-scaling configuration and capture backend you support.

MSS’s command-line interface also exposes a --with-cursor option; its usage documentation identifies that CLI option as available from MSS 8.0.0. The Python constructor remains the more convenient choice when you need to process or name the image in code.

Rank #2
Sale
Logitech G305 Lightspeed Wireless Gaming Mouse - Black
  • The next-generation optical HERO sensor delivers incredible performance and up to 10x the power efficiency over previous generations, with 400 IPS precision and up to 12,000 DPI sensitivity
  • Ultra-fast LIGHTSPEED wireless technology gives you a lag-free gaming experience, delivering incredible responsiveness and reliability with 1 ms report rate for competition-level performance
  • G305 wireless mouse boasts an incredible 250 hours of continuous gameplay on just 1 AA battery; switch to Endurance mode via Logitech G HUB software and extend battery life up to 9 months
  • Wireless does not have to mean heavy, G305 lightweight mouse provides high maneuverability coming in at only 3.4 oz thanks to efficient lightweight mechanical design and ultra-efficient battery usage
  • The durable, compact design with built-in nano receiver storage makes G305 not just a great portable desktop mouse, but also a great laptop travel companion, use with a gaming laptop and play anywhere

Windows and macOS: what the flag does not promise

MSS supports platform-specific screen-capture backends, but its documented with_cursor option is explicitly GNU/Linux-only. Therefore, do not publish or deploy code that promises the same native cursor behavior on Windows or macOS merely because the argument is accepted by your installed package. Test the actual output on the target platform and choose a fallback when necessary.

Pillow’s ImageGrab.grab() captures the screen or a bounding box, but its documented signature has no cursor-inclusion parameter. On macOS, Pillow documents Retina output at 2× by default; scale_down=True requests 1× output. On Linux, Pillow documents possible fallback commands such as gnome-screenshot, grim or spectacle when its normal X11 path cannot obtain an image. None of those documented behaviors promises that a pointer will be present.

PyAutoGUI’s pyautogui.screenshot() returns a Pillow image, can write directly to a filename and accepts a region argument, but its screenshot API documentation does not list a cursor-inclusion argument. PyAutoGUI documentation gives an approximate capture time of roughly 100 milliseconds for a 1920 × 1080 screen; treat that as a contextual documentation estimate, not a benchmark or guarantee.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Fallback: composite a cursor image yourself

When the capture library omits the pointer, a practical approach is to obtain the pointer position, capture the screen, and paste a cursor PNG over the result. This is an implementation pattern, not a built-in Pillow or PyAutoGUI guarantee. The details of obtaining the pointer position are platform- and toolkit-dependent, so select a position API that is supported in your application.

Rank #3
Sale
Logitech M185 Compact Ambidextrous Wireless Mouse with Rubber Grips - Blue
  • Compact Mouse: With a comfortable and contoured shape, this Logitech ambidextrous wireless mouse feels great in either right or left hand and is far superior to a touchpad
  • Durable and Reliable: This USB wireless mouse features a line-by-line scroll wheel, up to 1 year of battery life (2) thanks to a smart sleep mode function, and comes with the included AA battery
  • Universal Compatibility: Your Logitech mouse works with your Windows PC, Mac, or laptop, so no matter what type of computer you own today or buy tomorrow your mouse will be compatible
  • Plug and Play Simplicity: Just plug in the tiny nano USB receiver and start working in seconds with a strong, reliable connection to your wireless computer mouse up to 33 feet / 10 m (5)
  • Better than touchpad: Get more done by adding M185 to your laptop; according to a recent study, laptop users who chose this mouse over a touchpad were 50% more productive (3) and worked 30% faster (4)

The compositing part can be implemented with Pillow:

from PIL import Image

screen = Image.open("screen.png").convert("RGBA")
cursor = Image.open("cursor.png").convert("RGBA")

# Desktop coordinates captured at the same instant as the screenshot.
pointer_x, pointer_y = 420, 260
# Cursor hotspot: the pixel that touches the screen at the pointer location.
hotspot_x, hotspot_y = 5, 3

paste_at = (pointer_x - hotspot_x, pointer_y - hotspot_y)
screen.alpha_composite(cursor, dest=paste_at)
screen.convert("RGB").save("screen-with-cursor.png")

For a cropped capture, subtract the crop’s desktop origin before calculating the paste position:

region_left, region_top = 100, 100
image_x = pointer_x - region_left - hotspot_x
image_y = pointer_y - region_top - hotspot_y
screen.alpha_composite(cursor, dest=(image_x, image_y))

Coordinate and scaling rules

  • Use one coordinate space. The pointer position and screenshot must refer to the same virtual desktop. Multi-monitor layouts can have negative origins or gaps.
  • Account for scaling. Logical pointer coordinates and physical screenshot pixels may differ at fractional display scaling. macOS Retina capture is specifically documented as 2× unless scaled down.
  • Use the correct hotspot. The visible arrow’s top-left corner is not necessarily the click point. Store the cursor image’s hotspot and subtract it.
  • Capture close together in time. The pointer can move between position sampling and the screen capture, producing an offset.
  • Validate each configuration. Check full-screen and region captures, every supported monitor arrangement, scaling level and operating system.

If the cursor image has transparency, use alpha_composite or an equivalent mask-aware operation. A normal opaque paste creates a rectangular box around the pointer.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Common failures and fixes

The output has no pointer on GNU/Linux

  • Print sct.with_cursor. If MSS disabled it, native inclusion is unavailable in that session; use a compositing fallback or change the capture environment.
  • Move the pointer to a known location before testing and inspect the actual PNG rather than relying on the constructor argument.
  • Check whether you are capturing a different display, monitor or region than the one containing the pointer.

The pointer is clipped or appears shifted

  • For a region, subtract its left/top origin from desktop coordinates.
  • Apply the cursor hotspot, not simply the image’s top-left corner.
  • Recalculate physical pixels when display scaling is enabled.

macOS output is twice the expected size

Pillow documents Retina output at 2× by default. Use scale_down=True where a 1× image is required, and adjust any manually composited cursor coordinates to the image’s actual pixel dimensions.

Rank #4
Amazon Basics 3-Button USB Wired Mouse with Responsive Tracking, Plug & Play, Compatible with Windows and Mac, Black
  • Computer mouse for easily navigating a computer interface; click, scroll, and more
  • USB-A wired connection; if existing device only supports USB-C, an additional adapter will be required
  • High-definition (1000 dpi) optical tracking ensures responsive cursor control for precise tracking and easy text selection
  • 3 buttons offer effortless fingertip control
  • Plug-and-go ready for instant use

Linux Pillow capture returns no image

Pillow documents possible Linux fallback commands including gnome-screenshot, grim and spectacle when its default X11 display path cannot provide an image. Install and configure the appropriate desktop utility for the session, then retest. These fallbacks still do not promise cursor capture.

Automation captures a different pointer position

Prevent pointer movement during the two operations, or capture the position and screen in a tightly controlled sequence. Remote desktops, compositors and accessibility tools can also draw a pointer differently from the hardware cursor.

Choosing an approach

Approach Native cursor support Capture scope Main risk
MSS with with_cursor=True Documented for GNU/Linux Monitor or region Option may be disabled; verify output
Pillow ImageGrab No documented cursor parameter Screen or bounding box Platform fallback and scaling differences
PyAutoGUI screenshot No documented cursor parameter Screen or region Manual overlay and coordinate mapping
Manual Pillow overlay Application-controlled Any captured image Pointer timing, hotspot and scaling errors

For a Linux desktop where a real pointer must be visible, start with MSS and test the file. For cross-platform tooling, treat cursor rendering as a separate overlay problem unless your chosen backend explicitly documents support.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If what you actually need is a screenshot of a web page, rather than your local desktop pointer, ScreenshotNeo returns a website image or PDF from one request. It is not a replacement for capturing a physical desktop cursor, but it avoids maintaining a browser automation stack.

Best Value
Sale
Acer Wireless Mouse for Laptop, 2.4GHz Computer Mouse 3 Adjustable 1600 DPI
  • 【Plug and Play for Home/Office/School】The wireless computer mouse features 2.4GHz connectivity, delivering a stable, interference-free connection up to 32ft. Designed for 𝐦𝐞𝐝𝐢𝐮𝐦 𝐭𝐨 𝐥𝐚𝐫𝐠𝐞 𝐬𝐢𝐳𝐞𝐝 𝐡𝐚𝐧𝐝𝐬, it ensures comfortable use all day. Simply plug in the USB-A receiver for instant pairing—no drivers needed. 📌📌 If the mouse isn’t suitable, place the USB receiver in the battery compartment and return both.
  • 【3 Levels Adjustable DPI】This travel USB mouse offers 3 adjustable DPI settings (800, 1200, 1600), allowing you to customize sensitivity for precise design work. Effortlessly switch to match your task and elevate your productivity. 📌 Please remove the film at the bottom of the mouse before use.
  • 【Effortless Browsing】Equipped with forward and backward buttons, this computer mice streamlines your workflow, making it easy to navigate through web pages and files with a simple click. 📌Side button does not work on Mac.
  • 【Visible Indicator Light】 The pc mouse features a visual indicator for DPI levels and low battery alerts. The red light flashes once for 800 DPI, twice for 1200 DPI, and three times for 1600 DPI. When the battery level is below 10%, the light flashes red until the mouse is completely out of power.
  • 【Click to Wake】With smart sleep mode, it saves power by standby after 10 inactive minutes, just 2-3 clicks to wake. This efficient design delivers 3x longer battery life than motion-wake mice. Engineered for durability, its buttons and scroll wheel are tested for 10 million clicks, ensuring long-term reliability and consistent performance.

cURL:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Python:

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Node.js:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

See the ScreenshotNeo documentation for request options. Before capture, it can accept cookie or consent banners and remove more than 60 known consent platforms, newsletter popups and chat widgets; bot checks, blank pages and failed loads are not billed, and response headers identify the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info and capture_pdf tools for Claude, Cursor and other MCP clients. The Free plan includes 1,000 shots per month without a card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account.

FAQ

Can I turn on with_cursor after creating MSS?

No. Create the MSS object with with_cursor=True; the documented setting cannot be changed afterward.

Will the cursor be visible in a screenshot taken by a headless process?

Do not assume so. Cursor availability depends on the desktop session and capture backend, and MSS can disable the option. Verify the resulting image in the environment that runs the process.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Does ScreenshotNeo capture my computer’s mouse pointer?

No. ScreenshotNeo captures web pages at its service endpoint. Use MSS or a desktop capture API for a local pointer.

Frequently Asked Questions

Which Python library has a documented native cursor option?

MSS documents with_cursor=True for GNU/Linux capture.

What should I do when my library has no cursor parameter?

Capture the pointer position and image, then composite a cursor PNG using the correct crop origin, scale and hotspot.

Why must I inspect the saved image instead of only checking the flag?

A backend can accept the request but disable cursor inclusion when the current desktop circumstances cannot provide the pointer.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Quick Recap

SaleBestseller No. 1
Logitech M185 Compact Ambidextrous 2.4 GHz Wireless Mouse - Swift Grey
Logitech M185 Compact Ambidextrous 2.4 GHz Wireless Mouse - Swift Grey
Product carbon footprint: 3.97 kg CO2e; Contoured shape: Gives you more comfort and control
$14.90
SaleBestseller No. 3
Bestseller No. 4
Amazon Basics 3-Button USB Wired Mouse with Responsive Tracking, Plug & Play, Compatible with Windows and Mac, Black
Amazon Basics 3-Button USB Wired Mouse with Responsive Tracking, Plug & Play, Compatible with Windows and Mac, Black
Computer mouse for easily navigating a computer interface; click, scroll, and more; 3 buttons offer effortless fingertip control
$9.70

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.