from PIL import Image, ImageChops

PATH = "/home/cugur/Downloads/matf/dozs/2024/week2/data/strawberry.jpg"

with Image.open(PATH) as img:

    print("Image size: {}".format(img.size))
    img.show()


    # Zadatak: razbijanjem slike jagode na R, G, B kanale i kombinacijom tih kanala 
    # postici da jagoda ima zelenu boju. 

    r, g, b = img.split()
    black = ImageChops.constant(r, 0)

    # r.show()
    # g.show()
    # b.show()
    # black.show()

    Image.merge("RGB", (b, r, b)).show()

    # listovi plavi
    Image.merge("RGB", (b, r, g)).show()

    # listovi crveni
    Image.merge("RGB", (g, r, black)).show()
