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

Install DXcam with pip install dxcam, create a camera, and call grab(). The result is a NumPy array containing the captured frame; it is not automatically a PNG file. DXcam is a Windows screen-capture library, so use it when you need to capture a Windows display from Python—not a website screenshot service.

Install DXcam and capture a still frame

The basic workflow is to install the package, create a camera, capture one frame, and release the capture resources. DXcam’s project documents this context-manager pattern:

pip install dxcam
import dxcam

with dxcam.create() as camera:
    frame = camera.grab()

if frame is None:
    print("No new frame was available")
else:
    print(frame.shape, frame.dtype)

frame is a NumPy array. The context manager handles cleanup when the block ends. The README also documents release() for explicitly stopping capture and freeing buffers and resources; a released camera instance cannot be reused. [DXcam README]

DXcam’s repository describes it as a Windows screenshot and capture library based on the Desktop Duplication API. That is the project’s description, not an independent performance evaluation. [DXcam README]

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

Install requirements and check compatibility

The documented basic install is pip install dxcam. The project lists Python 3.10 or newer and says its official Windows wheels are built for CPython 3.10 through 3.14. These package details can change as releases are made, so check the current project listing if your Python version or Windows environment does not match. [DXcam on PyPI]

If you need OpenCV-based color conversion or WinRT backend support, the project documents an optional full-feature installation:

pip install "dxcam[cv2,winrt]"

Use the basic installation if it covers your workflow; install the optional extras only when you need those capabilities. [DXcam README]

Save the captured array as an image

grab() returns image data in memory; saving it is a separate step. For an uncomplicated path, request BGRA and save it with OpenCV. DXcam documents BGRA as its leanest dependency path, while other color conversions require OpenCV or the compiled NumPy processor path. OpenCV’s conventional color order is BGR/BGRA, so select a matching output rather than treating every four-channel array as RGBA.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
import dxcam
import cv2

with dxcam.create(output_color="BGRA") as camera:
    frame = camera.grab(new_frame_only=False)

if frame is None:
    raise RuntimeError("DXcam did not return a frame")

if not cv2.imwrite("screenshot.png", frame):
    raise RuntimeError("Could not write screenshot.png")

print("Saved screenshot.png")

This example uses the optional OpenCV dependency for writing the file. Install the extras with pip install "dxcam[cv2,winrt]", or use an image library already present in your application and pass it an array in the channel order it expects. DXcam documents RGB, RGBA, BGR, BGRA, and GRAY as output choices. [DXcam README]

Capture only part of the screen

Pass region=(left, top, right, bottom) to grab(). These are the rectangle’s boundary coordinates—not an x/y origin followed by width/height. For example, a 640-by-640 region centered in a 1920-by-1080 output can be calculated as follows:

import dxcam

left = (1920 - 640) // 2
 top = (1080 - 640) // 2

In Python, avoid indenting the second assignment accidentally; a complete example is:

import dxcam

left = (1920 - 640) // 2
top = (1080 - 640) // 2
region = (left, top, left + 640, top + 640)

with dxcam.create() as camera:
    frame = camera.grab(region=region, new_frame_only=False)

if frame is None:
    raise RuntimeError("No frame returned")

print(frame.shape)

The coordinates assume the selected output has the dimensions used in the calculation. For a different monitor resolution, calculate the bounds from that output’s actual dimensions. [DXcam README]

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Handle missing frames and choose the right capture mode

One current frame

For a one-off screenshot, use grab(). By default it can return None if no new frame has been available since the preceding capture. If your code needs the latest frame even when the display has not changed, call grab(new_frame_only=False). Check for None before processing or writing the result. [DXcam README]

A continuing stream

For repeated capture, use the continuous API: start capture, retrieve frames, and stop when finished. DXcam documents a capture thread and an in-memory ring buffer for this mode.

import dxcam

camera = dxcam.create()
camera.start(target_fps=60)
try:
    frame = camera.get_latest_frame()
    if frame is not None:
        print(frame.shape)
finally:
    camera.stop()

Use the streaming path for workflows such as video processing or computer vision that need a continuing sequence of frames. It is not just a loop around the one-shot API: the capture thread fills a ring buffer, and get_latest_frame() reads from it. The project documents video_mode=True for filling the buffer at the requested target frame rate; in that mode, if no new frame has rendered, the previous frame is reused. [DXcam README]

