code: def save_image(img, fname):
      
      _, ext = os.path.splitext(fname)
      ext = ext[1:] or 'png'
      with open(fname, 'wb') as fp:
          img.save(fp, ext)
docs: Save an image.
  
      Parameters
      ----------
      img : `PIL.Image`
          Image to save.
      fname : `str`
          File path.