home / skills / sarfraznawaz2005 / agent-skills-collection / take-screenshots
This skill captures full-screen or region screenshots on Windows with configurable JPEG quality and scaling to reduce file sizes.
npx playbooks add skill sarfraznawaz2005/agent-skills-collection --skill take-screenshotsReview the files below or copy the command above to add this skill to your agents.
---
name: take-screenshots
description: A Windows screenshot skill that provides both programmatic full-screen capture and interactive region selection.
license: ""
compatibility: opencode
---
# take-screenshots
## Purpose
RegionSnip is a Windows screenshot capture utility written in C# that provides both programmatic full-screen capture and interactive region selection. It supports JPEG formats, with options for quality compression and image scaling to optimize file size.
## Usage
RegionSnip is designed to be called programmatically and outputs JSON results to stdout.
### Command Line Arguments
| Argument | Description | Example |
|----------|-------------|---------|
| `--mode <mode>` | Capture mode: `full` or `region` (default: region) | `--mode full` |
| `--out <path>` | Output file path (required). Use `.jpg` or `.jpeg` for JPEG compression. | `--out screenshot.jpg` |
| `--all` | Capture all monitors (full mode only) | `--all` |
| `--monitor <n>` | Specific monitor index (0-based, full mode only) | `--monitor 1` |
| `--prompt <text>` | Custom prompt text for region selection | `--prompt "Select area"` |
| `--quality <n>` | JPEG quality level (1-100, default: 80) | `--quality 75` |
| `--scale <n>` | Image scaling factor (0.1-1.0, default: 0.75 for full, 1.0 for region) | `--scale 0.5` |
### Examples
#### Full-screen capture of primary monitor:
```bash
./scripts/RegionSnip.exe --mode full --out screenshot.jpg
```
#### Full-screen capture of all monitors:
```bash
./scripts/RegionSnip.exe --mode full --out screenshot.jpg --all
```
#### Full-screen capture of specific monitor:
```bash
./scripts/RegionSnip.exe --mode full --out screenshot.jpg --monitor 1
```
#### Interactive region selection:
```bash
./scripts/RegionSnip.exe --mode region --out screenshot.jpg
```
#### Interactive region selection with custom prompt:
```bash
./scripts/RegionSnip.exe --mode region --out screenshot.jpg --prompt "Drag to select the area to capture"
```
#### Optimized Capture Prefered (JPEG + Scaling):
To significantly reduce file size (e.g., for sending to LLMs), use `.jpg` extension along with quality and scale parameters.
```bash
# Reduces size by using JPEG compression (80%) and scaling down to 50%
./scripts/RegionSnip.exe --mode full --out screenshot.jpg --quality 80 --scale 0.5
```
## Output Format
RegionSnip outputs JSON to stdout with the following structure:
### Success Response (Full Mode):
```json
{
"ok": true,
"path": "screenshot.jpg",
"mode": "full",
"monitorIndex": 0,
"all": false,
"rect": {
"x": 0,
"y": 0,
"width": 1920,
"height": 1080
},
"width": 1920,
"height": 1080
}
```
### Success Response (Region Mode):
```json
{
"ok": true,
"path": "screenshot.jpg",
"mode": "region",
"rect": {
"x": 100,
"y": 100,
"width": 800,
"height": 600
},
"width": 800,
"height": 600
}
```
### Error Response:
```json
{
"ok": false,
"error": "Description of what went wrong",
"mode": "region"
}
```
### Cancellation Response (Region Mode):
```json
{
"ok": false,
"cancelled": true,
"mode": "region"
}
```
## Error Handling
- Always check the `ok` field in the response
- For region selection, users can cancel the operation (results in `cancelled: true`)
- Common errors include invalid monitor indices, permission issues, or timeout
- Screenshots are saved as JPEG files to the specified path
- Base64 image data is included when `includeImage=true` for further processing
This skill provides Windows screenshot capture with both programmatic full-screen grabs and interactive region selection. It saves JPEG output with configurable quality and scaling to reduce file size. The tool returns structured JSON to stdout so calling processes can parse results or errors programmatically.
You invoke the executable with command-line flags to choose mode (full or region), output path, and optional parameters like monitor index, quality, and scale. In full mode it captures one or all monitors; in region mode it displays an interactive selector and returns coordinates. The program writes a JSON success, error, or cancellation object to stdout and saves the image file to the provided path.
What does the tool output after a successful capture?
It prints a JSON object with ok:true plus path, mode, rect, width, and height; full mode also includes monitorIndex and all flags.
How do I reduce file size for model uploads?
Use a .jpg filename, set --quality to a lower value (e.g., 75) and --scale to a value below 1.0 (e.g., 0.5).
What happens if a user cancels region selection?
The tool writes a JSON object with ok:false and cancelled:true for region mode; handle this case in calling code.
What are common errors to handle?
Invalid monitor indices, permission or write errors for the output path, and timeouts during interactive selection; always check the ok and error fields.