Skip to content

Add locateOnScreen with skip_regions support to blackout regions before matching#137

Open
iamscottweber wants to merge 1 commit intoasweigart:masterfrom
iamscottweber:feature/locateOnScreen_skip_regions
Open

Add locateOnScreen with skip_regions support to blackout regions before matching#137
iamscottweber wants to merge 1 commit intoasweigart:masterfrom
iamscottweber:feature/locateOnScreen_skip_regions

Conversation

@iamscottweber
Copy link
Copy Markdown

  • Added argument to locateOnScreen to accept a list of (x, y, w, h) tuples.
  • Automatically blacks out these regions on each screenshot before searching for the image.
  • Useful for workflows that need to skip already-processed or known areas when finding multiple instances.
  • Also added helper function draw_blackout_regions for consistent blackout logic.
  • Added test TestLocateOnScreenSkipRegions.test_locateOnScreen_with_skip_regions:
    • Verifies that locateOnScreen correctly respects skip_regions.
    • Uses monkey-patched screenshot to consistently return haystack2.png.
    • Confirms it finds the slash pattern without blackout, then fails when blackout is applied.

…re matching

- Added  argument to locateOnScreen to accept a list of (x, y, w, h) tuples.
- Automatically blacks out these regions on each screenshot before searching for the image.
- Useful for workflows that need to skip already-processed or known areas when finding multiple instances.
- Also added helper function draw_blackout_regions for consistent blackout logic.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant