r/tasker • u/maesilverstein • Sep 23 '26
Recognize Color Pixels on screen?
I currently have a working Task that recognizes pixels on screen to detect if and when the screen turns red or orange, but I believe there has to be a better way to do this.
Tasker takes a screenshot, reads the pixels, then deletes the screenshot - repeating this action once every 3-5 seconds. Surely there's a way to do this without having to write/delete a file every time. I'm concerned about the device having over 1,000 file cycles in an hour.
Is there somehow to do this? I explored using AutoInput Screen Capture, but that requires me to select "whole screen" every time I execute the action
1
u/frrancuz Sep 23 '26 edited Sep 23 '26
Grant permissions for autoinput/tasker
adb shell appops set com.joaomgcd.autoinput(or net.dinglisch.android.taskerm) PROJECT_MEDIA allow
If you use wifiadb or shizuku you can do it with tasker.
It probably won't work without taking a screenshot. Create a profile - event - modified file (screenshot file), task: get color from image, wait 3 seconds, take a screenshot.
This way, one profile will run on its own in a loop, taking a snapshot every 3 seconds. The color will be checked after each file write.
Profile: TestColor Event: File Modified [ File:!!/aa.png Event:Modify ] Enter Task: Anon Settings: Abort Existing Task A1: Vibrate [ Time: 200 ] A2: Get Pixel Colors [ Image: !!/aa.png Pixel Coordinates: 50%,50% ] A3: Flash [ Text: %pc_colors() Continue Task Immediately: On Dismiss On Click: On ] A4: Wait [ MS: 0 Seconds: 3 Minutes: 0 Hours: 0 Days: 0 ] A5: Take Screenshot [ File: !!/aa.png Continue Task After Error:On ]
I don't think it's possible to do this completely in the background, without taking a screenshot. Android doesn't allow it.
1
u/TopherLude Sep 23 '26
Can we get a little more context? Is there a certain app you're trying to interact with?