from PIL import Image
from PIL import ImageFilter

im = Image.open("stella.jpg")
print(im.size)
#im.show()

big = Image.new("RGB", (9000, 9000))

small = im.crop((0, 0, 3000, 3000))

for row in range(3):
    for col in range(3):
        left = col * 3000
        top = row * 3000
        right = left + 3000
        bottom = top + 3000
        if (row + col) % 2 == 0:
            contour = small.filter(ImageFilter.CONTOUR)
            big.paste(contour, (left, top, right, bottom))
        else:
            big.paste(small, (left, top, right, bottom))
        small = small.rotate(90)
            

big.save("mosaic.jpg")