Compare commits

..

No commits in common. "75a7d0486c280564881d95a156c55e2ce41e2717" and "b2c112a728c3a5dda00731f17cd276f6238ff290" have entirely different histories.

View File

@ -8,8 +8,6 @@ import pyautogui
# Define the directory where screenshots will be saved
output_dir = os.path.expanduser("~/.screenmonitor/output")
screenshotIntervalInMinutes = 17
# Ensure the output directory exists
os.makedirs(output_dir, exist_ok=True)
@ -21,33 +19,6 @@ def capture_screenshot():
# Apply blur
blurred_screenshot = screenshot.filter(ImageFilter.GaussianBlur(10))
# resize
width, height = blurred_screenshot.size
width, height = width // 5, height // 5
blurred_screenshot = blurred_screenshot.resize((width, height), Image.NEAREST)
# Randomly turn 10% of the pixels grey
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)
for _ in range(black_pixels_count):
x = random.randint(0, width - 1)
y = random.randint(0, height - 1)
shade = random.randint(0, 255)
pixels[x, y] = (shade, shade, shade)
# Make 1% of the pixels copy themselves to their 8 neighbors
for _ in range(neighbor_copy_pixels_count):
x = random.randint(0, width - 1)
y = random.randint(0, height - 1)
original_color = pixels[x, y]
for dx in [-1, 0, 1]:
for dy in [-1, 0, 1]:
if 0 <= x + dx < width and 0 <= y + dy < height:
pixels[x + dx, y + dy] = original_color
# Compress and save
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
filename = os.path.join(output_dir, f"screenshot_{timestamp}.jpeg")
@ -72,10 +43,8 @@ def delete_old_screenshots():
def main():
while True:
# Calculate the random time within the next 17-minute interval
next_interval_start = datetime.now() + timedelta(
seconds=screenshotIntervalInMinutes * 60
)
random_seconds = random.randint(0, screenshotIntervalInMinutes * 60)
next_interval_start = datetime.now() + timedelta(minutes=17)
random_seconds = random.randint(0, 17 * 60)
random_time = datetime.now() + timedelta(seconds=random_seconds)
# Sleep until the random time within the interval