From 56440d123561808dce26ddb6dd876c28fd487641 Mon Sep 17 00:00:00 2001 From: PAlexanderFranklin Date: Fri, 2 Aug 2024 13:49:20 -0700 Subject: [PATCH] Add screenshot resizing --- src/screenmonitor.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/screenmonitor.py b/src/screenmonitor.py index 6db4a80..fcae286 100644 --- a/src/screenmonitor.py +++ b/src/screenmonitor.py @@ -22,8 +22,11 @@ def capture_screenshot(): blurred_screenshot = screenshot.filter(ImageFilter.GaussianBlur(10)) # Randomly turn 10% of the pixels black - pixels = blurred_screenshot.load() width, height = blurred_screenshot.size + width, height = width // 5, height // 5 + blurred_screenshot = blurred_screenshot.resize((width, height), Image.NEAREST) + + pixels = blurred_screenshot.load() total_pixels = width * height black_pixels_count = int(total_pixels * 0.1) neighbor_copy_pixels_count = int(total_pixels * 0.01)