> For the complete documentation index, see [llms.txt](https://docs.gpmautomate.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/image-search/image-search.md).

# Image search

这是一个高级动作，可以扫描整个屏幕，找到目标图像的位置，并准确返回该图像中心的坐标（X, Y）。

* 作用：当网站或应用程序没有 HTML 标签时（例如游戏、旧版应用程序或 canvas 图表），这是一种"救命"解决方案。您可以用它来确定坐标，从而要求工具准确点击到该位置。

🎥 观看更多教学视频：[点击这里](https://youtu.be/xWu0g35YTGo)。

> ⚠️ 关于缩放比例（Scale）的特别说明：您拍摄样本图像时的屏幕缩放百分比和浏览器分辨率，必须与脚本实际运行时的设置完全一致。如果您拍摄样本图像时屏幕显示为 100%，但运行 Profile 时系统自动以 80% 或 125% 的缩放比例打开，图像扫描算法将无法识别目标的像素结构，从而导致找不到坐标。

#### 实际案例：查找屏幕上移动物体的位置以进行鼠标点击

假设您正在一个游戏赢奖网站或应用程序上运行脚本，其按钮位置会实时不断变化，而不是固定在某个地方。您需要找出该按钮的位置以便控制鼠标点击它：

* 配置方法：您拍摄该按钮的样本图像作为搜索目标。
* 结果：执行时，系统会快速扫描屏幕。如果找到该按钮，它会立即计算出像素坐标（例如：`X = 550`，`Y = 420`），并将这两个值保存到输出的 System Variables 中。之后，您可以调用 Mouse move 或 Mouse click 动作，直接传入这两个坐标变量 `X` 和 `Y`，鼠标便会自动找到并准确点击到目标位置。

> 💡 *关于样本图像区域配置（Image）、颜色偏差（Threshold）、True color 以及输出变量（Output）等详细参数，将在结合 Wait to image、Image exists 和 Image search 这三个动作的组合使用指南中深入分析。*


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/image-search/image-search.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
