> 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/cao-zuo-zhi-nan/image-search/example-combine-for-image.md).

# 图像组合示例

为了创建一个智能自动化脚本，流畅地处理网站或软件界面上的实际情况，将这三项操作结合在一个紧密的逻辑流中是最佳解决方案。

以下是对一般技术参数的详细解释以及设置实际脚本流的步骤。

#### 需要掌握的核心配置参数：

* Image (样本图像): 从屏幕上裁剪出的目标图像区域，用作系统的匹配数据。
* Timeout (超时): 系统搜索图像的最大时间限制（仅适用于 *Wait to image*）。
* Threshold (颜色偏差 / 容差): 像素匹配的准确率（通常设置在 `0.7` 到 `0.95` 之间）。数值越接近 `1`，实际图像必须与样本图像越绝对相似。您可以调整此值并测试，直到合适为止。
* True color: 强制系统必须准确匹配原始色彩范围的选项。如果关闭，系统将图像转换为黑白（灰度）以识别形状，从而加快扫描速度，但忽略颜色因素。
* Output variable (输出变量): 存储逻辑值（`True`/`False`）或存储坐标点（`X`, `Y`），具体取决于所选的操作。

### 实际问题：在 Pinterest 上自动点击“继续使用 Google”

**步骤 1: 使用 Wait to image 操作同步页面加载流**

在您点击 Pinterest 首页上的 *Sign up* 按钮后，注册表单需要短暂的时间来加载数据到屏幕上。

* 配置方法: 将样本图像（Image）指向文本行的标题或一个固定组件（继续使用 Google 按钮），确保它会出现在注册表单上。将超时时间设置为 `10`（10 秒），并设置合适的阈值（例如: `0.7`）。
* 逻辑运行: 脚本将暂停以观察屏幕。注册表单一旦显示，系统将立即激活下一步，而无需浪费时间等待。

**🔹 步骤 2: 使用 Image exists 操作检查按钮的存在性**

由于 Pinterest 可能会根据不同的 Profile 显示覆盖的电子邮件输入表单或其他导航消息，我们需要检查 Google 按钮是否确实在屏幕上。

* 配置方法: 将样本图像指向 Google 的四色字母 "G" 图标或“继续使用 Google”文本。配置输出变量以存储结果。
* 逻辑运行: 系统在此时快速扫描屏幕一次。如果 Google 按钮出现，输出变量将接收逻辑值 `True`（否则为 `False`）。

**🔹 步骤 3: 使用 If 语句过滤处理条件**

为了使脚本智能运行并避免点击失误，我们将交互步骤封装在条件语句块中。

* 配置方法: 添加 If 语句块并设置条件: 检查步骤 2 中的结果变量是否返回值 `True`（即 Google 按钮已在屏幕上准备好）。

**🔹 步骤 4: 在 If 语句块中使用 Image search 操作查找确切位置**

在 If 语句块内部，当条件满足时，系统开始追踪以获取按钮的坐标（因为注册表单的位置可能根据每个 Profile 的屏幕分辨率灵活移动）。

* 配置方法: 使用“继续使用 Google”按钮的样本图像或字母 "G" 的标志。设置 True color 为 `Yes` *(强制开启以准确识别 Google 的四种特征原色，避免与其他字符混淆)*. 设置输出变量以存储坐标为 `pos`。
* 逻辑运行: 系统扫描并准确计算 Google 按钮在屏幕上的中心点位置（例如: `$pos = 720,540`）。

**🔹 步骤 5: 使用 Mouse click 操作执行点击**

这是在 If 语句块中完成处理流的最后一步。

* 配置方法: 选择 Mouse click 操作，在坐标设置框中，您将上一步找到的变量直接传递到相应的框中: `$pos`。
* 逻辑运行: 系统中的鼠标将自动移动到扫描到的 Google 按钮的确切像素位置，并执行点击命令，以顺利通过 Iframe 层进行登录流。


---

# 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/cao-zuo-zhi-nan/image-search/example-combine-for-image.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.
