Jump to content

Search range of pixels?


Recommended Posts

Hi,

i am writing a tool that would click at sertain pixel. However I would like to inquire if its possible to search for a "range" of colors rather then just one and make this efficient-not search for every single on in that range...

Link to comment
Share on other sites

Hi,

i am writing a tool that would click at sertain pixel. However I would like to inquire if its possible to search for a "range" of colors rather then just one and make this efficient-not search for every single on in that range...

Welcome to AutoIt,

PixelSearch has a parameter to search in a 'variant':

PixelSearch ( left, top, right, bottom, color [, shade-variation [, step [, hwnd]]] )

If you for some reason need to check for more than one color just use PixelSearch on the next color you need to find.

The help-file is really good in AutoIt. I suggest looking there for info about any of the commands=)

Link to comment
Share on other sites

PixelSearch ( left, top, right, bottom, color [, shade-variation [, step [, hwnd]]] )

the Left Top Right Bottom are all directly those, however you can add multiple to the color by putting them into a array to get your range of colors, shade tho it does check by checking red, green, and blue components all added down or up by 0-255. Step is the effecient 1 being the less effecient and the higher the more your skipping by 2 skips every other one 3 every 2. Hwnd is the handle to be used.

Contact via MSN: [email=terarink_msn@hotmail.com]terarink_msn@hotmail.com[/email], yahoo: terarink_yah

Link to comment
Share on other sites

thanks, i knew about the variations but is that the only way to apply it? because i have a number of functions, depending on user input different pixels are searched the function thus varies so:

PixelSearch(10, 10, 800, 580, $color) is what i have do i just:

PixelSearch(10, 10, 800, 580, $color, 100) if i say want 100 variations of that color?

thats another thing, i am not really all that savy on graphics so how many variations would it take to have everything from dark orange to brown?

But thanks for the help.

Link to comment
Share on other sites

thanks, i knew about the variations but is that the only way to apply it? because i have a number of functions, depending on user input different pixels are searched the function thus varies so:

PixelSearch(10, 10, 800, 580, $color) is what i have do i just:

PixelSearch(10, 10, 800, 580, $color, 100) if i say want 100 variations of that color?

thats another thing, i am not really all that savy on graphics so how many variations would it take to have everything from dark orange to brown?

But thanks for the help.

I believe that will check for 100 as it is check up and down those 50 off from both sides of the $color. If you add 255 to that is will check all color spectrums of the $color white and black.

The Hue and Saturation of the color stays the same but then Luminosity comes into play here with the variations. You can go into paint and edit menu and edit colors then select custom colors. Play around with it and find the colors you will need.

Min and Max = Hue Sat Lum is 0 and 240, Red Green Blue is 0 and 255

Contact via MSN: [email=terarink_msn@hotmail.com]terarink_msn@hotmail.com[/email], yahoo: terarink_yah

Link to comment
Share on other sites

hmm but that's just the thing i am not too used to graphical things like that. Can you give me an example of a function that would search diff luminocities and saturation as well as the color range of say 15 for each RGB

edit: also if forexample i actually KNOW the range of pixels how would i set PixelSearch to scan the known range rathern then all pixels around the only known one? (do i have to find a pixel "some where in the middle of that range" that sounds bizarre.)

Edited by Blahbots
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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