Created
February 23, 2017 12:19
-
-
Save sljeff/262db0f738fc732fa92403846d47eef9 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 | |
img = Image.open("QQwhite.jpg") | |
width, height = img.size | |
result = Image.new('RGB', (width, height)) | |
data = list(img.getdata()) | |
for i, t in enumerate(data): | |
if set(t) == {255}: | |
data[i] = (0, 0, 0) | |
result.putdata(data) | |
result.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment