def convert_to_grayscale(imlist):
 for imname in imlist:
  im = Image.open(imname).convert('L')
  im.save(imname)

def convert_to_grayscale ( imlist ) : for imname in imlist : im = Image . open ( imname ) . convert ( 'L' ) im . save ( imname )
convert a set of images to grayscale .