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:])
© 2024 OneMinuteCode. All rights reserved.