Nain57 / Smart-AutoClicker

An open-source auto clicker on images for Android
GNU General Public License v3.0
1.44k stars 287 forks source link

Transparent images/icons not detected as condition #402

Open 0lm opened 3 months ago

0lm commented 3 months ago

Describe the bug Image Condition which have transparence are not detected, because the colors in the transparent area change according to background changes (or moving icon). To Reproduce Steps to reproduce the behavior:

  1. Any App or Game which have a transparent images/icons (example: a circle image, but inside its filled with transparency)
  2. Create Smart Macro and select the transparent icon on the screen and set it as a click condition.

Expected behavior Detection.

Detection scenario Not necessary, since this is not limited to a certain scenario of mine, but to all scenarios which have transparent image conditions.

Screenshots Not needed, see "Detection Scenario"

Smartphone (please complete the following information): This issue is independent from phone model.

Cyber5imon commented 2 weeks ago

Because the selected area is a rectangle, the icon background will affect the detection as you mentioned.

Creating the ability to scan for custom shaped objects is not possible at this time.

Your best option is to zoom in the screen capture so you are only checking the icon with as little background showing as possible, and set the tolerance to 20% allowing more changes to the background. You may still need to create 3 conditions for light, medium, and dark backgrounds.

0lm commented 2 weeks ago

You may still need to create 3 conditions for light, medium, and dark backgrounds.

That sounds like a good idea. By now, I solved the issue by zooming in even more. Instead of trying to capture the whole symbol, I focused on a certain unique part of it, to have a bigger share of the actual symbol on the scereenshot, reducing the share of background-waste (which is caused by its transparency). Then allowing 20% change, it finally worke dproperly.

I was actually hoping for an updated feature, that allows more 'change'. Instead limiting to 0%-20%, why not just do 0%-100%, so people can set things the way it works for them. That aside, adding custom image (not screenshots, but actual images) as conditions could work, too. This way, one would be able to add transparent images as conditions, and the AutoClicker would look for that image on the screen.

And in general: I think this app is awesome and thank you to all contributors. And I hope my suggestions are taken as ideas for improvement and not as complaints.