Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
from PIL import Image
im = Image.open("ic_notify.png")
out = Image.new("RGBA", (96, 96))
pix = out.load()
blank = (0, 0, 0, 0)
white = (255, 255, 255, 255)
for x in range(0, 96):
for y in range(0, 96):
p = im.getpixel((x,y))
if p[0] > 200 and p[1] > 200 and p[2] > 200:
pix[x, y] = blank
else:
pix[x, y] = white
out.save("test.png")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.