from PIL import Image 
from PIL import ImageFilter

# Rezolucije slika su 250 x 200
PATH_JAGODA = "/home/cugur/Downloads/matf/dozs/2024/week4/data/jagoda_002.jpg"
PATH_MUVA = "/home/cugur/Downloads/matf/dozs/2024/week4/data/muva_002.jpg"

with Image.open(PATH_JAGODA) as imgJ, Image.open(PATH_MUVA) as imgM:

    # 2 koordinate - upper left corner
    imgTmp = imgJ.copy()
    imgTmp.paste(imgM, (50, 50))
    imgTmp.show()

    # maska
    r, g, b = imgJ.split()
    mask = r.filter(ImageFilter.BLUR)  # npr. kako mozemo ad-hoc kreirati masku odgovarajucih dimenzija
    imgTmp = imgJ.copy()
    imgTmp.paste(imgM, mask)
    imgTmp.show()

    # multiple paste
    imgTmp = imgM.copy()
    imgTmp.paste(imgJ, (50, 50))
    imgTmp.paste(imgJ, (100, 100))
    imgTmp.paste(imgJ, (150, 150))
    imgTmp.show()


