[Python] Can't create a multilayer TIFF readable with PhotoShop with python libraries

Discussão em 'Python' iniciado por Stack, Abril 27, 2025.

  1. Stack

    Stack Membro Participativo

    I have tried different tutorials in order to create a single multilayer TIFF from individual files, but with none of them I managed to open the file correctly with Adobe PhotoShop. Below is an example of what I tried. I can open the combined TIFF with GIMP, where I can "see" individual pages that can be imported as layers, but PhotoShop just imports a single layer. I saw a thread on a similar subject, but I think there was no conclusion about how to solve this issue.

    path = "img-tif"
    in_paths = [(path + "/000{:d}.tif".format(i)) for i in range(5)]
    images = [tifffile.imread(p) for p in in_paths]
    out_path = "img-test/multi.tif"
    with tifffile.TiffWriter(out_path) as tiff:
    for i, img in enumerate(images):
    tiff.write(img, photometric='rgb',
    contiguous=False, #planarconfig='separate',
    compression='none', subfiletype=1 if i > 0 else 0,
    predictor=False,
    metadata={'LayerName': f'Layer_{i+1}',
    'DocumentName': 'Multilayer TIFF',
    'Software': 'Python tifffile'})


    Do you have any suggestion? Thanks in advance.

    Continue reading...

Compartilhe esta Página