grim-rs
if you like this project, then the best way to express gratitude is to give it a star ⭐, it doesn't cost you anything, but I understand that I'm moving the project in the right direction.
Rust implementation of grim screenshot utility for Wayland compositors and Windows (DXGI Desktop Duplication).
Features
- Pure Rust implementation
- Cross-platform: same API on Linux (Wayland) and Windows (DXGI)
- Native capture via
ext-image-copy-capture-v1,zwlr_screencopy_manager_v1, or DXGI - Multi-output capture and compositing
- Adaptive image scaling (Nearest / Triangle / CatmullRom / Lanczos3)
- PNG / JPEG output
- Cursor overlay support
- No external runtime screenshot tools required
Usage
As a Library
[]
= "0.2"
MSRV: Rust 1.68+
use Grim;
Command Line
# Quick start
# Capture specific region
# Install and run direct binary
Full CLI reference: doc/cli.md
Architecture
Processing Pipeline
Supported Platforms
Linux (Wayland): Hyprland, Sway, River, Wayfire, Niri, any wlroots-based compositor
Windows: Windows 8+ with DXGI Desktop Duplication support
Limitations
- Linux: Requires compositor with
ext-image-copy-capture-v1orzwlr_screencopy_manager_v1 - Windows:
Grim::new_ext()andGrim::new_wlr()returnError::UnsupportedProtocol(Wayland-only); protected content (DRM) cannot be captured
Building
Contributing
See CONTRIBUTING.md.
License
MIT License - see LICENSE file for details.