Capture screenshots on Windows using mss and Pillow. Provides full-screen, region, and multi-monitor capture with output as PIL Image, PNG file, or base64 st...
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install screenshot-skill或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install screenshot-skill⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/screenshot-skill/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: screenshot-capture description: Capture screenshots on Windows using mss and Pillow. Provides full-screen, region, and multi-monitor capture with output as PIL Image, PNG file, or base64 string. Use when the user asks to take screenshots, capture screen content, get screen info, or needs screen images for AI vision APIs. ---
基于 mss + Pillow 的高性能屏幕截图工具,适用于 Windows 桌面自动化、AI 视觉分析等场景。
uv add mss pillow
# 或
pip install mss pillow
from scripts.screenshot import ScreenCapture
with ScreenCapture() as sc:
# 获取屏幕分辨率
width, height = sc.screen_size
# 全屏截图 → PIL Image
img = sc.capture()
# 截图保存为文件
sc.capture_to_file("output.png")
# 截图转 base64 (用于发送给视觉 API)
b64 = sc.capture_to_base64(quality=85, fmt="JPEG")
# 查看显示器信息
python scripts/screenshot.py info
# 截图保存到文件
python scripts/screenshot.py capture -o my_screenshot.png
# 截图输出 base64
python scripts/screenshot.py base64 --format JPEG --quality 85
| 方法 | 说明 | 返回值 | |------|------|--------| | screen_size | 主显示器 (宽, 高) | tuple[int, int] | | all_screen_size | 虚拟全屏 (宽, 高),多屏合并 | tuple[int, int] | | monitors | 所有显示器详细信息 | list[dict] | | capture(monitor, region, delay) | 截图 → PIL Image | Image.Image | | capture_to_file(filepath, ...) | 截图 → PNG/JPG 文件 | Path | | capture_to_base64(quality, fmt, ...) | 截图 → base64 字符串 | str |
from openai import OpenAI
from scripts.screenshot import ScreenCapture
client = OpenAI()
with ScreenCapture() as sc:
b64 = sc.capture_to_base64(fmt="JPEG", quality=85)
resp = client.chat.completions.create(
model="gpt-4o",
messages=[{
"role": "user",
"content": [
{"type": "text", "text": "描述截图内容"},
{"type": "image_url", "image_url": {
"url": f"data:image/jpeg;base64,{b64}",
"detail": "high",
}},
],
}],
)
with ScreenCapture() as sc:
region = {"left": 100, "top": 200, "width": 800, "height": 600}
img = sc.capture(region=region)
img.save("region.png")
with ScreenCapture(save_dir="screenshots") as sc:
for i in range(5):
sc.capture_to_base64(step=i) # 自动保存为 screenshots/step_000.jpg 等
完整 API 参数说明见 reference.md。
安装 Screenshot Skill 后,可以对 AI 说这些话来触发它
Help me get started with Screenshot Skill
Explains what Screenshot Skill does, walks through the setup, and runs a quick demo based on your current project
Use Screenshot Skill to capture screenshots on Windows using mss and Pillow
Invokes Screenshot Skill with the right parameters and returns the result directly in the conversation
What can I do with Screenshot Skill in my design & creative workflow?
Lists the top use cases for Screenshot Skill, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/screenshot-skill/ 目录(个人级,所有项目可用),或 .claude/skills/screenshot-skill/(项目级)。重启 AI 客户端后,用 /screenshot-skill 主动调用,或让 AI 根据上下文自动发现并使用。
Screenshot Skill 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Screenshot Skill 可免费安装使用。请查阅仓库了解许可证信息。
Capture screenshots on Windows using mss and Pillow. Provides full-screen, region, and multi-monitor capture with output as PIL Image, PNG file, or base64 st...
Screenshot Skill 属于「Design & Creative」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my design & creative tasks using Screenshot Skill
Identifies repetitive steps in your workflow and sets up Screenshot Skill to handle them automatically