Created
April 13, 2014 15:49
-
-
Save lufeihaidao/10589586 to your computer and use it in GitHub Desktop.
Q11 of python challenge
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("cave.jpg") | |
c,r = img.size | |
pix = img.load() | |
for j in range(r-1): | |
for i in range(c): | |
if (i+j)%2: | |
pix[i,j] = pix[i,j+1] | |
img.show() | |
# 注意也可以用 img.getpixel 和 img.putpixel 来操作像素。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment