Add screenshot resizing

This commit is contained in:
PAlexanderFranklin 2024-08-02 13:49:20 -07:00
parent 159ab0c484
commit 56440d1235

View File

@ -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)