Jump to content

Recommended Posts

Posted (edited)

I want to search image files kinda like how we use pixelSearch(), but only on image files.

I have been looking for a while, but still found not a word on it.

I have only seen ways to search the screen, but not a file.

Could someone point me to a method of this, either in AutoIt help, another tool, or really anything you use?

This would help a lot.

Thanks.

Edited by RandomClown
Posted

If you want to search for an exact match, you could use a hashing function and compare the hashed of the files.

ongoing projects:-firestorm: Largescale P2P Social NetworkCompleted Autoit Programs/Scripts: Variable Pickler | Networked Streaming Audio (in pure autoIT) | firenet p2p web messenger | Proxy Checker | Dynamic Execute() Code Generator | P2P UDF | Graph Theory Proof of Concept - Breadth First search

Posted

  On 7/23/2011 at 10:21 AM, 'RandomClown said:

I want to search image files kinda like how we use pixelSearch(), but only on image files.

I have been looking for a while, but still found not a word on it.

I have only seen ways to search the screen, but not a file.

Could someone point me to a method of this, either in AutoIt help, another tool, or really anything you use?

This would help a lot.

There are lots of image manipulation programs that work great from the command line. My favorite would be ImageMagick. Command line is easy to do with AutoIt.
Posted

there`s many ways of do that.. the most simple is using the that not uses GDI, but only works with with .BMP files.

A BMP file is a file divided in many sections one of those section are the pixel color of every pixel in the file.

You can use GDI to save any image file into BMP.

Another way is a little bit more complicated.. you can get the 0Scan of a bitmap handle and with some calculations you can get the color of the pixel you want.

This link examples how to set an array with the pixel data.

Posted

JohnOne:

Thanks, I'm looking into this right now.

hyperzap:

I am not looking for an image file, but looking for pixels in a file.

clicked:

Thanks for the suggestion.

For now, I'm coding for performance. Rather not make too many program calls if I can avoid it.

I'll keep that in mind though.

monoscout999:

I would rather not have to render a couple thousand frames in BMP

:)

I'll keep the files as PNG for HDD performance reasons. Decompressing a PNG should be a lot faster than loading a buncha 3MB files from a slow device with moving parts.

So it looks like GDI is my best bet.

Thanks for the suggestions everyone.

Posted (edited)

you didn`t understand me... a bitmap not always is a file, the windows GDI process all the pics like bitmaps objects, a PNG is a compressed bitmap, before that the PNG is showed it is decompress to a Bitmap. The 0Scan of a Bitmap is a string like this.

