Skip to content

Instantly share code, notes, and snippets.

@yammik
Created July 7, 2018 01:15
Show Gist options
  • Save yammik/6fbaa7bbfaf1a500f2c3b7230d345255 to your computer and use it in GitHub Desktop.
Save yammik/6fbaa7bbfaf1a500f2c3b7230d345255 to your computer and use it in GitHub Desktop.
script to split multipage TIFF for TFM
import os
import subprocess
path = raw_input("path : ") + "/"
for filename in os.listdir(path):
if (filename.endswith('.tif')):
print(filename)
cmd = "/usr/local/bin/convert -quiet -scene 1 " + path + filename + " " + path + filename + "-%d.tif"
subprocess.call(cmd, shell=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment