blur-image

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Blur 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
<name>-blurred.webp
by default, not overwriting the original. If the user expects in-place editing, they need
--overwrite
.
使用AI视觉 + ImageMagick 检测并模糊截图中的敏感区域。
公告: "我正在使用blur-image技能识别并模糊敏感区域。"
适用场景: 模糊、遮蔽、匿名化、隐藏截图中的文本、准备待分享的图片、移除图片中的PII。
不适用场景: 裁剪、调整大小、格式转换、色彩调整或其他非隐私相关的图片编辑。
常见误区: 默认输出文件名为
<name>-blurred.webp
,不会覆盖原文件。如果用户需要原地编辑,需要添加
--overwrite
参数。

Critical Rules

关键规则

AlwaysNever
Check
which magick
before running; if missing, provide install instructions and stop
Run blur without user confirmation
Show the generated command before executingOverwrite the original file without
--overwrite
flag
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
-quality 85
Blur decorative/non-sensitive content without asking
Add 30-50px padding around detected regions, clamped to image edgesTrust raw AI coordinates without padding (20-50px error margins)
Read output image after blurring to verify correct regions were blurredSkip the verification step
Get image pixel dimensions with
magick identify
before generating coordinates
Assume coordinates without checking actual image dimensions
必须遵守禁止
运行前先检查
which magick
,如果未安装,提供安装指引后终止流程
未经用户确认就运行模糊操作
执行前先展示生成的命令未加
--overwrite
参数时覆盖原文件
处理隐私敏感内容时sigma值 >= 15(sigma值过低可被逆向还原)使用sigma < 10(可通过去模糊算法逆向还原内容)
输出保存为WebP格式,质量参数为
-quality 85
未经询问就模糊装饰性/非敏感内容
在检测到的区域四周添加30-50px的内边距,边界不超出图片边缘直接使用AI输出的原始坐标,不添加内边距(存在20-50px的误差范围)
模糊处理后读取输出图片,验证正确区域已被模糊跳过验证步骤
生成坐标前使用
magick identify
获取图片像素尺寸
不检查实际图片尺寸就假设坐标

Flags

参数

FlagBehavior
(none)Full workflow: preflight, auto-detect, confirm, blur, verify
--guided
Skip auto-detection, ask user what to blur
--overwrite
Replace original file instead of creating
-blurred
copy
--solid
Use
-fill black -colorize 100
instead of Gaussian blur (more secure — can't be reversed)
--dry-run
Generate and show the command but don't execute it
参数行为
(无)完整工作流:前置检查、自动检测、用户确认、模糊处理、结果验证
--guided
跳过自动检测,询问用户需要模糊的内容
--overwrite
替换原文件,而非生成带
-blurred
后缀的副本
--solid
使用
-fill black -colorize 100
纯黑色填充代替高斯模糊(安全性更高,无法逆向还原)
--dry-run
生成并展示命令,但不执行

Phase 1: Preflight

阶段1:前置检查

Check that ImageMagick is installed and the image is valid.
  1. Run
    which magick
    . If missing, show install instructions and stop:
  2. Run
    magick identify -format '%wx%h\n' image.png
    — 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
    -region
    blur only affects the first frame
  3. Report dimensions to confirm the coordinate space — Retina/HiDPI screenshots may be 2x logical resolution
检查ImageMagick是否已安装,图片是否有效。
  1. 运行
    which magick
    ,如果未找到,展示安装指引后终止流程
  2. 运行
    magick identify -format '%wx%h\n' image.png
    —— 该命令会验证文件是否存在、格式是否支持(png、jpg、jpeg、webp、tiff),并一步返回像素尺寸。如果命令输出多行,说明图片是动图(GIF、动图WebP、APNG)—— 终止流程并告知用户,因为
    -region
    模糊仅会作用于第一帧
  3. 告知用户图片尺寸以确认坐标空间——Retina/HiDPI截图的物理分辨率可能是逻辑分辨率的2倍

Phase 2: Identify Regions

阶段2:识别区域

Two modes depending on flags and user input.
根据参数和用户输入分为两种模式。

Mode A — Auto-detect (default)

模式A — 自动检测(默认)

  1. Read the image using multimodal vision
  2. 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
  3. For each region, determine the bounding box
    (x, y, width, height)
    in pixels from top-left origin (ImageMagick's coordinate system)
  4. 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)
  5. 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)
  6. Ask user to confirm which regions to blur
  7. If no sensitive content found, report that and offer
    --guided
    mode
  1. 使用多模态视觉能力读取图片
  2. 识别包含敏感文本的区域:
    • 邮箱地址
    • API keys、tokens、密钥
    • 带凭证或内部主机名的URL
    • 个人姓名、电话号码
    • IP地址
    • 带用户名的文件路径
    • 密码、数据库连接字符串
  3. 针对每个区域,确定基于左上角原点(ImageMagick的坐标系)的 bounding box 坐标
    (x, y, width, height)
    (单位为像素)
  4. 为每个检测到的区域的四边添加30-50px的内边距——AI空间检测存在20-50px的误差范围。调整坐标确保区域不超出图片边界(X >= 0, Y >= 0, X+W <= 图片宽度, Y+H <= 图片高度)
  5. 展示检测结果:
    我找到了N处包含敏感文本的区域:
    1. [内容描述] 大致位于 (X, Y) —— 尺寸WxH(已加内边距)
    2. [内容描述] 大致位于 (X, Y) —— 尺寸WxH(已加内边距)
  6. 询问用户确认需要模糊的区域
  7. 如果未检测到敏感内容,告知用户并提供
    --guided
    模式选项

