Hi!
ImageSearch is a very cool command to search for buttons on the screen that match an image (for example). I've found the limits of this function though when the monitor uses the likes of f.lux or Night light (Windows tool) to turn the screen more yellow (e.g. at night time). When the screen tint changes, ImageSearch fails to find the button. Now there is a parameter *0-255 that could work around that, but I find its results too fickle in this particular case.
I am trying to figure out a workaround, perhaps going grayscale or compare differences in pixel colors of nearby pixels, but in the meantime I was wondering if there is perhaps a known way to overcome this limitation?
Thanks in advance for any kind hint!
K
https://www.autohotkey.com/docs/commands/ImageSearch.htm
P.S. the same issue was already asked here with no reply: viewtopic.php?f=76&t=81217&p=353420&hilit=imagesearch+f.lux#p353420
ImageSearch vs Night light & f.lux
Re: ImageSearch vs Night light & f.lux
It would be pretty easy, I think.
1. Save your original color.
2. Create a GUI with that color under the new conditions.
3. Get the new color.
4. Use pixelsearch / imagesearch using that new color.
I'm going to use ImagePut to demonstrate this since it's easier for me
1. Save your original color.
2. Create a GUI with that color under the new conditions.
3. Get the new color.
4. Use pixelsearch / imagesearch using that new color.
I'm going to use ImagePut to demonstrate this since it's easier for me
Code: Select all
#include ImagePut.ahk
pic := ImagePutBuffer("https://picsum.photos/300/300") ; Load image
hwnd := pic.show() ; or ImageShow(pic) ; Show image
new_pic := ImagePutBuffer(hwnd) ; Save new image
;ImageDestroy(hwnd) ; Close window
screen := ImagePutBuffer(0) ; Capture screen
if screen.ImageSearch(new_pic)
MsgBox found!
else Reload
Re: ImageSearch vs Night light & f.lux
Thank you, @iseahound, for your kind reply and a very interesting tip. I will try it and write about how it works for me here. It will take me some time to get to it though.
K
K
Re: ImageSearch vs Night light & f.lux
Hi, I have the exact same issue with f.lux. Did you have any progress?
I guess we are looking for some script that clones the original image and applies same color filters that are used in flux. So you are matching with multiple image color variants of same image?
I guess we are looking for some script that clones the original image and applies same color filters that are used in flux. So you are matching with multiple image color variants of same image?