Search code examples
pythonpyautogui

Pyautogui doesn't recognize own picture what is wrong?


im = pyautogui.screenshot(region=(802, 625, 45, 45))
im.save(r"C:\Users\Nanotech\Desktop\zax\boss.png")
if pyautogui.locateOnScreen('boss.png', region=(802, 625, 50, 50)):
    print("test")

this is my code and pyautogui doesn't recognize own picture, what is wrong on here ?


Solution

  • Adding confidence=0.9 is solved my problem but I was hoping the program would find it with the ss it got itself. A bit of a strange situation.