Upload solution to 11 from school

e v i l
This commit is contained in:
newt :D 2021-06-07 12:52:46 +01:00 committed by GitHub
parent bade3e5eb5
commit b3ecad3a1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 0 deletions

View file

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB