from PIL import Image 
from PIL import ImageFilter  # za blurovanje

PATH = "/home/cugur/Downloads/matf/dozs/2024/week4/data/yugo.jpg"

with Image.open(PATH) as img:

    img.show()

    # Koristmo kernel da "zamutimo sliku" 

    # a) 0-kernel rezultuje totalno crnom slikom
    img1 = img.filter(ImageFilter.Kernel((3, 3), [0 for _ in range(9)]))
    img1.show()


    img2 = img.filter(ImageFilter.Kernel((3, 3), [1, 2, 1,
                                                  2, 12, 2,
                                                  1, 2, 1]))
    img2.show()

    # Eksperimentisali smo sa vrednosti centralnog piksela: izabrali smo 15, probali 12, 25, 50, 100
    img3 = img.filter(ImageFilter.Kernel((3, 3), [-1, -2, -1,
                                                  -2, 15, -2,
                                                  -1, -2, -1]))
    img3.show()

