A black im.png from Pyscreenshot usually means the capture backend does not match your Fedora display session—most often an X11-oriented path being used while the desktop runs Wayland. Check the session type and the backends detected by your installed Pyscreenshot before changing permissions or reinstalling packages. Then select a backend that your compositor supports, or test a GNOME Xorg login as a case-specific workaround.
Why Pyscreenshot can return a black image
Pyscreenshot is a wrapper that chooses among several screenshot programs and desktop interfaces. X11 tools such as scrot, maim, MSS and ImageMagick expect an X display. A Fedora session running GNOME on Wayland may expose Xwayland for individual applications, but that does not make an X11 desktop-capture path reliable. The Pyscreenshot project documentation explicitly notes that Xwayland cannot be used for screenshot capture and describes separate Wayland routes.
The symptom alone does not prove one universal cause. A black result can also follow from an unavailable executable, an unsupported compositor, a portal request that was not completed, or behavior that differs between Pyscreenshot releases. Treat the session and backend as variables to identify rather than assuming that Fedora itself is broken.
1. Identify the session before changing anything
Check whether Fedora is using Wayland or Xorg
Run these commands in the same graphical login where the script produces the black image:
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware match#1 Best Overall
- Powerful Linux Laptop: This IdeaPad Slim 3 Laptop comes pre-installed with Ubuntu Linux, offering fast performance, robust security, and a clean, user-friendly experience. Enjoy full customization, seamless hardware compatibility, and access to thousands of open-source apps. Whether you're working, creating, or coding, it's built to keep up with everything you do.
- A Multitasking Master: The latest AMD Ryzen 7 5825U processor (up to 4.5 GHz) delivers powerful performance with 8 cores and 16 threads for smooth multitasking. Integrated AMD Radeon Graphics provide crisp visuals for streaming, browsing, photo editing, and casual gaming. With smart machine intelligence, it adapts to your needs for a fast, responsive experience.
- 15.6" Full HD Display: The IdeaPad Slim 3 boasts an 88% screen-to-body ratio for a floating, edge-to-edge visual experience. TÜV Low Blue Light certification reduces eye strain, making it perfect for long work or study sessions.
- Military-Grade Durability: The smart IdeaPad Slim 3 combines portability and durability, letting you work, study, and play on the go. With a profile 10% slimmer than the previous generation, it's lightweight yet military-grade rugged, ready for anything, anywhere.
- Versatile Connectivity: Enjoy the security of a built-in webcam with a privacy shutter. Connect effortlessly with multiple ports: 2x USB A, 1x USB C, 1x HDMI, 1x SD Card Reader, 1x Headphone/Microphone combo. Bundle comes with Stylus Pen, 256GB Portable SSD and 5-in-1 Docking Station.
printf 'XDG_SESSION_TYPE=%sn' "$XDG_SESSION_TYPE"
printf 'DISPLAY=%sn' "$DISPLAY"
printf 'WAYLAND_DISPLAY=%sn' "$WAYLAND_DISPLAY"
echo "$XDG_CURRENT_DESKTOP"
XDG_SESSION_TYPE=wayland points to a Wayland session; x11 points to an Xorg session. A non-empty DISPLAY is not enough to prove that the desktop is X11, because Wayland sessions commonly run Xwayland for compatibility. Record the desktop name as well (for example, GNOME or KDE) because compositor support differs.
Confirm the installed Pyscreenshot version and detected backends
Use the interpreter that runs your application:
python3 - <<'PY'
import pyscreenshot as ImageGrab
print("pyscreenshot backends:", ImageGrab.backends())
PY
If your installation does not expose backends(), print the package version and consult the backend list documented for that release:
python3 - <<'PY'
import pyscreenshot
print(getattr(pyscreenshot, "__version__", "version not exposed"))
print(pyscreenshot.__file__)
PY
The detected list tells you what Pyscreenshot can actually try on this machine. It is more useful than copying a backend name from an example written for another distribution.
2. Reproduce the failure with a minimal script
First remove application-specific variables such as cropping, image conversion and post-processing:
Recommended Free Tools
import pyscreenshot as ImageGrab
image = ImageGrab.grab()
image.save("im.png")
print("saved im.png", image.size, image.mode)
Open the file after each test and keep notes about the session, Pyscreenshot version and backend. A valid file with a sensible size but black pixels indicates a capture-path problem; an exception usually identifies a missing program or service directly.
Rank #2
- Dual USB-A & USB-C Bootable Drive – compatible with most desktops and laptops, new or old. Boot directly or install any included Linux system permanently on your hard drive.
- Fully Customizable USB – easily Add, Replace, or Upgrade any compatible bootable ISO app, installer, or utility (clear step-by-step instructions included).
- 8 Best Linux Distributions in One Drive – explore AV Linux, Elementary OS, Fedora SoaS, Fedora Workstation, Tails OS, Ubuntu Desktop, Ubuntu MATE, and Kubuntu (KDE). No Internet Required – run Live or install offline.
- Fast, Secure & Privacy-Focused – enjoy the freedom of Linux with no forced updates, no online account requirements, and improved privacy and performance compared to Windows or macOS. Ready for Work, Learning & Entertainment – includes office suite, web browser, multimedia apps, image editing, and gaming support (Steam, Epic, GOG via Lutris or Heroic Launcher).
- Premium Hardware & Reliable Support – built with high-quality flash chips for speed and longevity. TECH STORE ON provides responsive customer support within 24 hours.
3. Match the backend to your Fedora session
GNOME on Wayland: try a Wayland-capable route
For GNOME Wayland, prefer a backend that uses the XDG Desktop Portal Screenshot interface or GNOME Shell’s D-Bus screenshot interface, when those options appear in ImageGrab.backends(). A portal request can display a confirmation or selection dialog. If a dialog appears behind another window, complete it and wait for the capture to finish; cancelling it is not equivalent to a successful screenshot.
The portal documentation describes Screen, Window, Area and Active Window targets, with an interactive option that hints whether the dialog should allow customization. Your Pyscreenshot release may expose these choices differently, so inspect its installed API rather than assuming a particular keyword is available.
wlroots compositors: consider Grim
Pyscreenshot documents Grim for Wayland compositors that support the wlr-screencopy protocol. This is a compositor-specific route, not a general Wayland solution. The project documentation identifies GNOME and KDE as unsupported for its Grim route; use the portal or desktop-specific interface there instead.
Xorg: use X11-oriented backends
In an actual Xorg session, an available X11 backend such as MSS, scrot, maim or ImageMagick is appropriate. Test only names reported by ImageGrab.backends(), and verify that any external executable is installed and on your PATH. Do not select an X11 backend merely because DISPLAY is set inside Wayland.
4. Try an explicit backend
When several backends are detected, test them one at a time. The exact keyword is release-dependent, so use the names printed by your installation:
Rank #3
import pyscreenshot as ImageGrab
for name in ImageGrab.backends():
try:
image = ImageGrab.grab(backend=name)
image.save(f"shot-{name}.png")
print(name, "OK", image.size)
except Exception as error:
print(name, "FAILED", repr(error))
If your version rejects the backend argument, use the backend-selection syntax documented by that version instead of modifying the script blindly. The purpose of this loop is diagnostic: it identifies a working route and records useful error messages.
5. Test Pillow as the first alternative
The Pyscreenshot README describes the project as obsolete for most cases and recommends trying Pillow first. Pillow’s ImageGrab can use platform utilities on Linux when its default X11 display does not return a snapshot. The documented fallbacks include gnome-screenshot, grim and spectacle, if installed.
from PIL import ImageGrab
image = ImageGrab.grab()
image.save("pillow-shot.png")
print("saved", image.size, image.mode)
This is a test, not a guarantee. Pillow still depends on a capture utility that fits your session. If it reports that no usable display or helper is available, install or enable the helper appropriate to your desktop, then retry in the same login session.
6. Use GNOME Xorg only as a case-specific workaround
If you must capture the whole GNOME desktop and Wayland routes remain unavailable, sign out and choose a GNOME Xorg session from the login screen, then rerun the minimal script. A Fedora user report from December 2019 said that switching from GNOME Wayland to GNOME Xorg fixed that user’s black image. It is a historical, single-user report—not a guarantee for every Fedora release or hardware combination.
Switching sessions changes more than the screenshot backend and may affect display features, security behavior and application state. Use it to confirm a session mismatch or as a practical workaround, not as proof that all Wayland captures are defective.
Rank #4
- Just plug Panda PAU0F into your laptop or desktop to unlock the dedicated WiFi 6E (6GHz) frequency band for low latency and high data throughput with any WiFi 6E router.
- Locate the most robust WiFi connection and optimal signal range using the dual adjustable antennas.
- Use Panda PAU0F on Windows 11 (not Windows 10) or Linux to connect to any WiFi 6E router in 6GHz frequency band.
- Supports the WEP, WPA, WPA2, WPA3 WiFi security standards.
- If you want to use Panda Wireless PAU0F with a guest OS VM in a Virtual Machine, please contact Panda Wireless for more info.
Backend decision guide
| Route | Best fit | Interaction | What must be available | Session impact |
|---|---|---|---|---|
| X11 backend (MSS, scrot, maim, ImageMagick) | Real Xorg desktop | Usually none | Detected Pyscreenshot backend and its executable | Stays in current session |
| XDG Desktop Portal | Wayland desktops exposing the portal | May show confirmation or target selection | Portal service and a Pyscreenshot route using it | Stays in current session |
| GNOME Shell D-Bus | GNOME Wayland when supported by the installed integration | Depends on desktop service | GNOME Shell D-Bus backend | Stays in current session |
| Grim | wlr-screencopy-compatible compositors | Normally command-driven | Grim and a compatible wlroots compositor | Stays in current session |
| Pillow ImageGrab fallback | Many Linux setups when a helper is installed | Depends on helper | Pillow plus gnome-screenshot, grim or spectacle as applicable | Stays in current session |
| GNOME Xorg login | Diagnostic or workaround when Wayland capture fails | None after login | GNOME Xorg session offered by the login manager | Requires signing out and logging in again |
Common failures and precise fixes
“The file exists, but every pixel is black”
- Check
XDG_SESSION_TYPEand avoid X11-only backends under Wayland. - Print
ImageGrab.backends()and test a portal or GNOME route that is actually listed. - Run the minimal script without cropping or image manipulation.
“No backend is detected”
- Confirm that the script and inspection command use the same Python environment.
- Check the installed Pyscreenshot version and reinstall it in that environment if the import is incomplete.
- Install the desktop utility or service required by the backend you intend to use, then start a new terminal in the graphical session.
“A portal dialog appears, but no image is saved”
- Bring the confirmation window to the foreground and explicitly approve the requested target.
- Try a non-interactive option only if your Pyscreenshot version documents one.
- Check that the script waits for the request to finish before saving or exiting.
“Grim fails on GNOME or KDE”
That route requires the wlr-screencopy protocol. Use the portal or desktop-specific backend instead; the Pyscreenshot documentation lists GNOME and KDE as unsupported for its Grim path.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →“Running with sudo did not help”
Do not make sudo the default fix. A privileged process can lose access to the user’s graphical-session environment, and the matching Fedora report still produced a black image when run with sudo. Test as the logged-in desktop user first. Permissions can matter in other situations, but elevated privileges do not repair a Wayland/X11 mismatch.
“The image is black only in one application”
Capture the entire screen with the minimal script, then try a different target or window. If only a protected window is black, the application or compositor may intentionally restrict capture; Pyscreenshot cannot override every application-level protection.
Reliability and maintenance checklist
- Log the Fedora edition, desktop,
XDG_SESSION_TYPE, Pyscreenshot version and selected backend with each bug report. - Keep a tiny capture test in your project so upgrades can be checked before production jobs run.
- Expect backend availability to vary by desktop and package version; verify after major Fedora or desktop upgrades.
- Save the returned image only after the capture call completes and check dimensions and file size.
- Do not treat dated Ubuntu benchmark tables in the Pyscreenshot README as Fedora success rates; they describe the project’s test context, not your machine.
Or skip the browser setup
If you need a dependable website image rather than a screenshot of your Fedora desktop, ScreenshotNeo makes the capture in one request. It accepts the cookie or consent banner like a visitor, then removes more than 60 known consent platforms, newsletter popups and chat widgets before the shot. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed, and the response identifies the page verdict and billing status in headers.
Use the API documentation at https://screenshotneo.com/docs/ for all options. 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}`);
ScreenshotNeo also provides an MCP server for Claude, Cursor and other MCP clients, so AI agents can call take_screenshot, get_page_info and capture_pdf. One thousand screenshots per month are free with no card; paid plans start at $5 for 3,000. Create a free ScreenshotNeo account.
Best Value
- Fedora Linux Apparel design. This tee is great present. Show your passion for this mindset with this Linux Fedora Shirt! It is an open source Linux distribution which focuses more on stability. You can give this Tee as a gift for young or men and girl.
- This tee theme with Linux Fedora Logo. Gift idea for friends, co-workers, hackers, geeks, programmers, computer geniuses and sys admins. Furthermore for Christmas, birthday or Father's Day for young or men and girl.
- Lightweight, Classic fit, Double-needle sleeve and bottom hem
When to report a persistent bug
If every documented route fails, include the exact Fedora release, desktop and session type, Pyscreenshot and Pillow versions, output of ImageGrab.backends(), the command or script used, and the exception text. State whether the portal dialog appeared and whether an Xorg login changed the result. This information distinguishes a missing helper from a compositor limitation and gives maintainers a reproducible case.
Frequently Asked Questions
Should I uninstall Pyscreenshot because its README calls it obsolete?
Not necessarily. The README recommends Pillow for most cases but still documents Pyscreenshot backends that can be useful for flexible or particular Wayland setups. Test the route that matches your session before removing it.
Does a black screenshot mean Fedora permissions are wrong?
Usually not. A session/backend mismatch is a more direct first hypothesis. Test as the logged-in user and inspect the detected backends before changing permissions.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Can I use Grim on every Wayland desktop?
No. Grim requires the wlr-screencopy protocol. The Pyscreenshot documentation specifically identifies GNOME and KDE as unsupported for that Grim route.
Why does Pillow belong in a Pyscreenshot troubleshooting guide?
Pyscreenshot’s own documentation recommends trying Pillow first in many cases, and Pillow documents Linux fallbacks such as gnome-screenshot, grim and spectacle when its default X11 display cannot capture.
Quick Recap
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.