Choose one-shot capture when you need a single current image. Choose continuous capture when you need a paced stream or want the buffer behavior. Consider whether your application wants repeated frames when the screen is unchanged before enabling video mode.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

Select a backend, monitor, and color format

DXGI or WinRT

DXcam documents DXGI (the Desktop Duplication backend) as the default and recommends starting there for most workloads, particularly one-shot grabs. Its other documented backend is WinRT (Windows Graphics Capture). The project suggests trying WinRT when cursor rendering is needed or when it better fits application constraints. There is no universal cross-machine winner in the documentation; test the backend against your Windows system and target application. [DXcam README]

Monitor or output selection

The project’s examples associate each output or monitor with a camera instance and show selecting device and output indices for multi-monitor or multi-GPU systems. If you capture the wrong display, verify the selected device/output indices against the output you intend to capture rather than assuming the default camera targets a particular monitor. [DXcam README]

Color order

Choose the output format based on the next library in your pipeline. RGB and RGBA are common for image-display code; BGR and BGRA are often expected by OpenCV workflows; GRAY is useful when the next operation requires a single channel. DXcam documents these output modes, with conversion availability depending on installed support. [DXcam README]

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Performance, reliability, and cost considerations

DXcam’s README advertises “240+fps on 1080p.” That is a project-published figure, not an independently established benchmark or a guarantee for your system. Actual capture behavior depends on the machine, display, backend, application, and workload; measure your own pipeline if a particular frame rate is a requirement. [DXcam README]

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

For reliability, handle a possible None result, keep region coordinates within the intended output, and make cleanup explicit when using the streaming interface. A capture loop does not itself imply that every requested frame will be new; the documented video mode can repeat the preceding frame when the display does not render another one. [DXcam README]

DXcam is a Python package, rather than a per-screenshot hosted service; the reviewed package documentation does not state a price. Your practical costs are the Windows machine and the engineering or compute resources needed by your own application.

Troubleshoot common DXcam issues

  • pip reports no compatible distribution or install fails: confirm you are using Windows and a supported Python environment. The project lists Python 3.10+ and official Windows wheels for CPython 3.10–3.14; verify current package compatibility if your interpreter differs. [DXcam on PyPI]
  • grab() returns None: DXcam may have no new frame since the previous capture. Use grab(new_frame_only=False) when the latest available frame is needed regardless, and still check the result before use. [DXcam README]
  • The crop is shifted, too small, or empty: confirm the tuple is (left, top, right, bottom), not (x, y, width, height), and that its coordinates correspond to the selected output’s dimensions. [DXcam README]
  • The saved image has unexpected colors: check whether the chosen format is RGB/RGBA or BGR/BGRA and match it to the saving or processing library. DXcam exposes several channel orders; the consumer’s expected ordering matters. [DXcam README]
  • The wrong display is captured: inspect the device/output selection for multi-monitor or multi-GPU setups. The project examples use indices to select outputs. [DXcam README]
  • Cursor is absent or the backend does not fit the application: try the documented WinRT backend, especially when cursor rendering is needed; the project otherwise recommends starting with DXGI for most workloads. Test on the target system. [DXcam README]
  • A streaming instance stops working after cleanup: release frees resources and a released instance cannot be reused. Create a new camera instance for a new capture lifecycle. [DXcam README]

Or skip the browser setup

DXcam captures a Windows desktop. If instead you need a screenshot of a public website, ScreenshotNeo provides a website screenshot API and MCP server; one GET request can return PNG, JPEG, WebP, or PDF. For example, request a WebP capture of Stripe:

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

See the ScreenshotNeo documentation for the API details. ScreenshotNeo accepts cookie/consent banners and removes 60+ known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, with response headers identifying the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf for AI agents. The Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots.

Free tools Windows power users keep installed

One-click scans. No signup required.

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

Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month with no card.

Frequently asked questions

Does DXcam capture a website URL?

No. DXcam captures a Windows display. For a website URL capture rather than a desktop image, use a browser-based approach or a website screenshot API such as ScreenshotNeo.

Can I use DXcam on macOS or Linux?

The project describes DXcam as a Windows capture library and lists Windows package classifiers. The documentation cited here does not establish support for macOS or Linux. [DXcam on PyPI]

Can I use DXcam for a video or machine-learning pipeline?

Yes. The project documents continuous capture with a background capture thread, a ring buffer, and frame retrieval. Use that streaming API when the application needs repeated frames rather than a single still. [DXcam README]

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

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.