DBC1B0FFDBC1B0FFDBC1B0FFDBC1B0FFDBC1B0FFDCC2B0FFDDC3B2FFDEC4B3FFDFC6B4FFE0C7B5FFE0C7B5FFE0C8B6FFE1C9B7FFE3CAB8FFE3CAB9FFE4CCBBFFE4CDBCFFE6CFBEFFE6D1C0FFE7D1C3FFE8D4C5FFE9D4C7FFDABFAFFFD9BFAFFFD9BEAEFFD8BEAEFFD8BDADFFD9BEAEFFDABFAFFFDBC1B0FFDDC2B1FFDDC3B2FFDFC4B4FFE0C7B5FFE1C7B6FFE1C8B6FFE1C9B7FFE2CAB9FFE3CCBBFFE4CEBEFFE6CFC0FFE6D1C2FFE8D3C5FFE8D4C9FFD9BEAFFFD8BEAEFFD8BDADFFD7BCACFFD6BBABFFD7BCABFFD8BDADFFB1998AFF86776AFF7D7067FF776B61FF827368FFB69F8FFFDFC8B6FFE1C8B8FFE1C9BAFFE3CCBCFFE4CDBEFFE5CFC0FFE5D1C3FFE7D3C6FFE7D5C9FFD9BFAFFFD8BEAEFFD8BDADFFD7BCACFFD6BBABFFD6BBABFF877467FF756B61FF908984FFAFA8A3FF9F9893FF78726CFF60574FFF807063FFE0C8B8FFE1CABAFFE3CCBDFFE3CEBEFFE5D0C1FFE6D1C5FFE7D4C8FFE8D7CCFFDBC1B0FFDAC0AFFFDABFAFFFD8BEAEFFCDB3A3FF6A5E4CFF867D76FFBAAFA5FFD2C4B9FF807B74FF736E6AFFB8AEA7FF9C958FFF6C635CFF504539FFD5BFAFFFE3CDBDFFE4CFC0FFE5D1C3FFE6D3C6FFE8D5CAFFE9D8CDFFDDC4B4FFDDC3B2FFDCC2B1FFDAC0AFFF685745FF867767FFBEA697FFC1B0A2FF020202FF6D6D6DFF777777FF080808FFA39489FFA09387FF6C6154FF4A3B2EFFE2CDBEFFE6D1C3FFE6D2C5FFE8D5C8FFE9D8CBFFEBDACFFFE1C8B7FFE0C8B6FFDFC7B5FF7F6B5AFF725F45FFA0826AFFCDAF98FF585048FF7E7E7EFFD2D2D1FFE9E8E8FF959595FF504841FFBDA48FFF826F5CFF554532FF7A6758FFE7D4C5FFE9D6C8FFEAD8CBFFEBDACEFFECDCD1FFE5CCBAFFE4CCBAFFB29B89FF644A31FF7A5A40FFB18B6CFF665546FF424242FFE4E4E4FFC9C9C9FFCECECEFFF4F4F4FF525252FF5C4D40FF98785EFF6C573DFF3E2B1DFFB4A191FFECD9CBFFECDACDFFEDDCCFFFEDDED2FFE8D1BEFFE8D1BEFF755F4DFF5B3E20FF8B603DFF7E5E44FF131313FFD7D7D7FFD7D7D7FF666666FF666666FFCCCCCCFFE8E8E8FF1B1B1BFF6D523BFF6B4D31FF3E2816FF6D594AFFEDDCCDFFEFDDCFFFF0DFD2FFF0E0D4FFEAD4C1FFEAD4C1FF574231FF4D311AFF88562DFF322316FFA8A8A7FFDDDCDCFF949493FF0B0B0BFF0A0A0AFF949493FFE7E7E7FFB7B7B7FF010101FF613E20FF3E2814FF503E30FFF0DFCFFFF0E0D2FFF1E2D3FFF2E3D5FFECD6C3FFECD6C2FF533F30FF492E18FF311F10FF636363FFE2E2E2FFD3D3D3FF5A5959FF202020FF232322FF777777FFD0D0D0FFF4F3F3FF656565FF25170DFF382313FF4D3C2DFFF0DFD0FFF1E1D3FFF2E2D5FFF3E3D6FFEAD6C3FFEBD6C3FF675343FF3A2413FF2F2F2FFFDBDBDBFFBDBDBDFF767676FF8F8F8FFFE3E3E3FFE3E3E3FFD3D3D3FFC7C7C7FFD4D4D4FFE5E5E5FF282828FF1C120AFF695645FFF1E0D1FFF2E1D3FFF2E3D5FFF3E4D7FFE8D4C3FFE8D4C3FFAB9785FF1A110BFF414141FF494949FF313131FF161616FF474747FF3C3C3CFF313131FF303030FF313131FF313131FF434343FF2B2B2BFF120C08FFAB9889FFEFDFD1FFF1E0D3FFF2E2D5FFF2E4D6FFE4D1C2FFE5D1C2FFE5D1C2FF5D4E41FF1D130AFF1B1109FF301F10FF6E4B27FF362819FF3A2F20FF3A2F21FF352919FF2E1F11FF22150BFF191008FF0E0905FF605143FFEDDCCFFFEFDFD2FFF0E0D3FFF0E1D4FFF2E2D6FFDECBC0FFDECBBFFFDFCBBFFFDECBBEFF302217FF442813FF683E1DFF895B30FFA87E4FFFBD9A6BFFBC996BFFA57D4EFF7F572EFF553418FF27170BFF322418FFE7D6C9FFEBDACEFFECDCCFFFECDED2FFEEDFD3FFEFE0D4FFD7C6BDFFD8C6BDFFD8C6BDFFDAC7BEFFCCB9AEFF352417FF3E2210FF64411EFF916E39FFB19352FFA3884DFF7B5F31FF523518FF25140AFF372519FFD1C1B4FFE6D5CBFFE7D6CDFFE8D8CEFFEADAD0FFEBDCD2FFEDDED3FFD1BFBAFFD2C0BBFFD3C1BBFFD4C2BBFFD5C3BCFFD7C5BCFF644E3FFF362214FF4C351AFF604A27FF5B4624FF392613FF302112FF6A5443FFE5D3C6FFE4D2C9FFE3D2C9FFE2D2CAFFE4D4CCFFE6D6CDFFE9D8CFFFEADAD0FFCCBBB9FFCDBCBAFFCFBDBAFFD0BEBAFFD2BFBAFFD5C2BBFFDAC7BDFF9F8777FF71583EFF665031FF654F31FF70553CFF9E8876FFE6D3C6FFE4D1C7FFE1D0C7FFDFCEC8FFDFCFC9FFE1D1CAFFE3D3CBFFE5D5CCFFE8D7CEFFC9B9B8FFCBBAB8FFCCBBB9FFCEBCB9FFD0BEBAFFD2C0BBFFD8C5BDFFDDC9BEFFE3CEC0FFE5D0C1FFE5D1C1FFE5D2C3FFE7D3C4FFE5D2C5FFE2CFC6FFE0CEC5FFDDCCC5FFDECCC6FFDFCEC8FFE2D0C9FFE4D2CAFFE5D4CBFFC9B9B8FFCBBAB8FFCCBBB9FFCEBDB9FFD0BEBAFFD2C0BBFFD8C5BDFFDDC9BEFFE2CEBFFFE5D0C1FFE5D1C1FFE6D1C2FFE6D3C4FFE5D2C4FFE3CFC4FFDFCDC4FFDECCC5FFDDCCC6FFDFCEC6FFE1CFC6FFE3D1C8FFE5D2C9FFCCBBB9FFCDBCBAFFCFBDBAFFD0BEBAFFD2BFBAFFD5C2BBFFDAC7BDFFDECABEFFE3CFC0FFE6D1C1FFE6D1C1FFE7D3C2FFE7D3C3FFE6D3C4FFE4D1C3FFE2CEC3FFDFCCC4FFDFCDC4FFE0CEC5FFE3CFC5FFE4D0C6FF2D1915FF

Eight characters from the 0scan makes a pixel

The pixel format is this:

DBC1B0FF

DB = Blue component

C1 = Green Component

B0 = Red Component

FF = Alpha Component

You can get the 0Scan from any bitmap object, and you can get the bitmap object from any file you want using _GDIPlus_BitmapCreateFromFile() even a PNG file.:)

If you want to get a specific pixel from the image you need to get the widht the you will know how many pixels means a line.;)

and we already know that every 8 character we have a pixel so the maths are really simple.;)

If you want that i wrote this script for you just tell me with a good laugh :D

It takes a few ms get the 0scan.. it takes more time the string operations.

Edited by monoscout999
Posted

  On 7/27/2011 at 4:38 AM, 'RandomClown said:

clicked:

Thanks for the suggestion.

For now, I'm coding for performance. Rather not make too many program calls if I can avoid it.

I'll keep that in mind though.

Use the ImageMagickObject.dll, search the examples forum for it, it is multithreaded so could actually improve the performance of your script.

Some guy's script + some other guy's script = my script!

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...