vision-skills
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesevision-skills
vision-skills
Five local CLIs that give a text-only agent eyes. They read one shared
vision config ( / / /
), plus the optional Python-client settings ,
, and — no extra credentials.
VISION_API_KEYVISION_BASE_URLVISION_MODELLANGVISION_API_PROTOCOLVISION_REASONING_EFFORTVISION_USER_AGENTPick the tool by the question you are answering:
| Question | Tool |
|---|---|
| "What does this image show / say?" | |
| "Where is X?" — a thing you can name | |
| "Where are all the Xs?" — every instance of a kind | |
| "What is its exact shape, size, offset?" | |
| "Cut this box out as its own image file" | |
| "OCR this long screenshot / scrolling page / chat history" | |
| "Extract the icon/logo foreground as transparent PNG — manual region or auto (cropped+scaled screenshots)" | |
| "Turn this HTML file into a viewport or full-page screenshot" | |
| "Which colours dominate a region, and which palette value fits it?" | |
| A relation none of them return — a gap, a distance between two located things | code over the pixels (Pillow) |
glancegrounddetectgrounddetectBoth give real coordinates, but they are not pixel-exact: the box arrives
on a 0-1000 grid and is scaled to your image, so the last pixel or few are
not reliable. That is accurate enough to crop with, to click, to compare
positions against. When a number has to be exact, derives it from
the actual pixels — offsets, sizes, shapes.
trace这是一套为纯文本Agent赋予视觉能力的本地CLI工具集。它们读取统一的视觉配置项( / / / ),以及可选的Python客户端配置项、和——无需额外凭证。
VISION_API_KEYVISION_BASE_URLVISION_MODELLANGVISION_API_PROTOCOLVISION_REASONING_EFFORTVISION_USER_AGENT根据你要解答的问题选择对应工具:
| 问题 | 工具 |
|---|---|
| "这张图像展示/包含什么内容?" | |
| "X在哪里?"——某个可命名的事物 | |
| "所有的X都在哪里?"——某类事物的全部实例 | |
| "它的确切形状、尺寸、偏移量是多少?" | |
| "将这个框内的内容裁剪为独立图像文件" | |
| "OCR识别长截图/滚动页面/聊天记录" | |
| "提取图标/Logo前景为透明PNG——手动指定区域或自动识别(裁剪+缩放截图)" | |
| "将HTML文件转换为视口截图或全页截图" | |
| "某个区域的主导颜色是什么,哪个调色板颜色与之匹配?" | |
| 上述工具均无法返回的关系——比如两个定位对象之间的间隙、距离 | 基于像素的代码(Pillow) |
glancegrounddetectgrounddetect两者都会返回真实坐标,但并非像素级精确:返回的框基于0-1000网格,并会缩放适配你的图像,因此最后几个像素的数值不可靠。但这个精度足以满足裁剪、点击、位置对比等需求。当需要精确数值时,会从实际像素中提取——包括偏移量、尺寸、形状。
traceUse the provided tools before hand-rolled pixels
优先使用内置工具,而非自定义像素操作
Everything this toolkit ships a tool for, call the tool — do not rewrite
it with Pillow in the middle of a task. The CLIs exist so the same pixel
work is not hand-coded differently every time:
- cut a box out of an image → , not
cropImage.open(...).crop(...) - sample a region's palette →
scripts/dominant_colors.py - compare two images →
scripts/pixel_diff.py - vectorize to SVG →
trace - locate / inventory elements → /
grounddetect - describe / OCR an image →
glance - safely split, OCR, and merge a long screenshot →
scripts/long_screenshot_ocr.py - HTML file to a viewport or full-page screenshot →
scripts/html_shot.py
Hand-written Pillow is only for what none of them return: a relation
between two things you already located (a gap, a distance), a resize or
overlay, drawing. If you catch yourself writing , ,
or histogram code where one of the tools above fits, replace it with the
tool call — same coordinates, same box format, and the output feeds the
next tool directly.
.crop().convert()对于本工具包已提供对应工具的任务,请直接调用工具——不要在任务中手动用Pillow重写实现。这些CLI工具的存在就是为了避免每次都重复编写不同的像素处理代码:
- 从图像中裁剪区域 → 使用,而非
cropImage.open(...).crop(...) - 提取区域调色板 → 使用
scripts/dominant_colors.py - 对比两张图像 → 使用
scripts/pixel_diff.py - 矢量化为SVG → 使用
trace - 定位/盘点元素 → 使用/
grounddetect - 描述/OCR识别图像 → 使用
glance - 安全拆分、OCR识别并合并长截图 → 使用
scripts/long_screenshot_ocr.py - 将HTML文件转换为视口或全页截图 → 使用
scripts/html_shot.py
手动编写Pillow代码仅适用于上述工具均无法处理的场景:比如两个已定位对象之间的关系(间隙、距离)、图像缩放或叠加、绘图等。如果你发现自己在编写、或直方图代码,而上述工具可以满足需求,请替换为工具调用——它们使用相同的坐标和框格式,输出结果可直接用于下一个工具。
.crop().convert()glance — ask about an image
glance — 针对图像提问
bash
glance <image> # detailed description
glance <image> -q "<question>" # targeted question (qualitative only)
glance <image> --ocr # verbatim OCR
glance <image> --region X1,Y1,X2,Y2 -q "..." # zoom into a crop
glance <img1> <img2> -q "..." # compare in ONE callWhen you do compare with , pass all paths to one call — separate
calls cannot see both images, so two descriptions compared afterwards are
two hallucination surfaces, not a comparison. uploads only the
crop, so small text and icons become readable.
glance--regionBut "what changed between these two?" is not a glance question. A one-word
badge or a small shift is a rounding error to a vision model and exact to
. Diff first to get the box, then
that box to read what the change actually is.
scripts/pixel_diff.pyglance --regionFor a tall scrolling screenshot, do not send the whole image through one OCR
call and accept the model's downscaling loss. Run the long-screenshot workflow,
which finds low-content cut bands, invokes on each chunk, uses
structured extraction for chat histories, merges only duplicated overlap, and
writes a boundary audit:
glancebash
python3 scripts/long_screenshot_ocr.py work/page.png -o work/page.ocr.md
python3 scripts/long_screenshot_ocr.py work/chat.png --mode chat --resume -o work/chat.ocr.mdRead before using it. It defines the
verification pass for unsafe cuts and chat-message boundaries.
references/long-screenshot-ocr.mdbash
glance <image> # 生成详细描述
glance <image> -q "<question>" # 针对性提问(仅定性问题)
glance <image> --ocr # 逐字OCR识别
glance <image> --region X1,Y1,X2,Y2 -q "..." # 放大指定裁剪区域进行提问
glance <img1> <img2> -q "..." # 一次调用完成图像对比使用进行对比时,请将所有图像路径传入同一个调用——分开调用无法同时查看两张图像,后续对比两个描述会增加幻觉风险,而非直接对比。参数仅上传裁剪区域,因此小文本和图标会更清晰可读。
glance--region但“这两张图像有什么变化?”并非擅长的问题。一个单词的徽章或微小的位移对视觉模型来说是误差,但对来说是精确的。应先使用差异工具获取变化区域的框,再用查看该区域的具体变化内容。
glancescripts/pixel_diff.pyglance --region对于长滚动截图,不要通过单次OCR调用发送整个图像并接受模型的缩放损失。请运行长截图工作流,该工作流会找到低内容分割带,对每个片段调用,针对聊天记录使用结构化提取,仅合并重复重叠部分,并生成边界审计报告:
glancebash
python3 scripts/long_screenshot_ocr.py work/page.png -o work/page.ocr.md
python3 scripts/long_screenshot_ocr.py work/chat.png --mode chat --resume -o work/chat.ocr.md使用前请阅读,其中定义了不安全分割和聊天消息边界的验证流程。
references/long-screenshot-ocr.mdground — locate a named target
ground — 定位指定目标
bash
ground <image> "<target description>"
ground <image> "<target>" --region X1,Y1,X2,Y2Output: in original-image pixels — with
too (crop hits are mapped back).
x1: .., y1: .., x2: .., y2: ..--regionProvider-native 0-1000 boxes do not all use the same array order: Gemini uses
, while Qwen3-VL, Qwen3.5, and Qwen3.6 use
. Grounding code must select the order by model family (or
an explicit override) before scaling to pixels; never parse every provider as
Gemini-style .
[y0, x0, y1, x1][x0, y0, x1, y1]yxyxIf several boxes come back numbered, your description matched more than
one element rather than picking out a single thing. Narrow it with what
distinguishes the one you mean — its text, its position, the block it sits
in — and ask again.
The box is a handle, not just an answer — it feeds the next call:
bash
$ ground screenshot.png "the send button"
x1: 1067, y1: 841, x2: 1108, y2: 881
$ glance screenshot.png --region 1067,841,1108,881 -q "is it enabled or greyed out?"That two-step is how you inspect anything too small to survive a
full-image pass.
bash
ground <image> "<target description>"
ground <image> "<target>" --region X1,Y1,X2,Y2输出结果:(原始图像像素坐标)——即使使用参数,裁剪区域内的命中结果也会映射回原始图像坐标。
x1: .., y1: .., x2: .., y2: ..--region不同提供商的原生0-1000格式框使用的数组顺序不同:Gemini使用,而Qwen3-VL、Qwen3.5和Qwen3.6使用。定位代码必须根据模型家族(或显式覆盖)选择正确的顺序,再缩放为像素坐标;切勿将所有提供商的格式都解析为Gemini风格的。
[y0, x0, y1, x1][x0, y0, x1, y1]yxyx如果返回多个带编号的框,说明你的描述匹配了多个元素,而非单个目标。请通过区分目标的特征(文本、位置、所在区块)来缩小范围,重新尝试。
返回的框不仅是答案,还可以作为下一次调用的输入:
bash
$ ground screenshot.png "发送按钮"
x1: 1067, y1: 841, x2: 1108, y2: 881
$ glance screenshot.png --region 1067,841,1108,881 -q "它是启用状态还是灰色禁用状态?"这种两步操作是检查任何小到无法在全图像调用中清晰显示的元素的可靠方法。
detect — find every instance of a kind
detect — 找到某类事物的所有实例
bash
detect <image> # every UI element
detect <image> "buttons" # one kind only
detect <image> --region X1,Y1,X2,Y2 # inside one boxYou name a particular thing for ; you name a kind for and
it enumerates the instances. Output is a numbered list with each item's
visible text and box. A full-screen
pass is a fast first draft — counts vary run to run on dense screens. For
completeness, detect the layout blocks first, then each
block.
grounddetectdetect --regionbash
detect <image> # 识别所有UI元素
detect <image> "buttons" # 仅识别按钮类元素
detect <image> --region X1,Y1,X2,Y2 # 仅在指定框内识别使用时指定特定事物;使用时指定事物类别,它会枚举所有实例。输出结果为带编号的列表,包含每个元素的可见文本和框坐标。全屏幕扫描是快速生成初稿的方式——在密集屏幕上,每次运行的计数可能略有不同。为确保完整性,可先识别布局区块,再对每个区块调用。
grounddetectdetect --regiontrace — exact shape geometry (local, no vision API)
trace — 精确形状几何信息(本地工具,无需视觉API)
bash
trace <image> # b/w spline SVG to stdout
trace <image> --polygon # boxy diagrams/wireframes
trace <image> --region X1,Y1,X2,Y2 -o out.svg # crop firstCoordinates come from the actual pixels, not a model's estimate. Flat,
high-contrast graphics only; text becomes curves (pair with when
the text matters). Small images are upscaled automatically before tracing,
so a 30px icon traces as readily as a screenshot — size is not a reason to
skip the tool. Before shipping or reusing a traced SVG, read
— it holds the reuse traps and the
ship-vs-hand-write call.
--ocrreferences/restore-graphic.mdbash
trace <image> # 生成黑白样条曲线SVG并输出到标准输出
trace <image> --polygon # 适用于方正的图表/线框图
trace <image> --region X1,Y1,X2,Y2 -o out.svg # 先裁剪区域再生成SVG坐标来自实际像素,而非模型估算。仅适用于平面、高对比度图形;文本会转换为曲线(当文本重要时,请搭配使用)。小图像会自动放大后再进行矢量化,因此30px的图标可以像截图一样轻松处理——尺寸并非使用该工具的障碍。在交付或复用矢量化SVG前,请阅读——其中列出了复用陷阱和交付与手动编写的决策依据。
--ocrreferences/restore-graphic.mdcrop — cut a pixel box out of an image (local, no vision API)
crop — 从图像中裁剪像素框区域(本地工具,无需视觉API)
bash
crop <image> --region X1,Y1,X2,Y2 # writes <image-stem>.crop.png next to the input
crop <image> --region X1,Y1,X2,Y2 -o out.png
crop <image> --region X1,Y1,X2,Y2 --scale 4 # upscale the cut-out 4x (LANCZOS) firstThe same X1,Y1,X2,Y2 pixel boxes / print, clamped to the
image bounds. Once a box is worth keeping — the same crop is about to feed
, , and in turn — cut it to a file
once and reuse it, instead of re-cropping in memory on every call.
upscales the cut-out before writing (default output name becomes
): for icons too small for / to see
clearly, crop with , then run / on the upscaled
file — coordinates it returns are in the upscaled grid, divide by to map
back to the original image. Requires the optional .
grounddetectpixel_diffdominant_colorstrace--scale N<image-stem>.crop@Nx.pnggroundtrace--scale 4groundtraceNpillowbash
crop <image> --region X1,Y1,X2,Y2 # 在输入图像旁生成<image-stem>.crop.png文件
crop <image> --region X1,Y1,X2,Y2 -o out.png
crop <image> --region X1,Y1,X2,Y2 --scale 4 # 先将裁剪区域放大4倍(使用LANCZOS算法)再输出使用与/输出相同的X1,Y1,X2,Y2像素框,且会自动限制在图像边界内。当某个框需要重复使用——比如要依次传入、和——请先裁剪为文件并复用,而非每次调用都在内存中重新裁剪。参数会在写入前放大裁剪区域(默认输出名称为):对于小到/无法清晰识别的图标,可使用裁剪,再对放大后的文件运行/——返回的坐标基于放大后的网格,除以即可映射回原始图像。需要安装可选依赖。
grounddetectpixel_diffdominant_colorstrace--scale N<image-stem>.crop@Nx.pnggroundtrace--scale 4groundtraceNpillowextract_fg — icon foreground as transparent PNG: manual region or auto (local, no vision API)
extract_fg — 将图标前景提取为透明PNG:手动指定区域或自动识别(本地工具,无需视觉API)
bash
undefinedbash
undefinedmanual: you know the region (and optionally the background colour)
手动模式:你知道目标区域(可选指定背景色)
python3 scripts/extract_fg.py shot.png --region X1,Y1,X2,Y2 -o icon.png
python3 scripts/extract_fg.py shot.png --region X1,Y1,X2,Y2 --mode dark # grey/black line logos
python3 scripts/extract_fg.py shot.png --region X1,Y1,X2,Y2 --exclude-color '#E6E6E6'
python3 scripts/extract_fg.py shot.png --region X1,Y1,X2,Y2 -o icon.png
python3 scripts/extract_fg.py shot.png --region X1,Y1,X2,Y2 --mode dark # 适用于灰色/黑色线条Logo
python3 scripts/extract_fg.py shot.png --region X1,Y1,X2,Y2 --exclude-color '#E6E6E6'
auto: crop --scale
cut-outs with the icon centred — no region needed
crop --scale自动模式:使用crop --scale
裁剪出的居中图标——无需指定区域
crop --scalecrop shot.png --region X1,Y1,X2,Y2 --scale 4 -o d/icon1.png
python3 scripts/extract_fg.py d/icon1.png d/icon2.png # writes <stem>.clean.png next to each input
python3 scripts/extract_fg.py d/icon1.png --disc-radius 60
python3 scripts/extract_fg.py d/icon1.png --boxes "101,84,184,171"
Manual mode keeps every sufficiently large connected component of the
region (separate logo sub-shapes stay together; specks drop out). Auto mode
takes a `crop --scale` cut-out with the icon centred (disc + glyph): the
disc centre is the image centre, the disc radius defaults to
`min(w,h)/2 * 0.6`, and the disc colour is sampled from a ring around the
centre; that colour is excluded and the glyph is picked as the most
saturated among the three largest coloured components (white rings,
ripples, and text fall away), output as a 1:1 transparent PNG. When auto
inference fails, override the radius with `--disc-radius`, or pass a
`ground` box (in the upscaled grid) as `--boxes` to recentre and re-filter
by overlap. Multiple images may be passed at once (auto mode).
Requires the optional `pillow` (and `numpy` for auto mode).crop shot.png --region X1,Y1,X2,Y2 --scale 4 -o d/icon1.png
python3 scripts/extract_fg.py d/icon1.png d/icon2.png # 在每个输入文件旁生成<stem>.clean.png文件
python3 scripts/extract_fg.py d/icon1.png --disc-radius 60
python3 scripts/extract_fg.py d/icon1.png --boxes "101,84,184,171"
手动模式会保留区域内所有足够大的连通组件(独立的Logo子形状会保留,斑点会被剔除)。自动模式接受`crop --scale`裁剪出的居中图标(圆形+字形):圆心为图像中心,圆半径默认为`min(w,h)/2 * 0.6`,圆颜色从中心周围的环形区域采样;该颜色会被排除,字形会从三个最大颜色组件中选取饱和度最高的(白色环、波纹和文本会被剔除),输出为1:1的透明PNG。当自动识别失败时,可使用`--disc-radius`覆盖半径,或传入`ground`输出的框(基于放大后的网格)作为`--boxes`参数,重新居中并按重叠度过滤。可同时传入多个图像(自动模式)。需要安装可选依赖`pillow`(自动模式还需`numpy`)。html_shot — render an HTML file to an image (local, needs a Chrome-family browser)
html_shot — 将HTML文件渲染为图像(本地工具,需Chrome系列浏览器)
bash
python3 scripts/html_shot.py page.html # writes page.png, 1280x800
python3 scripts/html_shot.py page.html --width 1440 --height 900 -o page.png
python3 scripts/html_shot.py page.html --scale 2 # 2x pixels: small text stays readable
python3 scripts/html_shot.py page.html --full-page # complete scroll height, same layout viewport
python3 scripts/html_shot.py page.html --full-page --max-pixels 40000000The visual-alignment loop: write HTML, screenshot it at the reference
viewport, then compare it with the design. Use to locate
material differences, not to chase a zero-difference score. Rendering
happens in headless Chrome/Chromium/Edge — no Python dependencies. The default
captures only the viewport. Use for the complete document while
keeping and as the layout viewport, so / and
responsive breakpoints do not change. Add when the page height
is untrusted. pauses for fonts, images, or animation before
capturing. Paths are relative to this skill's own directory.
pixel_diff--full-page--width--heightvhsvh--max-pixels N--wait-ms Nbash
python3 scripts/html_shot.py page.html # 生成page.png,尺寸为1280x800
python3 scripts/html_shot.py page.html --width 1440 --height 900 -o page.png
python3 scripts/html_shot.py page.html --scale 2 # 2倍像素:小文本更清晰
python3 scripts/html_shot.py page.html --full-page # 完整滚动高度,保持布局视口不变
python3 scripts/html_shot.py page.html --full-page --max-pixels 40000000视觉对齐流程:编写HTML代码,在参考视口下生成截图,然后与设计图对比。使用定位实质性差异,而非追求零差异分数。渲染在无头Chrome/Chromium/Edge中进行——无需Python依赖。默认仅捕获视口内容。使用可捕获完整文档,同时保持和作为布局视口,确保/和响应式断点不变。当页面高度不可信时,添加参数。参数可在捕获前暂停,等待字体、图像或动画加载完成。路径相对于本技能工具集的目录。
pixel_diff--full-page--width--heightvhsvh--max-pixels N--wait-ms Npixel_diff — where two images differ (local, no vision API)
pixel_diff — 找出两张图像的差异(本地工具,无需视觉API)
bash
python3 scripts/pixel_diff.py <a> <b> # path is relative to this skill dirPrints an overall difference percentage plus the worst regions as
boxes you can feed straight into . Exact where a vision
model rounds off.
x1: ..glance --regionbash
python3 scripts/pixel_diff.py <a> <b> # 路径相对于本技能工具集目录输出整体差异百分比,以及差异最明显区域的框坐标,可直接传入。视觉模型会忽略的细微差异,该工具能精确识别。
x1: ..glance --regiondominant_colors — a region's palette, and the exact value among candidates (local, no vision API)
dominant_colors — 区域调色板,以及候选颜色中的精确匹配值(本地工具,无需视觉API)
bash
python3 scripts/dominant_colors.py <image> --region X1,Y1,X2,Y2 # top colour clusters + shares
python3 scripts/dominant_colors.py <image> --region X1,Y1,X2,Y2 \
--candidates '#F9FAFA,#F5F5F5,#F3F3F3,#EDEDED' # pick the best candidateA vision model names a colour ("light gray") but not its value. The first
mode downsamples, quantizes, and merges near-duplicates to list the region's
significant colours with the share each owns — the histogram shows which
colour is the background and which is the accent. Given the candidate palette
your label implies, the second mode scores each candidate by how close the
region's pixels are to it and prints the winner. Take the value from here,
never from 's prose. Paths are relative to this skill's own
directory.
glancebash
python3 scripts/dominant_colors.py <image> --region X1,Y1,X2,Y2 # 输出主要颜色聚类及占比
python3 scripts/dominant_colors.py <image> --region X1,Y1,X2,Y2 \
--candidates '#F9FAFA,#F5F5F5,#F3F3F3,#EDEDED' # 选出最匹配的候选颜色视觉模型会命名颜色(如“浅灰色”)但不会给出精确值。第一种模式会对图像降采样、量化并合并近似颜色,列出区域内的主要颜色及各自占比——直方图可显示背景色和强调色。当你知道候选调色板时,第二种模式会根据区域像素与候选颜色的接近度打分,并输出最佳匹配。请从此工具获取颜色值,而非的文本描述。路径相对于本技能工具集的目录。
glanceWork from a copy, not a temp path
基于副本操作,而非临时路径
If the image lives in a temp directory, before your first tool call on one, copy it somewhere durable and run everything against the copy — that is what keeps the image reachable later:
bash
cp "<the temp path>" work/shot.png
glance work/shot.png -q "..."Exception: the user asked for the image to stay in a temp folder.
如果图像位于临时目录,在首次调用工具前,请将其复制到持久化目录,并基于副本进行所有操作——这样可确保后续仍能访问该图像:
bash
cp "<临时路径>" work/shot.png
glance work/shot.png -q "..."例外情况:用户要求图像保留在临时文件夹中。
When you have a description instead of the image
仅拿到图像描述而非图像文件时
If an image reached you only as text — a description written by a person,
a tool, or another model — and the image's file path is visible in the
conversation, do not reason past a missing detail. Look again yourself:
- — one qualitative follow-up.
glance <path> -q "<the specific detail>" - then
ground <path> "<target>"— locate, then zoom. The reliable way to inspect one element closely.glance <path> --region <that box> -q "..."
If the file no longer exists, say so instead of guessing.
如果图像仅以文本形式传递——比如由人、工具或其他模型编写的描述——但对话中可见图像文件路径,请勿对缺失细节进行推理。请自行重新查看图像:
- ——一次定性跟进提问。
glance <路径> -q "<具体细节问题>" - ,然后
ground <路径> "<目标>"——先定位,再放大查看。这是近距离检查单个元素的可靠方法。glance <路径> --region <该框坐标> -q "..."
如果文件已不存在,请如实告知,不要猜测。
Coarse to fine — the method behind every task above
从粗到细——所有任务背后的方法
For a single question about an image, is the whole answer. For
anything multi-step, work outside-in:
glance- One full-image pass (, or a description you already have) for the layout and an inventory of what is where.
glance - For any element that matters, it, then zoom with
ground. Full-image passes routinely miss small text and icons; a crop puts all the pixels on one detail, so the model sees it at effectively higher resolution. When the same box will be checked more than once, cut it to a file first withglance --region <box> -q "...".crop - Never take a prose answer for a pixel-level fact — exact colors, small
offsets, sizes. Vision models confidently report styling that is not
there: coloured syntax highlighting in a monochrome code block, a border
that does not exist. Get the number from , from a
tracebox, or fromground; sample the pixels yourself only for what those cannot return.pixel_diff
对于单个图像问题,即可给出完整答案。对于多步骤任务,请遵循从外到内的流程:
glance- 先进行一次全图像扫描(或已有的描述),了解布局和元素分布。
glance - 对于任何重要元素,先用定位,再用
ground放大查看。全图像扫描通常会遗漏小文本和图标;裁剪区域可将所有像素聚焦于单个细节,让模型能以更高的有效分辨率查看。当同一个框需要多次检查时,请先用glance --region <框坐标> -q "..."裁剪为文件。crop - 切勿将文本描述作为像素级事实的依据——比如精确颜色、微小偏移量、尺寸。视觉模型会自信地报告不存在的样式:比如单色代码块中的彩色语法高亮、不存在的边框。精确数值请从、
trace框或ground获取;仅当这些工具无法返回时,才自行采样像素。pixel_diff
Use cases
使用场景
Each file below is one job, start to finish: when it applies, the call
sequence, and how to tell you got it right.
| The job | Read |
|---|---|
| OCR a long screenshot, scrolling page, or chat history without losing text at chunk boundaries | |
| Rebuild a page or component as HTML/CSS, including a roughly three-minute fast approximation mode, or align an existing UI with its reference image | |
| Extract or rebuild an icon, logo, illustration, or other isolated graphic as transparent PNG/SVG | |
| Turn a sketch, diagram, or whiteboard into Mermaid, Graphviz, or another structured representation | |
| Operate a GUI from screenshots — locate, act, verify each step | |
以下每个文件对应一个完整任务,包含适用场景、调用序列以及验证成功的方法:
| 任务 | 参考文档 |
|---|---|
| OCR识别长截图、滚动页面或聊天记录,避免在片段边界丢失文本 | |
| 将页面或组件重构为HTML/CSS,包括约三分钟的快速近似模式,或让现有UI与参考图像对齐 | |
| 提取或重构图标、Logo、插图或其他独立图形为透明PNG/SVG | |
| 将草图、图表或白板内容转换为Mermaid、Graphviz或其他结构化表示 | |
| 通过截图操作GUI——定位、执行操作、验证每一步 | |
Notes
注意事项
- Only PNG / JPEG / GIF / WebP images are supported.
- If a command is not found, the optional tools were not installed — report this to the user instead of improvising a replacement.
- If the vision API fails, relay the error faithfully; never fabricate image content.
Source repository: https://github.com/Anionex/agent-vision-toolkit
Installation guide: https://github.com/Anionex/agent-vision-toolkit/blob/main/AGENT_INSTALL.md
- 仅支持PNG / JPEG / GIF / WebP格式的图像。
- 如果命令未找到,说明可选工具未安装——请告知用户,不要自行替换实现。
- 如果视觉API调用失败,请如实传递错误信息;切勿编造图像内容。