Created
March 8, 2016 08:45
-
-
Save keewon/94be0f4f508f30739a37 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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