Skip to main content

Image/color matching

When the UI has no stable nodes (games, custom drawing, icon buttons), use image/color matching to locate small images on screen, then tap to act.

vs. node capture
MethodBest for
Node capture (fetch_nodes)Standard UI tree, text labels — most reliable
Template match (match_template_*)Fixed icons, button styles
Color-offset match (find_image_by_color_*)Transparent background, color-offset small images
OCRText recognition
VLM visual locateNatural language element location

Four-step pattern in workflows

Screenshot (optional) → Match → Match data extraction → Tap
  1. Match: Non-automation template match / Automation template match, or color-offset equivalents
  2. Match data extraction (pick_match): take center point or highest similarity match from results
  3. Tap: click_point reads previous step variable

You can skip a separate screenshot step: match steps auto-capture current screen when no “reference screenshot variable” is set.

Template match vs. color-offset match

StepAlgorithmTemplate traits
match_template_no_auto / _autoOpenCV template matchNormal PNG/JPG icons
find_image_by_color_no_auto / _autoColor-offset matchTransparent, semi-transparent, large color deviation

Naming matches screenshot/OCR:

SuffixAutomation required?
Non-automation (Bridge capture)No
Automation (Agent capture)Yes (run Start automation environment first)

Where template images come from

MethodDescription
Local pathSet templatePath relative to flow working directory, e.g. assets/templates/btn_ok.png
Base64Advanced: templateBase64 embeds small image directly
Editor preview cropTrial device online → step card Match preview → select region → Crop image save as template

Recommended: under Flow config → Working directory, create assets/templates/ and backup templates with the flow.

Match preview (editor)

With match or color-offset step selected and trial device chosen:

ButtonAction
Match previewCapture + match; show match boxes on canvas
Region selectDraw search area on large image; writes step region
Crop imageSave selected region as template file
Re-matchRe-run match after screen change

Color-offset steps have the same preview; parameter area has color tolerance, direction, etc.

Main parameters (reference)

Template match match_template_*

ParameterDescription
saveAsResult variable name (required)
templatePath / templateBase64Small image (one required)
imageFromParamOptional; reference previous screenshot variable’s imageBase64
regionOptional; search only within screen rectangle
weakThreshold / thresholdSimilarity threshold (default ~0.9)
limitMax matches returned

Color-offset match find_image_by_color_*

ParameterDescription
saveAsResult variable name
templatePath / templateBase64Color-offset small image
colorOffsetColor tolerance
directionSearch direction (0–3)
limitMax points returned

Match data extraction pick_match

ParameterDescription
fromParamPoints to earlier match saveAs
saveAsOutput coordinate variable
pick.modecenter (center point), best (highest similarity), find (by condition + index)

Match result x/y is template top-left; for button center use pick_match center mode.

Typical flow examples

Fixed icon button:

  1. match_template_no_auto → save as match_1
  2. pick_match: fromParam=match_1, mode=centerbtn_point
  3. click_point: fromParam=btn_point

Capture first, match on same image:

  1. capture_screen_no_autoscreen_1
  2. match_template_no_auto: imageFromParam=screen_1
  3. Continue as above

What to say in AI chat

With LLM configured:

  • “On first device do non-automation template match, template is xxx.png”
  • Automation template match login button, then tap center”

Complex template crop and region limits are easier in Workflow editor Match preview.

FAQ

SymptomFix
No match foundLower threshold, narrow region, clearer template; for color-offset images try color-offset match
Automation match failsStart automation environment first; or use non-automation template match
Tap offsetUse pick_match center; don’t use match top-left directly
Template path not foundConfirm working directory + assets/templates/ path

More step fields: Workflow step reference.