#๐ why is this not detecting the image with pyautogui
38 messages ยท Page 1 of 1 (latest)
@woven ginkgo
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

dont send .zip
bruh its literally .py there with .png
i sent coz its easier
Both the code and image can be posted here directly fairly trivially.
The code as text, and the image just as an image.
assume paths are correct
Click here to see this code in our pastebin.
lol kindoff yeah using image detection
but why its not detecting
its straight there in the picture
!rule 5 - then im afraid i cant help ya since it violates chess.com fair play 
5. Do not provide or request help on projects that may violate terms of service, or that may be deemed inappropriate, malicious, or illegal.
bruh my doubt is related to pyautogui lol
Ehh, I mean he could also just input the moves into a chess guide.
It's not like it's an effort to cheat in chess.
but can u all tell me the error ๐ญ
You're supposed to send us the error.
What's your issue?
More importantly, why do you want to do chess with image rec?
Traceback (most recent call last):
File "c:\Users\username.user\Desktop\Chess automator\this one.py", line 16, in <module>
pg.locate("black_pawn.png", "screenshot.png")
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\username.user\AppData\Roaming\Python\Python313\site-packages\pyautogui_init_.py", line 174, in wrapper
raise ImageNotFoundException # Raise PyAutoGUI's ImageNotFoundException.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pyautogui.ImageNotFoundException
That's so much resource for sth that doesn't need it.
That's simple. The image path is wrong.
whts right?
I don't know. Check the path of the images.
I can't see your pc man. You have to check the path of the images, and input it there correctly.
lol see screenshot is in same folder as the .py and pawn.png in /pieces
Pass the full path. Try that.
still/
Give me a sec. I'll try it on my side in a bit.
ty
lol it got solved actually i took more precise crop and it detected
This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.