I don't know how to combine multiple pngs into one tiff.

Asked 2 years ago, Updated 2 years ago, 85 views

I found out what Pillow can do, but I don't know any more.

python image pillow

2022-09-30 19:12

1 Answers

img Sample code to tiff the png files in the folder.
Qiita reference

import glob
from PIL import Image

Wildcards in the dir=r "img/*.png" #png file
save_path="hoge.tif"# output file path

stack = [ Image.open(p) for ping glob.glob(dir) ]

stack[0].save(save_path, compression="tiff_deflate", save_all=True, append_images=stack[1:])


2022-09-30 19:12

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.