Open balaganeshmohan opened 4 years ago
You need to create a directory named 'slices' at the same directory where the code below will work.
import glob, os
import image_slicer
os.chdir("./")
for file in glob.glob("*.png"):
image_slicer.slice(file, 4, save=False)
image_slicer.save_tiles(tiles, directory='./slices',\
prefix=file, format='png')
I used a for
loop. Worked fine.
Listed all files in the directory using os.listdir()
method, and then iterated through the loop.
I had about 12,000 high-res images. It took about 4-5 hours.
I have a list of 300 or so images, that needs to be split into 4. I wasn't successful to iterate over that list and apply image_slicer. Anyone can help me. Thanks