> 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/image-exists.md).

# 图像存在

此操作帮助工具“快速瞥一眼”目标图像是否在屏幕上显示。返回的结果立即为 True（如果看到）或 False（如果没有看到）。

* 不同之处：与 `Wait to image`（等待）不同，此操作不会停止等待，而是在运行时仅扫描一次。
* 作用：非常适合与条件语句块（`If`, `Else if`）结合使用，帮助脚本立即做出智能决策（例如：如果看到广告弹窗则关闭，如果没有看到则执行其他步骤）。

> ⚠️ 特别注意缩放比例（Scale）：屏幕的百分比缩放和您拍摄样本时浏览器的分辨率必须与脚本实际运行时完全相同。如果在拍摄样本时您将屏幕显示设置为 100%，但在运行系统配置时自动打开为 80% 或 125% 的缩放，则图像扫描算法将无法识别目标的像素结构，从而导致结果偏差。

#### 实际示例：检查并关闭意外广告通知（Popup）

当您浏览一个网页时，有时会出现广告窗口或意外的调查通知遮挡屏幕。如果有广告，脚本需要点击“X”按钮将其关闭，然后再继续运行；如果没有，脚本将跳过关闭步骤以避免浪费时间。

* 配置方法：您拍摄一个小的“X”按钮的样本图像以供系统识别。
* 结果：系统将在那一刻扫描屏幕。如果出现“X”按钮，输出变量将接收值 `True`。您只需与条件语句块 If（如果变量 = `True`）结合使用，则会调用鼠标点击该位置以清理屏幕，然后再继续。

> 💡 *详细参数如样本图像区域（Image）、颜色偏差（Threshold）、真实颜色和输出变量（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/cao-zuo-zhi-nan/image-search/image-exists.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.
