title: Pillow Image.save() [Errno 13] Permission denied
body: <p>So I am trying to loop a bunch of images in a folder, do some changes and save them in a subdirectory and I am having permission denied issues.</p>
  
  <pre><code>from PIL import Image
  import os
  
  path = 'D:/my_path/'
  
  
  dirs = os.listdir( path )
  
  new_folder = 'out'
  
  if not os.path.exists(path + new_folder):
      os.makedirs(path + new_folder)
  
  def resize():
      num=0
      for item in dirs:
  
          #print(path + item)
          if os.path.isfile(path+item):
              im = Image.open(path+item).convert('RGB')
  
              imResize = im.resize((64, 64), Image.ANTIALIAS)
              im.Resize = os.rename(os.path.join(path, item),os.path.join(path, 'bad_' + str(num)) )
              imResize.save(path + new_folder, 'JPEG', quality=90)
  
              num+=1
          #if num &gt; 1000:
              #break
  resize()
  </code></pre>
  
  <blockquote>
    <p>PermissionError: [Errno 13] Permission denied: 'D:/my_path/out/'</p>
  </blockquote>
  
  <p>Error triggers on this line <code>imResize.save(path + new_folder, 'JPEG', quality=90)</code> Any idea why?</p>