I am a beginner in python. I am trying to read all of the ascii files from one folder and after converting them into Image, I want all of them to be saved into a different folder in same directory. The code is running but I am not getting any output and no error is displayed.
Code without loop, for single image is working perfectly.
Please help.
import os
import glob
import numpy as np
from PIL import Image
path = r'D:\user\ASCII'
outpath = 'D:\user\ASCII\TIFF'
filenames = glob.glob(path + "/*.asc") #read all files in the path mentioned
for x in filenames:
myarray = np.loadtxt(x, skiprows=9)
im = Image.fromarray(myarray)
im.save(outpath + '/*.tif')