Color Variation Closest to Black and White

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
rockitdontstopit
Posts: 107
Joined: 12 Nov 2022, 15:47

Color Variation Closest to Black and White

24 Feb 2024, 08:50

I often need to find an image with constant shape but varied color (for example highlighted or un-highlighted). What color variation from 0 to 255 would be best to use in ImageSearch? Is there a color variation that is exactly like black and white?
User avatar
boiler
Posts: 17357
Joined: 21 Dec 2014, 02:44

Re: Color Variation Closest to Black and White

24 Feb 2024, 09:41

What do you mean by black and white? They are on the extreme opposite ends of the color values. Any variation that would include both will include every other color. Black is with each RGB component at 0 and white is with each component at 255 (0xFF).
User avatar
mikeyww
Posts: 27344
Joined: 09 Sep 2014, 18:38

Re: Color Variation Closest to Black and White

24 Feb 2024, 09:44

Hello,

I believe that the best option will depend on the images that you want to find. You can test your specific image with different settings, or use an image viewer to understand the hues that it contains.
Specify for n a number between 0 and 255 (inclusive) to indicate the allowed number of shades of variation in either direction for the intensity of the red, green, and blue components of each pixel's color. For example, if *2 is specified and the color of a pixel is 0x444444, any color from 0x424242 to 0x464646 will be considered a match
User avatar
Chunjee
Posts: 1494
Joined: 18 Apr 2014, 19:05
Contact:

Re: Color Variation Closest to Black and White

26 Feb 2024, 08:48

around 100 works well

You might need to go up to near 200 for this however. If you get too many false positives go down
rockitdontstopit
Posts: 107
Joined: 12 Nov 2022, 15:47

Re: Color Variation Closest to Black and White

26 Feb 2024, 12:32

Chunjee wrote:
26 Feb 2024, 08:48
around 100 works well
Yeah 80-100 seems like the sweet spot for what I'm doing. I first used 128 since it's right in the middle, but was getting too many false positives. And yes, I now understand my initial question doesn't really make any sense.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Chunjee and 97 guests