Check for img

33 views
Skip to first unread message

deduijk

unread,
Aug 11, 2026, 5:32:27 AM (2 days ago) Aug 11
to Automate for Android
I have searched, but i couldn't find any way to check for the existence of an img in the loaded image?

Current
Currently i have a flow that checks if a certain button is present on the screen.
I am using this flow (simplified):
  • check if certain app is running
  • screenshot
  • load image
  • for each (looping 4 different points.. currently the button appears in a fixed place). 
    • check pixel color 
    • store expression is true result (checking the color is withtin a certain rgb value, a certain brightness etc)
  • unload img
  • 'check returned colors' if at least 3 of 4 match: click the button
3 issues: 
  1. the flow is pretty slow
  2. if the button moves this will no longer work (and button can move in certain situations)
  3. [occasional false-positves (very rarely)]
What i''d like to do is make a cropped img of the button and check if the button is present on screen (maybe on part of the screen to make it faster if needed).

Not having a for...each will save a little time and i wouldn't have to worry about false-positives (very occasionally happening) and the button moving.

I did notice making the screenshot is very time consuming. I wish there was another way to do this, but ocr and img sample color both seem to need it.. they seem unable to pick it up live from the screen?

Thanks for the help!! 
C:-)

Henrik "The Developer" Lindqvist

unread,
Aug 12, 2026, 10:10:48 AM (yesterday) Aug 12
to Automate for Android
None of the blocks are designed for your use-case, hence they're not optimized for it.
Reading the screen directly, without using screenshots, is no longer possible without use confirmation/interface each time.
Message has been deleted

deduijk

unread,
Aug 12, 2026, 6:02:40 PM (17 hours ago) Aug 12
to Automate for Android
Thanks for your response.


I might not have been completely clear, but the button is at a fixed position 90% of the time. When it diverts i click it manually or not at all. that's fine.
The '4 point for each'-is to check several points of the button; when 3 of 4 checks match certain color and brightness -> the button is there.

Screenshot block the main bottleneck, other things go fine
I've run it more times now and it's working fine, except for the block taking the screenshot; that takes near 3 seconds.. which seems to be the only way to use ocr or image sample color(??!) 
I hope there is something that can be done (on my side or otherwise..?) to speed that up.., or if there is a work-arround.
NOTE: the screenshot seems to be taken, but for the flow to continue it takes longer. Which sometimes results in the flow being behind on reality;
  • *Button is present at the time of the screenshot, 
  • then 2-3 seconds later the next blocks run. 
  • =>At that point the button can already be gone on screen, but the screenshot still sees it, so it initiates a click
So might not be the screenshot taking long, but something else in that block? 

Xpath [interact block?]
I cannot use xpath, since it's a custom draw interface [so it seems]; inspect returns a near blank xml, except for some general android stuff i think -Or i am not doing it correctly, that is also a possibility-.
(else i would have used that ['interact'-block]  and left the screenshot, load img etc out of it.. would have saved a lot of ""coding"").

OCR 
Besides that; if there is an OCR block that requires taking a screenshot.. i would expect that block to perform as well? :).


"Reading the screen directly no longer possible"  => due to new security in android in the higher versions?



Thanks once again for the response. Hope a deeper dive is possible ☺


Op woensdag 12 augustus 2026 om 16:10:48 UTC+2 schreef Henrik "The Developer" Lindqvist:
Reply all
Reply to author
Forward
0 new messages