from PIL import Image, ImageChops

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

with Image.open(PATH) as img:

    c, m, y, k = img.convert("CMYK").split()
    black = ImageChops.constant(c, 0)

    # Kako "vidimo" cmyk kanale?
    Image.merge("CMYK", (c, black, black, black)).show()
    Image.merge("CMYK", (black, m, black, black)).show()
    Image.merge("CMYK", (black, black, y, black)).show()
    Image.merge("CMYK", (black, black, black, k)).show()