Mode B — User-guided (
--guided
or when user specifies what to blur)

模式B — 用户引导(
--guided
或用户指定模糊内容时)

  1. User describes what to blur: "blur the email in the top right" or "blur everything below the header"
  2. Read the image, locate the described content
  3. Propose padded coordinates and ask user to confirm
  1. 用户描述需要模糊的内容:「模糊右上角的邮箱」或「模糊头部以下的所有内容」
  2. 读取图片,定位描述的内容
  3. 提供添加内边距后的坐标,询问用户确认

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.webp
Solid fill (
--solid
flag):
bash
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:
    <original-name>-blurred.webp
    alongside the original (
    -strip
    removes EXIF metadata)
  • 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
纯色填充(
--solid
参数):
bash
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
    -strip
    参数会移除EXIF元数据)
  • 运行前展示完整命令和输出路径
  • 询问:「是否运行该命令?模糊后的图片将保存至 [path]。」

Phase 4: Execute and Verify

阶段4:执行与验证

  1. Run the command
  2. Read the output image to verify blur was applied to the correct regions
  3. If any text is still visible or wrong area was blurred, offer to adjust coordinates (increase padding or shift position) and re-run
  4. Report success with the output file path
  1. 运行命令
  2. 读取输出图片,验证模糊已应用到正确区域
  3. 如果仍有文本可见或模糊了错误区域,提供调整坐标(增加内边距或调整位置)并重跑的选项
  4. 报告执行成功,告知输出文件路径

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
    --overwrite
    flag
  • Blurring the entire image instead of specific regions
  • Not reading the output image to verify the blur
  • Using coordinates without adding padding
  • Skipping
    magick identify
    to confirm image dimensions
  • Not handling Retina/HiDPI resolution differences
如果出现以下情况请终止流程:
  • 未先展示命令就运行模糊操作
  • 使用的sigma值 < 10(可通过去模糊算法还原文本)
  • 未加
    --overwrite
    参数就覆盖原文件
  • 模糊整张图片而非特定区域
  • 未读取输出图片验证模糊效果
  • 使用坐标时未添加内边距
  • 跳过
    magick identify
    确认图片尺寸
  • 未处理Retina/HiDPI分辨率差异