SearchImage

searchimage [<image file path>] (<max amount of results>) (<bounds X1>,<bounds Y1>,<bounds X2>,<bounds Y2>) (<tolerance>)

Finds instances of an image on the screen.

Parameters:

  1. The absolute path to the image file to search for.
  2. The maximum amount of instances of the image to include in the result. When the maximum amount of results is reached, the search will stop early. The default value is -1 (infinite results).
  3. The bounds in which to search for the image. The expected input is a list with 4 numbers of which the first 2 represent the X and Y coordinates of one corner of the bounds, and the last 2 values represent the X and Y coordinates of the opposite corner of the bounds. By default, every the entire virtual screen (across all monitors) is searched through.
  4. The tolerance amount (as an integer from 1 to 255) that controls by how much each pixel in the image its R, G, and B values can vary from the pixel it is being compared to on the screen. This can help improve reliability when dealing with compressed images or semi-transparent backgrounds. The default value is 0, meaning an exact match is required. In contrast, a value of 255 would cause the image to be considered found at every pixel. If you are having trouble with your image not being found on your screen when you believe it should be, it can help to increase this value a little at a time until you get a result.

Returns: A list of coordinates each representing the top left pixel of the image found on the screen. each entry of the list is a coordinate in the form of its own list with an X and a Y value.