Crop Image

Arguments

  • image
  • region
  • filename=None
  • save_format=PNG

Take a screenshot of the current desktop.

param image:Image to crop
param region:Region to crop image to
param filename:Save cropped image to filename
param save_format:
 File format to save the image in

Find Template In Image

Arguments

  • image
  • template
  • region=None
  • limit=None
  • tolerance=None

Attempt to find the template from the given image.

param image:Path to image or Image instance, used to search from
param template:Path to image or Image instance, used to search with
param limit:Limit returned results to maximum of limit.
param region:Area to search from. Can speed up search significantly.
param tolerance:
 Tolerance for matching, value between 0.1 and 1.0
return:List of matching regions
raises ImageNotFoundError:
 No match was found

Find Template On Screen

Arguments

  • template
  • **kwargs

Attempt to find the template image from the current desktop. For argument descriptions, see find_template_in_image()

Get Pixel Color In Image

Arguments

  • image
  • point

Get the RGB value of a pixel in the image.

param image:image to get pixel from
param point:coordinates for pixel or Point object

Get Pixel Color On Screen

Arguments

  • point

Get the RGB value of a pixel currently on screen.

param point:coordinates for pixel or Point object

Show Region In Image

Arguments

  • image
  • region
  • color=red
  • width=5

Draw a rectangle onto the image around the given region.

param image:image to draw onto
param region:coordinates for region or Region object
param color:color of rectangle
param width:line width of rectangle

Show Region On Screen

Arguments

  • region
  • color=red
  • width=5

Draw a rectangle around the given region on the current desktop.

param region:coordinates for region or Region object
param color:color of rectangle
param width:line width of rectangle

Take Screenshot

Arguments

  • filename=None
  • region=None
  • save_format=PNG

Take a screenshot of the current desktop.

param filename:Save screenshot to filename
param region:Region to crop screenshot to
param save_format:
 File format to save the screenshot in

Wait Template On Screen

Arguments

  • template
  • timeout=5
  • **kwargs

Wait for template image to appear on current desktop. For further argument descriptions, see find_template_in_image()

param timeout:Time to wait for template (in seconds)