Upload solution to 11 from school

e v i l
This commit is contained in:
newt 2024-10-09 18:02:28 +01:00
parent 4423e9dfce
commit aaacf8184c
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