Skip to content

Instantly share code, notes, and snippets.

@namieluss
namieluss / python-pillow-image-change-background.py
Created March 12, 2020 11:00
Replace a Color (RGB) from an Image using Python Pillow
from PIL import Image
img = Image.open("test_image.jpg")
img = img.convert("RGB")
datas = img.getdata()
new_image_data = []
for item in datas:
# change all white (also shades of whites) pixels to yellow
@M0Rph3U56031769
M0Rph3U56031769 / disable_lockscreen.py
Created December 22, 2020 07:57
prevent screensaver/lock screen
from ctypes import windll
# prevent screensaver/lock screen
windll.kernel32.SetThreadExecutionState(0x80000002)
# restore state
windll.kernel32.SetThreadExecutionState(0x80000000)