The error is because you are trying to open a non-image file with Image.open()
.
If your goal is to move the file from one folder to another then I would suggest you use
os.rename(SourceFileName,TargetFileName)
If not, consider filtering your input file before calling Image.open
to specific extensions that you would like to access, say like:-
ext=['jpg','png','gif']
for filename in os.listdir(image_folder):
if filename[-3:] in ext:
img= Image.open(f'{image_folder}{filename}')
img.save(f'{output_folder}{filename}', 'png')
print ('all done!')
Hope that helps