Skip to content

Instantly share code, notes, and snippets.

@cesarkawakami
Created January 16, 2013 03:09
Show Gist options
  • Save cesarkawakami/4544334 to your computer and use it in GitHub Desktop.
Save cesarkawakami/4544334 to your computer and use it in GitHub Desktop.
import itertools
from PIL import Image
img = Image.new("RGB", (10, 10))
pixels = img.load()
for i, j in itertools.product(xrange(10), xrange(10)):
if (i + j) % 2 == 0:
pixels[i, j] = (0, 0, 0)
else:
pixels[i, j] = (255, 255, 255)
img.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment