PyAutoGUI Image Recognition - Slight Issue With Pixel Color Matching
Solution 1:
Try this below ( see here: http://pyautogui.readthedocs.io/en/latest/screenshot.html )
From the comment I know that you have tried that and this didn't solved the issue in your case.
Another idea which could help is when you crop the image of the button down to an absolute minimum required to find it on screen. Usually the colors near the center are more "stable" than shadows.
From the comment I know, that this hasn't solved your issue either.
Do you allow TRANSPARENCY for Windows in your OS (transparency is when you can "see" through what the current application displays what is in background of the window of this application - is a feature which is a default value in many versions of newest operating systems)?
From the comment I know you do.
This can lead to severe recognition problems. Reducing (to what level?) transparency didn't solved the issue, what means that the only right way to go is:
Switch the transparency feature OFF to get stable colors
That's it - problem solved (how to do that for your specific system is another question not related to the subject of image recognition).
All or one from this above should solve your problem and if not you will be probably forced to do own image recognition using another image processing tools next to pyautogui
.
ADDENDUM: The shape and color of an [OK] button can depend on many things. If displayed in an Internet browser it can change its size with resizing the page. If a user dialog is created by different applications the shape and color of an [OK] button can also be different if the application doesn't use the system stadards. And as said above the colors can vary if the system uses the transparency feature.
Post a Comment for "PyAutoGUI Image Recognition - Slight Issue With Pixel Color Matching"