You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Image watcher screenshots the whole virtual desktop 10 times a second #97
Image mode burns CPU and holds the GIL for about half of every poll, competing with the click thread for timing accuracy. It scales with total desktop size, so 4K multi-monitor users get the worst of it.
Evidence
autoclicker/core/image_match.py:68-72: ImageGrab.grab(bbox=..., all_screens=True). On Windows, Pillow's grabscreen_win32 captures the full virtual screen and then crops to the bbox.
Measured during review on a 3840x1080 desktop: ~52 ms per grab for a 300x200 region, against a 100 ms poll (_IMAGE_POLL_SECONDS).
find_template (image_match.py:26-41) also reconverts the needle to RGB and re-picks the anchor row on every call, though the template never changes.
Suggested approach
Capture only the search region (Win32 BitBlt from GetDC(0) into a region-sized bitmap via ctypes, or mss).
Precompute the template bytes and anchor row once in ImageTarget.
Add an image-search section to docs/PERFORMANCE.md with numbers at the default margin and at MAX_IMAGE_MARGIN.
Done when
Grab time for a 300x200 region is under ~5 ms on a multi-monitor desktop, and PERFORMANCE.md records before/after.
Activity
docs: bring ARCHITECTURE and PERFORMANCE up to date