blur-image
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseBlur Image
模糊图片
Detect and blur sensitive regions in screenshots using AI vision + ImageMagick.
Announce: "I'm using the blur-image skill to identify and blur sensitive regions."
Use when: Blur, redact, anonymize, hide text in screenshots, prepare images for sharing, remove PII from images.
Skip when: Crop, resize, format conversion, color adjustments, or non-privacy image editing.
Common mistake: Output goes to by default, not overwriting the original. If the user expects in-place editing, they need .
<name>-blurred.webp--overwrite使用AI视觉 + ImageMagick 检测并模糊截图中的敏感区域。
公告: "我正在使用blur-image技能识别并模糊敏感区域。"
适用场景: 模糊、遮蔽、匿名化、隐藏截图中的文本、准备待分享的图片、移除图片中的PII。
不适用场景: 裁剪、调整大小、格式转换、色彩调整或其他非隐私相关的图片编辑。
常见误区: 默认输出文件名为,不会覆盖原文件。如果用户需要原地编辑,需要添加参数。
<name>-blurred.webp--overwriteCritical Rules
关键规则
| Always | Never |
|---|---|
Check | Run blur without user confirmation |
| Show the generated command before executing | Overwrite the original file without |
| Use sigma >= 15 for privacy-sensitive content (low sigma is reversible) | Use sigma < 10 (can be reversed with deblurring algorithms) |
Save output as WebP with | Blur decorative/non-sensitive content without asking |
| Add 30-50px padding around detected regions, clamped to image edges | Trust raw AI coordinates without padding (20-50px error margins) |
| Read output image after blurring to verify correct regions were blurred | Skip the verification step |
Get image pixel dimensions with | Assume coordinates without checking actual image dimensions |
| 必须遵守 | 禁止 |
|---|---|
运行前先检查 | 未经用户确认就运行模糊操作 |
| 执行前先展示生成的命令 | 未加 |
| 处理隐私敏感内容时sigma值 >= 15(sigma值过低可被逆向还原) | 使用sigma < 10(可通过去模糊算法逆向还原内容) |
输出保存为WebP格式,质量参数为 | 未经询问就模糊装饰性/非敏感内容 |
| 在检测到的区域四周添加30-50px的内边距,边界不超出图片边缘 | 直接使用AI输出的原始坐标,不添加内边距(存在20-50px的误差范围) |
| 模糊处理后读取输出图片,验证正确区域已被模糊 | 跳过验证步骤 |
生成坐标前使用 | 不检查实际图片尺寸就假设坐标 |
Flags
参数
| Flag | Behavior |
|---|---|
| (none) | Full workflow: preflight, auto-detect, confirm, blur, verify |
| Skip auto-detection, ask user what to blur |
| Replace original file instead of creating |
| Use |
| Generate and show the command but don't execute it |
| 参数 | 行为 |
|---|---|
| (无) | 完整工作流:前置检查、自动检测、用户确认、模糊处理、结果验证 |
| 跳过自动检测,询问用户需要模糊的内容 |
| 替换原文件,而非生成带 |
| 使用 |
| 生成并展示命令,但不执行 |
Phase 1: Preflight
阶段1:前置检查
Check that ImageMagick is installed and the image is valid.
- Run . If missing, show install instructions and stop:
which magick- macOS:
brew install imagemagick - Ubuntu/Debian:
sudo apt install imagemagick - Other: https://imagemagick.org/script/download.php
- macOS:
- Run — this validates the file exists, format is supported (png, jpg, jpeg, webp, tiff), and returns pixel dimensions in one step. If the command outputs multiple lines, the image is animated (GIF, animated WebP, APNG) — stop and tell the user, because
magick identify -format '%wx%h\n' image.pngblur only affects the first frame-region - Report dimensions to confirm the coordinate space — Retina/HiDPI screenshots may be 2x logical resolution
检查ImageMagick是否已安装,图片是否有效。
- 运行,如果未找到,展示安装指引后终止流程:
which magick- macOS:
brew install imagemagick - Ubuntu/Debian:
sudo apt install imagemagick - 其他系统: https://imagemagick.org/script/download.php
- macOS:
- 运行—— 该命令会验证文件是否存在、格式是否支持(png、jpg、jpeg、webp、tiff),并一步返回像素尺寸。如果命令输出多行,说明图片是动图(GIF、动图WebP、APNG)—— 终止流程并告知用户,因为
magick identify -format '%wx%h\n' image.png模糊仅会作用于第一帧-region - 告知用户图片尺寸以确认坐标空间——Retina/HiDPI截图的物理分辨率可能是逻辑分辨率的2倍
Phase 2: Identify Regions
阶段2:识别区域
Two modes depending on flags and user input.
根据参数和用户输入分为两种模式。
Mode A — Auto-detect (default)
模式A — 自动检测(默认)
- Read the image using multimodal vision
- Identify regions containing sensitive text:
- Email addresses
- API keys, tokens, secrets
- URLs with credentials or internal hostnames
- Personal names, phone numbers
- IP addresses
- File paths with usernames
- Passwords, database connection strings
- For each region, determine the bounding box in pixels from top-left origin (ImageMagick's coordinate system)
(x, y, width, height) - Add 30-50px padding to all sides of each detected region — AI spatial detection has 20-50px error margins. Clamp coordinates so regions don't extend past image edges (X >= 0, Y >= 0, X+W <= image width, Y+H <= image height)
- Present findings:
I found N regions with sensitive text: 1. [description] at roughly (X, Y) — WxH (with padding) 2. [description] at roughly (X, Y) — WxH (with padding) - Ask user to confirm which regions to blur
- If no sensitive content found, report that and offer mode
--guided
- 使用多模态视觉能力读取图片
- 识别包含敏感文本的区域:
- 邮箱地址
- API keys、tokens、密钥
- 带凭证或内部主机名的URL
- 个人姓名、电话号码
- IP地址
- 带用户名的文件路径
- 密码、数据库连接字符串
- 针对每个区域,确定基于左上角原点(ImageMagick的坐标系)的 bounding box 坐标 (单位为像素)
(x, y, width, height) - 为每个检测到的区域的四边添加30-50px的内边距——AI空间检测存在20-50px的误差范围。调整坐标确保区域不超出图片边界(X >= 0, Y >= 0, X+W <= 图片宽度, Y+H <= 图片高度)
- 展示检测结果:
我找到了N处包含敏感文本的区域: 1. [内容描述] 大致位于 (X, Y) —— 尺寸WxH(已加内边距) 2. [内容描述] 大致位于 (X, Y) —— 尺寸WxH(已加内边距) - 询问用户确认需要模糊的区域
- 如果未检测到敏感内容,告知用户并提供模式选项
--guided
Mode B — User-guided (--guided
or when user specifies what to blur)
--guided模式B — 用户引导(--guided
或用户指定模糊内容时)
--guided- User describes what to blur: "blur the email in the top right" or "blur everything below the header"
- Read the image, locate the described content
- Propose padded coordinates and ask user to confirm
- 用户描述需要模糊的内容:「模糊右上角的邮箱」或「模糊头部以下的所有内容」
- 读取图片,定位描述的内容
- 提供添加内边距后的坐标,询问用户确认
Phase 3: Generate Command
阶段3:生成命令
Build the ImageMagick command with all confirmed regions.
Gaussian blur (default):
bash
magick input.png \
-region WxH+X+Y -blur 0x20 \
-region WxH+X+Y -blur 0x20 \
-strip -quality 85 output-blurred.webpSolid fill ( flag):
--solidbash
magick input.png \
-region WxH+X+Y -fill black -colorize 100 \
-region WxH+X+Y -fill black -colorize 100 \
-strip -quality 85 output-blurred.webp- Default output filename: alongside the original (
<original-name>-blurred.webpremoves EXIF metadata)-strip - Present the full command and output path before running
- Ask: "Run this command? The blurred image will be saved as [path]."
基于所有确认的区域构建ImageMagick命令。
高斯模糊(默认):
bash
magick input.png \
-region WxH+X+Y -blur 0x20 \
-region WxH+X+Y -blur 0x20 \
-strip -quality 85 output-blurred.webp纯色填充(参数):
--solidbash
magick input.png \
-region WxH+X+Y -fill black -colorize 100 \
-region WxH+X+Y -fill black -colorize 100 \
-strip -quality 85 output-blurred.webp- 默认输出文件名:和原文件同目录下的(
<original-name>-blurred.webp参数会移除EXIF元数据)-strip - 运行前展示完整命令和输出路径
- 询问:「是否运行该命令?模糊后的图片将保存至 [path]。」
Phase 4: Execute and Verify
阶段4:执行与验证
- Run the command
- Read the output image to verify blur was applied to the correct regions
- If any text is still visible or wrong area was blurred, offer to adjust coordinates (increase padding or shift position) and re-run
- Report success with the output file path
- 运行命令
- 读取输出图片,验证模糊已应用到正确区域
- 如果仍有文本可见或模糊了错误区域,提供调整坐标(增加内边距或调整位置)并重跑的选项
- 报告执行成功,告知输出文件路径
Example
示例
User: blur the sensitive stuff in screenshot.png
Claude: I'm using the blur-image skill to identify and blur sensitive regions.
Preflight: magick found at /opt/homebrew/bin/magick (v7.1.2)
Image: screenshot.png (1920x1080 PNG)
I found 2 regions with sensitive text:
1. Email address "user@company.com" at roughly (430, 210) — 320x65px (with padding)
2. API key "sk_live_..." at roughly (80, 560) — 390x60px (with padding)
Blur both regions? [Y/n]
User: Y
Running:
magick screenshot.png \
-region 320x65+430+210 -blur 0x20 \
-region 390x60+80+560 -blur 0x20 \
-strip -quality 85 screenshot-blurred.webp
✓ Done. Saved to screenshot-blurred.webp
I've verified the output — both regions are blurred and surrounding content is intact.用户:blur the sensitive stuff in screenshot.png
Claude:我正在使用blur-image技能识别并模糊敏感区域。
前置检查:magick已安装,路径为/opt/homebrew/bin/magick (v7.1.2)
图片:screenshot.png (1920x1080 PNG)
我找到了2处包含敏感文本的区域:
1. 邮箱地址 "user@company.com" 大致位于 (430, 210) —— 320x65px(已加内边距)
2. API密钥 "sk_live_..." 大致位于 (80, 560) —— 390x60px(已加内边距)
是否模糊这两个区域?[Y/n]
用户:Y
运行:
magick screenshot.png \
-region 320x65+430+210 -blur 0x20 \
-region 390x60+80+560 -blur 0x20 \
-strip -quality 85 screenshot-blurred.webp
✓ 完成。已保存至screenshot-blurred.webp
我已验证输出结果——两处区域均已模糊,周边内容完好。Red Flags
风险预警
Stop if you catch yourself:
- Running blur without showing the command first
- Using sigma < 10 (text may be recoverable with deblurring)
- Overwriting the original without flag
--overwrite - Blurring the entire image instead of specific regions
- Not reading the output image to verify the blur
- Using coordinates without adding padding
- Skipping to confirm image dimensions
magick identify - Not handling Retina/HiDPI resolution differences
如果出现以下情况请终止流程:
- 未先展示命令就运行模糊操作
- 使用的sigma值 < 10(可通过去模糊算法还原文本)
- 未加参数就覆盖原文件
--overwrite - 模糊整张图片而非特定区域
- 未读取输出图片验证模糊效果
- 使用坐标时未添加内边距
- 跳过确认图片尺寸
magick identify - 未处理Retina/HiDPI分辨率差异