-
Notifications
You must be signed in to change notification settings - Fork 13
How can this bot works cross platform?
HungPV edited this page Aug 23, 2021
·
9 revisions
This bot use one code but works across platforms like Windows, Linux (and maybe MacOS), here is why:
Original issue:
- This bot uses pixel color and image detection from screen to make logic
- Detect pixel color and image from screen usually won't works because the
Gamma Correction
issue. For example on Linux the green color show as 138,232,67 (RGB) but on Windows it may display as 100,240,50
Resolve:
- Use images with 3 kinds of custom format
- Same Pix image which was extracted from 2 images and only keep pixels which exists on both source images
- Pixels with RGB = 0xFFFFFF (white) are treated as transparent color and any color match this
- Other pixels with RGB != 0xFFFFFF much be match
- Keep Pix image which was extracted from a image with only pixels from another source image are kept
- Pixels with RGB = 0xFFFFFF (white) are treated as transparent color and any color match this
- Other pixels with RGB != 0xFFFFFF much be match
- Matrix image image which was extracted from image with only specified RGB pixels are kept
- Pixels with RGB = 0xFFFFFF (white) are treated as transparent color and any color match this
- The provided RGB must be match
- Other pixels with RGB != 0xFFFFFF and provided RGB will match any pixels with RGB different with provided RGB
- Same Pix image which was extracted from 2 images and only keep pixels which exists on both source images
- Basically, the images contain only black and similar to black colors which doesn't faced with the
Gamma Correction
issue and will match cross platforms - Use hard-coded coordinate to detect image on a small screen rectangle with good performance and click <= this is why you have to configure
screen.offset.x
andscreen.offset.y
on user-config.properties file as described where
For example:
- Same Pix:
- ReRun button on normal state:
- ReRun button on highlight state:
- Output:
- ReRun button on normal state:
- Keep Pix:
- Source image (to get pixels to keep):
- Image to process:
- Output:
- Source image (to get pixels to keep):
- Matrix:
- Color to keep: 0x000000 (black)
- Source image (to process):
- Output:
- Note: the red color pixels on result image are filled manually, used to match any pixels which has RGB color different than source color 0x000000 and the transparent color 0xFFFFFF (treated as)
Hi, I'm a bot. Please give me a Star for this repository, thank you 😜