111222qaz Posted December 6, 2014 Share Posted December 6, 2014 Hello and good day, I'm new autoit student. Script i want to make is: -Read two (might be pre)defined areas in active window -compare them if they are the same images -if yes then stop -if no then press LM button pos (X,Y) -Go back to start Is it possible for app to read the areas of screen and compare them if they are same? I don't want to check data or strings but image parts Thanks Link to comment Share on other sites More sharing options...
water Posted December 6, 2014 Share Posted December 6, 2014 Welcome to AutoIt and the forum! Can you please tell us what you try to achieve with your script? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Bert Posted December 6, 2014 Share Posted December 6, 2014 Hello and good day, I'm new autoit student. Script i want to make is: -Read two (might be pre)defined areas in active window -compare them if they are the same images -if yes then stop -if no then press LM button pos (X,Y) -Go back to start Is it possible for app to read the areas of screen and compare them if they are same? I don't want to check data or strings but image parts Thanks Comparing images is very difficult. If for example the image is slightly a different size you will get the wrong result. If a transparent image is laid on top of the image you want to examine then you also get a different result. Also in some cases position on the screen may cause an error. If you could tell the the name of the application or website we may have a better solution for you. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
111222qaz Posted December 7, 2014 Author Share Posted December 7, 2014 (edited) Thanks for answers. I want to get universal tool for comparing stored locally/on imageshack images for filtering unwanted ones. (photos without specified similarity would be spread, camera was on stator so main plan is 100% repeatable and has no moving without specified elements) Apps: firefox and image viewer for windows. (like xnview or basic windows, idc here ease of implement decides) That is why I would like to predefine areas,for example: I set square 100/100px with centre pix position x,y, and square 2 100/100px with centre x,y. Then I could easily make two versions of soft for each environment, just need to determine constant window positions and sizing for both apps. While being able to define them for both versions separately I would avoid each time areas defining and possible area mismatches with different images (hand input is probably impossible to define precisely two linked pixels on separated images). Regards, Marcin Edited December 7, 2014 by 111222qaz Link to comment Share on other sites More sharing options...
JohnOne Posted December 7, 2014 Share Posted December 7, 2014 One method is to use the PixelChecksum function on both areas and compare. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
computergroove Posted December 7, 2014 Share Posted December 7, 2014 One method is to use the PixelChecksum function on both areas and compare. As Bert mentioned, if the images differ in size or transparency or anything else even by one pixel this method wont work. Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html Link to comment Share on other sites More sharing options...
junkew Posted December 7, 2014 Share Posted December 7, 2014 long time ago i made this (and still use it) '?do=embed' frameborder='0' data-embedContent>> but also there its an exact matching bitmap algorithm othere options are interfacing with tesseract FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
JohnOne Posted December 7, 2014 Share Posted December 7, 2014 As Bert mentioned, if the images differ in size or transparency or anything else even by one pixel this method wont work. That's true, but as yet the OP has not indicated that there is. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
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