title: how can i keep an image name when changing its extention
body: <p>how can i get the file name without its root and path. only a name so i can save the images i want to convert with the same original name?</p>
  <pre><code>import sys
  import os,glob
  from PIL import Image, ImageFilter
  
  
  path = os.getcwd()
  
  if not os.path.exists('converted'):
      save_to = os.makedirs('converted')
  
  
  for i in glob.glob(f'{path}/*.jpg'):
  
      img = Image.open(i)
  
      img.save(???????)  ########  &lt;---------?????????
  
      #i want to save the imege whith its original name,
      # but with a different extention, and i want to save it to a different folder then cwd
  </code></pre>