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

# Image exists

此操作可帮助工具快速"扫视"一次,查看目标图像是否正在屏幕上显示。返回的结果立即为 True(如果找到)或 False(如果未找到)。

* 区别之处:与 `Wait to image`(等待)不同,此操作不会停下来等待,而是仅在运行时刻扫描一次。
* 作用:非常适合与条件语句块(`If`、`Else if`)结合使用,帮助脚本立即做出智能决策(例如:如果看到弹出的广告就关闭它,如果没看到就执行其他步骤)。

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

> ⚠️ 关于缩放比例(Scale)的特别注意事项:您拍摄样本图像时的屏幕缩放百分比和浏览器分辨率必须与脚本实际运行时完全一致。如果您在拍摄样本图像时屏幕显示比例为 100%,但运行 Profile 时系统自动以 80% 或 125% 的缩放比例打开,图像扫描算法将无法识别目标的像素结构,从而导致结果出现偏差。

#### 实际示例:检测并关闭突然出现的广告通知(Popup)

当您浏览网页时,有时会有广告窗口或调查通知突然弹出并遮挡屏幕。如果出现广告,脚本需要点击"X"按钮将其关闭后才能继续运行;如果没有出现,脚本将跳过关闭步骤以节省时间。

* 配置方法:您拍摄一张关闭广告的"X"按钮的小样本图像,以便系统识别。
* 结果:系统将在该时刻扫描屏幕。如果出现"X"按钮,输出变量将获得值 `True`。您只需结合条件语句块 If(如果变量 = `True`),即可调用 Mouse click 操作点击该位置,在继续下一步之前清理屏幕。

> 💡 *关于样本图像区域配置(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-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.
