Sign in to follow this  
Followers 0
MikeP

Bitmap Pixel Color work

4 posts in this topic

#1 ·  Posted (edited)

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 this post


Link to post
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 this post


Link to post
Share on other sites

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

pure blue = 0000FF

pure yellow = FFFF00

hex addition = FFFFFF

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

and everyone knows blue+yellow = green

Share this post


Link to post
Share on other sites

average every octet...

Average 00 and FF = 88 or some crap

Lar.


f_mrcleansmalm_77ce002.jpgAutoIt has helped make me wealthy

Share this post


Link to post
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
Sign in to follow this  
Followers 0