Skip to content

Instantly share code, notes, and snippets.

@lufeihaidao
Created April 13, 2014 15:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lufeihaidao/10589586 to your computer and use it in GitHub Desktop.
Save lufeihaidao/10589586 to your computer and use it in GitHub Desktop.
Q11 of python challenge
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