Skip to content

Instantly share code, notes, and snippets.

@BilHim
Created February 17, 2021 14:41
Show Gist options
  • Save BilHim/f5e190f94e0c15379f71fbcb3bb1e529 to your computer and use it in GitHub Desktop.
Save BilHim/f5e190f94e0c15379f71fbcb3bb1e529 to your computer and use it in GitHub Desktop.
from PIL import Image
# Open image
image = Image.open('image.jpg')
# Filter
def filter(image):
# Get image dimesions
width, height = image.size
# Create a white RGB image
new_image = Image.new("RGB", (width, height), "white")
# Filter magic happens here
return new_image
# Show result
new_image = filter(image)
new_image.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment