from PIL import Image 
from PIL import ImageFilter  # za blurovanje

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

with Image.open(PATH) as img:

    img.show()

    # Zadatak 1: variranje treshold-a 
    for threshold in (0, 10, 25, 50, 100, 1000):
        imgTmp = img.filter(ImageFilter.UnsharpMask(2, 150, threshold))
        imgTmp.show()

    # Zadatak 2: variranje percent-a
    for perc in (0, 10, 50, 100, 150, 200):
        imgTmp = img.filter(ImageFilter.UnsharpMask(2, perc, 3))
        imgTmp.show()

    # Zadatak 3: variranje radius-a
    for rad in (1, 2, 3, 5, 7, 10, 20):
        imgTmp = img.filter(ImageFilter.UnsharpMask(rad, 150, 3))
        imgTmp.show()

    # Final slika
    imgf = img.filter(ImageFilter.UnsharpMask(20, 250, 1))
    imgf.show()