# Bitmap Pixel Color work

## Recommended Posts

Hi !

Here's what i'm trying to do, if anyone got ideas or knows which functions would help me, feel free to post ! Thanks

I would like to calculate the average color value in an area and have the function returning wether it belongs to a color range or not. Something like that :

Boolean PixelColorCheckSum (x1, y1, x2, y2, \$colorA, \$colorB, \$colorTest)

returns True if \$colorTest is within the range \$colorA - \$colorB

goal : given a square area of the screen.. telling if the average color is more "yellow" .."orange", "red", "blue", "green", "purple", "pink", ..

Edited by MikeP

##### Share on other sites

Hi !

Here's what i'm trying to do, if anyone got ideas or knows which functions would help me, feel free to post ! Thanks

I would like to calculate the average color value in an area and have the function returning wether it belongs to a color range or not. Something like that :

Boolean PixelColorCheckSum (x1, y1, x2, y2, \$colorA, \$colorB, \$colorTest)

returns True if \$colorTest is within the range \$colorA - \$colorB

As the colours are all hex, couldn't you add them all together and divide by the total?

##### Share on other sites

That would be easy but it's not working (in RGB) :

pure blue = 0000FF

pure yellow = FFFF00

hex division by 2 = 7FFFFF.8 which is a color near Cyan

and everyone knows blue+yellow = green

##### Share on other sites

average every octet...

Average 00 and FF = 88 or some crap

Lar.

AutoIt has helped make me wealthy

## Create an account

Register a new account

• ### Recently Browsing   0 members

×

• Wiki

• Back

• #### Beta

• Git
• FAQ
• Our Picks
×
• Create New...