Page 2 of 2

Re: [Class] graphicsearch.ahk (ImageSearch strings)

Posted: 18 Jun 2020, 08:15
by malcev

Re: [Class] graphicsearch.ahk (ImageSearch strings)

Posted: 18 Jun 2020, 09:14
by boiler
You could create a thread in the Wish List sub-forum. However, I don’t think asking lexikos to change the language will yield results based on his statements regarding his focus on v1 vs. v2. Perhaps it would be considered for v2. It certainly wouldn’t be implemented soon in any case, so I wouldn’t go that route if you’re looking for a near-term solution.

Re: [Class] graphicsearch.ahk (ImageSearch strings)

Posted: 18 Jun 2020, 09:23
by malcev
IMHO AHK v2 if ever will be finished long time will be less popular than Ahk v1 (more complex syntax, less user libraries).
But add possibility to use pBitmap in imagesearch - it is a couple lines of code.

Re: [Class] graphicsearch.ahk (ImageSearch strings)

Posted: 23 Jun 2020, 07:46
by Chunjee
0.3.3 is now on npm and github.

FeiYue answered my question about joinqueries/joinText which is now described in the documentation as: Whether or not to search each query in succession. Queries must be in close proximity (like characters in a string)

The code has reverted to this being defaulted to 0
I will make a tutorial on this in more detail in the future.

Re: [Class] graphicsearch.ahk (ImageSearch strings)

Posted: 20 Jun 2021, 07:03
by skripter31
Thanks for the script. It looks great, but I couldn't install it. Would it be possible to provide an easier installation rather than npm?

When I tried to open test-all.ahk it said Include file C:\xx\node_modules\graphicsearch.ahk\node_modules cannot be opened. The program will exit.

Re: [Class] graphicsearch.ahk (ImageSearch strings)

Posted: 21 Jun 2021, 17:03
by Chunjee
I will update the README to read:
In your code only export.ahk needs to be included:

You may also review or copy the library from ./export.ahk on GitHub; #Incude as you would normally when manually downloading.
Hopefully this is more clear.

Re: [Class] graphicsearch.ahk (ImageSearch strings)

Posted: 28 Jun 2021, 15:50
by skripter31
Sorry, somehow I missed that part, my bad. I can confirm including export.ahk made it work. Excellent stuff, thanks Chunjee

Re: [Class] graphicsearch.ahk (ImageSearch strings)

Posted: 01 Aug 2021, 13:40
by Chunjee
There is a v0.4.0 on github.

Someone was reporting an issue with a 2nd monitor. This should fix that but I wasn't able to reproduce it exactly so I'm hoping some people will test it and give the green light for better 2nd monitor support.

Re: [Class] graphicsearch.ahk (ImageSearch strings)

Posted: 12 Sep 2021, 22:59
by rc76
Hi Guys,

I have a sort of different problem scenario would like to seek your help.

Is it possible to:
(1) Capture any type of notifications (either Yellow Warning or Pink Error) that appears on screen, for any type of contents in the notification (i.e. images are not exactly the same every time).
(2) Recognize the content of the image (i.e. text recognition or find text).

Any hint on the direction how I may achieve the above will be super appreciated. Is there any existing function can achieve it, as ImageSearch needs exact match…

Thank you so much!

Re: [Class] graphicsearch.ahk (ImageSearch strings)

Posted: 14 Sep 2021, 11:51
by Chunjee
@rc76 I think you would probably be better off with GDIP to capture the image and one of the Optical Character Recognition (OCR) packages to parse the text. I've never used those.
Another thread about trying to gather the notification text: viewtopic.php?t=76103&p=331628


graphicsearch.ahk doesn't really have much to do with understanding the text on the screen unless you painstakingly search for each word. Would be so complicated I doubt it would work well.

To answer your questions
1) yes, you can probably detect a notification
2) no, you can't recognize the content of the notification with this package

Re: [Class] graphicsearch.ahk (ImageSearch strings)

Posted: 15 Sep 2021, 15:55
by rc76
Thank you so much @Chunjee !

Re: [Class] graphicsearch.ahk (ImageSearch strings)

Posted: 18 Oct 2021, 15:39
by neelsoon
I'm not very smart and I'm not able to make this work.
Is there any video tutorials?


I downloaded graphicsearch.ahk-master.zip
and extracted it, I capture a part of the screen but when I trigger the the hotkey LControl & LShift it says not found.

Code: Select all

~LControl & LShift:: ; intro 1.

; #Include graphicsearch.ahk\export.ahk
;#Include %A_ScriptDir%\graphicsearch.ahk\export.ahk
;#Include %A_ScriptDir%\export.ahk

 t1 := A_TickCount, X := Y := ""
graphicsearch_query := "|<>*183$29.ztzXtznzDsQ60sUsA1k1kM3k3Uz3w71y3yC300wQ60EssA1llkTvz3UzlwU"
 resultObj := graphicsearch.search(GraphicSearch_query)
 if (resultObj) {
   X := resultObj.1.x, Y := resultObj.1.y, Comment := resultObj.1.id
   ; Click, %X%, %Y%
 }

 MsgBox, 4096, Tip, % "Found :`t" Round(resultObj.MaxIndex())
   . "`n`nTime  :`t" (A_TickCount-t1) " ms"
   . "`n`nPos   :`t" X ", " Y
   . "`n`nResult:`t" (resultObj ? "Success !" : "Failed !")

 for i,v in resultObj
   if (i<=2)
     graphicsearch.mouseTip(resultObj[i].x, resultObj[i].y)

return


~RControl & numpad0::
Reload
Return
Anyone think can help? What I'm doing wrong?

Re: [Class] graphicsearch.ahk (ImageSearch strings)

Posted: 05 Dec 2021, 12:36
by Chunjee
v0.4.0 has been published to npm

It was on github for a while and seems like people are having much better luck with that version.

Re: [Class] graphicsearch.ahk (ImageSearch strings)

Posted: 04 Nov 2022, 10:38
by thut11
Chunjee wrote:
05 Dec 2021, 12:36
v0.4.0 has been published to npm

It was on github for a while and seems like people are having much better luck with that version.
I love the class but is there an easy way to create search queries from just .png or .jpg files? so i don't have to manually use the tool to capture, crop etc.?

Re: [Class] graphicsearch.ahk (ImageSearch strings)

Posted: 05 Sep 2023, 05:35
by tedo
Is there a built in tool to apply color masking to the screenshot before the library tries to find matches?

I'm guessing .scan with its screenshot argument set to zero will use whatever is on the clipboard? And if this is so, I could use other tools to apply a color mask. As long as the data on the clipboard is in bmp format it will work?

edit 9/6. I missed that this doesn't work for V2 :oops: And as such I'll stop pursuing this.