Vine Posted April 7, 2022 Posted April 7, 2022 So basically I have a png file with tiles (32x32 icons) and I want to be able to take a 32x32 section of the screen and determine which tile in the file it corresponds to. Are there built in functions that would let me do this or do I have to write a lot of this from scratch? I suppose what I am after is: -Read in pixels from (x1, y1) to (x2, y2) from screen -Read pixels (x1, y1) to (x1, y1) from a file and associate this with some label in a hashtable or something -Be able to take what I read on screen and look up the corresponding label if one exists Thanks
Vine Posted April 7, 2022 Author Posted April 7, 2022 I can't seem to edit my post but what I've done so far is modify it so I've saved off each file as its own .png. So now I am just looking to compare a section of pixels on-screen to see which file it corresponds to.
Vine Posted April 7, 2022 Author Posted April 7, 2022 Sorry each tile not each file, as its own .png.
Vine Posted April 7, 2022 Author Posted April 7, 2022 Looks like maybe PixelCheckSum() could be useful here, comparing checksum of a region of pixels, so then it's just a matter of loading in these files and seeing what their checksums are
Vine Posted April 7, 2022 Author Posted April 7, 2022 Okay so now this problem has boiled down to "get PixelCheckSum of an image file" and while this question has been asked numerous files, nobody seems to have actually come up with a good solution over the years, which doesn't inspire much confidence.
Vine Posted April 7, 2022 Author Posted April 7, 2022 I have no idea why this forum doesn't let you edit posts but good lord, files -> times
Nine Posted April 7, 2022 Posted April 7, 2022 Why do you need to checksum your files/tiles since you already have checksumed them before ? I first thought you had a brilliant idea. I first though you meant that all tiles you want to search for are coming from a screen, right ? So register the tiles into checksum, save it to a file somewhere and compare checksum from screen with a list of saved numbers (checksums) into a file. I must admit I thought it was a nice idea. Or maybe I do not understand what you want to achieve “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Vine Posted April 7, 2022 Author Posted April 7, 2022 34 minutes ago, Nine said: Why do you need to checksum your files/tiles since you already have checksumed them before ? I first thought you had a brilliant idea. I first though you meant that all tiles you want to search for are coming from a screen, right ? So register the tiles into checksum, save it to a file somewhere and compare checksum from screen with a list of saved numbers (checksums) into a file. I must admit I thought it was a nice idea. Or maybe I do not understand what you want to achieve No, what you describe is indeed what I am doing - I just split the tiles off into files because they were a little easier to process individually instead of needing to move things around within one giant image.
BurninSun Posted April 8, 2022 Posted April 8, 2022 Check out: https://www.autoitscript.com/forum/topic/66545-find-bmp-in-another-bmp-imagesearch Basically converts your image into a string and uses built-in string matching. Would probably be even easier in your case since you know exactly where the image would be located.
StooneyLLC Posted April 13, 2022 Posted April 13, 2022 https://www.autoitscript.com/forum/topic/65748-image-search-library/ https://www.autoitscript.com/forum/topic/148005-imagesearch-usage-explanation/ This is old but still works.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now