diff --git a/python/pythonchallenge.com/11 - 5808.py b/python/pythonchallenge.com/11 - 5808.py new file mode 100644 index 0000000..dada000 --- /dev/null +++ b/python/pythonchallenge.com/11 - 5808.py @@ -0,0 +1,17 @@ +from PIL import Image + +img = Image.open('cave.jpg') + +even = Image.new('RGB', (img.width // 2, img.height // 2)) +odd = Image.new('RGB', (img.width // 2, img.height // 2)) + +for i in range(img.width): + for j in range(img.height): + p = img.getpixel((i, j)) + if (i + j) % 2 == 1: + odd.putpixel((i // 2, j // 2), p) + else: + even.putpixel((i // 2, j // 2), p) + +even.save('even.jpg') +odd.save('odd.jpg') # evil \ No newline at end of file diff --git a/python/pythonchallenge.com/cave.jpg b/python/pythonchallenge.com/cave.jpg new file mode 100644 index 0000000..124073e Binary files /dev/null and b/python/pythonchallenge.com/cave.jpg differ diff --git a/python/pythonchallenge.com/even.jpg b/python/pythonchallenge.com/even.jpg new file mode 100644 index 0000000..0fa7455 Binary files /dev/null and b/python/pythonchallenge.com/even.jpg differ diff --git a/python/pythonchallenge.com/odd.jpg b/python/pythonchallenge.com/odd.jpg new file mode 100644 index 0000000..6d78627 Binary files /dev/null and b/python/pythonchallenge.com/odd.jpg differ