from PIL import Image
import glob
import os
import pdb

if __name__ == "__main__":
    root_LR=os.path.expanduser('/mnt/server5_hard1/seungjun/KAIR-master/trainsets/trainL_realdegrade_SRFormer/X4')


    
    for filename in glob.glob(root_LR + '/*x4.png'):  # assuming gif
        print('Re-Naming {}'.format(filename))
        img_name=filename[:-6]
        img_new_name=img_name+'.png'
        os.rename(filename, img_new_name)